Skip to main content

lodestone_wire/
lib.rs

1//! @generated by scripts/generate-lodestone-api.py; do not edit by hand.
2//! Active Lodestone API public DTOs; predecessor public reachability is absent.
3
4use serde::{Deserialize, Serialize};
5mod bulk_batch_id;
6mod document_mutation_semantic_digest;
7pub use bulk_batch_id::{BulkBatchIdError, bulk_batch_id};
8pub use document_mutation_semantic_digest::{DocumentMutationSemanticDigestError, document_mutation_semantic_digest};
9
10pub const LODESTONE_API_SCHEMA_ID: &str = "lodestone-api";
11pub const LODESTONE_API_SPEC_SHA256: &str = "336e8b68a1d948b2e4b46c1e00ea0f00274fb1c9a64c2fde4d6dbe465a2a7758";
12pub const LODESTONE_API_FORMAT_VERSION: u16 = 4;
13pub const LODESTONE_API_ALPN: &str = "lodestone";
14pub const BULK_BATCH_ID_FORMAT_VERSION: u16 = 2;
15pub const BULK_BATCH_ID_DOMAIN: &[u8] = b"lodestone/bulk-batch\0";
16pub const DOCUMENT_MUTATION_SEMANTIC_DIGEST_FORMAT_VERSION: u16 = 1;
17pub const DOCUMENT_MUTATION_SEMANTIC_DIGEST_DOMAIN: &[u8] = b"lodestone/document-mutation-recovery/v1\0";
18pub const LODESTONE_API_MAX_OPERATION_WAIT_ATTEMPTS: u32 = 100;
19pub const LODESTONE_API_MAX_OPERATION_WAIT_INTERVAL_MILLIS: u64 = 60000;
20
21#[derive(Clone, Debug, Eq, PartialEq, Serialize)]
22#[serde(transparent)]
23pub struct I64 {
24    pub value: String,
25}
26#[derive(Clone, Debug, Eq, PartialEq, Serialize)]
27#[serde(transparent)]
28pub struct U64 {
29    pub value: String,
30}
31#[derive(Clone, Debug, Eq, PartialEq, Serialize)]
32#[serde(transparent)]
33pub struct Identity {
34    pub value: String,
35}
36#[derive(Clone, Debug, Eq, PartialEq, Serialize)]
37#[serde(transparent)]
38pub struct Digest {
39    pub value: String,
40}
41#[derive(Clone, Debug, Eq, PartialEq, Serialize)]
42pub struct ExactDecimal {
43    pub coefficient: String,
44    pub scale: u32,
45}
46#[derive(Clone, Debug, Eq, PartialEq, Serialize)]
47#[serde(transparent)]
48pub struct ApproximateNumber {
49    pub canonical_value: String,
50}
51#[derive(Clone, Debug, Deserialize, Eq, PartialEq, Serialize)]
52#[serde(deny_unknown_fields)]
53pub struct RawJson {
54    pub bytes_base64: String,
55}
56#[derive(Clone, Copy, Debug, Eq, PartialEq)]
57pub enum ScalarError {
58    InvalidI64,
59    InvalidU64,
60    InvalidIdentity,
61    InvalidDigest,
62    InvalidDecimal,
63    InvalidApproximateNumber,
64}
65impl std::fmt::Display for ScalarError {
66    fn fmt(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
67        write!(formatter, "invalid Lodestone API scalar: {self:?}")
68    }
69}
70impl I64 {
71    pub fn validate(&self) -> Result<(), ScalarError> {
72        self.value
73            .parse::<i64>()
74            .ok()
75            .filter(|parsed| parsed.to_string() == self.value)
76            .map(|_| ())
77            .ok_or(ScalarError::InvalidI64)
78    }
79}
80impl U64 {
81    pub fn validate(&self) -> Result<(), ScalarError> {
82        self.value
83            .parse::<u64>()
84            .ok()
85            .filter(|parsed| parsed.to_string() == self.value)
86            .map(|_| ())
87            .ok_or(ScalarError::InvalidU64)
88    }
89}
90impl Identity {
91    pub fn validate(&self) -> Result<(), ScalarError> {
92        (self.value.len() == 32
93            && self
94                .value
95                .bytes()
96                .all(|byte| byte.is_ascii_digit() || (b'a'..=b'f').contains(&byte)))
97        .then_some(())
98        .ok_or(ScalarError::InvalidIdentity)
99    }
100}
101impl Digest {
102    pub fn validate(&self) -> Result<(), ScalarError> {
103        (self.value.len() == 64
104            && self
105                .value
106                .bytes()
107                .all(|byte| byte.is_ascii_digit() || (b'a'..=b'f').contains(&byte)))
108        .then_some(())
109        .ok_or(ScalarError::InvalidDigest)
110    }
111}
112impl ExactDecimal {
113    pub fn validate(&self) -> Result<(), ScalarError> {
114        let unsigned = self.coefficient.strip_prefix('-').unwrap_or(&self.coefficient);
115        let canonical = self.coefficient == "0"
116            || (!unsigned.is_empty()
117                && !unsigned.starts_with('0')
118                && unsigned.bytes().all(|byte| byte.is_ascii_digit()));
119        (canonical
120            && self.coefficient != "-0"
121            && self.scale <= 1024
122            && (self.scale == 0 || !self.coefficient.ends_with('0')))
123        .then_some(())
124        .ok_or(ScalarError::InvalidDecimal)
125    }
126}
127impl ApproximateNumber {
128    pub fn validate(&self) -> Result<(), ScalarError> {
129        self.canonical_value
130            .parse::<f64>()
131            .ok()
132            .filter(|parsed| {
133                parsed.is_finite() && self.canonical_value != "-0" && parsed.to_string() == self.canonical_value
134            })
135            .map(|_| ())
136            .ok_or(ScalarError::InvalidApproximateNumber)
137    }
138}
139macro_rules! deserialize_validated_string_scalar {
140    ($type:ty) => {
141        impl<'de> Deserialize<'de> for $type {
142            fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
143            where
144                D: serde::Deserializer<'de>,
145            {
146                let value = String::deserialize(deserializer)?;
147                let scalar = Self { value };
148                scalar.validate().map_err(serde::de::Error::custom)?;
149                Ok(scalar)
150            }
151        }
152    };
153}
154deserialize_validated_string_scalar!(I64);
155deserialize_validated_string_scalar!(U64);
156deserialize_validated_string_scalar!(Identity);
157deserialize_validated_string_scalar!(Digest);
158impl<'de> Deserialize<'de> for ExactDecimal {
159    fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
160    where
161        D: serde::Deserializer<'de>,
162    {
163        #[derive(Deserialize)]
164        #[serde(deny_unknown_fields)]
165        struct Wire {
166            coefficient: String,
167            scale: u32,
168        }
169        let wire = Wire::deserialize(deserializer)?;
170        let scalar = Self {
171            coefficient: wire.coefficient,
172            scale: wire.scale,
173        };
174        scalar.validate().map_err(serde::de::Error::custom)?;
175        Ok(scalar)
176    }
177}
178impl<'de> Deserialize<'de> for ApproximateNumber {
179    fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
180    where
181        D: serde::Deserializer<'de>,
182    {
183        let canonical_value = String::deserialize(deserializer)?;
184        let scalar = Self { canonical_value };
185        scalar.validate().map_err(serde::de::Error::custom)?;
186        Ok(scalar)
187    }
188}
189#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
190#[serde(tag = "kind", content = "value", rename_all = "snake_case")]
191pub enum JsonValue {
192    Null,
193    Bool(bool),
194    String(String),
195    I64(I64),
196    U64(U64),
197    ExactDecimal(ExactDecimal),
198    Approximate(ApproximateNumber),
199    Array(Vec<JsonValue>),
200    Object(Vec<JsonField>),
201}
202#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
203#[serde(deny_unknown_fields)]
204pub struct JsonField {
205    pub name: String,
206    pub value: JsonValue,
207}
208#[derive(Clone, Copy, Debug, Deserialize, Eq, PartialEq, Serialize)]
209#[serde(rename_all = "snake_case")]
210pub enum Action {
211    IdentityDiscovery,
212    DataRead,
213    DataWrite,
214    Append,
215    ResolveAppend,
216    IndexAdmin,
217    CatalogRead,
218    TaskRead,
219    SubscriptionRead,
220    DiagnosticsRead,
221    DiagnosticsCreate,
222    SecurityRead,
223    SecurityAdmin,
224    AuditRead,
225    QuotaRead,
226    QuotaAdmin,
227    BindingRead,
228    LifecycleAdmin,
229    AdmissionRead,
230    AdmissionAdmin,
231    UsageRead,
232    OperationRead,
233    OperationCancel,
234    CollectionExport,
235    CollectionRestore,
236    IndexExport,
237    IndexImport,
238}
239
240#[derive(Clone, Copy, Debug, Deserialize, Eq, PartialEq, Serialize)]
241#[serde(rename_all = "snake_case")]
242pub enum ErrorCode {
243    Aborted,
244    DeadlineExceeded,
245    InvalidRequest,
246    UnsupportedVersion,
247    Unauthenticated,
248    PermissionDenied,
249    NotFound,
250    Conflict,
251    StaleCursor,
252    RestartBudgetExhausted,
253    LimitExceeded,
254    CapabilityUnavailable,
255    NotSubmitted,
256    SubmittedIndeterminate,
257    ExpiredUnknown,
258    SecretNotEscrowed,
259    RetentionGap,
260    ArtifactRangeInvalid,
261    ChecksumMismatch,
262    TemporarilyUnavailable,
263    Internal,
264}
265
266#[derive(Clone, Copy, Debug, Deserialize, Eq, PartialEq, Serialize)]
267#[serde(rename_all = "snake_case")]
268pub enum Command {
269    Discover,
270    ListIndexes,
271    GetIndex,
272    ValidateIndexChange,
273    ApplyIndexChange,
274    ApplyAdministrationMutation,
275    ListAliases,
276    GetAlias,
277    ListDataStreams,
278    GetDataStream,
279    ListComponentTemplates,
280    GetComponentTemplate,
281    ListIndexTemplates,
282    GetIndexTemplate,
283    ListIngestPipelines,
284    GetIngestPipeline,
285    SimulateIngestPipeline,
286    ReprocessByQuery,
287    ListLifecyclePolicies,
288    GetLifecyclePolicy,
289    PrepareCreateIndex,
290    PrepareDeleteIndex,
291    SubmitCatalogAction,
292    ResolveCatalogAction,
293    PrepareReplayableSourceIndex,
294    SubmitReplayableSourceIndex,
295    GetReplayableSource,
296    ControlReplayableSource,
297    CloneIndex,
298    ConfigureHistory,
299    GetHistory,
300    ResolveHistory,
301    PlaceHistoryHold,
302    ReleaseHistoryHold,
303    PrepareDocumentMutation,
304    SubmitDocumentMutation,
305    PrepareDocumentBulk,
306    SubmitDocumentBulk,
307    ResolveDocumentBulk,
308    PrepareAppendBulk,
309    SubmitAppendBulk,
310    ResolveAppendBulk,
311    ObserveAppendCommitted,
312    ResolveDocumentMutation,
313    GetDocument,
314    Search,
315    TraverseRelationships,
316    QueryProfiles,
317    EvaluateTemporalEvidence,
318    CreateContinuousTemporalEvaluation,
319    GetContinuousTemporalEvaluation,
320    PauseContinuousTemporalEvaluation,
321    ResumeContinuousTemporalEvaluation,
322    ReplaceContinuousTemporalEvaluation,
323    RetireContinuousTemporalEvaluation,
324    ReadContinuousTemporalEvidence,
325    ValidateSearch,
326    OpenPit,
327    RenewPit,
328    ClosePit,
329    ListOperations,
330    GetOperation,
331    WaitOperation,
332    CancelOperation,
333    ListAuditEvents,
334    ExportAuditEvents,
335    ReserveServiceCredential,
336    ReserveServiceCredentialRotation,
337    ActivateServiceCredential,
338    ResolveServiceCredentialReservation,
339    PrepareRevokeServiceCredential,
340    RevokeServiceCredential,
341    ResolveSecurityAction,
342    GetSecurityRole,
343    PrepareRoleAppendAccessChange,
344    SubmitRoleAppendAccessChange,
345    ListServiceCredentials,
346    GetRuntimeStatus,
347    GetResultCacheStatus,
348    GetFieldPromotionStatus,
349    GetOverloadStatus,
350    ConfigureExternalKey,
351    RotateExternalKeyBinding,
352    ConfigureAggregateThenDelete,
353    GetLifecycleStatus,
354    GetQuota,
355    UpdateQuota,
356    GetBinding,
357    GetAdmissionStatus,
358    SetAdmission,
359    GetQuiesceStatus,
360    GetDecommissionReadiness,
361    GetUpgradeReadiness,
362    GetMaintenanceStatus,
363    WarmVectorIndex,
364    EvaluateVectorRecall,
365    CalibrateVectorStrategy,
366    GetVectorDiagnostic,
367    CreateDiagnostic,
368    GetDiagnostic,
369    PrepareCollectionExport,
370    StartCollectionExport,
371    ResolveCollectionExport,
372    VerifyCollectionExport,
373    PrepareCollectionRestore,
374    StartCollectionRestore,
375    ResolveCollectionRestore,
376    PrepareIndexExport,
377    StartIndexExport,
378    ResolveIndexExport,
379    VerifyIndexExport,
380    PrepareIndexImport,
381    StartIndexImport,
382    ResolveIndexImport,
383    ReadArtifactChunk,
384    ExportUsage,
385    ExecuteStateRead,
386    PrepareStateWrite,
387    SubmitStateWrite,
388    ResolveStateWrite,
389}
390
391pub const LODESTONE_API_ERROR_CODES: &[ErrorCode] = &[
392    ErrorCode::Aborted,
393    ErrorCode::DeadlineExceeded,
394    ErrorCode::InvalidRequest,
395    ErrorCode::UnsupportedVersion,
396    ErrorCode::Unauthenticated,
397    ErrorCode::PermissionDenied,
398    ErrorCode::NotFound,
399    ErrorCode::Conflict,
400    ErrorCode::StaleCursor,
401    ErrorCode::RestartBudgetExhausted,
402    ErrorCode::LimitExceeded,
403    ErrorCode::CapabilityUnavailable,
404    ErrorCode::NotSubmitted,
405    ErrorCode::SubmittedIndeterminate,
406    ErrorCode::ExpiredUnknown,
407    ErrorCode::SecretNotEscrowed,
408    ErrorCode::RetentionGap,
409    ErrorCode::ArtifactRangeInvalid,
410    ErrorCode::ChecksumMismatch,
411    ErrorCode::TemporarilyUnavailable,
412    ErrorCode::Internal,
413];
414
415#[derive(Clone, Copy, Debug, Eq, PartialEq)]
416pub struct ActionAuthorizationContract {
417    pub action: Action,
418    pub any_of_permission_ids: &'static [&'static str],
419}
420pub const LODESTONE_API_ACTION_AUTHORIZATION: &[ActionAuthorizationContract] = &[
421    ActionAuthorizationContract {
422        action: Action::IdentityDiscovery,
423        any_of_permission_ids: &["security_read"],
424    },
425    ActionAuthorizationContract {
426        action: Action::DataRead,
427        any_of_permission_ids: &["data_read"],
428    },
429    ActionAuthorizationContract {
430        action: Action::DataWrite,
431        any_of_permission_ids: &["data_write"],
432    },
433    ActionAuthorizationContract {
434        action: Action::Append,
435        any_of_permission_ids: &["append"],
436    },
437    ActionAuthorizationContract {
438        action: Action::ResolveAppend,
439        any_of_permission_ids: &["resolve_append"],
440    },
441    ActionAuthorizationContract {
442        action: Action::IndexAdmin,
443        any_of_permission_ids: &["index_admin"],
444    },
445    ActionAuthorizationContract {
446        action: Action::CatalogRead,
447        any_of_permission_ids: &["catalog_read"],
448    },
449    ActionAuthorizationContract {
450        action: Action::TaskRead,
451        any_of_permission_ids: &["task_read"],
452    },
453    ActionAuthorizationContract {
454        action: Action::SubscriptionRead,
455        any_of_permission_ids: &["subscription_read"],
456    },
457    ActionAuthorizationContract {
458        action: Action::DiagnosticsRead,
459        any_of_permission_ids: &["diagnostics_read"],
460    },
461    ActionAuthorizationContract {
462        action: Action::DiagnosticsCreate,
463        any_of_permission_ids: &["diagnostics_create"],
464    },
465    ActionAuthorizationContract {
466        action: Action::SecurityRead,
467        any_of_permission_ids: &["security_read"],
468    },
469    ActionAuthorizationContract {
470        action: Action::SecurityAdmin,
471        any_of_permission_ids: &["security_admin"],
472    },
473    ActionAuthorizationContract {
474        action: Action::AuditRead,
475        any_of_permission_ids: &["audit_read"],
476    },
477    ActionAuthorizationContract {
478        action: Action::QuotaRead,
479        any_of_permission_ids: &["quota_read"],
480    },
481    ActionAuthorizationContract {
482        action: Action::QuotaAdmin,
483        any_of_permission_ids: &["quota_admin"],
484    },
485    ActionAuthorizationContract {
486        action: Action::BindingRead,
487        any_of_permission_ids: &["binding_read"],
488    },
489    ActionAuthorizationContract {
490        action: Action::LifecycleAdmin,
491        any_of_permission_ids: &["lifecycle_admin"],
492    },
493    ActionAuthorizationContract {
494        action: Action::AdmissionRead,
495        any_of_permission_ids: &["admission_read"],
496    },
497    ActionAuthorizationContract {
498        action: Action::AdmissionAdmin,
499        any_of_permission_ids: &["admission_admin"],
500    },
501    ActionAuthorizationContract {
502        action: Action::UsageRead,
503        any_of_permission_ids: &["usage_read"],
504    },
505    ActionAuthorizationContract {
506        action: Action::OperationRead,
507        any_of_permission_ids: &[
508            "catalog_read",
509            "task_read",
510            "security_read",
511            "diagnostics_read",
512            "collection_export",
513            "collection_restore",
514            "index_export",
515            "index_import",
516        ],
517    },
518    ActionAuthorizationContract {
519        action: Action::OperationCancel,
520        any_of_permission_ids: &[
521            "index_admin",
522            "task_admin",
523            "security_admin",
524            "diagnostics_create",
525            "collection_export",
526            "index_export",
527        ],
528    },
529    ActionAuthorizationContract {
530        action: Action::CollectionExport,
531        any_of_permission_ids: &["collection_export"],
532    },
533    ActionAuthorizationContract {
534        action: Action::CollectionRestore,
535        any_of_permission_ids: &["collection_restore"],
536    },
537    ActionAuthorizationContract {
538        action: Action::IndexExport,
539        any_of_permission_ids: &["index_export"],
540    },
541    ActionAuthorizationContract {
542        action: Action::IndexImport,
543        any_of_permission_ids: &["index_import"],
544    },
545];
546pub fn action_authorization(action: Action) -> Option<&'static ActionAuthorizationContract> {
547    LODESTONE_API_ACTION_AUTHORIZATION
548        .iter()
549        .find(|contract| contract.action == action)
550}
551
552#[derive(Clone, Copy, Debug, Eq, PartialEq)]
553pub struct RuntimeCapabilityAuthorizationContract {
554    pub capability_id: &'static str,
555    pub required_permission_ids: &'static [&'static str],
556}
557pub const LODESTONE_API_RUNTIME_CAPABILITY_AUTHORIZATION: &[RuntimeCapabilityAuthorizationContract] = &[
558    RuntimeCapabilityAuthorizationContract {
559        capability_id: "search_and_append_log",
560        required_permission_ids: &["data_read", "data_write"],
561    },
562    RuntimeCapabilityAuthorizationContract {
563        capability_id: "native_metric_records_and_time_series",
564        required_permission_ids: &["data_read", "append"],
565    },
566    RuntimeCapabilityAuthorizationContract {
567        capability_id: "historical_temporal_evidence",
568        required_permission_ids: &["data_read"],
569    },
570    RuntimeCapabilityAuthorizationContract {
571        capability_id: "continuous_temporal_evidence",
572        required_permission_ids: &["data_read", "lifecycle_admin"],
573    },
574    RuntimeCapabilityAuthorizationContract {
575        capability_id: "bounded_relationship_traversal",
576        required_permission_ids: &["data_read", "data_write", "append"],
577    },
578    RuntimeCapabilityAuthorizationContract {
579        capability_id: "native_continuous_profiles",
580        required_permission_ids: &["data_read", "append"],
581    },
582    RuntimeCapabilityAuthorizationContract {
583        capability_id: "committed_vector_and_hybrid",
584        required_permission_ids: &["data_read"],
585    },
586    RuntimeCapabilityAuthorizationContract {
587        capability_id: "realtime_or_pit_vector",
588        required_permission_ids: &["data_read"],
589    },
590    RuntimeCapabilityAuthorizationContract {
591        capability_id: "state_standard_express_ephemeral",
592        required_permission_ids: &["data_read", "data_write"],
593    },
594    RuntimeCapabilityAuthorizationContract {
595        capability_id: "state_relaxed",
596        required_permission_ids: &[],
597    },
598    RuntimeCapabilityAuthorizationContract {
599        capability_id: "bounded_resp",
600        required_permission_ids: &["data_read", "data_write"],
601    },
602    RuntimeCapabilityAuthorizationContract {
603        capability_id: "lodestone_rust_client",
604        required_permission_ids: &[],
605    },
606    RuntimeCapabilityAuthorizationContract {
607        capability_id: "replayable_source_indexes",
608        required_permission_ids: &["index_admin"],
609    },
610    RuntimeCapabilityAuthorizationContract {
611        capability_id: "zero_copy_clones",
612        required_permission_ids: &["index_admin"],
613    },
614    RuntimeCapabilityAuthorizationContract {
615        capability_id: "retained_history",
616        required_permission_ids: &["data_read"],
617    },
618    RuntimeCapabilityAuthorizationContract {
619        capability_id: "generation_result_cache",
620        required_permission_ids: &["data_read"],
621    },
622    RuntimeCapabilityAuthorizationContract {
623        capability_id: "adaptive_field_promotion",
624        required_permission_ids: &["index_admin"],
625    },
626    RuntimeCapabilityAuthorizationContract {
627        capability_id: "durable_overload_buffering",
628        required_permission_ids: &["data_read", "data_write"],
629    },
630    RuntimeCapabilityAuthorizationContract {
631        capability_id: "current_table_reader",
632        required_permission_ids: &["data_read"],
633    },
634    RuntimeCapabilityAuthorizationContract {
635        capability_id: "crypto_shred_and_rollup_lifecycle",
636        required_permission_ids: &["lifecycle_admin"],
637    },
638];
639pub fn runtime_capability_authorization(
640    capability_id: &str,
641) -> Option<&'static RuntimeCapabilityAuthorizationContract> {
642    LODESTONE_API_RUNTIME_CAPABILITY_AUTHORIZATION
643        .iter()
644        .find(|contract| contract.capability_id == capability_id)
645}
646
647#[derive(Clone, Copy, Debug, Eq, PartialEq)]
648pub struct ClusterControlActionContract {
649    pub credential_kind: &'static str,
650    pub action: &'static str,
651}
652pub const LODESTONE_API_CLUSTER_CONTROL_FORMAT_VERSION: u16 = 2;
653pub const LODESTONE_API_CLUSTER_CONTROL_TRANSPORT: &str = "isolated_tls_u32_be_length_then_canonical_json";
654pub const LODESTONE_API_CLUSTER_CONTROL_ACTIONS: &[ClusterControlActionContract] = &[
655    ClusterControlActionContract {
656        credential_kind: "collection_provisioner",
657        action: "initialize_collection_authority",
658    },
659    ClusterControlActionContract {
660        credential_kind: "collection_provisioner",
661        action: "activate_collection_authority",
662    },
663    ClusterControlActionContract {
664        credential_kind: "collection_provisioner",
665        action: "resolve_collection_authority",
666    },
667    ClusterControlActionContract {
668        credential_kind: "collection_provisioner",
669        action: "inspect_collection_retirement",
670    },
671    ClusterControlActionContract {
672        credential_kind: "collection_provisioner",
673        action: "retire_collection_authority",
674    },
675    ClusterControlActionContract {
676        credential_kind: "collection_provisioner",
677        action: "reserve_cluster_control_credential_rotation",
678    },
679    ClusterControlActionContract {
680        credential_kind: "collection_provisioner",
681        action: "activate_cluster_control_credential_rotation",
682    },
683    ClusterControlActionContract {
684        credential_kind: "collection_provisioner",
685        action: "revoke_cluster_control_credential",
686    },
687    ClusterControlActionContract {
688        credential_kind: "collection_provisioner",
689        action: "resolve_cluster_control_credential",
690    },
691    ClusterControlActionContract {
692        credential_kind: "capacity_observer",
693        action: "observe_cluster_capacity",
694    },
695    ClusterControlActionContract {
696        credential_kind: "capacity_observer",
697        action: "observe_resource_diagnostics",
698    },
699    ClusterControlActionContract {
700        credential_kind: "recovery_operator",
701        action: "list_cluster_backups",
702    },
703    ClusterControlActionContract {
704        credential_kind: "recovery_operator",
705        action: "get_cluster_backup",
706    },
707    ClusterControlActionContract {
708        credential_kind: "recovery_operator",
709        action: "create_cluster_backup",
710    },
711    ClusterControlActionContract {
712        credential_kind: "recovery_operator",
713        action: "resolve_cluster_backup",
714    },
715    ClusterControlActionContract {
716        credential_kind: "recovery_operator",
717        action: "delete_cluster_backup",
718    },
719    ClusterControlActionContract {
720        credential_kind: "recovery_operator",
721        action: "resolve_cluster_backup_deletion",
722    },
723    ClusterControlActionContract {
724        credential_kind: "recovery_operator",
725        action: "get_cluster_restore_readiness",
726    },
727    ClusterControlActionContract {
728        credential_kind: "recovery_operator",
729        action: "prepare_offline_recovery",
730    },
731    ClusterControlActionContract {
732        credential_kind: "recovery_operator",
733        action: "reserve_cluster_control_credential_rotation",
734    },
735    ClusterControlActionContract {
736        credential_kind: "recovery_operator",
737        action: "activate_cluster_control_credential_rotation",
738    },
739    ClusterControlActionContract {
740        credential_kind: "recovery_operator",
741        action: "revoke_cluster_control_credential",
742    },
743    ClusterControlActionContract {
744        credential_kind: "recovery_operator",
745        action: "resolve_cluster_control_credential",
746    },
747];
748pub const LODESTONE_API_CLUSTER_CONTROL_TYPES: &[&str] = &[
749    "cluster_control_session",
750    "cluster_control_request",
751    "cluster_control_response",
752    "collection_authority_operation",
753    "collection_retirement_blockers",
754    "core_capacity_observation",
755    "core_resource_diagnostic_page",
756    "cluster_control_credential_rotation",
757    "cluster_backup_operation",
758    "cluster_restore_readiness",
759];
760
761pub const LODESTONE_API_CURSOR_FORMAT_VERSION: u16 = 1;
762#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
763#[serde(deny_unknown_fields)]
764pub struct Cursor {
765    pub value: String,
766}
767
768pub const LODESTONE_API_LOCATOR_FORMAT_VERSION: u16 = 1;
769#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
770#[serde(deny_unknown_fields)]
771pub struct Locator {
772    pub authority: String,
773    pub value: String,
774}
775
776pub const LODESTONE_API_RESOURCE_FORMAT_VERSION: u16 = 1;
777#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
778#[serde(deny_unknown_fields)]
779pub struct Resource {
780    pub kind: String,
781    pub name: String,
782    pub incarnation: Identity,
783}
784
785pub const LODESTONE_API_FIELD_PROMOTION_CONFIGURATION_SHAPE_VERSION: u16 = 1;
786pub const LODESTONE_API_FIELD_PROMOTION_CONFIGURATION_FORMAT_VERSION: u16 = 3;
787#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
788#[serde(deny_unknown_fields)]
789pub struct FieldPromotionConfiguration {
790    pub format_version: u32,
791    pub enabled: bool,
792    pub minimum_query_count: u32,
793    pub maximum_promoted_fields: u32,
794    pub maximum_cardinality: U64,
795    pub maximum_extra_bytes: U64,
796    pub allow_sensitive: bool,
797}
798
799pub const LODESTONE_API_OVERLOAD_CONFIGURATION_SHAPE_VERSION: u16 = 2;
800pub const LODESTONE_API_OVERLOAD_CONFIGURATION_FORMAT_VERSION: u16 = 3;
801#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
802#[serde(deny_unknown_fields)]
803pub struct OverloadConfiguration {
804    pub format_version: u32,
805    pub mode: String,
806    pub maximum_backlog_bytes: U64,
807    pub maximum_backlog_age_millis: U64,
808    pub maximum_collection_share_bytes: U64,
809    pub maximum_recovery_ops_per_pass: u32,
810    pub maximum_pending_overlay_documents: U64,
811}
812
813pub const LODESTONE_API_INDEX_POLICIES_FORMAT_VERSION: u16 = 1;
814#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
815#[serde(deny_unknown_fields)]
816pub struct IndexPolicies {
817    pub durability: String,
818    pub storage: String,
819    pub cache: String,
820    #[serde(default, skip_serializing_if = "Option::is_none")]
821    pub default_visibility: Option<String>,
822    pub field_promotion: FieldPromotionConfiguration,
823    pub overload: OverloadConfiguration,
824}
825
826pub const LODESTONE_API_MAINTENANCE_BUDGETS_FORMAT_VERSION: u16 = 1;
827#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
828#[serde(deny_unknown_fields)]
829pub struct MaintenanceBudgets {
830    pub memtable_max_bytes: U64,
831    pub refresh_max_millis: U64,
832    pub seal_max_bytes: U64,
833    pub seal_max_millis: U64,
834    pub merge_max_bytes: U64,
835    pub delete_resolution_max_bytes: U64,
836    pub wal_retention_max_bytes: U64,
837    pub gc_max_keys: u32,
838    pub fsck_max_objects: u32,
839    pub deleted_tombstone_retention_millis: U64,
840}
841
842pub const LODESTONE_API_RESOURCE_DURABILITY_CLASS_FORMAT_VERSION: u16 = 1;
843#[derive(Clone, Copy, Debug, Deserialize, Eq, PartialEq, Serialize)]
844#[serde(rename_all = "snake_case")]
845pub enum ResourceDurabilityClass {
846    RegionalObject,
847    ZonalLowLatency,
848    Relaxed,
849    Ephemeral,
850}
851
852pub const LODESTONE_API_RESOURCE_STORAGE_CLASS_FORMAT_VERSION: u16 = 1;
853#[derive(Clone, Copy, Debug, Deserialize, Eq, PartialEq, Serialize)]
854#[serde(rename_all = "snake_case")]
855pub enum ResourceStorageClass {
856    Standard,
857    Cold,
858}
859
860pub const LODESTONE_API_VECTOR_QUALITY_OBJECTIVE_FORMAT_VERSION: u16 = 1;
861#[derive(Clone, Copy, Debug, Deserialize, Eq, PartialEq, Serialize)]
862#[serde(rename_all = "snake_case")]
863pub enum VectorQualityObjective {
864    Balanced,
865    HighRecall,
866    MemoryEfficient,
867}
868
869pub const LODESTONE_API_VECTOR_INDEXING_OBJECTIVE_FORMAT_VERSION: u16 = 1;
870#[derive(Clone, Copy, Debug, Deserialize, Eq, PartialEq, Serialize)]
871#[serde(rename_all = "snake_case")]
872pub enum VectorIndexingObjective {
873    FastBuild,
874    Balanced,
875    Compact,
876}
877
878pub const LODESTONE_API_VECTOR_RESIDENCY_INTENT_FORMAT_VERSION: u16 = 1;
879#[derive(Clone, Copy, Debug, Deserialize, Eq, PartialEq, Serialize)]
880#[serde(rename_all = "snake_case")]
881pub enum VectorResidencyIntent {
882    Automatic,
883    PreferResident,
884    RequireResident,
885}
886
887pub const LODESTONE_API_VECTOR_CALIBRATION_BINDING_FORMAT_VERSION: u16 = 1;
888#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
889#[serde(deny_unknown_fields)]
890pub struct VectorCalibrationBinding {
891    pub profile: VectorStrategyProfile,
892    pub evidence_digest: Digest,
893}
894
895pub const LODESTONE_API_VECTOR_RESOURCE_POLICY_FORMAT_VERSION: u16 = 2;
896#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
897#[serde(deny_unknown_fields)]
898pub struct VectorResourcePolicy {
899    pub quality: VectorQualityObjective,
900    pub indexing: VectorIndexingObjective,
901    #[serde(default, skip_serializing_if = "Option::is_none")]
902    pub residency: Option<VectorResidencyIntent>,
903    #[serde(default, skip_serializing_if = "Option::is_none")]
904    pub calibration: Option<VectorCalibrationBinding>,
905}
906
907pub const LODESTONE_API_WORKLOAD_CLASS_FORMAT_VERSION: u16 = 1;
908#[derive(Clone, Copy, Debug, Deserialize, Eq, PartialEq, Serialize)]
909#[serde(rename_all = "snake_case")]
910pub enum WorkloadClass {
911    InteractiveSearch,
912    BatchAnalytics,
913    StreamingIngest,
914    BulkBackfill,
915    InternalMaintenance,
916}
917
918pub const LODESTONE_API_INDEX_RESOURCE_SPEC_SHAPE_VERSION: u16 = 3;
919pub const LODESTONE_API_INDEX_RESOURCE_SPEC_FORMAT_VERSION: u16 = 3;
920#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
921#[serde(deny_unknown_fields)]
922pub struct IndexResourceSpec {
923    pub format_version: u32,
924    pub revision: U64,
925    pub initial_shards: u32,
926    pub target_shard_bytes: U64,
927    pub durability: ResourceDurabilityClass,
928    pub storage_class: ResourceStorageClass,
929    pub ram_admission_weight: u32,
930    pub ram_hard_max_bytes: U64,
931    pub nvme_admission_weight: u32,
932    pub nvme_hard_max_bytes: U64,
933    pub refresh_objective_millis: u32,
934    pub memtable_hard_max_bytes: U64,
935    pub seal_parallelism: u32,
936    pub merge_parallelism: u32,
937    pub vector: VectorResourcePolicy,
938    #[serde(default, skip_serializing_if = "Option::is_none")]
939    pub lifecycle_binding: Option<Identity>,
940    pub encryption_required: bool,
941    #[serde(default, skip_serializing_if = "Option::is_none")]
942    pub resolver_capability: Option<Identity>,
943}
944
945pub const LODESTONE_API_INDEX_SUMMARY_FORMAT_VERSION: u16 = 1;
946#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
947#[serde(deny_unknown_fields)]
948pub struct IndexSummary {
949    pub name: String,
950    pub incarnation: Identity,
951    pub revision: U64,
952    pub mode: String,
953    pub retained_event_identity: bool,
954    pub state: String,
955    pub schema_generation: U64,
956    pub routing_revision: U64,
957    pub shard_count: u32,
958    pub policies: IndexPolicies,
959    pub management_mode: String,
960}
961
962pub const LODESTONE_API_MAPPING_MODE_FORMAT_VERSION: u16 = 1;
963#[derive(Clone, Copy, Debug, Deserialize, Eq, PartialEq, Serialize)]
964#[serde(rename_all = "snake_case")]
965pub enum MappingMode {
966    Mutable,
967    AppendLog,
968    State,
969}
970
971pub const LODESTONE_API_DYNAMIC_MAPPING_POLICY_FORMAT_VERSION: u16 = 1;
972#[derive(Clone, Copy, Debug, Deserialize, Eq, PartialEq, Serialize)]
973#[serde(rename_all = "snake_case")]
974pub enum DynamicMappingPolicy {
975    True,
976    False,
977    Strict,
978}
979
980pub const LODESTONE_API_MAPPING_ANALYZER_FORMAT_VERSION: u16 = 1;
981#[derive(Clone, Copy, Debug, Deserialize, Eq, PartialEq, Serialize)]
982#[serde(rename_all = "snake_case")]
983pub enum MappingAnalyzer {
984    Keyword,
985    Simple,
986    Standard,
987    Whitespace,
988}
989
990pub const LODESTONE_API_KEYWORD_NORMALIZER_FORMAT_VERSION: u16 = 1;
991#[derive(Clone, Copy, Debug, Deserialize, Eq, PartialEq, Serialize)]
992#[serde(rename_all = "snake_case")]
993pub enum KeywordNormalizer {
994    Keyword,
995    Lowercase,
996}
997
998pub const LODESTONE_API_VECTOR_METRIC_FORMAT_VERSION: u16 = 1;
999#[derive(Clone, Copy, Debug, Deserialize, Eq, PartialEq, Serialize)]
1000#[serde(rename_all = "snake_case")]
1001pub enum VectorMetric {
1002    Cosine,
1003    DotProduct,
1004    SquaredL2,
1005}
1006
1007pub const LODESTONE_API_MAPPING_SCALAR_FORMAT_VERSION: u16 = 1;
1008#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
1009#[serde(tag = "kind", rename_all = "snake_case", deny_unknown_fields)]
1010pub enum MappingScalar {
1011    Boolean { value: bool },
1012    I64 { value: I64 },
1013    U64 { value: U64 },
1014    F64Bits { value: U64 },
1015    Keyword { value: String },
1016}
1017
1018pub const LODESTONE_API_SPARSE_VECTOR_WEIGHT_TYPE_FORMAT_VERSION: u16 = 1;
1019#[derive(Clone, Copy, Debug, Deserialize, Eq, PartialEq, Serialize)]
1020#[serde(rename_all = "snake_case")]
1021pub enum SparseVectorWeightType {
1022    F32,
1023    F16,
1024}
1025
1026pub const LODESTONE_API_MAPPING_FIELD_TYPE_SHAPE_VERSION: u16 = 3;
1027pub const LODESTONE_API_MAPPING_FIELD_TYPE_VECTOR_FORMAT_VERSION: u16 = 2;
1028pub const LODESTONE_API_MAPPING_FIELD_TYPE_SPARSE_VECTOR_FORMAT_VERSION: u16 = 1;
1029pub const LODESTONE_API_MAPPING_FIELD_TYPE_VECTOR_SET_FORMAT_VERSION: u16 = 1;
1030#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
1031#[serde(tag = "kind", rename_all = "snake_case", deny_unknown_fields)]
1032pub enum MappingFieldType {
1033    Text,
1034    Keyword,
1035    U64,
1036    Date,
1037    I64,
1038    F64,
1039    Bool,
1040    Nested,
1041    Vector {
1042        format_version: u32,
1043        field_id: u32,
1044        dimensions: u32,
1045        metric: VectorMetric,
1046        element_type: DenseVectorElementType,
1047        #[serde(default, skip_serializing_if = "Option::is_none")]
1048        quantization_scale: Option<ApproximateNumber>,
1049    },
1050    SparseVector {
1051        format_version: u32,
1052        field_id: u32,
1053        maximum_dimension: u32,
1054        weight_type: SparseVectorWeightType,
1055    },
1056    VectorSet {
1057        format_version: u32,
1058        field_id: u32,
1059        dimensions: u32,
1060        metric: VectorMetric,
1061        element_type: DenseVectorElementType,
1062        #[serde(default, skip_serializing_if = "Option::is_none")]
1063        quantization_scale: Option<ApproximateNumber>,
1064        maximum_vectors: u32,
1065    },
1066}
1067
1068pub const LODESTONE_API_MAPPING_FIELD_FORMAT_VERSION: u16 = 1;
1069#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
1070#[serde(deny_unknown_fields)]
1071pub struct MappingField {
1072    pub path: String,
1073    pub field_type: MappingFieldType,
1074    pub stored: bool,
1075    #[serde(default, skip_serializing_if = "Option::is_none")]
1076    pub null_value: Option<MappingScalar>,
1077}
1078
1079pub const LODESTONE_API_MULTI_FIELD_PROJECTION_FORMAT_VERSION: u16 = 1;
1080#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
1081#[serde(deny_unknown_fields)]
1082pub struct MultiFieldProjection {
1083    pub parent: String,
1084    pub child: String,
1085}
1086
1087pub const LODESTONE_API_ANALYZER_IDENTITY_FORMAT_VERSION: u16 = 1;
1088#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
1089#[serde(deny_unknown_fields)]
1090pub struct AnalyzerIdentity {
1091    pub field: String,
1092    pub index_analyzer: MappingAnalyzer,
1093    pub search_analyzer: MappingAnalyzer,
1094}
1095
1096pub const LODESTONE_API_KEYWORD_LIMIT_FORMAT_VERSION: u16 = 1;
1097#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
1098#[serde(deny_unknown_fields)]
1099pub struct KeywordLimit {
1100    pub field: String,
1101    pub max_bytes: u32,
1102    pub normalizer: KeywordNormalizer,
1103}
1104
1105pub const LODESTONE_API_PROFILE_PRIVACY_ACTION_FORMAT_VERSION: u16 = 1;
1106#[derive(Clone, Copy, Debug, Deserialize, Eq, PartialEq, Serialize)]
1107#[serde(rename_all = "snake_case")]
1108pub enum ProfilePrivacyAction {
1109    Allow,
1110    Drop,
1111    Redact,
1112    Reject,
1113}
1114
1115pub const LODESTONE_API_PROFILE_PRIVACY_FIELD_FORMAT_VERSION: u16 = 1;
1116#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
1117#[serde(tag = "kind", rename_all = "snake_case", deny_unknown_fields)]
1118pub enum ProfilePrivacyField {
1119    ResourceAttribute { key: String },
1120    ScopeAttribute { key: String },
1121    SampleLabel { key: String },
1122    FunctionName,
1123    FunctionSystemName,
1124    FunctionFilename,
1125    MappingFilename,
1126}
1127
1128pub const LODESTONE_API_PROFILE_PRIVACY_RULE_FORMAT_VERSION: u16 = 1;
1129#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
1130#[serde(deny_unknown_fields)]
1131pub struct ProfilePrivacyRule {
1132    pub field: ProfilePrivacyField,
1133    pub action: ProfilePrivacyAction,
1134}
1135
1136pub const LODESTONE_API_PROFILE_PRIVACY_POLICY_SHAPE_VERSION: u16 = 1;
1137pub const LODESTONE_API_PROFILE_PRIVACY_POLICY_FORMAT_VERSION: u16 = 1;
1138#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
1139#[serde(deny_unknown_fields)]
1140pub struct ProfilePrivacyPolicy {
1141    pub format_version: u32,
1142    pub rules: Vec<ProfilePrivacyRule>,
1143}
1144
1145pub const LODESTONE_API_MAPPING_RECORD_MODEL_SHAPE_VERSION: u16 = 3;
1146pub const LODESTONE_API_MAPPING_RECORD_MODEL_METRIC_V1_FORMAT_VERSION: u16 = 1;
1147pub const LODESTONE_API_MAPPING_RECORD_MODEL_RELATIONSHIP_V1_FORMAT_VERSION: u16 = 1;
1148pub const LODESTONE_API_MAPPING_RECORD_MODEL_PROFILE_V1_FORMAT_VERSION: u16 = 1;
1149#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
1150#[serde(tag = "kind", rename_all = "snake_case", deny_unknown_fields)]
1151pub enum MappingRecordModel {
1152    Document,
1153    MetricV1 {
1154        format_version: u32,
1155        grouping_attributes: Vec<String>,
1156    },
1157    RelationshipV1 {
1158        format_version: u32,
1159    },
1160    ProfileV1 {
1161        format_version: u32,
1162        privacy: ProfilePrivacyPolicy,
1163    },
1164}
1165
1166pub const LODESTONE_API_MAPPING_SHAPE_VERSION: u16 = 4;
1167pub const LODESTONE_API_MAPPING_FORMAT_VERSION: u16 = 10;
1168#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
1169#[serde(deny_unknown_fields)]
1170pub struct Mapping {
1171    pub format_version: u32,
1172    pub generation: U64,
1173    pub mode: MappingMode,
1174    pub record_model: MappingRecordModel,
1175    pub dynamic_policy: DynamicMappingPolicy,
1176    pub fields: Vec<MappingField>,
1177    pub multi_field_projections: Vec<MultiFieldProjection>,
1178    pub analyzer_identities: Vec<AnalyzerIdentity>,
1179    pub keyword_limits: Vec<KeywordLimit>,
1180    pub nested_paths: Vec<String>,
1181}
1182
1183pub const LODESTONE_API_INDEX_DETAIL_FORMAT_VERSION: u16 = 1;
1184#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
1185#[serde(deny_unknown_fields)]
1186pub struct IndexDetail {
1187    pub summary: IndexSummary,
1188    pub current_mapping: Mapping,
1189    pub budgets: MaintenanceBudgets,
1190    pub resource_spec: IndexResourceSpec,
1191    pub aliases: Vec<String>,
1192    pub data_streams: Vec<String>,
1193}
1194
1195pub const LODESTONE_API_SOURCE_PROVIDER_FORMAT_VERSION: u16 = 1;
1196#[derive(Clone, Copy, Debug, Deserialize, Eq, PartialEq, Serialize)]
1197#[serde(rename_all = "snake_case")]
1198pub enum SourceProvider {
1199    Kafka,
1200    ObjectLog,
1201    HttpReplay,
1202    GrpcReplay,
1203}
1204
1205pub const LODESTONE_API_SOURCE_DECODER_FORMAT_VERSION: u16 = 1;
1206#[derive(Clone, Copy, Debug, Deserialize, Eq, PartialEq, Serialize)]
1207#[serde(rename_all = "snake_case")]
1208pub enum SourceDecoder {
1209    LodestoneDocumentJson,
1210    DebeziumPostgresJson,
1211}
1212
1213pub const LODESTONE_API_SOURCE_REPLAY_GUARANTEES_FORMAT_VERSION: u16 = 1;
1214#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
1215#[serde(deny_unknown_fields)]
1216pub struct SourceReplayGuarantees {
1217    pub durable_replay: bool,
1218    pub stable_partition_identity: bool,
1219    pub stable_operation_identity: bool,
1220    pub ordered_positions: bool,
1221    pub bounded_reads: bool,
1222    pub explicit_retention: bool,
1223    pub explicit_rewind: bool,
1224    pub minimum_replay_window_millis: U64,
1225}
1226
1227pub const LODESTONE_API_SOURCE_PARTITION_CONFIGURATION_FORMAT_VERSION: u16 = 1;
1228#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
1229#[serde(deny_unknown_fields)]
1230pub struct SourcePartitionConfiguration {
1231    pub partition_id: u32,
1232    pub partition_incarnation: U64,
1233    pub initial_next_ordinal: U64,
1234    pub initial_resume_token_base64: String,
1235}
1236
1237pub const LODESTONE_API_REPLAYABLE_SOURCE_CONFIGURATION_FORMAT_VERSION: u16 = 1;
1238#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
1239#[serde(deny_unknown_fields)]
1240pub struct ReplayableSourceConfiguration {
1241    pub source_incarnation: U64,
1242    pub source_identity_digest: Digest,
1243    pub provider: SourceProvider,
1244    pub decoder: SourceDecoder,
1245    pub partitions: Vec<SourcePartitionConfiguration>,
1246    pub guarantees: SourceReplayGuarantees,
1247}
1248
1249pub const LODESTONE_API_SOURCE_PARTITION_STATUS_FORMAT_VERSION: u16 = 1;
1250#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
1251#[serde(deny_unknown_fields)]
1252pub struct SourcePartitionStatus {
1253    pub partition_id: u32,
1254    pub partition_incarnation: U64,
1255    pub indexed_next_ordinal: U64,
1256    #[serde(default, skip_serializing_if = "Option::is_none")]
1257    pub provider_high_watermark_next_ordinal: Option<U64>,
1258    #[serde(default, skip_serializing_if = "Option::is_none")]
1259    pub retention_floor_next_ordinal: Option<U64>,
1260    #[serde(default, skip_serializing_if = "Option::is_none")]
1261    pub lag_records: Option<U64>,
1262}
1263
1264pub const LODESTONE_API_REPLAYABLE_SOURCE_STATUS_FORMAT_VERSION: u16 = 1;
1265#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
1266#[serde(deny_unknown_fields)]
1267pub struct ReplayableSourceStatus {
1268    pub index: Resource,
1269    pub provider: SourceProvider,
1270    pub decoder: SourceDecoder,
1271    pub source_incarnation: U64,
1272    pub source_identity_digest: Digest,
1273    pub lifecycle: String,
1274    pub lifecycle_generation: U64,
1275    #[serde(default, skip_serializing_if = "Option::is_none")]
1276    pub pause_reason: Option<String>,
1277    #[serde(default, skip_serializing_if = "Option::is_none")]
1278    pub rebuild_reason: Option<String>,
1279    pub retry_state: String,
1280    pub retention_risk: String,
1281    #[serde(default, skip_serializing_if = "Option::is_none")]
1282    pub last_batch_identity: Option<Identity>,
1283    pub partitions: Vec<SourcePartitionStatus>,
1284}
1285
1286pub const LODESTONE_API_SOURCE_CONTROL_TRANSITION_FORMAT_VERSION: u16 = 1;
1287#[derive(Clone, Copy, Debug, Deserialize, Eq, PartialEq, Serialize)]
1288#[serde(rename_all = "snake_case")]
1289pub enum SourceControlTransition {
1290    Pause,
1291    Resume,
1292    RequireRebuild,
1293}
1294
1295pub const LODESTONE_API_HISTORY_LEDGER_PRECONDITION_FORMAT_VERSION: u16 = 1;
1296#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
1297#[serde(tag = "kind", rename_all = "snake_case", deny_unknown_fields)]
1298pub enum HistoryLedgerPrecondition {
1299    Absent,
1300    Exact { revision: U64 },
1301}
1302
1303pub const LODESTONE_API_HISTORY_RETENTION_POLICY_FORMAT_VERSION: u16 = 1;
1304#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
1305#[serde(deny_unknown_fields)]
1306pub struct HistoryRetentionPolicy {
1307    pub keep_for_millis: U64,
1308    pub capture_interval_millis: U64,
1309    pub maximum_cuts: u32,
1310    pub privacy_overlay_identity_limit: u32,
1311}
1312
1313pub const LODESTONE_API_HISTORY_SELECTOR_FORMAT_VERSION: u16 = 1;
1314#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
1315#[serde(tag = "kind", rename_all = "snake_case", deny_unknown_fields)]
1316pub enum HistorySelector {
1317    ExactCut { cut_id: Identity },
1318    AtOrBeforeCommitTime { unix_millis: U64 },
1319}
1320
1321pub const LODESTONE_API_HISTORY_HOLD_FORMAT_VERSION: u16 = 1;
1322#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
1323#[serde(deny_unknown_fields)]
1324pub struct HistoryHold {
1325    pub hold_id: Identity,
1326    pub cut_ids: Vec<Identity>,
1327}
1328
1329pub const LODESTONE_API_HISTORY_STATUS_FORMAT_VERSION: u16 = 1;
1330#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
1331#[serde(deny_unknown_fields)]
1332pub struct HistoryStatus {
1333    pub index: Resource,
1334    pub revision: U64,
1335    pub policy: HistoryRetentionPolicy,
1336    pub page_count: u32,
1337    pub cut_count: u32,
1338    pub holds: Vec<HistoryHold>,
1339}
1340
1341pub const LODESTONE_API_HISTORY_RESOLUTION_FORMAT_VERSION: u16 = 1;
1342#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
1343#[serde(deny_unknown_fields)]
1344pub struct HistoryResolution {
1345    pub index: Resource,
1346    pub selector: HistorySelector,
1347    pub cut_id: Identity,
1348    pub committed_at_unix_millis: U64,
1349    pub uncertainty_millis: U64,
1350    pub shard_count: u32,
1351    pub security_policy_revision: U64,
1352}
1353
1354pub const LODESTONE_API_INDEX_REFERENCE_FORMAT_VERSION: u16 = 1;
1355#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
1356#[serde(deny_unknown_fields)]
1357pub struct IndexReference {
1358    pub name: String,
1359    pub incarnation: Identity,
1360}
1361
1362pub const LODESTONE_API_ALIAS_TARGET_FORMAT_VERSION: u16 = 1;
1363#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
1364#[serde(deny_unknown_fields)]
1365pub struct AliasTarget {
1366    pub index: IndexReference,
1367    pub write_index: bool,
1368}
1369
1370pub const LODESTONE_API_ALIAS_SUMMARY_FORMAT_VERSION: u16 = 1;
1371#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
1372#[serde(deny_unknown_fields)]
1373pub struct AliasSummary {
1374    pub name: String,
1375    pub revision: U64,
1376    pub visible_target_count: u32,
1377}
1378
1379pub const LODESTONE_API_ALIAS_DETAIL_FORMAT_VERSION: u16 = 1;
1380#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
1381#[serde(deny_unknown_fields)]
1382pub struct AliasDetail {
1383    pub summary: AliasSummary,
1384    pub visible_targets: Vec<AliasTarget>,
1385    #[serde(default, skip_serializing_if = "Option::is_none")]
1386    pub filter: Option<RawJson>,
1387    #[serde(default, skip_serializing_if = "Option::is_none")]
1388    pub index_routing: Option<String>,
1389    #[serde(default, skip_serializing_if = "Option::is_none")]
1390    pub search_routing: Option<String>,
1391}
1392
1393pub const LODESTONE_API_DATA_STREAM_SUMMARY_FORMAT_VERSION: u16 = 1;
1394#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
1395#[serde(deny_unknown_fields)]
1396pub struct DataStreamSummary {
1397    pub name: String,
1398    pub incarnation: Identity,
1399    pub revision: U64,
1400    pub generation: U64,
1401    pub state: String,
1402    pub visible_backing_count: u32,
1403}
1404
1405pub const LODESTONE_API_COMPONENT_TEMPLATE_BINDING_FORMAT_VERSION: u16 = 1;
1406#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
1407#[serde(deny_unknown_fields)]
1408pub struct ComponentTemplateBinding {
1409    pub name: String,
1410    pub incarnation: Identity,
1411    pub revision: U64,
1412}
1413
1414pub const LODESTONE_API_INDEX_TEMPLATE_BINDING_FORMAT_VERSION: u16 = 1;
1415#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
1416#[serde(deny_unknown_fields)]
1417pub struct IndexTemplateBinding {
1418    pub name: String,
1419    pub incarnation: Identity,
1420    pub revision: U64,
1421}
1422
1423pub const LODESTONE_API_LIFECYCLE_POLICY_BINDING_FORMAT_VERSION: u16 = 1;
1424#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
1425#[serde(deny_unknown_fields)]
1426pub struct LifecyclePolicyBinding {
1427    pub name: String,
1428    pub incarnation: Identity,
1429    pub revision: U64,
1430}
1431
1432pub const LODESTONE_API_DATA_STREAM_DETAIL_FORMAT_VERSION: u16 = 1;
1433#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
1434#[serde(deny_unknown_fields)]
1435pub struct DataStreamDetail {
1436    pub summary: DataStreamSummary,
1437    pub visible_backing_indices: Vec<IndexReference>,
1438    #[serde(default, skip_serializing_if = "Option::is_none")]
1439    pub write_index: Option<IndexReference>,
1440    pub timestamp_field: String,
1441    pub index_template: IndexTemplateBinding,
1442    #[serde(default, skip_serializing_if = "Option::is_none")]
1443    pub lifecycle_policy: Option<LifecyclePolicyBinding>,
1444}
1445
1446pub const LODESTONE_API_COMPONENT_TEMPLATE_SUMMARY_FORMAT_VERSION: u16 = 1;
1447#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
1448#[serde(deny_unknown_fields)]
1449pub struct ComponentTemplateSummary {
1450    pub name: String,
1451    pub incarnation: Identity,
1452    pub revision: U64,
1453}
1454
1455pub const LODESTONE_API_COMPONENT_TEMPLATE_DETAIL_FORMAT_VERSION: u16 = 1;
1456#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
1457#[serde(deny_unknown_fields)]
1458pub struct ComponentTemplateDetail {
1459    pub summary: ComponentTemplateSummary,
1460    pub mapping: Mapping,
1461    pub settings: RawJson,
1462    #[serde(default, skip_serializing_if = "Option::is_none")]
1463    pub resource_spec: Option<IndexResourceSpec>,
1464}
1465
1466pub const LODESTONE_API_INDEX_TEMPLATE_SUMMARY_FORMAT_VERSION: u16 = 1;
1467#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
1468#[serde(deny_unknown_fields)]
1469pub struct IndexTemplateSummary {
1470    pub name: String,
1471    pub incarnation: Identity,
1472    pub revision: U64,
1473    pub priority: i32,
1474    pub data_stream: bool,
1475}
1476
1477pub const LODESTONE_API_INDEX_TEMPLATE_DETAIL_FORMAT_VERSION: u16 = 1;
1478#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
1479#[serde(deny_unknown_fields)]
1480pub struct IndexTemplateDetail {
1481    pub summary: IndexTemplateSummary,
1482    pub index_patterns: Vec<String>,
1483    pub components: Vec<ComponentTemplateBinding>,
1484    pub mapping: Mapping,
1485    pub settings: RawJson,
1486    #[serde(default, skip_serializing_if = "Option::is_none")]
1487    pub resource_spec: Option<IndexResourceSpec>,
1488}
1489
1490pub const LODESTONE_API_INGEST_PIPELINE_SUMMARY_FORMAT_VERSION: u16 = 1;
1491#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
1492#[serde(deny_unknown_fields)]
1493pub struct IngestPipelineSummary {
1494    pub name: String,
1495    pub incarnation: Identity,
1496    pub revision: U64,
1497    pub digest: Digest,
1498}
1499
1500pub const LODESTONE_API_INGEST_PIPELINE_DETAIL_FORMAT_VERSION: u16 = 1;
1501#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
1502#[serde(deny_unknown_fields)]
1503pub struct IngestPipelineDetail {
1504    pub summary: IngestPipelineSummary,
1505    pub definition: RawJson,
1506}
1507
1508pub const LODESTONE_API_INGEST_PIPELINE_SELECTION_FORMAT_VERSION: u16 = 1;
1509#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
1510#[serde(deny_unknown_fields)]
1511pub struct IngestPipelineSelection {
1512    pub name: String,
1513    pub expected: ExpectedBinding,
1514}
1515
1516pub const LODESTONE_API_LIFECYCLE_POLICY_SUMMARY_FORMAT_VERSION: u16 = 1;
1517#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
1518#[serde(deny_unknown_fields)]
1519pub struct LifecyclePolicySummary {
1520    pub name: String,
1521    pub incarnation: Identity,
1522    pub revision: U64,
1523}
1524
1525pub const LODESTONE_API_ROLLOVER_THRESHOLDS_FORMAT_VERSION: u16 = 1;
1526#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
1527#[serde(deny_unknown_fields)]
1528pub struct RolloverThresholds {
1529    #[serde(default, skip_serializing_if = "Option::is_none")]
1530    pub max_primary_docs: Option<U64>,
1531    #[serde(default, skip_serializing_if = "Option::is_none")]
1532    pub max_primary_bytes: Option<U64>,
1533    #[serde(default, skip_serializing_if = "Option::is_none")]
1534    pub max_age_millis: Option<U64>,
1535}
1536
1537pub const LODESTONE_API_RETENTION_POLICY_FORMAT_VERSION: u16 = 1;
1538#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
1539#[serde(deny_unknown_fields)]
1540pub struct RetentionPolicy {
1541    #[serde(default, skip_serializing_if = "Option::is_none")]
1542    pub document_max_age_millis: Option<U64>,
1543    #[serde(default, skip_serializing_if = "Option::is_none")]
1544    pub backing_index_max_age_millis: Option<U64>,
1545}
1546
1547pub const LODESTONE_API_LIFECYCLE_POLICY_DETAIL_FORMAT_VERSION: u16 = 1;
1548#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
1549#[serde(deny_unknown_fields)]
1550pub struct LifecyclePolicyDetail {
1551    pub summary: LifecyclePolicySummary,
1552    pub rollover: RolloverThresholds,
1553    pub retention: RetentionPolicy,
1554    pub merge_hint: bool,
1555    pub freeze_hint: bool,
1556    pub delete_expired: bool,
1557}
1558
1559pub const LODESTONE_API_TEXT_QUERY_OPERATOR_FORMAT_VERSION: u16 = 1;
1560#[derive(Clone, Copy, Debug, Deserialize, Eq, PartialEq, Serialize)]
1561#[serde(rename_all = "snake_case")]
1562pub enum TextQueryOperator {
1563    Or,
1564    And,
1565}
1566
1567pub const LODESTONE_API_TEXT_QUERY_ANALYZER_FORMAT_VERSION: u16 = 1;
1568#[derive(Clone, Copy, Debug, Deserialize, Eq, PartialEq, Serialize)]
1569#[serde(rename_all = "snake_case")]
1570pub enum TextQueryAnalyzer {
1571    Mapping,
1572    Standard,
1573    Simple,
1574    Whitespace,
1575    Keyword,
1576}
1577
1578pub const LODESTONE_API_ZERO_TERMS_QUERY_FORMAT_VERSION: u16 = 1;
1579#[derive(Clone, Copy, Debug, Deserialize, Eq, PartialEq, Serialize)]
1580#[serde(rename_all = "snake_case")]
1581pub enum ZeroTermsQuery {
1582    None,
1583    All,
1584}
1585
1586pub const LODESTONE_API_TEXT_QUERY_OPTIONS_FORMAT_VERSION: u16 = 1;
1587#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
1588#[serde(deny_unknown_fields)]
1589pub struct TextQueryOptions {
1590    pub operator: TextQueryOperator,
1591    #[serde(default, skip_serializing_if = "Option::is_none")]
1592    pub minimum_should_match: Option<u32>,
1593    pub analyzer: TextQueryAnalyzer,
1594    pub zero_terms_query: ZeroTermsQuery,
1595}
1596
1597pub const LODESTONE_API_MULTI_MATCH_MODE_FORMAT_VERSION: u16 = 1;
1598#[derive(Clone, Copy, Debug, Deserialize, Eq, PartialEq, Serialize)]
1599#[serde(rename_all = "snake_case")]
1600pub enum MultiMatchMode {
1601    BestFields,
1602    MostFields,
1603    Phrase,
1604    PhrasePrefix,
1605    CrossFields,
1606}
1607
1608pub const LODESTONE_API_MULTI_MATCH_FIELD_FORMAT_VERSION: u16 = 1;
1609#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
1610#[serde(deny_unknown_fields)]
1611pub struct MultiMatchField {
1612    pub field: String,
1613    pub boost: ApproximateNumber,
1614}
1615
1616pub const LODESTONE_API_MULTI_MATCH_OPTIONS_FORMAT_VERSION: u16 = 1;
1617#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
1618#[serde(deny_unknown_fields)]
1619pub struct MultiMatchOptions {
1620    pub mode: MultiMatchMode,
1621    pub operator: TextQueryOperator,
1622    #[serde(default, skip_serializing_if = "Option::is_none")]
1623    pub minimum_should_match: Option<u32>,
1624    pub analyzer: TextQueryAnalyzer,
1625    pub zero_terms_query: ZeroTermsQuery,
1626    pub slop: u32,
1627}
1628
1629pub const LODESTONE_API_SORT_ORDER_FORMAT_VERSION: u16 = 1;
1630#[derive(Clone, Copy, Debug, Deserialize, Eq, PartialEq, Serialize)]
1631#[serde(rename_all = "snake_case")]
1632pub enum SortOrder {
1633    Asc,
1634    Desc,
1635}
1636
1637pub const LODESTONE_API_SORT_MODE_FORMAT_VERSION: u16 = 1;
1638#[derive(Clone, Copy, Debug, Deserialize, Eq, PartialEq, Serialize)]
1639#[serde(rename_all = "snake_case")]
1640pub enum SortMode {
1641    Auto,
1642    Min,
1643    Max,
1644}
1645
1646pub const LODESTONE_API_MISSING_ORDER_FORMAT_VERSION: u16 = 1;
1647#[derive(Clone, Copy, Debug, Deserialize, Eq, PartialEq, Serialize)]
1648#[serde(rename_all = "snake_case")]
1649pub enum MissingOrder {
1650    First,
1651    Last,
1652}
1653
1654pub const LODESTONE_API_NESTED_SCORE_MODE_FORMAT_VERSION: u16 = 1;
1655#[derive(Clone, Copy, Debug, Deserialize, Eq, PartialEq, Serialize)]
1656#[serde(rename_all = "snake_case")]
1657pub enum NestedScoreMode {
1658    Avg,
1659    Max,
1660    Min,
1661    None,
1662    Sum,
1663}
1664
1665pub const LODESTONE_API_NESTED_INNER_HITS_FORMAT_VERSION: u16 = 1;
1666#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
1667#[serde(deny_unknown_fields)]
1668pub struct NestedInnerHits {
1669    #[serde(default, skip_serializing_if = "Option::is_none")]
1670    pub name: Option<String>,
1671    pub from: u32,
1672    pub size: u32,
1673    pub sort: Vec<SortSpec>,
1674}
1675
1676pub const LODESTONE_API_SORT_SPEC_FORMAT_VERSION: u16 = 1;
1677#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
1678#[serde(tag = "kind", rename_all = "snake_case", deny_unknown_fields)]
1679pub enum SortSpec {
1680    Score {
1681        order: SortOrder,
1682    },
1683    Field {
1684        field: String,
1685        order: SortOrder,
1686        #[serde(default, skip_serializing_if = "Option::is_none")]
1687        missing: Option<MissingOrder>,
1688        mode: SortMode,
1689    },
1690    NestedField {
1691        path: String,
1692        field: String,
1693        #[serde(default, skip_serializing_if = "Option::is_none")]
1694        filter: Option<Box<Query>>,
1695        order: SortOrder,
1696        #[serde(default, skip_serializing_if = "Option::is_none")]
1697        missing: Option<MissingOrder>,
1698        mode: SortMode,
1699    },
1700}
1701
1702pub const LODESTONE_API_QUERY_FORMAT_VERSION: u16 = 1;
1703#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
1704#[serde(tag = "kind", rename_all = "snake_case", deny_unknown_fields)]
1705pub enum Query {
1706    MatchAll,
1707    Term {
1708        field: String,
1709        value: JsonValue,
1710    },
1711    Terms {
1712        field: String,
1713        values: Vec<JsonValue>,
1714    },
1715    Range {
1716        field: String,
1717        #[serde(default, skip_serializing_if = "Option::is_none")]
1718        lower: Option<JsonValue>,
1719        #[serde(default, skip_serializing_if = "Option::is_none")]
1720        upper: Option<JsonValue>,
1721        include_lower: bool,
1722        include_upper: bool,
1723    },
1724    Text {
1725        field: String,
1726        text: String,
1727        #[serde(default, skip_serializing_if = "Option::is_none")]
1728        options: Option<TextQueryOptions>,
1729    },
1730    MultiMatch {
1731        fields: Vec<MultiMatchField>,
1732        text: String,
1733        #[serde(default, skip_serializing_if = "Option::is_none")]
1734        options: Option<MultiMatchOptions>,
1735    },
1736    Exists {
1737        field: String,
1738    },
1739    Prefix {
1740        field: String,
1741        prefix: String,
1742        #[serde(default, skip_serializing_if = "Option::is_none")]
1743        analyzer: Option<TextQueryAnalyzer>,
1744        analyze_wildcard: bool,
1745    },
1746    Fuzzy {
1747        field: String,
1748        value: String,
1749        distance: u32,
1750        #[serde(default, skip_serializing_if = "Option::is_none")]
1751        analyzer: Option<TextQueryAnalyzer>,
1752    },
1753    Boost {
1754        query: Box<Query>,
1755        boost: ApproximateNumber,
1756    },
1757    Bool {
1758        must: Vec<Query>,
1759        filter: Vec<Query>,
1760        should: Vec<Query>,
1761        must_not: Vec<Query>,
1762        minimum_should_match: u32,
1763    },
1764    Nested {
1765        path: String,
1766        query: Box<Query>,
1767        score_mode: NestedScoreMode,
1768        ignore_unmapped: bool,
1769        #[serde(default, skip_serializing_if = "Option::is_none")]
1770        inner_hits: Option<NestedInnerHits>,
1771    },
1772}
1773
1774pub const LODESTONE_API_DENSE_RETRIEVAL_MODE_FORMAT_VERSION: u16 = 1;
1775#[derive(Clone, Copy, Debug, Deserialize, Eq, PartialEq, Serialize)]
1776#[serde(rename_all = "snake_case")]
1777pub enum DenseRetrievalMode {
1778    Auto,
1779    Ann,
1780    Exact,
1781}
1782
1783pub const LODESTONE_API_VECTOR_ACHIEVED_MODE_FORMAT_VERSION: u16 = 1;
1784#[derive(Clone, Copy, Debug, Deserialize, Eq, PartialEq, Serialize)]
1785#[serde(rename_all = "snake_case")]
1786pub enum VectorAchievedMode {
1787    Exact,
1788    Ann,
1789    Mixed,
1790}
1791
1792pub const LODESTONE_API_VECTOR_BRANCH_DIAGNOSTICS_FORMAT_VERSION: u16 = 2;
1793#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
1794#[serde(deny_unknown_fields)]
1795pub struct VectorBranchDiagnostics {
1796    pub name: String,
1797    pub requested_mode: DenseRetrievalMode,
1798    pub achieved_mode: VectorAchievedMode,
1799    pub result_count: U64,
1800    pub exact_segments: U64,
1801    pub ann_segments: U64,
1802    pub exact_fallback_segments: U64,
1803    pub distance_evaluations: U64,
1804    pub peak_scratch_bytes: U64,
1805    pub fresh_vectors_scanned: U64,
1806    pub realtime_overlay_queries: U64,
1807    pub realtime_overlay_candidates: U64,
1808    pub bundle_roots: U64,
1809    pub object_read_requests: U64,
1810    pub object_bytes_read: U64,
1811    pub cache_hits: U64,
1812    pub cache_misses: U64,
1813    pub snapshot_digests: Vec<Digest>,
1814}
1815
1816pub const LODESTONE_API_DENSE_VECTOR_ELEMENT_TYPE_FORMAT_VERSION: u16 = 1;
1817#[derive(Clone, Copy, Debug, Deserialize, Eq, PartialEq, Serialize)]
1818#[serde(rename_all = "snake_case")]
1819pub enum DenseVectorElementType {
1820    F32,
1821    F16,
1822    I8,
1823}
1824
1825pub const LODESTONE_API_DENSE_VECTOR_BYTE_ORDER_FORMAT_VERSION: u16 = 1;
1826#[derive(Clone, Copy, Debug, Deserialize, Eq, PartialEq, Serialize)]
1827#[serde(rename_all = "snake_case")]
1828pub enum DenseVectorByteOrder {
1829    LittleEndian,
1830}
1831
1832pub const LODESTONE_API_VECTOR_VALUE_FORMAT_VERSION: u16 = 1;
1833#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
1834#[serde(tag = "kind", rename_all = "snake_case", deny_unknown_fields)]
1835pub enum VectorValue {
1836    Numeric {
1837        values: Vec<ApproximateNumber>,
1838    },
1839    Binary {
1840        element_type: DenseVectorElementType,
1841        byte_order: DenseVectorByteOrder,
1842        data_base64: String,
1843        #[serde(default, skip_serializing_if = "Option::is_none")]
1844        quantization_scale: Option<ApproximateNumber>,
1845    },
1846}
1847
1848pub const LODESTONE_API_SPARSE_VECTOR_ENTRY_FORMAT_VERSION: u16 = 1;
1849#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
1850#[serde(deny_unknown_fields)]
1851pub struct SparseVectorEntry {
1852    pub dimension: u32,
1853    pub weight: ApproximateNumber,
1854}
1855
1856pub const LODESTONE_API_SPARSE_VECTOR_VALUE_FORMAT_VERSION: u16 = 1;
1857#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
1858#[serde(deny_unknown_fields)]
1859pub struct SparseVectorValue {
1860    pub entries: Vec<SparseVectorEntry>,
1861}
1862
1863pub const LODESTONE_API_VECTOR_SET_VALUE_FORMAT_VERSION: u16 = 1;
1864#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
1865#[serde(deny_unknown_fields)]
1866pub struct VectorSetValue {
1867    pub vectors: Vec<VectorValue>,
1868}
1869
1870pub const LODESTONE_API_VECTOR_EVALUATION_SNAPSHOT_FORMAT_VERSION: u16 = 1;
1871#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
1872#[serde(tag = "kind", rename_all = "snake_case", deny_unknown_fields)]
1873pub enum VectorEvaluationSnapshot {
1874    CommittedCut { digest: Digest },
1875    Pit { pit: Cursor },
1876}
1877
1878pub const LODESTONE_API_VECTOR_EVALUATION_QUERY_SET_FORMAT_VERSION: u16 = 1;
1879#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
1880#[serde(tag = "kind", rename_all = "snake_case", deny_unknown_fields)]
1881pub enum VectorEvaluationQuerySet {
1882    Sample { seed: U64, sample_count: u32 },
1883    Supplied { digest: Digest, queries: Vec<VectorValue> },
1884}
1885
1886pub const LODESTONE_API_VECTOR_EVALUATION_BUDGET_FORMAT_VERSION: u16 = 1;
1887#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
1888#[serde(deny_unknown_fields)]
1889pub struct VectorEvaluationBudget {
1890    pub maximum_distance_evaluations: U64,
1891    pub maximum_elapsed_work_units: U64,
1892    pub maximum_peak_memory_bytes: U64,
1893    pub maximum_object_reads: U64,
1894    pub maximum_object_bytes: U64,
1895    pub maximum_build_scratch_bytes: U64,
1896    pub maximum_profile_comparisons: u32,
1897}
1898
1899pub const LODESTONE_API_VECTOR_CANDIDATE_POLICY_FORMAT_VERSION: u16 = 1;
1900#[derive(Clone, Copy, Debug, Deserialize, Eq, PartialEq, Serialize)]
1901#[serde(rename_all = "snake_case")]
1902pub enum VectorCandidatePolicy {
1903    Balanced,
1904    HighRecall,
1905    MemoryEfficient,
1906}
1907
1908pub const LODESTONE_API_VECTOR_CALIBRATION_OBJECTIVE_FORMAT_VERSION: u16 = 1;
1909#[derive(Clone, Copy, Debug, Deserialize, Eq, PartialEq, Serialize)]
1910#[serde(rename_all = "snake_case")]
1911pub enum VectorCalibrationObjective {
1912    Balanced,
1913    HighRecall,
1914    MemoryEfficient,
1915}
1916
1917pub const LODESTONE_API_VECTOR_STRATEGY_PROFILE_FORMAT_VERSION: u16 = 1;
1918#[derive(Clone, Copy, Debug, Deserialize, Eq, PartialEq, Serialize)]
1919#[serde(rename_all = "snake_case")]
1920pub enum VectorStrategyProfile {
1921    BalancedV1,
1922    HighRecallV1,
1923    MemoryEfficientV1,
1924}
1925
1926pub const LODESTONE_API_VECTOR_EVALUATION_WORK_FORMAT_VERSION: u16 = 1;
1927#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
1928#[serde(deny_unknown_fields)]
1929pub struct VectorEvaluationWork {
1930    pub distance_evaluations: U64,
1931    pub elapsed_work_units: U64,
1932    pub peak_memory_bytes: U64,
1933    pub object_reads: U64,
1934    pub object_bytes: U64,
1935}
1936
1937pub const LODESTONE_API_VECTOR_EVALUATION_ERROR_CODE_FORMAT_VERSION: u16 = 1;
1938#[derive(Clone, Copy, Debug, Deserialize, Eq, PartialEq, Serialize)]
1939#[serde(rename_all = "snake_case")]
1940pub enum VectorEvaluationErrorCode {
1941    AnnRefused,
1942    ExhaustiveRefused,
1943    TimedOut,
1944    Cancelled,
1945    Internal,
1946}
1947
1948pub const LODESTONE_API_VECTOR_EVALUATION_ERROR_FORMAT_VERSION: u16 = 1;
1949#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
1950#[serde(deny_unknown_fields)]
1951pub struct VectorEvaluationError {
1952    pub sample_ordinal: u32,
1953    pub code: VectorEvaluationErrorCode,
1954}
1955
1956pub const LODESTONE_API_VECTOR_RECALL_RESULT_SHAPE_VERSION: u16 = 1;
1957pub const LODESTONE_API_VECTOR_RECALL_RESULT_FORMAT_VERSION: u16 = 1;
1958#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
1959#[serde(deny_unknown_fields)]
1960pub struct VectorRecallResult {
1961    pub format_version: u32,
1962    pub index: Resource,
1963    pub field: String,
1964    pub mapping_generation: U64,
1965    pub snapshot_digest: Digest,
1966    pub query_set_digest: Digest,
1967    pub metric: VectorMetric,
1968    pub k: u32,
1969    pub candidate_policy: VectorCandidatePolicy,
1970    pub strategy_identity: String,
1971    pub completed_samples: u32,
1972    pub ann_result_count: U64,
1973    pub exhaustive_result_count: U64,
1974    pub mean_recall_basis_points: u32,
1975    pub minimum_recall_basis_points: u32,
1976    pub p05_recall_basis_points: u32,
1977    pub p50_recall_basis_points: u32,
1978    pub p90_recall_basis_points: u32,
1979    pub p99_recall_basis_points: u32,
1980    pub ann_work: VectorEvaluationWork,
1981    pub exhaustive_work: VectorEvaluationWork,
1982    pub errors: Vec<VectorEvaluationError>,
1983}
1984
1985pub const LODESTONE_API_VECTOR_CALIBRATION_CANDIDATE_FORMAT_VERSION: u16 = 1;
1986#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
1987#[serde(deny_unknown_fields)]
1988pub struct VectorCalibrationCandidate {
1989    pub profile: VectorStrategyProfile,
1990    pub recall: VectorRecallResult,
1991    pub build_scratch_bytes: U64,
1992    pub resident_bytes: U64,
1993    pub evidence_digest: Digest,
1994}
1995
1996pub const LODESTONE_API_VECTOR_CALIBRATION_RESULT_SHAPE_VERSION: u16 = 1;
1997pub const LODESTONE_API_VECTOR_CALIBRATION_RESULT_FORMAT_VERSION: u16 = 1;
1998#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
1999#[serde(deny_unknown_fields)]
2000pub struct VectorCalibrationResult {
2001    pub format_version: u32,
2002    pub objective: VectorCalibrationObjective,
2003    pub candidates: Vec<VectorCalibrationCandidate>,
2004    pub recommended_profile: VectorStrategyProfile,
2005    pub recommended_evidence_digest: Digest,
2006    pub requires_explicit_resource_revision_and_rebuild: bool,
2007}
2008
2009pub const LODESTONE_API_VECTOR_DIAGNOSTIC_RESULT_FORMAT_VERSION: u16 = 1;
2010#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
2011#[serde(tag = "kind", rename_all = "snake_case", deny_unknown_fields)]
2012pub enum VectorDiagnosticResult {
2013    Recall { result: Box<VectorRecallResult> },
2014    Calibration { result: Box<VectorCalibrationResult> },
2015}
2016
2017pub const LODESTONE_API_VECTOR_WARM_COMPONENT_FORMAT_VERSION: u16 = 1;
2018#[derive(Clone, Copy, Debug, Deserialize, Eq, PartialEq, Serialize)]
2019#[serde(rename_all = "snake_case")]
2020pub enum VectorWarmComponent {
2021    Directory,
2022    Approximate,
2023    Exact,
2024}
2025
2026pub const LODESTONE_API_VECTOR_WARM_STATE_FORMAT_VERSION: u16 = 1;
2027#[derive(Clone, Copy, Debug, Deserialize, Eq, PartialEq, Serialize)]
2028#[serde(rename_all = "snake_case")]
2029pub enum VectorWarmState {
2030    Warmed,
2031    Partial,
2032    Stale,
2033}
2034
2035pub const LODESTONE_API_VECTOR_WARM_ACHIEVEMENT_FORMAT_VERSION: u16 = 1;
2036#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
2037#[serde(deny_unknown_fields)]
2038pub struct VectorWarmAchievement {
2039    pub component: VectorWarmComponent,
2040    pub cache_identity: Digest,
2041    pub resident_bytes: U64,
2042}
2043
2044pub const LODESTONE_API_VECTOR_WARM_RESULT_SHAPE_VERSION: u16 = 1;
2045pub const LODESTONE_API_VECTOR_WARM_RESULT_FORMAT_VERSION: u16 = 1;
2046#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
2047#[serde(deny_unknown_fields)]
2048pub struct VectorWarmResult {
2049    pub format_version: u32,
2050    pub operation_identity: Digest,
2051    pub index: Resource,
2052    pub root_digest: Digest,
2053    pub state: VectorWarmState,
2054    pub progress: ExactDecimal,
2055    pub achieved: Vec<VectorWarmAchievement>,
2056    pub object_requests: U64,
2057    pub object_bytes: U64,
2058    pub cache_hits: U64,
2059    pub cache_misses: U64,
2060    pub started_at: U64,
2061    pub completed_at: U64,
2062    pub expires_at: U64,
2063    #[serde(default, skip_serializing_if = "Option::is_none")]
2064    pub residency_intent: Option<VectorResidencyIntent>,
2065}
2066
2067pub const LODESTONE_API_DENSE_RETRIEVAL_THRESHOLD_FORMAT_VERSION: u16 = 1;
2068#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
2069#[serde(tag = "kind", rename_all = "snake_case", deny_unknown_fields)]
2070pub enum DenseRetrievalThreshold {
2071    MinimumScore { value: ApproximateNumber },
2072    MaximumDistance { value: ApproximateNumber },
2073}
2074
2075pub const LODESTONE_API_RETRIEVAL_BRANCH_FORMAT_VERSION: u16 = 3;
2076#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
2077#[serde(tag = "kind", rename_all = "snake_case", deny_unknown_fields)]
2078pub enum RetrievalBranch {
2079    Lexical {
2080        name: String,
2081        query: Box<Query>,
2082        #[serde(default, skip_serializing_if = "Option::is_none")]
2083        filter: Option<Box<Query>>,
2084        window: u32,
2085        weight: ApproximateNumber,
2086    },
2087    Dense {
2088        name: String,
2089        field: String,
2090        query_vector: VectorValue,
2091        #[serde(default, skip_serializing_if = "Option::is_none")]
2092        filter: Option<Box<Query>>,
2093        window: u32,
2094        #[serde(default, skip_serializing_if = "Option::is_none")]
2095        candidates: Option<u32>,
2096        weight: ApproximateNumber,
2097        mode: DenseRetrievalMode,
2098        #[serde(default, skip_serializing_if = "Option::is_none")]
2099        threshold: Option<DenseRetrievalThreshold>,
2100    },
2101    Sparse {
2102        name: String,
2103        field: String,
2104        query_vector: SparseVectorValue,
2105        #[serde(default, skip_serializing_if = "Option::is_none")]
2106        filter: Option<Box<Query>>,
2107        window: u32,
2108        weight: ApproximateNumber,
2109    },
2110    LateInteraction {
2111        name: String,
2112        field: String,
2113        query_vectors: VectorSetValue,
2114        #[serde(default, skip_serializing_if = "Option::is_none")]
2115        filter: Option<Box<Query>>,
2116        window: u32,
2117        candidates: u32,
2118        weight: ApproximateNumber,
2119    },
2120}
2121
2122pub const LODESTONE_API_WEIGHTED_RRF_FUSION_FORMAT_VERSION: u16 = 1;
2123#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
2124#[serde(deny_unknown_fields)]
2125pub struct WeightedRrfFusion {
2126    pub rank_constant: u32,
2127}
2128
2129pub const LODESTONE_API_RETRIEVAL_PLAN_SHAPE_VERSION: u16 = 1;
2130pub const LODESTONE_API_RETRIEVAL_PLAN_FORMAT_VERSION: u16 = 1;
2131#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
2132#[serde(deny_unknown_fields)]
2133pub struct RetrievalPlan {
2134    pub format_version: u32,
2135    #[serde(default, skip_serializing_if = "Option::is_none")]
2136    pub global_filter: Option<Box<Query>>,
2137    pub branches: Vec<RetrievalBranch>,
2138    pub fusion: WeightedRrfFusion,
2139    pub result_window: u32,
2140}
2141
2142pub const LODESTONE_API_HISTOGRAM_BOUNDS_FORMAT_VERSION: u16 = 1;
2143#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
2144#[serde(deny_unknown_fields)]
2145pub struct HistogramBounds {
2146    #[serde(default, skip_serializing_if = "Option::is_none")]
2147    pub min: Option<ApproximateNumber>,
2148    #[serde(default, skip_serializing_if = "Option::is_none")]
2149    pub max: Option<ApproximateNumber>,
2150}
2151
2152pub const LODESTONE_API_DATE_HISTOGRAM_BOUNDS_FORMAT_VERSION: u16 = 1;
2153#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
2154#[serde(deny_unknown_fields)]
2155pub struct DateHistogramBounds {
2156    #[serde(default, skip_serializing_if = "Option::is_none")]
2157    pub min: Option<I64>,
2158    #[serde(default, skip_serializing_if = "Option::is_none")]
2159    pub max: Option<I64>,
2160}
2161
2162pub const LODESTONE_API_APPROXIMATION_ALGORITHM_FORMAT_VERSION: u16 = 1;
2163#[derive(Clone, Copy, Debug, Deserialize, Eq, PartialEq, Serialize)]
2164#[serde(rename_all = "snake_case")]
2165pub enum ApproximationAlgorithm {
2166    HyperloglogV1,
2167    FloatPrefixHistogramV1,
2168}
2169
2170pub const LODESTONE_API_APPROXIMATION_FORMAT_VERSION: u16 = 1;
2171#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
2172#[serde(deny_unknown_fields)]
2173pub struct Approximation {
2174    pub algorithm: ApproximationAlgorithm,
2175    pub algorithm_version: u32,
2176    pub precision: u32,
2177    pub state_bytes: U64,
2178    #[serde(default, skip_serializing_if = "Option::is_none")]
2179    pub relative_standard_error: Option<ApproximateNumber>,
2180    #[serde(default, skip_serializing_if = "Option::is_none")]
2181    pub maximum_rank_error: Option<ApproximateNumber>,
2182}
2183
2184pub const LODESTONE_API_PERCENTILE_VALUE_FORMAT_VERSION: u16 = 1;
2185#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
2186#[serde(deny_unknown_fields)]
2187pub struct PercentileValue {
2188    pub percent: ApproximateNumber,
2189    #[serde(default, skip_serializing_if = "Option::is_none")]
2190    pub value: Option<ApproximateNumber>,
2191}
2192
2193pub const LODESTONE_API_APPROXIMATE_PERCENTILE_VALUE_FORMAT_VERSION: u16 = 1;
2194#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
2195#[serde(deny_unknown_fields)]
2196pub struct ApproximatePercentileValue {
2197    pub percent: ApproximateNumber,
2198    pub value: ApproximateNumber,
2199    pub lower_bound: ApproximateNumber,
2200    pub upper_bound: ApproximateNumber,
2201    pub maximum_rank_error: ApproximateNumber,
2202}
2203
2204pub const LODESTONE_API_TIME_SERIES_OPERATOR_FORMAT_VERSION: u16 = 1;
2205#[derive(Clone, Copy, Debug, Deserialize, Eq, PartialEq, Serialize)]
2206#[serde(rename_all = "snake_case")]
2207pub enum TimeSeriesOperator {
2208    Raw,
2209    Sum,
2210    Count,
2211    Min,
2212    Max,
2213    Average,
2214    Delta,
2215    Increase,
2216    Rate,
2217    HistogramMerge,
2218    Quantiles,
2219}
2220
2221pub const LODESTONE_API_TIME_SERIES_MISSING_DATA_FORMAT_VERSION: u16 = 1;
2222#[derive(Clone, Copy, Debug, Deserialize, Eq, PartialEq, Serialize)]
2223#[serde(rename_all = "snake_case")]
2224pub enum TimeSeriesMissingData {
2225    Omit,
2226    ExplicitEmpty,
2227}
2228
2229pub const LODESTONE_API_TIME_SERIES_QUANTILE_MODE_FORMAT_VERSION: u16 = 1;
2230#[derive(Clone, Copy, Debug, Deserialize, Eq, PartialEq, Serialize)]
2231#[serde(rename_all = "snake_case")]
2232pub enum TimeSeriesQuantileMode {
2233    Exact,
2234    Approximate,
2235}
2236
2237pub const LODESTONE_API_TIME_SERIES_BUCKET_STATE_FORMAT_VERSION: u16 = 1;
2238#[derive(Clone, Copy, Debug, Deserialize, Eq, PartialEq, Serialize)]
2239#[serde(rename_all = "snake_case")]
2240pub enum TimeSeriesBucketState {
2241    Observed,
2242    ExplicitEmpty,
2243}
2244
2245pub const LODESTONE_API_TIME_SERIES_QUANTILE_VALUE_FORMAT_VERSION: u16 = 1;
2246#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
2247#[serde(deny_unknown_fields)]
2248pub struct TimeSeriesQuantileValue {
2249    pub quantile: ApproximateNumber,
2250    #[serde(default, skip_serializing_if = "Option::is_none")]
2251    pub value: Option<MetricNumber>,
2252    #[serde(default, skip_serializing_if = "Option::is_none")]
2253    pub lower_bound: Option<MetricNumber>,
2254    #[serde(default, skip_serializing_if = "Option::is_none")]
2255    pub upper_bound: Option<MetricNumber>,
2256    #[serde(default, skip_serializing_if = "Option::is_none")]
2257    pub maximum_rank_error: Option<ApproximateNumber>,
2258}
2259
2260pub const LODESTONE_API_TIME_SERIES_VALUE_FORMAT_VERSION: u16 = 1;
2261#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
2262#[serde(tag = "kind", rename_all = "snake_case", deny_unknown_fields)]
2263pub enum TimeSeriesValue {
2264    Raw {
2265        values: Vec<MetricNumber>,
2266    },
2267    Number {
2268        value: MetricNumber,
2269        algorithm: String,
2270    },
2271    Count {
2272        value: U64,
2273    },
2274    ExplicitHistogram {
2275        count: U64,
2276        #[serde(default, skip_serializing_if = "Option::is_none")]
2277        sum: Option<MetricNumber>,
2278        bounds_f64_bits: Vec<U64>,
2279        bucket_counts: Vec<U64>,
2280    },
2281    ExponentialHistogram {
2282        count: U64,
2283        #[serde(default, skip_serializing_if = "Option::is_none")]
2284        sum: Option<MetricNumber>,
2285        scale: i32,
2286        zero_count: U64,
2287        positive: MetricExponentialBuckets,
2288        negative: MetricExponentialBuckets,
2289    },
2290    Quantiles {
2291        values: Vec<TimeSeriesQuantileValue>,
2292        exact: bool,
2293        algorithm: String,
2294        algorithm_version: u32,
2295        state_bytes: U64,
2296    },
2297}
2298
2299pub const LODESTONE_API_TIME_SERIES_BUCKET_FORMAT_VERSION: u16 = 1;
2300#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
2301#[serde(deny_unknown_fields)]
2302pub struct TimeSeriesBucket {
2303    pub start_unix_nanos: U64,
2304    pub end_unix_nanos: U64,
2305    pub group: Vec<MetricAttribute>,
2306    pub state: TimeSeriesBucketState,
2307    pub reset: bool,
2308    #[serde(default, skip_serializing_if = "Option::is_none")]
2309    pub value: Option<TimeSeriesValue>,
2310    pub exemplars: Vec<MetricExemplar>,
2311}
2312
2313pub const LODESTONE_API_RELATIONSHIP_TRAVERSAL_DIRECTION_FORMAT_VERSION: u16 = 1;
2314#[derive(Clone, Copy, Debug, Deserialize, Eq, PartialEq, Serialize)]
2315#[serde(rename_all = "snake_case")]
2316pub enum RelationshipTraversalDirection {
2317    Inbound,
2318    Outbound,
2319    Both,
2320}
2321
2322pub const LODESTONE_API_RELATIONSHIP_TRAVERSAL_FILTER_FORMAT_VERSION: u16 = 1;
2323#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
2324#[serde(deny_unknown_fields)]
2325pub struct RelationshipTraversalFilter {
2326    pub relationship_types: Vec<String>,
2327    pub assertion_classes: Vec<String>,
2328    pub provenance: Vec<String>,
2329    #[serde(default, skip_serializing_if = "Option::is_none")]
2330    pub valid_from_unix_nanos: Option<U64>,
2331    #[serde(default, skip_serializing_if = "Option::is_none")]
2332    pub valid_through_unix_nanos: Option<U64>,
2333}
2334
2335pub const LODESTONE_API_RELATIONSHIP_TRAVERSAL_BUDGET_FORMAT_VERSION: u16 = 1;
2336#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
2337#[serde(deny_unknown_fields)]
2338pub struct RelationshipTraversalBudget {
2339    pub maximum_depth: u32,
2340    pub maximum_fan_out: u32,
2341    pub maximum_visited_entities: u32,
2342    pub maximum_visited_relationships: u32,
2343    pub maximum_returned_relationships: u32,
2344    pub maximum_memory_bytes: U64,
2345}
2346
2347pub const LODESTONE_API_TRAVERSED_RELATIONSHIP_FORMAT_VERSION: u16 = 1;
2348#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
2349#[serde(deny_unknown_fields)]
2350pub struct TraversedRelationship {
2351    pub depth: u32,
2352    pub from: EntityRef,
2353    pub to: EntityRef,
2354    pub relationship: RelationshipRecord,
2355}
2356
2357pub const LODESTONE_API_PROFILE_QUERY_OPERATION_FORMAT_VERSION: u16 = 1;
2358#[derive(Clone, Copy, Debug, Deserialize, Eq, PartialEq, Serialize)]
2359#[serde(rename_all = "snake_case")]
2360pub enum ProfileQueryOperation {
2361    Flamegraph,
2362    TopStacks,
2363    TopFunctions,
2364    SampleTable,
2365}
2366
2367pub const LODESTONE_API_PROFILE_GROUP_BY_FORMAT_VERSION: u16 = 1;
2368#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
2369#[serde(tag = "kind", rename_all = "snake_case", deny_unknown_fields)]
2370pub enum ProfileGroupBy {
2371    ResourceAttribute { key: String },
2372    SampleLabel { key: String },
2373    BuildId,
2374    ModuleId,
2375}
2376
2377pub const LODESTONE_API_PROFILE_QUERY_FILTER_FORMAT_VERSION: u16 = 1;
2378#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
2379#[serde(deny_unknown_fields)]
2380pub struct ProfileQueryFilter {
2381    pub profile_ids: Vec<String>,
2382    pub build_ids: Vec<String>,
2383    pub module_ids: Vec<String>,
2384    pub function_ids: Vec<String>,
2385    pub trace_ids: Vec<String>,
2386    pub span_ids: Vec<String>,
2387}
2388
2389pub const LODESTONE_API_PROFILE_QUERY_BUDGET_FORMAT_VERSION: u16 = 1;
2390#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
2391#[serde(deny_unknown_fields)]
2392pub struct ProfileQueryBudget {
2393    pub maximum_batches: u32,
2394    pub maximum_samples: u32,
2395    pub maximum_results: u32,
2396    pub maximum_memory_bytes: U64,
2397}
2398
2399pub const LODESTONE_API_PROFILE_QUERY_ROW_FORMAT_VERSION: u16 = 1;
2400#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
2401#[serde(deny_unknown_fields)]
2402pub struct ProfileQueryRow {
2403    pub key: String,
2404    pub stack: Vec<String>,
2405    pub value: MetricNumber,
2406    pub sample_count: U64,
2407}
2408
2409pub const LODESTONE_API_TEMPORAL_INPUT_FORMAT_VERSION: u16 = 1;
2410#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
2411#[serde(deny_unknown_fields)]
2412pub struct TemporalInput {
2413    pub index: Resource,
2414    pub schema_generation: U64,
2415}
2416
2417pub const LODESTONE_API_TEMPORAL_PATTERN_FORMAT_VERSION: u16 = 1;
2418#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
2419#[serde(tag = "kind", rename_all = "snake_case", deny_unknown_fields)]
2420pub enum TemporalPattern {
2421    Event {
2422        node_id: String,
2423        query: Box<Query>,
2424    },
2425    Sequence {
2426        node_id: String,
2427        branches: Vec<TemporalPattern>,
2428        within_nanos: U64,
2429    },
2430    AllOf {
2431        node_id: String,
2432        branches: Vec<TemporalPattern>,
2433        within_nanos: U64,
2434    },
2435    AnyOf {
2436        node_id: String,
2437        branches: Vec<TemporalPattern>,
2438    },
2439    Count {
2440        node_id: String,
2441        pattern: Box<TemporalPattern>,
2442        minimum: u32,
2443        within_nanos: U64,
2444    },
2445    Repetition {
2446        node_id: String,
2447        pattern: Box<TemporalPattern>,
2448        count: u32,
2449        within_nanos: U64,
2450    },
2451    NotFollowedBy {
2452        node_id: String,
2453        anchor: Box<TemporalPattern>,
2454        forbidden: Box<TemporalPattern>,
2455        within_nanos: U64,
2456    },
2457}
2458
2459pub const LODESTONE_API_HISTORICAL_TEMPORAL_DEFINITION_SHAPE_VERSION: u16 = 1;
2460pub const LODESTONE_API_HISTORICAL_TEMPORAL_DEFINITION_FORMAT_VERSION: u16 = 1;
2461#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
2462#[serde(deny_unknown_fields)]
2463pub struct HistoricalTemporalDefinition {
2464    pub format_version: u32,
2465    pub pattern_generation: U64,
2466    pub inputs: Vec<TemporalInput>,
2467    pub event_time_field: String,
2468    pub correlation_fields: Vec<String>,
2469    pub pattern: TemporalPattern,
2470    pub watermark_unix_nanos: U64,
2471    pub maximum_events: u32,
2472    pub maximum_states: u32,
2473    pub maximum_captured_events: u32,
2474    pub maximum_results: u32,
2475    pub maximum_state_bytes: U64,
2476}
2477
2478pub const LODESTONE_API_TEMPORAL_EVIDENCE_STATUS_FORMAT_VERSION: u16 = 2;
2479#[derive(Clone, Copy, Debug, Deserialize, Eq, PartialEq, Serialize)]
2480#[serde(rename_all = "snake_case")]
2481pub enum TemporalEvidenceStatus {
2482    Provisional,
2483    Final,
2484    Correction,
2485    Retraction,
2486}
2487
2488pub const LODESTONE_API_TEMPORAL_SOURCE_EVENT_FORMAT_VERSION: u16 = 1;
2489#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
2490#[serde(deny_unknown_fields)]
2491pub struct TemporalSourceEvent {
2492    pub index: Resource,
2493    pub shard_id: u32,
2494    pub recovery_era: Identity,
2495    pub sequence: U64,
2496    pub document_id: String,
2497}
2498
2499pub const LODESTONE_API_TEMPORAL_EVIDENCE_FORMAT_VERSION: u16 = 2;
2500#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
2501#[serde(deny_unknown_fields)]
2502pub struct TemporalEvidence {
2503    pub evidence_id: Digest,
2504    pub pattern_generation: U64,
2505    pub pattern_digest: Digest,
2506    pub correlation_key: Vec<JsonValue>,
2507    pub matched_node_id: String,
2508    pub interval_start_unix_nanos: U64,
2509    pub interval_end_unix_nanos: U64,
2510    pub watermark_unix_nanos: U64,
2511    pub source_events: Vec<TemporalSourceEvent>,
2512    pub input_cut_digest: Digest,
2513    pub status: TemporalEvidenceStatus,
2514    #[serde(default, skip_serializing_if = "Option::is_none")]
2515    pub predecessor_evidence_id: Option<Digest>,
2516}
2517
2518pub const LODESTONE_API_CONTINUOUS_TEMPORAL_START_FORMAT_VERSION: u16 = 1;
2519#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
2520#[serde(tag = "kind", rename_all = "snake_case", deny_unknown_fields)]
2521pub enum ContinuousTemporalStart {
2522    FromCurrentHeads,
2523    HistoricalThenFollow { pit: Cursor },
2524}
2525
2526pub const LODESTONE_API_CONTINUOUS_TEMPORAL_WATERMARK_POLICY_FORMAT_VERSION: u16 = 1;
2527#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
2528#[serde(tag = "kind", rename_all = "snake_case", deny_unknown_fields)]
2529pub enum ContinuousTemporalWatermarkPolicy {
2530    MaximumObservedMinusOutOfOrder {
2531        allowed_out_of_orderness_nanos: U64,
2532    },
2533    MappingBoundEvent {
2534        allowed_out_of_orderness_nanos: U64,
2535        predicate: Box<Query>,
2536        timestamp_field: String,
2537    },
2538}
2539
2540pub const LODESTONE_API_CONTINUOUS_TEMPORAL_LATE_DATA_POLICY_FORMAT_VERSION: u16 = 1;
2541#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
2542#[serde(tag = "kind", rename_all = "snake_case", deny_unknown_fields)]
2543pub enum ContinuousTemporalLateDataPolicy {
2544    RecomputeWithinHorizon { correction_horizon_nanos: U64 },
2545    PauseWithGap,
2546}
2547
2548pub const LODESTONE_API_CONTINUOUS_TEMPORAL_OUTPUT_FORMAT_VERSION: u16 = 1;
2549#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
2550#[serde(tag = "kind", rename_all = "snake_case", deny_unknown_fields)]
2551pub enum ContinuousTemporalOutput {
2552    InternalResults {
2553        maximum_retained_records: U64,
2554        maximum_retained_bytes: U64,
2555        maximum_retained_event_age_nanos: U64,
2556    },
2557    MaterializedIndex {
2558        index: Resource,
2559        schema_generation: U64,
2560    },
2561}
2562
2563pub const LODESTONE_API_CONTINUOUS_TEMPORAL_DEFINITION_SHAPE_VERSION: u16 = 1;
2564pub const LODESTONE_API_CONTINUOUS_TEMPORAL_DEFINITION_FORMAT_VERSION: u16 = 1;
2565#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
2566#[serde(deny_unknown_fields)]
2567pub struct ContinuousTemporalDefinition {
2568    pub format_version: u32,
2569    pub evaluation_id: Identity,
2570    pub pattern_generation: U64,
2571    pub inputs: Vec<TemporalInput>,
2572    pub event_time_field: String,
2573    pub correlation_fields: Vec<String>,
2574    pub pattern: TemporalPattern,
2575    pub start: ContinuousTemporalStart,
2576    pub watermark_policy: ContinuousTemporalWatermarkPolicy,
2577    pub late_data_policy: ContinuousTemporalLateDataPolicy,
2578    pub maximum_events_per_step: u32,
2579    pub maximum_states: u32,
2580    pub maximum_captured_events: u32,
2581    pub maximum_results: u32,
2582    pub maximum_state_bytes: U64,
2583    pub maximum_lag_bytes: U64,
2584    pub maximum_lag_events: U64,
2585    pub maximum_lag_event_age_nanos: U64,
2586    pub output: ContinuousTemporalOutput,
2587}
2588
2589pub const LODESTONE_API_CONTINUOUS_TEMPORAL_FRONTIER_FORMAT_VERSION: u16 = 1;
2590#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
2591#[serde(deny_unknown_fields)]
2592pub struct ContinuousTemporalFrontier {
2593    pub index: Resource,
2594    pub shard_id: u32,
2595    pub recovery_era: Identity,
2596    pub routing_revision: U64,
2597    pub registered_wal_frontier: U64,
2598    #[serde(default, skip_serializing_if = "Option::is_none")]
2599    pub watermark_unix_nanos: Option<U64>,
2600}
2601
2602pub const LODESTONE_API_CONTINUOUS_TEMPORAL_AVAILABLE_FRONTIER_FORMAT_VERSION: u16 = 1;
2603#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
2604#[serde(deny_unknown_fields)]
2605pub struct ContinuousTemporalAvailableFrontier {
2606    pub index: Resource,
2607    pub shard_id: u32,
2608    pub sequence: U64,
2609}
2610
2611pub const LODESTONE_API_CONTINUOUS_TEMPORAL_GAP_REASON_FORMAT_VERSION: u16 = 1;
2612#[derive(Clone, Copy, Debug, Deserialize, Eq, PartialEq, Serialize)]
2613#[serde(rename_all = "snake_case")]
2614pub enum ContinuousTemporalGapReason {
2615    RetentionGap,
2616    LateDataGap,
2617    SchemaGap,
2618    RouteGap,
2619    OutputGap,
2620}
2621
2622pub const LODESTONE_API_CONTINUOUS_TEMPORAL_GAP_FORMAT_VERSION: u16 = 1;
2623#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
2624#[serde(deny_unknown_fields)]
2625pub struct ContinuousTemporalGap {
2626    pub reason: ContinuousTemporalGapReason,
2627    pub last_complete_frontiers: Vec<ContinuousTemporalFrontier>,
2628    pub earliest_available_frontiers: Vec<ContinuousTemporalAvailableFrontier>,
2629}
2630
2631pub const LODESTONE_API_CONTINUOUS_TEMPORAL_EVALUATION_SHAPE_VERSION: u16 = 1;
2632pub const LODESTONE_API_CONTINUOUS_TEMPORAL_EVALUATION_FORMAT_VERSION: u16 = 1;
2633#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
2634#[serde(deny_unknown_fields)]
2635pub struct ContinuousTemporalEvaluation {
2636    pub format_version: u32,
2637    pub evaluation_id: Identity,
2638    pub generation: U64,
2639    pub revision: U64,
2640    pub definition_digest: Digest,
2641    pub definition: ContinuousTemporalDefinition,
2642    pub lifecycle: String,
2643    pub frontiers: Vec<ContinuousTemporalFrontier>,
2644    #[serde(default, skip_serializing_if = "Option::is_none")]
2645    pub global_watermark_unix_nanos: Option<U64>,
2646    pub state_bytes: U64,
2647    pub active_states: U64,
2648    pub active_timers: U64,
2649    pub retained_results: U64,
2650    pub pending_emissions: U64,
2651    #[serde(default, skip_serializing_if = "Option::is_none")]
2652    pub last_materialized_frontier_digest: Option<Digest>,
2653    pub retry_count: u32,
2654    #[serde(default, skip_serializing_if = "Option::is_none")]
2655    pub gap: Option<ContinuousTemporalGap>,
2656}
2657
2658pub const LODESTONE_API_COMPOSITE_ORDER_FORMAT_VERSION: u16 = 1;
2659#[derive(Clone, Copy, Debug, Deserialize, Eq, PartialEq, Serialize)]
2660#[serde(rename_all = "snake_case")]
2661pub enum CompositeOrder {
2662    Asc,
2663    Desc,
2664}
2665
2666pub const LODESTONE_API_COMPOSITE_SOURCE_FORMAT_VERSION: u16 = 1;
2667#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
2668#[serde(tag = "kind", rename_all = "snake_case", deny_unknown_fields)]
2669pub enum CompositeSource {
2670    Terms {
2671        name: String,
2672        field: String,
2673        order: CompositeOrder,
2674    },
2675    DateHistogram {
2676        name: String,
2677        field: String,
2678        #[serde(default, skip_serializing_if = "Option::is_none")]
2679        fixed_interval_millis: Option<U64>,
2680        #[serde(default, skip_serializing_if = "Option::is_none")]
2681        calendar_interval: Option<String>,
2682        #[serde(default, skip_serializing_if = "Option::is_none")]
2683        time_zone: Option<String>,
2684        offset_millis: I64,
2685        order: CompositeOrder,
2686    },
2687}
2688
2689pub const LODESTONE_API_AGGREGATION_FORMAT_VERSION: u16 = 3;
2690#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
2691#[serde(tag = "kind", rename_all = "snake_case", deny_unknown_fields)]
2692pub enum Aggregation {
2693    Terms {
2694        name: String,
2695        field: String,
2696        size: u32,
2697        sub_aggregations: Vec<Aggregation>,
2698    },
2699    Histogram {
2700        name: String,
2701        field: String,
2702        interval: ApproximateNumber,
2703        min_doc_count: U64,
2704        #[serde(default, skip_serializing_if = "Option::is_none")]
2705        extended_bounds: Option<HistogramBounds>,
2706        #[serde(default, skip_serializing_if = "Option::is_none")]
2707        hard_bounds: Option<HistogramBounds>,
2708        offset: ApproximateNumber,
2709        #[serde(default, skip_serializing_if = "Option::is_none")]
2710        missing: Option<ApproximateNumber>,
2711        sub_aggregations: Vec<Aggregation>,
2712    },
2713    Cardinality {
2714        name: String,
2715        field: String,
2716    },
2717    Percentiles {
2718        name: String,
2719        field: String,
2720        percents: Vec<ApproximateNumber>,
2721    },
2722    ApproximateCardinality {
2723        name: String,
2724        field: String,
2725        precision: u32,
2726    },
2727    ApproximatePercentiles {
2728        name: String,
2729        field: String,
2730        percents: Vec<ApproximateNumber>,
2731        precision: u32,
2732    },
2733    Sum {
2734        name: String,
2735        field: String,
2736    },
2737    Avg {
2738        name: String,
2739        field: String,
2740    },
2741    Min {
2742        name: String,
2743        field: String,
2744    },
2745    Max {
2746        name: String,
2747        field: String,
2748    },
2749    Stats {
2750        name: String,
2751        field: String,
2752    },
2753    DateHistogram {
2754        name: String,
2755        field: String,
2756        #[serde(default, skip_serializing_if = "Option::is_none")]
2757        fixed_interval_millis: Option<U64>,
2758        #[serde(default, skip_serializing_if = "Option::is_none")]
2759        calendar_interval: Option<String>,
2760        #[serde(default, skip_serializing_if = "Option::is_none")]
2761        time_zone: Option<String>,
2762        min_doc_count: U64,
2763        #[serde(default, skip_serializing_if = "Option::is_none")]
2764        extended_bounds: Option<DateHistogramBounds>,
2765        #[serde(default, skip_serializing_if = "Option::is_none")]
2766        hard_bounds: Option<DateHistogramBounds>,
2767        offset_millis: I64,
2768        #[serde(default, skip_serializing_if = "Option::is_none")]
2769        missing: Option<I64>,
2770        sub_aggregations: Vec<Aggregation>,
2771    },
2772    Composite {
2773        name: String,
2774        size: u32,
2775        sources: Vec<CompositeSource>,
2776        #[serde(default, skip_serializing_if = "Option::is_none")]
2777        after: Option<Cursor>,
2778        sub_aggregations: Vec<Aggregation>,
2779    },
2780    Filter {
2781        name: String,
2782        query: Box<Query>,
2783        sub_aggregations: Vec<Aggregation>,
2784    },
2785    Nested {
2786        name: String,
2787        path: String,
2788        sub_aggregations: Vec<Aggregation>,
2789    },
2790    ReverseNested {
2791        name: String,
2792        #[serde(default, skip_serializing_if = "Option::is_none")]
2793        path: Option<String>,
2794        sub_aggregations: Vec<Aggregation>,
2795    },
2796    TimeSeriesV1 {
2797        name: String,
2798        metric_name: String,
2799        unit: String,
2800        point_kind: MetricPointKind,
2801        #[serde(default, skip_serializing_if = "Option::is_none")]
2802        temporality: Option<MetricTemporality>,
2803        #[serde(default, skip_serializing_if = "Option::is_none")]
2804        monotonic: Option<bool>,
2805        range_start_unix_nanos: U64,
2806        range_end_unix_nanos: U64,
2807        bucket_width_nanos: U64,
2808        alignment_origin_unix_nanos: U64,
2809        group_by: Vec<String>,
2810        operator: TimeSeriesOperator,
2811        missing_data: TimeSeriesMissingData,
2812        quantiles: Vec<ApproximateNumber>,
2813        quantile_mode: TimeSeriesQuantileMode,
2814        maximum_exemplars: u32,
2815        maximum_points: u32,
2816        maximum_series: u32,
2817        maximum_buckets: u32,
2818        maximum_results: u32,
2819        maximum_state_bytes: U64,
2820    },
2821}
2822
2823pub const LODESTONE_API_NESTED_SEARCH_HIT_FORMAT_VERSION: u16 = 2;
2824#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
2825#[serde(deny_unknown_fields)]
2826pub struct NestedSearchHit {
2827    pub path: String,
2828    pub ordinal: u32,
2829    #[serde(default, skip_serializing_if = "Option::is_none")]
2830    pub score: Option<ApproximateNumber>,
2831    #[serde(default, skip_serializing_if = "Option::is_none")]
2832    pub source: Option<RawJson>,
2833    pub sort: Vec<JsonValue>,
2834}
2835
2836pub const LODESTONE_API_NAMED_NESTED_INNER_HITS_RESULT_FORMAT_VERSION: u16 = 1;
2837#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
2838#[serde(deny_unknown_fields)]
2839pub struct NamedNestedInnerHitsResult {
2840    pub name: String,
2841    pub total: U64,
2842    pub hits: Vec<NestedSearchHit>,
2843}
2844
2845pub const LODESTONE_API_FRAGMENT_BOUNDARY_FORMAT_VERSION: u16 = 1;
2846#[derive(Clone, Copy, Debug, Deserialize, Eq, PartialEq, Serialize)]
2847#[serde(rename_all = "snake_case")]
2848pub enum FragmentBoundary {
2849    Word,
2850    Sentence,
2851    Paragraph,
2852    WholeField,
2853}
2854
2855pub const LODESTONE_API_FRAGMENT_OFFSET_ENCODING_FORMAT_VERSION: u16 = 1;
2856#[derive(Clone, Copy, Debug, Deserialize, Eq, PartialEq, Serialize)]
2857#[serde(rename_all = "snake_case")]
2858pub enum FragmentOffsetEncoding {
2859    Utf8Bytes,
2860    Utf16CodeUnits,
2861    UnicodeCodepoints,
2862}
2863
2864pub const LODESTONE_API_FRAGMENT_RANKER_FORMAT_VERSION: u16 = 1;
2865#[derive(Clone, Copy, Debug, Deserialize, Eq, PartialEq, Serialize)]
2866#[serde(rename_all = "snake_case")]
2867pub enum FragmentRanker {
2868    LexicalMatchCountV1,
2869}
2870
2871pub const LODESTONE_API_FRAGMENT_REQUEST_FORMAT_VERSION: u16 = 1;
2872#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
2873#[serde(deny_unknown_fields)]
2874pub struct FragmentRequest {
2875    pub fields: Vec<String>,
2876    pub max_fragment_bytes: u32,
2877    pub max_fragments: u32,
2878    pub boundary: FragmentBoundary,
2879    pub offset_encoding: FragmentOffsetEncoding,
2880    pub ranker: FragmentRanker,
2881}
2882
2883pub const LODESTONE_API_SEARCH_FRAGMENT_FORMAT_VERSION: u16 = 1;
2884#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
2885#[serde(deny_unknown_fields)]
2886pub struct SearchFragment {
2887    pub field: String,
2888    pub text: String,
2889    pub start: u32,
2890    pub end: u32,
2891    pub offset_encoding: FragmentOffsetEncoding,
2892    pub rank: u32,
2893    pub match_count: u32,
2894    pub truncated: bool,
2895    pub partial: bool,
2896}
2897
2898pub const LODESTONE_API_NUMERIC_FEATURE_TRANSFORM_FORMAT_VERSION: u16 = 1;
2899#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
2900#[serde(tag = "kind", rename_all = "snake_case", deny_unknown_fields)]
2901pub enum NumericFeatureTransform {
2902    Identity,
2903    Log1p,
2904    Clamp {
2905        minimum: ApproximateNumber,
2906        maximum: ApproximateNumber,
2907    },
2908}
2909
2910pub const LODESTONE_API_NUMERIC_RESULT_FEATURE_FORMAT_VERSION: u16 = 1;
2911#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
2912#[serde(deny_unknown_fields)]
2913pub struct NumericResultFeature {
2914    pub name: String,
2915    pub field: String,
2916    pub transform: NumericFeatureTransform,
2917}
2918
2919pub const LODESTONE_API_RESULT_FEATURE_REQUEST_FORMAT_VERSION: u16 = 1;
2920#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
2921#[serde(deny_unknown_fields)]
2922pub struct ResultFeatureRequest {
2923    pub top_n: u32,
2924    pub include_branch_components: bool,
2925    pub numeric: Vec<NumericResultFeature>,
2926}
2927
2928pub const LODESTONE_API_RESULT_DIVERSIFICATION_FORMAT_VERSION: u16 = 1;
2929#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
2930#[serde(deny_unknown_fields)]
2931pub struct ResultDiversification {
2932    pub fields: Vec<String>,
2933    pub max_per_group: u32,
2934}
2935
2936pub const LODESTONE_API_SOURCE_PROJECTION_FORMAT_VERSION: u16 = 1;
2937#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
2938#[serde(tag = "kind", rename_all = "snake_case", deny_unknown_fields)]
2939pub enum SourceProjection {
2940    Full,
2941    Omit,
2942    Filter {
2943        includes: Vec<String>,
2944        excludes: Vec<String>,
2945    },
2946}
2947
2948pub const LODESTONE_API_BRANCH_SCORE_KIND_FORMAT_VERSION: u16 = 2;
2949#[derive(Clone, Copy, Debug, Deserialize, Eq, PartialEq, Serialize)]
2950#[serde(rename_all = "snake_case")]
2951pub enum BranchScoreKind {
2952    LexicalScore,
2953    DenseSimilarity,
2954    SparseDotProduct,
2955    LateInteractionMaxsim,
2956}
2957
2958pub const LODESTONE_API_RESULT_FEATURE_FORMAT_VERSION: u16 = 1;
2959#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
2960#[serde(tag = "kind", rename_all = "snake_case", deny_unknown_fields)]
2961pub enum ResultFeature {
2962    Branch {
2963        branch: String,
2964        score_kind: BranchScoreKind,
2965        rank: u32,
2966        score: ApproximateNumber,
2967    },
2968    Numeric {
2969        name: String,
2970        field: String,
2971        value: ApproximateNumber,
2972    },
2973}
2974
2975pub const LODESTONE_API_SEARCH_HIT_FORMAT_VERSION: u16 = 2;
2976#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
2977#[serde(deny_unknown_fields)]
2978pub struct SearchHit {
2979    pub index: Resource,
2980    pub document_id: String,
2981    #[serde(default, skip_serializing_if = "Option::is_none")]
2982    pub score: Option<ApproximateNumber>,
2983    #[serde(default, skip_serializing_if = "Option::is_none")]
2984    pub source: Option<RawJson>,
2985    pub sort: Vec<JsonValue>,
2986    pub fragments: Vec<SearchFragment>,
2987    pub features: Vec<ResultFeature>,
2988    pub group_values: Vec<JsonValue>,
2989    pub inner_hits: Vec<NamedNestedInnerHitsResult>,
2990}
2991
2992pub const LODESTONE_API_AGGREGATION_BUCKET_FORMAT_VERSION: u16 = 1;
2993#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
2994#[serde(deny_unknown_fields)]
2995pub struct AggregationBucket {
2996    pub key: JsonValue,
2997    pub document_count: U64,
2998    pub sub_aggregations: Vec<AggregationResult>,
2999}
3000
3001pub const LODESTONE_API_AGGREGATION_RESULT_FORMAT_VERSION: u16 = 3;
3002#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
3003#[serde(tag = "kind", rename_all = "snake_case", deny_unknown_fields)]
3004pub enum AggregationResult {
3005    Terms {
3006        name: String,
3007        buckets: Vec<AggregationBucket>,
3008        partial: bool,
3009    },
3010    Histogram {
3011        name: String,
3012        buckets: Vec<AggregationBucket>,
3013        partial: bool,
3014    },
3015    DateHistogram {
3016        name: String,
3017        buckets: Vec<AggregationBucket>,
3018        partial: bool,
3019    },
3020    Composite {
3021        name: String,
3022        buckets: Vec<AggregationBucket>,
3023        #[serde(default, skip_serializing_if = "Option::is_none")]
3024        after: Option<Cursor>,
3025        partial: bool,
3026    },
3027    Filter {
3028        name: String,
3029        buckets: Vec<AggregationBucket>,
3030        partial: bool,
3031    },
3032    SingleBucket {
3033        name: String,
3034        document_count: U64,
3035        sub_aggregations: Vec<AggregationResult>,
3036        partial: bool,
3037    },
3038    Cardinality {
3039        name: String,
3040        #[serde(default, skip_serializing_if = "Option::is_none")]
3041        value: Option<ApproximateNumber>,
3042        partial: bool,
3043    },
3044    Percentiles {
3045        name: String,
3046        values: Vec<PercentileValue>,
3047        partial: bool,
3048    },
3049    ApproximateCardinality {
3050        name: String,
3051        value: ApproximateNumber,
3052        approximation: Approximation,
3053        partial: bool,
3054    },
3055    ApproximatePercentiles {
3056        name: String,
3057        values: Vec<ApproximatePercentileValue>,
3058        approximation: Approximation,
3059        partial: bool,
3060    },
3061    Sum {
3062        name: String,
3063        #[serde(default, skip_serializing_if = "Option::is_none")]
3064        value: Option<ApproximateNumber>,
3065        partial: bool,
3066    },
3067    Avg {
3068        name: String,
3069        #[serde(default, skip_serializing_if = "Option::is_none")]
3070        value: Option<ApproximateNumber>,
3071        partial: bool,
3072    },
3073    Min {
3074        name: String,
3075        #[serde(default, skip_serializing_if = "Option::is_none")]
3076        value: Option<ApproximateNumber>,
3077        partial: bool,
3078    },
3079    Max {
3080        name: String,
3081        #[serde(default, skip_serializing_if = "Option::is_none")]
3082        value: Option<ApproximateNumber>,
3083        partial: bool,
3084    },
3085    Stats {
3086        name: String,
3087        count: U64,
3088        #[serde(default, skip_serializing_if = "Option::is_none")]
3089        min: Option<ApproximateNumber>,
3090        #[serde(default, skip_serializing_if = "Option::is_none")]
3091        max: Option<ApproximateNumber>,
3092        #[serde(default, skip_serializing_if = "Option::is_none")]
3093        avg: Option<ApproximateNumber>,
3094        sum: ApproximateNumber,
3095        partial: bool,
3096    },
3097    TimeSeriesV1 {
3098        name: String,
3099        buckets: Vec<TimeSeriesBucket>,
3100        partial: bool,
3101    },
3102}
3103
3104pub const LODESTONE_API_SHARD_COUNTS_FORMAT_VERSION: u16 = 1;
3105#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
3106#[serde(deny_unknown_fields)]
3107pub struct ShardCounts {
3108    pub total: u32,
3109    pub successful: u32,
3110    pub skipped: u32,
3111    pub failed: u32,
3112}
3113
3114pub const LODESTONE_API_TOTAL_HITS_RELATION_FORMAT_VERSION: u16 = 1;
3115#[derive(Clone, Copy, Debug, Deserialize, Eq, PartialEq, Serialize)]
3116#[serde(rename_all = "snake_case")]
3117pub enum TotalHitsRelation {
3118    Exact,
3119    LowerBound,
3120    Incomplete,
3121}
3122
3123pub const LODESTONE_API_SEARCH_TOTAL_FORMAT_VERSION: u16 = 1;
3124#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
3125#[serde(deny_unknown_fields)]
3126pub struct SearchTotal {
3127    pub value: U64,
3128    pub relation: TotalHitsRelation,
3129    pub partial: bool,
3130}
3131
3132pub const LODESTONE_API_SEARCH_EXECUTION_FRESHNESS_FORMAT_VERSION: u16 = 1;
3133#[derive(Clone, Copy, Debug, Deserialize, Eq, PartialEq, Serialize)]
3134#[serde(rename_all = "snake_case")]
3135pub enum SearchExecutionFreshness {
3136    Realtime,
3137    Committed,
3138}
3139
3140pub const LODESTONE_API_SEARCH_FRESHNESS_FORMAT_VERSION: u16 = 1;
3141#[derive(Clone, Copy, Debug, Deserialize, Eq, PartialEq, Serialize)]
3142#[serde(rename_all = "snake_case")]
3143pub enum SearchFreshness {
3144    Auto,
3145    Realtime,
3146    Committed,
3147}
3148
3149pub const LODESTONE_API_SEARCH_DEGRADATION_REASON_FORMAT_VERSION: u16 = 1;
3150#[derive(Clone, Copy, Debug, Deserialize, Eq, PartialEq, Serialize)]
3151#[serde(rename_all = "snake_case")]
3152pub enum SearchDegradationReason {
3153    WriterUnavailable,
3154}
3155
3156pub const LODESTONE_API_SEARCH_ACHIEVEMENT_FORMAT_VERSION: u16 = 1;
3157#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
3158#[serde(deny_unknown_fields)]
3159pub struct SearchAchievement {
3160    pub freshness: SearchExecutionFreshness,
3161    pub degradation_reasons: Vec<SearchDegradationReason>,
3162}
3163
3164pub const LODESTONE_API_SEARCH_FAILURE_STAGE_FORMAT_VERSION: u16 = 1;
3165#[derive(Clone, Copy, Debug, Deserialize, Eq, PartialEq, Serialize)]
3166#[serde(rename_all = "snake_case")]
3167pub enum SearchFailureStage {
3168    Preflight,
3169    Dispatch,
3170}
3171
3172pub const LODESTONE_API_SEARCH_FAILURE_REASON_FORMAT_VERSION: u16 = 1;
3173#[derive(Clone, Copy, Debug, Deserialize, Eq, PartialEq, Serialize)]
3174#[serde(rename_all = "snake_case")]
3175pub enum SearchFailureReason {
3176    Cancelled,
3177    Overloaded,
3178    ResourceLimit,
3179    DeadlineExceeded,
3180    Unavailable,
3181    InvalidResponse,
3182}
3183
3184pub const LODESTONE_API_COLLECTION_SHARD_FORMAT_VERSION: u16 = 1;
3185#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
3186#[serde(deny_unknown_fields)]
3187pub struct CollectionShard {
3188    pub collection_id: Identity,
3189    pub index_id: Identity,
3190    pub shard_id: u32,
3191}
3192
3193pub const LODESTONE_API_SEARCH_PARTIAL_FAILURE_FORMAT_VERSION: u16 = 1;
3194#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
3195#[serde(deny_unknown_fields)]
3196pub struct SearchPartialFailure {
3197    pub shard: CollectionShard,
3198    pub stage: SearchFailureStage,
3199    pub reason: SearchFailureReason,
3200    pub recovery: RecoveryAction,
3201}
3202
3203pub const LODESTONE_API_ARTIFACT_FORMAT_VERSION: u16 = 1;
3204#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
3205#[serde(deny_unknown_fields)]
3206pub struct Artifact {
3207    pub locator: Locator,
3208    pub bytes: U64,
3209    pub sha256: Digest,
3210    pub expires_at: U64,
3211}
3212
3213pub const LODESTONE_API_PORTABILITY_STORAGE_CAPABILITY_FORMAT_VERSION: u16 = 1;
3214#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
3215#[serde(deny_unknown_fields)]
3216pub struct PortabilityStorageCapability {
3217    pub backend_authority: String,
3218    pub object_prefix: String,
3219    pub maximum_bytes: U64,
3220    #[serde(default, skip_serializing_if = "Option::is_none")]
3221    pub key_capability_digest: Option<Digest>,
3222}
3223
3224pub const LODESTONE_API_COLLECTION_EXPORT_ARTIFACT_FORMAT_VERSION: u16 = 1;
3225#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
3226#[serde(deny_unknown_fields)]
3227pub struct CollectionExportArtifact {
3228    pub artifact: Artifact,
3229    pub backend_authority: String,
3230    pub object_key: String,
3231    pub source_collection_id: Identity,
3232    pub source_catalog_revision: U64,
3233}
3234
3235pub const LODESTONE_API_INDEX_TRANSFER_PAGE_FORMAT_VERSION: u16 = 1;
3236#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
3237#[serde(deny_unknown_fields)]
3238pub struct IndexTransferPage {
3239    pub ordinal: u32,
3240    pub object_key: String,
3241    pub bytes: U64,
3242    pub content_digest: Digest,
3243    pub record_count: u32,
3244}
3245
3246pub const LODESTONE_API_INDEX_TRANSFER_ARTIFACT_FORMAT_VERSION: u16 = 1;
3247#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
3248#[serde(deny_unknown_fields)]
3249pub struct IndexTransferArtifact {
3250    pub manifest: Artifact,
3251    pub manifest_object_key: String,
3252    pub transfer_identity: Digest,
3253    pub source_cluster_storage_id: Identity,
3254    pub source_collection_id: Identity,
3255    pub source_index: Resource,
3256    pub source_catalog_revision: U64,
3257    pub source_cut_digest: Digest,
3258    pub pages: Vec<IndexTransferPage>,
3259    pub record_count: u32,
3260}
3261
3262pub const LODESTONE_API_SEARCH_VALIDATION_BOUND_FORMAT_VERSION: u16 = 1;
3263#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
3264#[serde(tag = "kind", rename_all = "snake_case", deny_unknown_fields)]
3265pub enum SearchValidationBound {
3266    Exact { value: U64 },
3267    UpperBound { value: U64 },
3268    Unknown { reason: String },
3269}
3270
3271pub const LODESTONE_API_SEARCH_VALIDATION_ESTIMATES_FORMAT_VERSION: u16 = 1;
3272#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
3273#[serde(deny_unknown_fields)]
3274pub struct SearchValidationEstimates {
3275    pub shard_fanout: SearchValidationBound,
3276    pub candidate_documents: SearchValidationBound,
3277    pub segments: SearchValidationBound,
3278    pub buckets: SearchValidationBound,
3279    pub memory_bytes: SearchValidationBound,
3280    pub object_reads: SearchValidationBound,
3281    pub object_bytes: SearchValidationBound,
3282    pub response_bytes: SearchValidationBound,
3283    pub planning_work: SearchValidationBound,
3284}
3285
3286pub const LODESTONE_API_SEARCH_VALIDATION_LIMIT_FORMAT_VERSION: u16 = 1;
3287#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
3288#[serde(deny_unknown_fields)]
3289pub struct SearchValidationLimit {
3290    pub id: String,
3291    pub applied: U64,
3292    pub unit: String,
3293}
3294
3295pub const LODESTONE_API_OPERATION_KIND_FORMAT_VERSION: u16 = 2;
3296#[derive(Clone, Copy, Debug, Deserialize, Eq, PartialEq, Serialize)]
3297#[serde(rename_all = "snake_case")]
3298pub enum OperationKind {
3299    Catalog,
3300    MaintenanceTask,
3301    Security,
3302    Diagnostic,
3303    CollectionExport,
3304    CollectionRestore,
3305    IndexExport,
3306    IndexImport,
3307    VectorEvaluation,
3308    VectorWarm,
3309    Lifecycle,
3310    Quota,
3311    Admission,
3312}
3313
3314pub const LODESTONE_API_OPERATION_AUTHORITY_FORMAT_VERSION: u16 = 1;
3315#[derive(Clone, Copy, Debug, Deserialize, Eq, PartialEq, Serialize)]
3316#[serde(rename_all = "snake_case")]
3317pub enum OperationAuthority {
3318    Catalog,
3319    Tasks,
3320    Security,
3321    Diagnostics,
3322    Portability,
3323    Lifecycle,
3324    Quota,
3325    Admission,
3326}
3327
3328pub const LODESTONE_API_OPERATION_TARGET_FORMAT_VERSION: u16 = 1;
3329#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
3330#[serde(tag = "kind", rename_all = "snake_case", deny_unknown_fields)]
3331pub enum OperationTarget {
3332    Collection { collection_id: Identity },
3333    Resource { resource: Resource },
3334    Artifact { locator: Locator },
3335    None,
3336}
3337
3338pub const LODESTONE_API_OPERATION_STATE_FORMAT_VERSION: u16 = 1;
3339#[derive(Clone, Copy, Debug, Deserialize, Eq, PartialEq, Serialize)]
3340#[serde(rename_all = "snake_case")]
3341pub enum OperationState {
3342    Pending,
3343    Succeeded,
3344    Failed,
3345    Cancelled,
3346}
3347
3348pub const LODESTONE_API_OPERATION_PENDING_STATE_FORMAT_VERSION: u16 = 1;
3349#[derive(Clone, Copy, Debug, Deserialize, Eq, PartialEq, Serialize)]
3350#[serde(rename_all = "snake_case")]
3351pub enum OperationPendingState {
3352    Queued,
3353    Running,
3354    CancelRequested,
3355}
3356
3357pub const LODESTONE_API_OPERATION_PROGRESS_UNIT_FORMAT_VERSION: u16 = 1;
3358#[derive(Clone, Copy, Debug, Deserialize, Eq, PartialEq, Serialize)]
3359#[serde(rename_all = "snake_case")]
3360pub enum OperationProgressUnit {
3361    BasisPoints,
3362    Items,
3363    Bytes,
3364    WorkUnits,
3365}
3366
3367pub const LODESTONE_API_OPERATION_PROGRESS_FORMAT_VERSION: u16 = 1;
3368#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
3369#[serde(deny_unknown_fields)]
3370pub struct OperationProgress {
3371    pub completed: U64,
3372    pub total: U64,
3373    pub unit: OperationProgressUnit,
3374}
3375
3376pub const LODESTONE_API_OPERATION_RESULT_FORMAT_VERSION: u16 = 1;
3377#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
3378#[serde(tag = "kind", rename_all = "snake_case", deny_unknown_fields)]
3379pub enum OperationResult {
3380    None,
3381    Artifacts { items: Vec<Artifact> },
3382}
3383
3384pub const LODESTONE_API_OPERATION_FAILURE_FORMAT_VERSION: u16 = 1;
3385#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
3386#[serde(deny_unknown_fields)]
3387pub struct OperationFailure {
3388    pub error: ErrorBody,
3389}
3390
3391pub const LODESTONE_API_OPERATION_CANCELLATION_FORMAT_VERSION: u16 = 1;
3392#[derive(Clone, Copy, Debug, Deserialize, Eq, PartialEq, Serialize)]
3393#[serde(rename_all = "snake_case")]
3394pub enum OperationCancellation {
3395    NotCancellable,
3396    Cancellable,
3397    CancelRequested,
3398    Cancelled,
3399}
3400
3401pub const LODESTONE_API_OPERATION_RETENTION_STATE_FORMAT_VERSION: u16 = 1;
3402#[derive(Clone, Copy, Debug, Deserialize, Eq, PartialEq, Serialize)]
3403#[serde(rename_all = "snake_case")]
3404pub enum OperationRetentionState {
3405    Active,
3406    Retired,
3407}
3408
3409pub const LODESTONE_API_OPERATION_RETENTION_FORMAT_VERSION: u16 = 1;
3410#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
3411#[serde(deny_unknown_fields)]
3412pub struct OperationRetention {
3413    pub state: OperationRetentionState,
3414    #[serde(default, skip_serializing_if = "Option::is_none")]
3415    pub retire_after: Option<U64>,
3416}
3417
3418pub const LODESTONE_API_OPERATION_FORMAT_VERSION: u16 = 2;
3419#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
3420#[serde(deny_unknown_fields)]
3421pub struct Operation {
3422    pub locator: Locator,
3423    pub kind: OperationKind,
3424    pub authority: OperationAuthority,
3425    pub target: OperationTarget,
3426    pub authority_revision: U64,
3427    pub current_state: OperationState,
3428    #[serde(default, skip_serializing_if = "Option::is_none")]
3429    pub pending_state: Option<OperationPendingState>,
3430    #[serde(default, skip_serializing_if = "Option::is_none")]
3431    pub progress: Option<OperationProgress>,
3432    #[serde(default, skip_serializing_if = "Option::is_none")]
3433    pub result: Option<OperationResult>,
3434    #[serde(default, skip_serializing_if = "Option::is_none")]
3435    pub failure: Option<OperationFailure>,
3436    pub cancellation: OperationCancellation,
3437    pub retention: OperationRetention,
3438    pub submitted_at: U64,
3439    #[serde(default, skip_serializing_if = "Option::is_none")]
3440    pub terminal_at: Option<U64>,
3441}
3442
3443pub const LODESTONE_API_WRITE_DURABILITY_BOUNDARY_FORMAT_VERSION: u16 = 1;
3444#[derive(Clone, Copy, Debug, Deserialize, Eq, PartialEq, Serialize)]
3445#[serde(rename_all = "snake_case")]
3446pub enum WriteDurabilityBoundary {
3447    Registered,
3448    IncarnationMemory,
3449}
3450
3451pub const LODESTONE_API_WRITE_VISIBILITY_MODE_FORMAT_VERSION: u16 = 1;
3452#[derive(Clone, Copy, Debug, Deserialize, Eq, PartialEq, Serialize)]
3453#[serde(rename_all = "snake_case")]
3454pub enum WriteVisibilityMode {
3455    Applied,
3456    WaitFor,
3457}
3458
3459pub const LODESTONE_API_WRITE_RESPONSE_STAGE_FORMAT_VERSION: u16 = 1;
3460#[derive(Clone, Copy, Debug, Deserialize, Eq, PartialEq, Serialize)]
3461#[serde(rename_all = "snake_case")]
3462pub enum WriteResponseStage {
3463    Validated,
3464    Admitted,
3465    Sequenced,
3466    ObjectPut,
3467    Registered,
3468    AppliedToActiveMemtable,
3469    MicroCommitted,
3470    Sealed,
3471}
3472
3473pub const LODESTONE_API_WRITE_ACHIEVEMENT_FORMAT_VERSION: u16 = 1;
3474#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
3475#[serde(deny_unknown_fields)]
3476pub struct WriteAchievement {
3477    pub durability_class: ResourceDurabilityClass,
3478    pub durability_boundary: WriteDurabilityBoundary,
3479    pub visibility_mode: WriteVisibilityMode,
3480    pub response_stage: WriteResponseStage,
3481}
3482
3483pub const LODESTONE_API_MUTATION_COMMIT_POSITION_FORMAT_VERSION: u16 = 1;
3484#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
3485#[serde(deny_unknown_fields)]
3486pub struct MutationCommitPosition {
3487    pub leader_term: U64,
3488    pub leader_node_id: U64,
3489    pub log_index: U64,
3490}
3491
3492pub const LODESTONE_API_MUTATION_COMMIT_RECEIPT_SHAPE_VERSION: u16 = 1;
3493pub const LODESTONE_API_MUTATION_COMMIT_RECEIPT_FORMAT_VERSION: u16 = 1;
3494#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
3495#[serde(deny_unknown_fields)]
3496pub struct MutationCommitReceipt {
3497    pub format_version: u32,
3498    pub registration_position: MutationCommitPosition,
3499    pub sequence: U64,
3500    pub primary_term: U64,
3501    pub mapping_generation: U64,
3502    pub durability_class: ResourceDurabilityClass,
3503    pub durability_boundary: WriteDurabilityBoundary,
3504    pub committed_at_unix_millis: U64,
3505    pub committed_at_uncertainty_millis: U64,
3506}
3507
3508pub const LODESTONE_API_MUTATION_RESOLVER_FORMAT_VERSION: u16 = 1;
3509#[derive(Clone, Copy, Debug, Deserialize, Eq, PartialEq, Serialize)]
3510#[serde(rename_all = "snake_case")]
3511pub enum MutationResolver {
3512    CloneIndex,
3513    GetHistory,
3514    ResolveAppendBulk,
3515    ResolveCatalogAction,
3516    ResolveDocumentBulk,
3517    ResolveDocumentMutation,
3518    ResolveSecurityAction,
3519    ResolveServiceCredentialReservation,
3520    ResolveStateWrite,
3521}
3522
3523pub const LODESTONE_API_MUTATION_OUTCOME_FORMAT_VERSION: u16 = 1;
3524#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
3525#[serde(tag = "state", rename_all = "snake_case", deny_unknown_fields)]
3526pub enum MutationOutcome {
3527    Terminal,
3528    Pending {
3529        #[serde(default, skip_serializing_if = "Option::is_none")]
3530        resolver: Option<MutationResolver>,
3531    },
3532    Indeterminate {
3533        #[serde(default, skip_serializing_if = "Option::is_none")]
3534        resolver: Option<MutationResolver>,
3535    },
3536    ResolutionRequired {
3537        resolver: MutationResolver,
3538    },
3539}
3540
3541pub const LODESTONE_API_SUBMISSION_STATE_FORMAT_VERSION: u16 = 1;
3542#[derive(Clone, Copy, Debug, Deserialize, Eq, PartialEq, Serialize)]
3543#[serde(rename_all = "snake_case")]
3544pub enum SubmissionState {
3545    NotSubmitted,
3546    Submitted,
3547    Resolved,
3548    KnownRetired,
3549    Indeterminate,
3550}
3551
3552pub const LODESTONE_API_EXPECTED_BINDING_FORMAT_VERSION: u16 = 1;
3553#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
3554#[serde(deny_unknown_fields)]
3555pub struct ExpectedBinding {
3556    pub incarnation: Identity,
3557    pub revision: U64,
3558}
3559
3560pub const LODESTONE_API_ADMINISTRATION_ALIAS_ACTION_FORMAT_VERSION: u16 = 1;
3561#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
3562#[serde(tag = "kind", rename_all = "snake_case", deny_unknown_fields)]
3563pub enum AdministrationAliasAction {
3564    Put {
3565        name: String,
3566        #[serde(default, skip_serializing_if = "Option::is_none")]
3567        expected_revision: Option<U64>,
3568        targets: Vec<AliasTarget>,
3569        #[serde(default, skip_serializing_if = "Option::is_none")]
3570        filter: Option<RawJson>,
3571        #[serde(default, skip_serializing_if = "Option::is_none")]
3572        index_routing: Option<String>,
3573        #[serde(default, skip_serializing_if = "Option::is_none")]
3574        search_routing: Option<String>,
3575    },
3576    Delete {
3577        name: String,
3578        expected_revision: U64,
3579    },
3580}
3581
3582pub const LODESTONE_API_ADMINISTRATION_MUTATION_FORMAT_VERSION: u16 = 1;
3583#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
3584#[serde(tag = "kind", rename_all = "snake_case", deny_unknown_fields)]
3585pub enum AdministrationMutation {
3586    ApplyAliasActions {
3587        actions: Vec<AdministrationAliasAction>,
3588    },
3589    PutComponentTemplate {
3590        name: String,
3591        #[serde(default, skip_serializing_if = "Option::is_none")]
3592        expected: Option<ExpectedBinding>,
3593        mapping: Mapping,
3594        settings: RawJson,
3595        #[serde(default, skip_serializing_if = "Option::is_none")]
3596        resource_spec: Option<IndexResourceSpec>,
3597    },
3598    DeleteComponentTemplate {
3599        name: String,
3600        expected: ExpectedBinding,
3601    },
3602    PutIndexTemplate {
3603        name: String,
3604        #[serde(default, skip_serializing_if = "Option::is_none")]
3605        expected: Option<ExpectedBinding>,
3606        priority: i32,
3607        data_stream: bool,
3608        index_patterns: Vec<String>,
3609        components: Vec<ExpectedBinding>,
3610        mapping: Mapping,
3611        settings: RawJson,
3612        #[serde(default, skip_serializing_if = "Option::is_none")]
3613        resource_spec: Option<IndexResourceSpec>,
3614    },
3615    DeleteIndexTemplate {
3616        name: String,
3617        expected: ExpectedBinding,
3618    },
3619    PutIngestPipeline {
3620        name: String,
3621        #[serde(default, skip_serializing_if = "Option::is_none")]
3622        expected: Option<ExpectedBinding>,
3623        definition: RawJson,
3624    },
3625    DeleteIngestPipeline {
3626        name: String,
3627        expected: ExpectedBinding,
3628    },
3629    PutLifecyclePolicy {
3630        name: String,
3631        #[serde(default, skip_serializing_if = "Option::is_none")]
3632        expected: Option<ExpectedBinding>,
3633        rollover: RolloverThresholds,
3634        retention: RetentionPolicy,
3635        merge_hint: bool,
3636        freeze_hint: bool,
3637        delete_expired: bool,
3638    },
3639    DeleteLifecyclePolicy {
3640        name: String,
3641        expected: ExpectedBinding,
3642    },
3643    CreateDataStream {
3644        name: String,
3645        timestamp_field: String,
3646        index_template: ExpectedBinding,
3647        #[serde(default, skip_serializing_if = "Option::is_none")]
3648        lifecycle_policy: Option<ExpectedBinding>,
3649    },
3650    DeleteDataStream {
3651        name: String,
3652        expected_revision: U64,
3653    },
3654    RolloverDataStream {
3655        name: String,
3656        expected_revision: U64,
3657    },
3658}
3659
3660pub const LODESTONE_API_ADMINISTRATION_OUTCOME_FORMAT_VERSION: u16 = 1;
3661#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
3662#[serde(deny_unknown_fields)]
3663pub struct AdministrationOutcome {
3664    pub action_id: Digest,
3665    pub authority_revision: U64,
3666    pub state: String,
3667    #[serde(default, skip_serializing_if = "Option::is_none")]
3668    pub resource: Option<Resource>,
3669}
3670
3671pub const LODESTONE_API_INDEX_CHANGE_APPLY_RECEIPT_FORMAT_VERSION: u16 = 1;
3672#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
3673#[serde(deny_unknown_fields)]
3674pub struct IndexChangeApplyReceipt {
3675    pub action_id: Digest,
3676    pub semantic_digest: Digest,
3677    pub index: Resource,
3678    pub revision: U64,
3679    pub schema_generation: U64,
3680    pub state: String,
3681}
3682
3683pub const LODESTONE_API_BULK_DOCUMENT_ITEM_FORMAT_VERSION: u16 = 2;
3684#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
3685#[serde(deny_unknown_fields)]
3686pub struct BulkDocumentItem {
3687    pub item_action_id: Digest,
3688    pub document_id: String,
3689    pub operation: String,
3690    #[serde(default, skip_serializing_if = "Option::is_none")]
3691    pub source: Option<RawJson>,
3692    #[serde(default, skip_serializing_if = "Option::is_none")]
3693    pub record: Option<NativeRecord>,
3694    #[serde(default, skip_serializing_if = "Option::is_none")]
3695    pub routing: Option<String>,
3696    #[serde(default, skip_serializing_if = "Option::is_none")]
3697    pub condition: Option<DocumentMutationCondition>,
3698    #[serde(default, skip_serializing_if = "Option::is_none")]
3699    pub pipeline: Option<IngestPipelineSelection>,
3700    pub semantic_digest: Digest,
3701}
3702
3703pub const LODESTONE_API_BULK_DOCUMENT_ITEM_OUTCOME_FORMAT_VERSION: u16 = 1;
3704#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
3705#[serde(deny_unknown_fields)]
3706pub struct BulkDocumentItemOutcome {
3707    pub item_action_id: Digest,
3708    #[serde(default, skip_serializing_if = "Option::is_none")]
3709    pub locator: Option<Locator>,
3710    pub state: SubmissionState,
3711    #[serde(default, skip_serializing_if = "Option::is_none")]
3712    pub sequence: Option<U64>,
3713    #[serde(default, skip_serializing_if = "Option::is_none")]
3714    pub mapping_generation: Option<U64>,
3715    pub mapping_adopted: bool,
3716    pub no_document_effect: bool,
3717    #[serde(default, skip_serializing_if = "Option::is_none")]
3718    pub error: Option<ErrorBody>,
3719}
3720
3721pub const LODESTONE_API_BULK_DOCUMENT_OUTCOME_FORMAT_VERSION: u16 = 1;
3722#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
3723#[serde(deny_unknown_fields)]
3724pub struct BulkDocumentOutcome {
3725    pub batch_id: Digest,
3726    pub index: Resource,
3727    pub items: Vec<BulkDocumentItemOutcome>,
3728    pub complete: bool,
3729    #[serde(default, skip_serializing_if = "Option::is_none")]
3730    pub achievement: Option<WriteAchievement>,
3731}
3732
3733pub const LODESTONE_API_METRIC_ATTRIBUTE_VALUE_FORMAT_VERSION: u16 = 1;
3734#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
3735#[serde(tag = "kind", rename_all = "snake_case", deny_unknown_fields)]
3736pub enum MetricAttributeValue {
3737    String { value: String },
3738    Boolean { value: bool },
3739    I64 { value: I64 },
3740    U64 { value: U64 },
3741    F64Bits { value: U64 },
3742}
3743
3744pub const LODESTONE_API_METRIC_ATTRIBUTE_FORMAT_VERSION: u16 = 1;
3745#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
3746#[serde(deny_unknown_fields)]
3747pub struct MetricAttribute {
3748    pub key: String,
3749    pub value: MetricAttributeValue,
3750}
3751
3752pub const LODESTONE_API_METRIC_NUMBER_FORMAT_VERSION: u16 = 1;
3753#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
3754#[serde(tag = "kind", rename_all = "snake_case", deny_unknown_fields)]
3755pub enum MetricNumber {
3756    I64 { value: I64 },
3757    F64Bits { value: U64 },
3758}
3759
3760pub const LODESTONE_API_METRIC_TEMPORALITY_FORMAT_VERSION: u16 = 1;
3761#[derive(Clone, Copy, Debug, Deserialize, Eq, PartialEq, Serialize)]
3762#[serde(rename_all = "snake_case")]
3763pub enum MetricTemporality {
3764    Cumulative,
3765    Delta,
3766}
3767
3768pub const LODESTONE_API_METRIC_POINT_KIND_FORMAT_VERSION: u16 = 1;
3769#[derive(Clone, Copy, Debug, Deserialize, Eq, PartialEq, Serialize)]
3770#[serde(rename_all = "snake_case")]
3771pub enum MetricPointKind {
3772    Gauge,
3773    Sum,
3774    ExplicitHistogram,
3775    ExponentialHistogram,
3776}
3777
3778pub const LODESTONE_API_METRIC_EXPONENTIAL_BUCKETS_FORMAT_VERSION: u16 = 1;
3779#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
3780#[serde(deny_unknown_fields)]
3781pub struct MetricExponentialBuckets {
3782    pub offset: i32,
3783    pub counts: Vec<U64>,
3784}
3785
3786pub const LODESTONE_API_METRIC_DATA_FORMAT_VERSION: u16 = 1;
3787#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
3788#[serde(tag = "kind", rename_all = "snake_case", deny_unknown_fields)]
3789pub enum MetricData {
3790    Gauge {
3791        value: MetricNumber,
3792    },
3793    Sum {
3794        value: MetricNumber,
3795        temporality: MetricTemporality,
3796        monotonic: bool,
3797    },
3798    ExplicitHistogram {
3799        temporality: MetricTemporality,
3800        count: U64,
3801        #[serde(default, skip_serializing_if = "Option::is_none")]
3802        sum: Option<MetricNumber>,
3803        bounds_f64_bits: Vec<U64>,
3804        bucket_counts: Vec<U64>,
3805    },
3806    ExponentialHistogram {
3807        temporality: MetricTemporality,
3808        count: U64,
3809        #[serde(default, skip_serializing_if = "Option::is_none")]
3810        sum: Option<MetricNumber>,
3811        scale: i32,
3812        zero_count: U64,
3813        positive: MetricExponentialBuckets,
3814        negative: MetricExponentialBuckets,
3815    },
3816}
3817
3818pub const LODESTONE_API_METRIC_INSTRUMENTATION_SCOPE_FORMAT_VERSION: u16 = 1;
3819#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
3820#[serde(deny_unknown_fields)]
3821pub struct MetricInstrumentationScope {
3822    pub name: String,
3823    #[serde(default, skip_serializing_if = "Option::is_none")]
3824    pub version: Option<String>,
3825    #[serde(default, skip_serializing_if = "Option::is_none")]
3826    pub schema_url: Option<String>,
3827    pub attributes: Vec<MetricAttribute>,
3828}
3829
3830pub const LODESTONE_API_METRIC_EXEMPLAR_FORMAT_VERSION: u16 = 1;
3831#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
3832#[serde(deny_unknown_fields)]
3833pub struct MetricExemplar {
3834    pub timestamp_unix_nanos: U64,
3835    pub value: MetricNumber,
3836    #[serde(default, skip_serializing_if = "Option::is_none")]
3837    pub trace_id: Option<String>,
3838    #[serde(default, skip_serializing_if = "Option::is_none")]
3839    pub span_id: Option<String>,
3840    pub filtered_attributes: Vec<MetricAttribute>,
3841}
3842
3843pub const LODESTONE_API_METRIC_POINT_SHAPE_VERSION: u16 = 1;
3844pub const LODESTONE_API_METRIC_POINT_FORMAT_VERSION: u16 = 1;
3845#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
3846#[serde(deny_unknown_fields)]
3847pub struct MetricPoint {
3848    pub format_version: u32,
3849    pub resource_attributes: Vec<MetricAttribute>,
3850    pub instrumentation_scope: MetricInstrumentationScope,
3851    pub metric_name: String,
3852    #[serde(default, skip_serializing_if = "Option::is_none")]
3853    pub description: Option<String>,
3854    pub unit: String,
3855    pub series_attributes: Vec<MetricAttribute>,
3856    pub timestamp_unix_nanos: U64,
3857    #[serde(default, skip_serializing_if = "Option::is_none")]
3858    pub start_timestamp_unix_nanos: Option<U64>,
3859    pub data: MetricData,
3860    pub exemplars: Vec<MetricExemplar>,
3861}
3862
3863pub const LODESTONE_API_ENTITY_REF_FORMAT_VERSION: u16 = 1;
3864#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
3865#[serde(deny_unknown_fields)]
3866pub struct EntityRef {
3867    pub entity_kind: String,
3868    pub entity_id: String,
3869}
3870
3871pub const LODESTONE_API_RELATIONSHIP_EVIDENCE_REF_FORMAT_VERSION: u16 = 1;
3872#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
3873#[serde(deny_unknown_fields)]
3874pub struct RelationshipEvidenceRef {
3875    pub index: Resource,
3876    pub record_id: String,
3877}
3878
3879pub const LODESTONE_API_RELATIONSHIP_DIRECTIONALITY_FORMAT_VERSION: u16 = 1;
3880#[derive(Clone, Copy, Debug, Deserialize, Eq, PartialEq, Serialize)]
3881#[serde(rename_all = "snake_case")]
3882pub enum RelationshipDirectionality {
3883    Directed,
3884    Undirected,
3885}
3886
3887pub const LODESTONE_API_RELATIONSHIP_RECORD_SHAPE_VERSION: u16 = 1;
3888pub const LODESTONE_API_RELATIONSHIP_RECORD_FORMAT_VERSION: u16 = 1;
3889#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
3890#[serde(deny_unknown_fields)]
3891pub struct RelationshipRecord {
3892    pub format_version: u32,
3893    pub relationship_id: String,
3894    pub source: EntityRef,
3895    pub target: EntityRef,
3896    pub relationship_type: String,
3897    pub directionality: RelationshipDirectionality,
3898    #[serde(default, skip_serializing_if = "Option::is_none")]
3899    pub valid_from_unix_nanos: Option<U64>,
3900    #[serde(default, skip_serializing_if = "Option::is_none")]
3901    pub valid_through_unix_nanos: Option<U64>,
3902    pub provenance: Vec<String>,
3903    pub evidence: Vec<RelationshipEvidenceRef>,
3904    pub assertion_class: String,
3905}
3906
3907pub const LODESTONE_API_PROFILE_LABEL_FORMAT_VERSION: u16 = 1;
3908#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
3909#[serde(deny_unknown_fields)]
3910pub struct ProfileLabel {
3911    pub key: String,
3912    pub value: String,
3913}
3914
3915pub const LODESTONE_API_PROFILE_SAMPLE_TYPE_FORMAT_VERSION: u16 = 1;
3916#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
3917#[serde(deny_unknown_fields)]
3918pub struct ProfileSampleType {
3919    pub sample_type: String,
3920    pub unit: String,
3921}
3922
3923pub const LODESTONE_API_PROFILE_MAPPING_FORMAT_VERSION: u16 = 1;
3924#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
3925#[serde(deny_unknown_fields)]
3926pub struct ProfileMapping {
3927    pub mapping_id: String,
3928    pub build_id: String,
3929    pub module_id: String,
3930    #[serde(default, skip_serializing_if = "Option::is_none")]
3931    pub filename: Option<String>,
3932}
3933
3934pub const LODESTONE_API_PROFILE_FUNCTION_FORMAT_VERSION: u16 = 1;
3935#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
3936#[serde(deny_unknown_fields)]
3937pub struct ProfileFunction {
3938    pub function_id: String,
3939    #[serde(default, skip_serializing_if = "Option::is_none")]
3940    pub name: Option<String>,
3941    #[serde(default, skip_serializing_if = "Option::is_none")]
3942    pub system_name: Option<String>,
3943    #[serde(default, skip_serializing_if = "Option::is_none")]
3944    pub filename: Option<String>,
3945    #[serde(default, skip_serializing_if = "Option::is_none")]
3946    pub start_line: Option<U64>,
3947    #[serde(default, skip_serializing_if = "Option::is_none")]
3948    pub symbol_observation_id: Option<String>,
3949}
3950
3951pub const LODESTONE_API_PROFILE_LINE_FORMAT_VERSION: u16 = 1;
3952#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
3953#[serde(deny_unknown_fields)]
3954pub struct ProfileLine {
3955    pub function_id: String,
3956    pub line: U64,
3957}
3958
3959pub const LODESTONE_API_PROFILE_LOCATION_FORMAT_VERSION: u16 = 1;
3960#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
3961#[serde(deny_unknown_fields)]
3962pub struct ProfileLocation {
3963    pub location_id: String,
3964    #[serde(default, skip_serializing_if = "Option::is_none")]
3965    pub mapping_id: Option<String>,
3966    pub address: U64,
3967    pub lines: Vec<ProfileLine>,
3968}
3969
3970pub const LODESTONE_API_PROFILE_STACK_FORMAT_VERSION: u16 = 1;
3971#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
3972#[serde(deny_unknown_fields)]
3973pub struct ProfileStack {
3974    pub stack_id: String,
3975    #[serde(default, skip_serializing_if = "Option::is_none")]
3976    pub parent_stack_id: Option<String>,
3977    pub location_id: String,
3978}
3979
3980pub const LODESTONE_API_PROFILE_SAMPLE_FORMAT_VERSION: u16 = 1;
3981#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
3982#[serde(deny_unknown_fields)]
3983pub struct ProfileSample {
3984    pub sample_id: String,
3985    pub stack_id: String,
3986    pub values: Vec<MetricNumber>,
3987    pub labels: Vec<ProfileLabel>,
3988    #[serde(default, skip_serializing_if = "Option::is_none")]
3989    pub trace_id: Option<String>,
3990    #[serde(default, skip_serializing_if = "Option::is_none")]
3991    pub span_id: Option<String>,
3992}
3993
3994pub const LODESTONE_API_PROFILE_INSTRUMENTATION_SCOPE_FORMAT_VERSION: u16 = 1;
3995#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
3996#[serde(deny_unknown_fields)]
3997pub struct ProfileInstrumentationScope {
3998    pub name: String,
3999    #[serde(default, skip_serializing_if = "Option::is_none")]
4000    pub version: Option<String>,
4001    pub attributes: Vec<ProfileLabel>,
4002}
4003
4004pub const LODESTONE_API_PROFILE_BATCH_SHAPE_VERSION: u16 = 1;
4005pub const LODESTONE_API_PROFILE_BATCH_FORMAT_VERSION: u16 = 1;
4006#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
4007#[serde(deny_unknown_fields)]
4008pub struct ProfileBatch {
4009    pub format_version: u32,
4010    pub profile_id: String,
4011    pub batch_id: String,
4012    pub start_unix_nanos: U64,
4013    pub end_unix_nanos: U64,
4014    pub duration_nanos: U64,
4015    pub period_nanos: U64,
4016    pub sample_types: Vec<ProfileSampleType>,
4017    pub resource_attributes: Vec<ProfileLabel>,
4018    pub instrumentation_scope: ProfileInstrumentationScope,
4019    pub mappings: Vec<ProfileMapping>,
4020    pub functions: Vec<ProfileFunction>,
4021    pub locations: Vec<ProfileLocation>,
4022    pub stacks: Vec<ProfileStack>,
4023    pub samples: Vec<ProfileSample>,
4024}
4025
4026pub const LODESTONE_API_NATIVE_RECORD_FORMAT_VERSION: u16 = 3;
4027#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
4028#[serde(tag = "kind", rename_all = "snake_case", deny_unknown_fields)]
4029pub enum NativeRecord {
4030    Document { source: RawJson },
4031    MetricPoint { point: Box<MetricPoint> },
4032    Relationship { relationship: Box<RelationshipRecord> },
4033    ProfileBatch { batch: Box<ProfileBatch> },
4034}
4035
4036pub const LODESTONE_API_RETAINED_APPEND_ITEM_FORMAT_VERSION: u16 = 4;
4037#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
4038#[serde(deny_unknown_fields)]
4039pub struct RetainedAppendItem {
4040    pub item_action_id: Digest,
4041    pub document_id: String,
4042    pub record: NativeRecord,
4043}
4044
4045pub const LODESTONE_API_RETAINED_APPEND_STATE_FORMAT_VERSION: u16 = 1;
4046#[derive(Clone, Copy, Debug, Deserialize, Eq, PartialEq, Serialize)]
4047#[serde(rename_all = "snake_case")]
4048pub enum RetainedAppendState {
4049    Prepared,
4050    Committed,
4051    Replayed,
4052    Conflict,
4053    NotSubmittedRetryable,
4054    NotSubmittedTerminal,
4055    SubmittedIndeterminate,
4056    Retired,
4057}
4058
4059pub const LODESTONE_API_RETAINED_APPEND_RETRY_SAFETY_FORMAT_VERSION: u16 = 1;
4060#[derive(Clone, Copy, Debug, Deserialize, Eq, PartialEq, Serialize)]
4061#[serde(rename_all = "snake_case")]
4062pub enum RetainedAppendRetrySafety {
4063    Safe,
4064    ResolveOnly,
4065    Terminal,
4066}
4067
4068pub const LODESTONE_API_RETAINED_APPEND_ITEM_OUTCOME_FORMAT_VERSION: u16 = 1;
4069#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
4070#[serde(deny_unknown_fields)]
4071pub struct RetainedAppendItemOutcome {
4072    pub item_action_id: Digest,
4073    #[serde(default, skip_serializing_if = "Option::is_none")]
4074    pub locator: Option<Locator>,
4075    #[serde(default, skip_serializing_if = "Option::is_none")]
4076    pub semantic_digest: Option<Digest>,
4077    pub state: RetainedAppendState,
4078    pub retry_safety: RetainedAppendRetrySafety,
4079    #[serde(default, skip_serializing_if = "Option::is_none")]
4080    pub sequence: Option<U64>,
4081    #[serde(default, skip_serializing_if = "Option::is_none")]
4082    pub primary_term: Option<U64>,
4083    #[serde(default, skip_serializing_if = "Option::is_none")]
4084    pub error: Option<ErrorBody>,
4085}
4086
4087pub const LODESTONE_API_RETAINED_APPEND_BULK_OUTCOME_FORMAT_VERSION: u16 = 1;
4088#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
4089#[serde(deny_unknown_fields)]
4090pub struct RetainedAppendBulkOutcome {
4091    pub batch_id: Digest,
4092    pub index: Resource,
4093    pub items: Vec<RetainedAppendItemOutcome>,
4094    pub complete: bool,
4095    #[serde(default, skip_serializing_if = "Option::is_none")]
4096    pub achievement: Option<WriteAchievement>,
4097}
4098
4099pub const LODESTONE_API_RETAINED_APPEND_OBSERVATION_STATE_FORMAT_VERSION: u16 = 1;
4100#[derive(Clone, Copy, Debug, Deserialize, Eq, PartialEq, Serialize)]
4101#[serde(rename_all = "snake_case")]
4102pub enum RetainedAppendObservationState {
4103    Visible,
4104    Pending,
4105    SubmittedIndeterminate,
4106    Conflict,
4107    Retired,
4108}
4109
4110pub const LODESTONE_API_RETAINED_APPEND_OBSERVATION_OUTCOME_FORMAT_VERSION: u16 = 1;
4111#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
4112#[serde(deny_unknown_fields)]
4113pub struct RetainedAppendObservationOutcome {
4114    pub index: Resource,
4115    pub locator: Locator,
4116    pub state: RetainedAppendObservationState,
4117    #[serde(default, skip_serializing_if = "Option::is_none")]
4118    pub sequence: Option<U64>,
4119    #[serde(default, skip_serializing_if = "Option::is_none")]
4120    pub primary_term: Option<U64>,
4121}
4122
4123pub const LODESTONE_API_BINARY_VALUE_FORMAT_VERSION: u16 = 1;
4124#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
4125#[serde(deny_unknown_fields)]
4126pub struct BinaryValue {
4127    pub bytes_base64: String,
4128}
4129
4130pub const LODESTONE_API_STATE_HASH_FIELD_FORMAT_VERSION: u16 = 1;
4131#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
4132#[serde(deny_unknown_fields)]
4133pub struct StateHashField {
4134    pub field: BinaryValue,
4135    pub value: BinaryValue,
4136}
4137
4138pub const LODESTONE_API_STATE_SET_ENTRY_FORMAT_VERSION: u16 = 1;
4139#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
4140#[serde(deny_unknown_fields)]
4141pub struct StateSetEntry {
4142    pub key: BinaryValue,
4143    pub value: BinaryValue,
4144}
4145
4146pub const LODESTONE_API_STATE_SET_CONDITION_FORMAT_VERSION: u16 = 1;
4147#[derive(Clone, Copy, Debug, Deserialize, Eq, PartialEq, Serialize)]
4148#[serde(rename_all = "snake_case")]
4149pub enum StateSetCondition {
4150    Always,
4151    IfAbsent,
4152    IfPresent,
4153}
4154
4155pub const LODESTONE_API_STATE_OPERATION_FORMAT_VERSION: u16 = 1;
4156#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
4157#[serde(tag = "kind", rename_all = "snake_case", deny_unknown_fields)]
4158pub enum StateOperation {
4159    Get {
4160        key: BinaryValue,
4161    },
4162    Set {
4163        key: BinaryValue,
4164        value: BinaryValue,
4165        condition: StateSetCondition,
4166        #[serde(default, skip_serializing_if = "Option::is_none")]
4167        expires_at_millis: Option<U64>,
4168    },
4169    Delete {
4170        keys: Vec<BinaryValue>,
4171    },
4172    Exists {
4173        keys: Vec<BinaryValue>,
4174    },
4175    ExpireAt {
4176        key: BinaryValue,
4177        absolute_millis: U64,
4178    },
4179    TtlStatus {
4180        key: BinaryValue,
4181    },
4182    Persist {
4183        key: BinaryValue,
4184    },
4185    MultiGet {
4186        keys: Vec<BinaryValue>,
4187    },
4188    MultiSet {
4189        entries: Vec<StateSetEntry>,
4190    },
4191    Increment {
4192        key: BinaryValue,
4193        delta: I64,
4194    },
4195    HashGet {
4196        key: BinaryValue,
4197        field: BinaryValue,
4198    },
4199    HashSet {
4200        key: BinaryValue,
4201        fields: Vec<StateHashField>,
4202    },
4203    HashGetAll {
4204        key: BinaryValue,
4205    },
4206}
4207
4208pub const LODESTONE_API_STATE_OPTIONAL_VALUE_FORMAT_VERSION: u16 = 1;
4209#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
4210#[serde(tag = "state", rename_all = "snake_case", deny_unknown_fields)]
4211pub enum StateOptionalValue {
4212    Missing,
4213    Value { value: BinaryValue },
4214}
4215
4216pub const LODESTONE_API_STATE_COMMAND_RESULT_FORMAT_VERSION: u16 = 1;
4217#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
4218#[serde(tag = "kind", rename_all = "snake_case", deny_unknown_fields)]
4219pub enum StateCommandResult {
4220    Get {
4221        value: StateOptionalValue,
4222    },
4223    Set {
4224        applied: bool,
4225    },
4226    Delete {
4227        removed: u32,
4228    },
4229    Exists {
4230        count: u32,
4231    },
4232    Expire {
4233        changed: bool,
4234    },
4235    TtlStatus {
4236        state: String,
4237        #[serde(default, skip_serializing_if = "Option::is_none")]
4238        remaining_millis: Option<U64>,
4239    },
4240    Persist {
4241        changed: bool,
4242    },
4243    MultiGet {
4244        values: Vec<StateOptionalValue>,
4245    },
4246    MultiSet {
4247        written: u32,
4248    },
4249    Increment {
4250        value: I64,
4251    },
4252    HashGet {
4253        value: StateOptionalValue,
4254    },
4255    HashSet {
4256        fields_added: u32,
4257    },
4258    HashGetAll {
4259        fields: Vec<StateHashField>,
4260    },
4261}
4262
4263pub const LODESTONE_API_STATE_WRITE_RESOLUTION_FORMAT_VERSION: u16 = 1;
4264#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
4265#[serde(tag = "state", rename_all = "snake_case", deny_unknown_fields)]
4266pub enum StateWriteResolution {
4267    NotSubmitted,
4268    Resolved {
4269        result: StateCommandResult,
4270        sequence: U64,
4271    },
4272    KnownRetired {
4273        retired_through: U64,
4274    },
4275    StateReset {
4276        submitted_reset_epoch: U64,
4277        current_reset_epoch: U64,
4278    },
4279    Indeterminate {
4280        #[serde(default, skip_serializing_if = "Option::is_none")]
4281        observed_high_water: Option<U64>,
4282        #[serde(default, skip_serializing_if = "Option::is_none")]
4283        current_high_water: Option<U64>,
4284        #[serde(default, skip_serializing_if = "Option::is_none")]
4285        retired_through: Option<U64>,
4286    },
4287}
4288
4289pub const LODESTONE_API_SERVICE_CREDENTIAL_RESERVATION_FORMAT_VERSION: u16 = 1;
4290#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
4291#[serde(deny_unknown_fields)]
4292pub struct ServiceCredentialReservation {
4293    pub locator: Locator,
4294    pub reservation_action_id: Digest,
4295    pub activation_action_id: Digest,
4296    pub principal_id: Identity,
4297    pub api_key_id: Identity,
4298    pub generation: U64,
4299    pub reservation_expires_at: U64,
4300    pub credential_expires_at: U64,
4301    pub verifier_algorithm: String,
4302    pub verifier_algorithm_version: u32,
4303    pub required_secret_bytes: u32,
4304}
4305
4306pub const LODESTONE_API_SUBSCRIPTION_METADATA_FIELD_FORMAT_VERSION: u16 = 1;
4307#[derive(Clone, Copy, Debug, Deserialize, Eq, PartialEq, Serialize)]
4308#[serde(rename_all = "snake_case")]
4309pub enum SubscriptionMetadataField {
4310    Id,
4311    RoutingHash,
4312    Operation,
4313    Shard,
4314    Sequence,
4315}
4316
4317pub const LODESTONE_API_SUBSCRIPTION_FIELD_FORMAT_VERSION: u16 = 1;
4318#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
4319#[serde(tag = "kind", rename_all = "snake_case", deny_unknown_fields)]
4320pub enum SubscriptionField {
4321    Source { path: String },
4322    Metadata { field: SubscriptionMetadataField },
4323}
4324
4325pub const LODESTONE_API_SUBSCRIPTION_FILTER_FORMAT_VERSION: u16 = 1;
4326#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
4327#[serde(tag = "kind", rename_all = "snake_case", deny_unknown_fields)]
4328pub enum SubscriptionFilter {
4329    All,
4330    Bool {
4331        must: Vec<SubscriptionFilter>,
4332        should: Vec<SubscriptionFilter>,
4333        must_not: Vec<SubscriptionFilter>,
4334        minimum_should_match: u32,
4335    },
4336    Term {
4337        field: SubscriptionField,
4338        value: JsonValue,
4339    },
4340    Terms {
4341        field: SubscriptionField,
4342        values: Vec<JsonValue>,
4343    },
4344    Range {
4345        field: SubscriptionField,
4346        #[serde(default, skip_serializing_if = "Option::is_none")]
4347        gt: Option<JsonValue>,
4348        #[serde(default, skip_serializing_if = "Option::is_none")]
4349        gte: Option<JsonValue>,
4350        #[serde(default, skip_serializing_if = "Option::is_none")]
4351        lt: Option<JsonValue>,
4352        #[serde(default, skip_serializing_if = "Option::is_none")]
4353        lte: Option<JsonValue>,
4354    },
4355    Exists {
4356        field: SubscriptionField,
4357    },
4358    Prefix {
4359        field: SubscriptionField,
4360        value: String,
4361    },
4362}
4363
4364pub const LODESTONE_API_SUBSCRIPTION_CURSOR_ENTRY_FORMAT_VERSION: u16 = 1;
4365#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
4366#[serde(deny_unknown_fields)]
4367pub struct SubscriptionCursorEntry {
4368    pub index: Resource,
4369    pub routing_revision: U64,
4370    pub recovery_era: Identity,
4371    pub shard_id: U64,
4372    pub sequence: U64,
4373}
4374
4375pub const LODESTONE_API_SUBSCRIPTION_ROUTE_FORMAT_VERSION: u16 = 1;
4376#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
4377#[serde(deny_unknown_fields)]
4378pub struct SubscriptionRoute {
4379    pub index: Resource,
4380    pub routing_revision: U64,
4381    pub shard_ids: Vec<U64>,
4382}
4383
4384pub const LODESTONE_API_SUBSCRIPTION_START_POSITION_FORMAT_VERSION: u16 = 1;
4385#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
4386#[serde(tag = "kind", rename_all = "snake_case", deny_unknown_fields)]
4387pub enum SubscriptionStartPosition {
4388    FromNow,
4389    Resume {
4390        routes: Vec<SubscriptionRoute>,
4391        cut: Vec<SubscriptionCursorEntry>,
4392    },
4393}
4394
4395pub const LODESTONE_API_SUBSCRIPTION_START_SHAPE_VERSION: u16 = 1;
4396pub const LODESTONE_API_SUBSCRIPTION_START_FORMAT_VERSION: u16 = 1;
4397#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
4398#[serde(deny_unknown_fields)]
4399pub struct SubscriptionStart {
4400    pub format_version: u32,
4401    pub request_id: String,
4402    pub index: Resource,
4403    #[serde(default, skip_serializing_if = "Option::is_none")]
4404    pub filter: Option<SubscriptionFilter>,
4405    pub include_deletes: bool,
4406    pub source_projection: Vec<String>,
4407    pub reconnect_attempt: u32,
4408    pub start: SubscriptionStartPosition,
4409    pub heartbeat_millis: U64,
4410    pub schema_digest: Digest,
4411}
4412
4413pub const LODESTONE_API_SUBSCRIPTION_ACCEPTED_SHAPE_VERSION: u16 = 1;
4414pub const LODESTONE_API_SUBSCRIPTION_ACCEPTED_FORMAT_VERSION: u16 = 1;
4415#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
4416#[serde(deny_unknown_fields)]
4417pub struct SubscriptionAccepted {
4418    pub format_version: u32,
4419    pub routes: Vec<SubscriptionRoute>,
4420    pub accepted_cut: Vec<SubscriptionCursorEntry>,
4421    pub schema_digest: Digest,
4422}
4423
4424pub const LODESTONE_API_SUBSCRIPTION_WRITER_FENCE_FORMAT_VERSION: u16 = 1;
4425#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
4426#[serde(deny_unknown_fields)]
4427pub struct SubscriptionWriterFence {
4428    pub recovery_era: Identity,
4429    pub epoch: u32,
4430}
4431
4432pub const LODESTONE_API_SUBSCRIPTION_EVENT_SHAPE_VERSION: u16 = 1;
4433pub const LODESTONE_API_SUBSCRIPTION_EVENT_FORMAT_VERSION: u16 = 1;
4434#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
4435#[serde(deny_unknown_fields)]
4436pub struct SubscriptionEvent {
4437    pub format_version: u32,
4438    pub event_id: Digest,
4439    pub index: Resource,
4440    pub shard_id: U64,
4441    pub recovery_era: Identity,
4442    pub writer_fence: SubscriptionWriterFence,
4443    pub routing_revision: U64,
4444    pub sequence: U64,
4445    pub operation: String,
4446    pub document_id: String,
4447    pub routing_hash: u32,
4448    #[serde(default, skip_serializing_if = "Option::is_none")]
4449    pub source: Option<RawJson>,
4450}
4451
4452pub const LODESTONE_API_SUBSCRIPTION_HEARTBEAT_SHAPE_VERSION: u16 = 1;
4453pub const LODESTONE_API_SUBSCRIPTION_HEARTBEAT_FORMAT_VERSION: u16 = 1;
4454#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
4455#[serde(deny_unknown_fields)]
4456pub struct SubscriptionHeartbeat {
4457    pub format_version: u32,
4458    pub confirmed_cut: Vec<SubscriptionCursorEntry>,
4459    pub route_revision: U64,
4460    pub authorization_revision: U64,
4461    pub authorization_valid_until_millis: U64,
4462}
4463
4464pub const LODESTONE_API_SUBSCRIPTION_GAP_SHAPE_VERSION: u16 = 1;
4465pub const LODESTONE_API_SUBSCRIPTION_GAP_FORMAT_VERSION: u16 = 1;
4466#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
4467#[serde(deny_unknown_fields)]
4468pub struct SubscriptionGap {
4469    pub format_version: u32,
4470    pub affected: Vec<SubscriptionCursorEntry>,
4471    pub last_confirmed: Vec<SubscriptionCursorEntry>,
4472    pub earliest_available: Vec<SubscriptionCursorEntry>,
4473    pub reason: String,
4474    pub terminal: bool,
4475}
4476
4477pub const LODESTONE_API_SUBSCRIPTION_TERMINAL_REASON_FORMAT_VERSION: u16 = 1;
4478#[derive(Clone, Copy, Debug, Deserialize, Eq, PartialEq, Serialize)]
4479#[serde(rename_all = "snake_case")]
4480pub enum SubscriptionTerminalReason {
4481    Completed,
4482    Cancelled,
4483    DeadlineExceeded,
4484    StaleCursor,
4485    RetentionGap,
4486    Unavailable,
4487    Internal,
4488}
4489
4490pub const LODESTONE_API_SUBSCRIPTION_TERMINAL_SHAPE_VERSION: u16 = 2;
4491pub const LODESTONE_API_SUBSCRIPTION_TERMINAL_FORMAT_VERSION: u16 = 2;
4492#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
4493#[serde(deny_unknown_fields)]
4494pub struct SubscriptionTerminal {
4495    pub format_version: u32,
4496    pub reason: SubscriptionTerminalReason,
4497    pub recovery: RecoveryAction,
4498}
4499
4500pub const LODESTONE_API_SUBSCRIPTION_FRAME_FORMAT_VERSION: u16 = 1;
4501#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
4502#[serde(tag = "frame", rename_all = "snake_case", deny_unknown_fields)]
4503pub enum SubscriptionFrame {
4504    Accepted { body: SubscriptionAccepted },
4505    Event { body: SubscriptionEvent },
4506    Heartbeat { body: SubscriptionHeartbeat },
4507    Gap { body: SubscriptionGap },
4508    Terminal { body: SubscriptionTerminal },
4509}
4510
4511pub const LODESTONE_API_STREAM_BINDING_FORMAT_VERSION: u16 = 1;
4512#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
4513#[serde(deny_unknown_fields)]
4514pub struct StreamBinding {
4515    pub name: String,
4516    pub transport: String,
4517    pub service: String,
4518    pub method: String,
4519    pub endpoint: String,
4520    pub auth_metadata: String,
4521    pub auth_scheme: String,
4522    pub semantic_format_version: u32,
4523    pub schema_digest: Digest,
4524}
4525
4526pub const LODESTONE_API_CAPABILITY_GRANT_FORMAT_VERSION: u16 = 1;
4527#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
4528#[serde(deny_unknown_fields)]
4529pub struct CapabilityGrant {
4530    pub command: String,
4531    pub action: String,
4532    pub state: String,
4533    pub reason: String,
4534    pub mutation_class: String,
4535    pub cancellable: bool,
4536    pub workload_classes: Vec<WorkloadClass>,
4537    pub possible_submission_states: Vec<String>,
4538    pub capability_family: String,
4539    pub effect_class: String,
4540    pub risk_flags: Vec<String>,
4541    pub admissible_errors: Vec<String>,
4542    pub referenced_limits: Vec<String>,
4543    pub retry_safety: String,
4544    pub identity_requirement: String,
4545    #[serde(default, skip_serializing_if = "Option::is_none")]
4546    pub resolver_command: Option<String>,
4547    pub cancellation: String,
4548    pub side_effects: Vec<String>,
4549    pub recovery: String,
4550    pub index_patterns: Vec<String>,
4551    pub exact_index_incarnations: Vec<Identity>,
4552}
4553
4554pub const LODESTONE_API_PROTOCOL_LIMIT_FORMAT_VERSION: u16 = 1;
4555#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
4556#[serde(deny_unknown_fields)]
4557pub struct ProtocolLimit {
4558    pub id: String,
4559    pub default: U64,
4560    pub maximum: U64,
4561    pub unit: String,
4562}
4563
4564pub const LODESTONE_API_DOCUMENT_MUTATION_CONDITION_FORMAT_VERSION: u16 = 1;
4565#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
4566#[serde(tag = "kind", rename_all = "snake_case", deny_unknown_fields)]
4567pub enum DocumentMutationCondition {
4568    Any,
4569    MustNotExist,
4570    IfSeqNo { seq_no: U64 },
4571    IfSeqNoAndPrimaryTerm { seq_no: U64, primary_term: U64 },
4572}
4573
4574pub const LODESTONE_API_AUDIT_ADAPTER_FORMAT_VERSION: u16 = 1;
4575#[derive(Clone, Copy, Debug, Deserialize, Eq, PartialEq, Serialize)]
4576#[serde(rename_all = "snake_case")]
4577pub enum AuditAdapter {
4578    Native,
4579    Elasticsearch,
4580    Otlp,
4581    Jaeger,
4582    Grpc,
4583    WebSocket,
4584    Resp,
4585    InternalRpc,
4586    ControlPlane,
4587}
4588
4589pub const LODESTONE_API_AUDIT_DECISION_FORMAT_VERSION: u16 = 1;
4590#[derive(Clone, Copy, Debug, Deserialize, Eq, PartialEq, Serialize)]
4591#[serde(rename_all = "snake_case")]
4592pub enum AuditDecision {
4593    Allowed,
4594    DeniedAuthentication,
4595    DeniedAuthorization,
4596    DeniedQuota,
4597    DeniedStalePolicy,
4598}
4599
4600pub const LODESTONE_API_AUDIT_OUTCOME_FORMAT_VERSION: u16 = 1;
4601#[derive(Clone, Copy, Debug, Deserialize, Eq, PartialEq, Serialize)]
4602#[serde(rename_all = "snake_case")]
4603pub enum AuditOutcome {
4604    AdmissionAccepted,
4605    AuthenticationRefused,
4606    AuthorizationRefused,
4607    QuotaRefused,
4608    PolicyUnavailable,
4609    DecodeFailed,
4610    OperationSucceeded,
4611    OperationFailed,
4612    OperationIndeterminate,
4613    FailedRedacted,
4614}
4615
4616pub const LODESTONE_API_AUDIT_DETAIL_FORMAT_VERSION: u16 = 1;
4617#[derive(Clone, Copy, Debug, Deserialize, Eq, PartialEq, Serialize)]
4618#[serde(rename_all = "snake_case")]
4619pub enum AuditDetail {
4620    PolicyMutation,
4621    CredentialRotation,
4622    CredentialRevocation,
4623    QuotaAdmission,
4624    RequestAdmission,
4625    ExplicitCrashGap,
4626    BackupLifecycle,
4627    RetentionLifecycle,
4628    FieldPromotion,
4629}
4630
4631pub const LODESTONE_API_AUDIT_GAP_REASON_FORMAT_VERSION: u16 = 1;
4632#[derive(Clone, Copy, Debug, Deserialize, Eq, PartialEq, Serialize)]
4633#[serde(rename_all = "snake_case")]
4634pub enum AuditGapReason {
4635    ExplicitCrashGap,
4636    Retention,
4637}
4638
4639pub const LODESTONE_API_AUDIT_EVENT_FORMAT_VERSION: u16 = 2;
4640#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
4641#[serde(deny_unknown_fields)]
4642pub struct AuditEvent {
4643    pub event_id: Digest,
4644    pub recovery_era: Identity,
4645    pub sequence: U64,
4646    pub server_time: U64,
4647    #[serde(default, skip_serializing_if = "Option::is_none")]
4648    pub principal_id: Option<Identity>,
4649    #[serde(default, skip_serializing_if = "Option::is_none")]
4650    pub api_key_id: Option<Identity>,
4651    pub policy_revision: U64,
4652    pub adapter: AuditAdapter,
4653    pub action: String,
4654    pub resource_digest: Digest,
4655    pub request_digest: Digest,
4656    #[serde(default, skip_serializing_if = "Option::is_none")]
4657    pub correlation_id: Option<Identity>,
4658    #[serde(default, skip_serializing_if = "Option::is_none")]
4659    pub diagnostic_id: Option<Identity>,
4660    pub decision: AuditDecision,
4661    pub outcome: AuditOutcome,
4662    pub detail: AuditDetail,
4663}
4664
4665pub const LODESTONE_API_AUDIT_GAP_FORMAT_VERSION: u16 = 2;
4666#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
4667#[serde(deny_unknown_fields)]
4668pub struct AuditGap {
4669    pub recovery_era: Identity,
4670    pub first_sequence: U64,
4671    pub last_sequence: U64,
4672    pub reason: AuditGapReason,
4673}
4674
4675pub const LODESTONE_API_AUDIT_STREAM_STATE_FORMAT_VERSION: u16 = 1;
4676#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
4677#[serde(deny_unknown_fields)]
4678pub struct AuditStreamState {
4679    pub recovery_era: Identity,
4680    pub earliest_available_sequence: U64,
4681    pub snapshot_through: U64,
4682}
4683
4684pub const LODESTONE_API_SERVICE_CREDENTIAL_GRANT_FORMAT_VERSION: u16 = 1;
4685#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
4686#[serde(deny_unknown_fields)]
4687pub struct ServiceCredentialGrant {
4688    pub role_name: String,
4689    pub role_version: U64,
4690}
4691
4692pub const LODESTONE_API_SERVICE_CREDENTIAL_SUMMARY_FORMAT_VERSION: u16 = 1;
4693#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
4694#[serde(deny_unknown_fields)]
4695pub struct ServiceCredentialSummary {
4696    pub principal_id: Identity,
4697    pub api_key_id: Identity,
4698    pub generation: U64,
4699    pub state: String,
4700    #[serde(default, skip_serializing_if = "Option::is_none")]
4701    pub expires_at: Option<U64>,
4702    pub grants: Vec<ServiceCredentialGrant>,
4703}
4704
4705pub const LODESTONE_API_SECURITY_ROLE_FORMAT_VERSION: u16 = 1;
4706#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
4707#[serde(deny_unknown_fields)]
4708pub struct SecurityRole {
4709    pub role_name: String,
4710    pub version: U64,
4711    pub permissions: Vec<String>,
4712    pub delegable_permissions: Vec<String>,
4713    pub allowed_workload_classes: Vec<WorkloadClass>,
4714    pub index_patterns: Vec<String>,
4715    pub append_index_incarnations: Vec<Identity>,
4716}
4717
4718pub const LODESTONE_API_ROLE_APPEND_SCOPE_CHANGE_FORMAT_VERSION: u16 = 1;
4719#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
4720#[serde(tag = "kind", rename_all = "snake_case", deny_unknown_fields)]
4721pub enum RoleAppendScopeChange {
4722    Add { index: Resource },
4723    Remove { index_incarnation: Identity },
4724}
4725
4726pub const LODESTONE_API_ROLE_APPEND_ACCESS_PREPARATION_FORMAT_VERSION: u16 = 1;
4727#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
4728#[serde(tag = "state", rename_all = "snake_case", deny_unknown_fields)]
4729pub enum RoleAppendAccessPreparation {
4730    Prepared {
4731        locator: Locator,
4732        semantic_digest: Digest,
4733        expires_at: U64,
4734        predecessor_role_version: U64,
4735        successor_role_version: U64,
4736    },
4737    AlreadySatisfied {
4738        role: SecurityRole,
4739    },
4740}
4741
4742pub const LODESTONE_API_SECURITY_ACTION_OUTCOME_FORMAT_VERSION: u16 = 1;
4743#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
4744#[serde(tag = "kind", rename_all = "snake_case", deny_unknown_fields)]
4745pub enum SecurityActionOutcome {
4746    Reserved {
4747        principal_id: Identity,
4748        api_key_id: Identity,
4749        generation: U64,
4750    },
4751    Activated {
4752        principal_id: Identity,
4753        api_key_id: Identity,
4754        generation: U64,
4755    },
4756    Revoked {
4757        principal_id: Identity,
4758        api_key_id: Identity,
4759        generation: U64,
4760    },
4761    Retired {
4762        principal_id: Identity,
4763        api_key_id: Identity,
4764        generation: U64,
4765    },
4766}
4767
4768pub const LODESTONE_API_MAINTENANCE_WORK_STATE_FORMAT_VERSION: u16 = 1;
4769#[derive(Clone, Copy, Debug, Deserialize, Eq, PartialEq, Serialize)]
4770#[serde(rename_all = "snake_case")]
4771pub enum MaintenanceWorkState {
4772    ParkedOperatorRequired,
4773    RetryWait,
4774    RetryReady,
4775    Leased,
4776    Deferred,
4777    Runnable,
4778}
4779
4780pub const LODESTONE_API_MAINTENANCE_ATTEMPT_STATE_FORMAT_VERSION: u16 = 1;
4781#[derive(Clone, Copy, Debug, Deserialize, Eq, PartialEq, Serialize)]
4782#[serde(rename_all = "snake_case")]
4783pub enum MaintenanceAttemptState {
4784    Running,
4785    DeadlineExceededDraining,
4786    DeadlineExceededReclaimPending,
4787    CancellationDraining,
4788    ClaimRecoveryPending,
4789}
4790
4791pub const LODESTONE_API_MAINTENANCE_FAILURE_CLASS_FORMAT_VERSION: u16 = 1;
4792#[derive(Clone, Copy, Debug, Deserialize, Eq, PartialEq, Serialize)]
4793#[serde(rename_all = "snake_case")]
4794pub enum MaintenanceFailureClass {
4795    Corruption,
4796    AttemptBudget,
4797    StructuralLimit,
4798    Execution,
4799    Other,
4800}
4801
4802pub const LODESTONE_API_MAINTENANCE_FAILURE_CLASS_COUNT_FORMAT_VERSION: u16 = 1;
4803#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
4804#[serde(deny_unknown_fields)]
4805pub struct MaintenanceFailureClassCount {
4806    pub class: MaintenanceFailureClass,
4807    pub count: U64,
4808}
4809
4810pub const LODESTONE_API_MAINTENANCE_ATTEMPT_OBSERVATION_FORMAT_VERSION: u16 = 1;
4811#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
4812#[serde(deny_unknown_fields)]
4813pub struct MaintenanceAttemptObservation {
4814    pub state: MaintenanceAttemptState,
4815    pub lease_epoch: U64,
4816    pub lease_expires_at: U64,
4817    pub observed_at_millis: U64,
4818}
4819
4820pub const LODESTONE_API_MAINTENANCE_TASK_SCOPE_FORMAT_VERSION: u16 = 1;
4821#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
4822#[serde(deny_unknown_fields)]
4823pub struct MaintenanceTaskScope {
4824    pub kind: String,
4825    #[serde(default, skip_serializing_if = "Option::is_none")]
4826    pub index: Option<Resource>,
4827    #[serde(default, skip_serializing_if = "Option::is_none")]
4828    pub shard_id: Option<u32>,
4829}
4830
4831pub const LODESTONE_API_MAINTENANCE_TASK_STATUS_FORMAT_VERSION: u16 = 1;
4832#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
4833#[serde(deny_unknown_fields)]
4834pub struct MaintenanceTaskStatus {
4835    pub task_id: Identity,
4836    pub kind: String,
4837    pub scope: MaintenanceTaskScope,
4838    pub checkpoint_generation: U64,
4839    pub attempt_count: u32,
4840    pub admitted_at: U64,
4841    pub last_transition_at: U64,
4842    pub last_progress_at: U64,
4843    pub work_state: MaintenanceWorkState,
4844    pub state_since: U64,
4845    #[serde(default, skip_serializing_if = "Option::is_none")]
4846    pub defer_reason: Option<String>,
4847    pub cancellation_requested: bool,
4848    #[serde(default, skip_serializing_if = "Option::is_none")]
4849    pub retry_not_before: Option<U64>,
4850    #[serde(default, skip_serializing_if = "Option::is_none")]
4851    pub failure_at: Option<U64>,
4852    #[serde(default, skip_serializing_if = "Option::is_none")]
4853    pub lease_acquired_at: Option<U64>,
4854    #[serde(default, skip_serializing_if = "Option::is_none")]
4855    pub lease_expires_at: Option<U64>,
4856    #[serde(default, skip_serializing_if = "Option::is_none")]
4857    pub failure_class: Option<MaintenanceFailureClass>,
4858    #[serde(default, skip_serializing_if = "Option::is_none")]
4859    pub failure_code: Option<String>,
4860    pub operator_action_required: bool,
4861    #[serde(default, skip_serializing_if = "Option::is_none")]
4862    pub local_attempt: Option<MaintenanceAttemptObservation>,
4863}
4864
4865pub const LODESTONE_API_MAINTENANCE_STATUS_AGGREGATE_SHAPE_VERSION: u16 = 1;
4866pub const LODESTONE_API_MAINTENANCE_STATUS_AGGREGATE_FORMAT_VERSION: u16 = 2;
4867#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
4868#[serde(deny_unknown_fields)]
4869pub struct MaintenanceStatusAggregate {
4870    pub format_version: u32,
4871    pub recovery_era: Identity,
4872    pub source_revision: U64,
4873    pub root_revision: U64,
4874    pub logical_observation_time: U64,
4875    #[serde(default, skip_serializing_if = "Option::is_none")]
4876    pub local_observation_millis: Option<U64>,
4877    pub total_incomplete: U64,
4878    pub parked_operator_required: U64,
4879    pub retry_wait: U64,
4880    pub retry_ready: U64,
4881    pub leased: U64,
4882    pub deferred: U64,
4883    pub runnable: U64,
4884    pub eligible_backlog: U64,
4885    pub cancellation_requested: U64,
4886    #[serde(default, skip_serializing_if = "Option::is_none")]
4887    pub oldest_backlog_age: Option<U64>,
4888    #[serde(default, skip_serializing_if = "Option::is_none")]
4889    pub oldest_runnable_age: Option<U64>,
4890    #[serde(default, skip_serializing_if = "Option::is_none")]
4891    pub oldest_retry_wait_age: Option<U64>,
4892    #[serde(default, skip_serializing_if = "Option::is_none")]
4893    pub oldest_parked_age: Option<U64>,
4894    #[serde(default, skip_serializing_if = "Option::is_none")]
4895    pub oldest_no_progress_age: Option<U64>,
4896    pub current_action_capacity: u32,
4897    pub maximum_action_capacity: u32,
4898    pub active_passes: U64,
4899    pub local_in_flight: U64,
4900    pub deadline_draining: U64,
4901    pub cancellation_draining: U64,
4902    pub claim_recovery_pending: U64,
4903    pub projection_refresh_pending: bool,
4904    #[serde(default, skip_serializing_if = "Option::is_none")]
4905    pub durable_last_progress_at: Option<U64>,
4906    pub tasks_claimed_total: U64,
4907    pub tasks_progressed_total: U64,
4908    pub tasks_completed_total: U64,
4909    pub task_retries_total: U64,
4910    pub task_failures_total: U64,
4911    pub deadline_failures_total: U64,
4912    pub cancellations_total: U64,
4913    pub overlay_capacity_exhaustions_total: U64,
4914    pub failure_classes: Vec<MaintenanceFailureClassCount>,
4915}
4916
4917pub const LODESTONE_API_RUNTIME_STATUS_DETAIL_FORMAT_VERSION: u16 = 1;
4918#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
4919#[serde(deny_unknown_fields)]
4920pub struct RuntimeStatusDetail {
4921    pub metastore_revision: U64,
4922    pub root_revision: U64,
4923    pub logical_time: U64,
4924    pub degraded_dependencies: Vec<String>,
4925}
4926
4927pub const LODESTONE_API_RESULT_CACHE_STATUS_SHAPE_VERSION: u16 = 2;
4928pub const LODESTONE_API_RESULT_CACHE_STATUS_FORMAT_VERSION: u16 = 3;
4929#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
4930#[serde(deny_unknown_fields)]
4931pub struct ResultCacheStatus {
4932    pub format_version: u32,
4933    pub hits: U64,
4934    pub misses: U64,
4935    pub admissions: U64,
4936    pub bypasses: U64,
4937    pub evictions: U64,
4938    pub collection_bytes: U64,
4939    pub collection_entries: u32,
4940}
4941
4942pub const LODESTONE_API_FIELD_PROMOTION_STATUS_SHAPE_VERSION: u16 = 1;
4943pub const LODESTONE_API_FIELD_PROMOTION_STATUS_FORMAT_VERSION: u16 = 3;
4944#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
4945#[serde(deny_unknown_fields)]
4946pub struct FieldPromotionStatus {
4947    pub format_version: u32,
4948    pub index: Resource,
4949    pub mapping_generation: U64,
4950    pub policy_generation: U64,
4951    #[serde(default, skip_serializing_if = "Option::is_none")]
4952    pub last_decision_generation: Option<U64>,
4953    pub heat_records: u32,
4954    pub promoted_fields: u32,
4955    pub extra_bytes: U64,
4956    pub enabled: bool,
4957}
4958
4959pub const LODESTONE_API_OVERLOAD_SHARD_STATUS_SHAPE_VERSION: u16 = 2;
4960pub const LODESTONE_API_OVERLOAD_SHARD_STATUS_FORMAT_VERSION: u16 = 3;
4961#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
4962#[serde(deny_unknown_fields)]
4963pub struct OverloadShardStatus {
4964    pub format_version: u32,
4965    pub shard_id: u32,
4966    pub writer_epoch: U64,
4967    pub configured_mode: String,
4968    pub effective_disposition: String,
4969    pub registered_through: U64,
4970    pub indexed_through: U64,
4971    pub lag_operations: U64,
4972    pub backlog_bytes: U64,
4973    pub oldest_age_millis: U64,
4974    pub collection_share_bytes: U64,
4975    pub recovery_ops_this_pass: u32,
4976    pub pending_overlay_documents: U64,
4977    #[serde(default, skip_serializing_if = "Option::is_none")]
4978    pub shed_reason: Option<String>,
4979}
4980
4981pub const LODESTONE_API_EXTERNAL_KEY_BINDING_FORMAT_VERSION: u16 = 1;
4982#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
4983#[serde(deny_unknown_fields)]
4984pub struct ExternalKeyBinding {
4985    pub content_key_id: Identity,
4986    pub content_key_generation: U64,
4987    pub binding_id: Identity,
4988    pub binding_generation: U64,
4989    pub access_generation: U64,
4990    pub opaque_binding_base64: String,
4991    pub object_context_digest: Digest,
4992}
4993
4994pub const LODESTONE_API_ROLLUP_MEASURE_FORMAT_VERSION: u16 = 1;
4995#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
4996#[serde(tag = "kind", rename_all = "snake_case", deny_unknown_fields)]
4997pub enum RollupMeasure {
4998    Count,
4999    Sum { field_path_digest: Digest },
5000    Min { field_path_digest: Digest },
5001    Max { field_path_digest: Digest },
5002}
5003
5004pub const LODESTONE_API_AGGREGATE_THEN_DELETE_POLICY_FORMAT_VERSION: u16 = 1;
5005#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
5006#[serde(deny_unknown_fields)]
5007pub struct AggregateThenDeletePolicy {
5008    pub policy_id: Identity,
5009    pub policy_generation: U64,
5010    pub detail_retirement_acknowledged: bool,
5011    #[serde(default, skip_serializing_if = "Option::is_none")]
5012    pub expected_policy_generation: Option<U64>,
5013    pub timestamp_field_digest: Digest,
5014    pub bucket_width_millis: U64,
5015    pub bucket_alignment_millis: U64,
5016    pub dimensions: Vec<Digest>,
5017    pub measures: Vec<RollupMeasure>,
5018}
5019
5020pub const LODESTONE_API_LIFECYCLE_BINDING_STATUS_FORMAT_VERSION: u16 = 1;
5021#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
5022#[serde(deny_unknown_fields)]
5023pub struct LifecycleBindingStatus {
5024    pub content_key_id: Identity,
5025    pub content_key_generation: U64,
5026    pub binding_id: Identity,
5027    pub binding_generation: U64,
5028    pub access_generation: U64,
5029}
5030
5031pub const LODESTONE_API_LIFECYCLE_ROLLUP_STATUS_FORMAT_VERSION: u16 = 1;
5032#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
5033#[serde(deny_unknown_fields)]
5034pub struct LifecycleRollupStatus {
5035    pub policy_id: Identity,
5036    pub policy_generation: U64,
5037    pub ledger_revision: U64,
5038    pub coverages: u32,
5039    pub raw_retired_coverages: u32,
5040    pub detail_retirement_acknowledged: bool,
5041    pub query_contract_version: u32,
5042    pub timestamp_field_digest: Digest,
5043    pub bucket_width_millis: U64,
5044    pub bucket_alignment_millis: U64,
5045    pub dimensions: Vec<Digest>,
5046    pub measures: Vec<RollupMeasure>,
5047}
5048
5049pub const LODESTONE_API_LIFECYCLE_STATUS_SHAPE_VERSION: u16 = 2;
5050pub const LODESTONE_API_LIFECYCLE_STATUS_FORMAT_VERSION: u16 = 4;
5051#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
5052#[serde(deny_unknown_fields)]
5053pub struct LifecycleStatus {
5054    pub format_version: u32,
5055    pub index: Resource,
5056    pub authority_revision: U64,
5057    pub active_bindings: Vec<LifecycleBindingStatus>,
5058    #[serde(default, skip_serializing_if = "Option::is_none")]
5059    pub rollup: Option<LifecycleRollupStatus>,
5060}
5061
5062pub const LODESTONE_API_QUOTA_LIMIT_FORMAT_VERSION: u16 = 1;
5063#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
5064#[serde(deny_unknown_fields)]
5065pub struct QuotaLimit {
5066    pub dimension: String,
5067    pub maximum: U64,
5068    pub window_millis: U64,
5069}
5070
5071pub const LODESTONE_API_QUOTA_CONSUMPTION_FORMAT_VERSION: u16 = 1;
5072#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
5073#[serde(deny_unknown_fields)]
5074pub struct QuotaConsumption {
5075    pub dimension: String,
5076    pub consumed: U64,
5077    pub window_millis: U64,
5078}
5079
5080pub const LODESTONE_API_QUOTA_UPDATE_FORMAT_VERSION: u16 = 1;
5081#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
5082#[serde(deny_unknown_fields)]
5083pub struct QuotaUpdate {
5084    pub revision: U64,
5085    pub state: String,
5086}
5087
5088pub const LODESTONE_API_STORAGE_OVERALL_POSTURE_FORMAT_VERSION: u16 = 1;
5089#[derive(Clone, Copy, Debug, Deserialize, Eq, PartialEq, Serialize)]
5090#[serde(rename_all = "snake_case")]
5091pub enum StorageOverallPosture {
5092    FilesystemDevelopment,
5093    ProviderObjectStorage,
5094    S3CompatibleDevelopment,
5095    Mixed,
5096}
5097
5098pub const LODESTONE_API_STORAGE_PROFILE_ROLE_FORMAT_VERSION: u16 = 1;
5099#[derive(Clone, Copy, Debug, Deserialize, Eq, PartialEq, Serialize)]
5100#[serde(rename_all = "snake_case")]
5101pub enum StorageProfileRole {
5102    Control,
5103    DefaultWal,
5104    DefaultData,
5105}
5106
5107pub const LODESTONE_API_STORAGE_PROVIDER_POSTURE_FORMAT_VERSION: u16 = 1;
5108#[derive(Clone, Copy, Debug, Deserialize, Eq, PartialEq, Serialize)]
5109#[serde(rename_all = "snake_case")]
5110pub enum StorageProviderPosture {
5111    Aws,
5112    GoogleCloudStorage,
5113    AzureBlob,
5114    S3CompatibleDevelopment,
5115    FilesystemDevelopment,
5116}
5117
5118pub const LODESTONE_API_STORAGE_BACKEND_SERVICE_CLASS_FORMAT_VERSION: u16 = 1;
5119#[derive(Clone, Copy, Debug, Deserialize, Eq, PartialEq, Serialize)]
5120#[serde(rename_all = "snake_case")]
5121pub enum StorageBackendServiceClass {
5122    RegionalObject,
5123    ZonalLowLatency,
5124}
5125
5126pub const LODESTONE_API_STORAGE_PROFILE_ROLE_BINDING_FORMAT_VERSION: u16 = 1;
5127#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
5128#[serde(deny_unknown_fields)]
5129pub struct StorageProfileRoleBinding {
5130    pub role: StorageProfileRole,
5131    pub authority_group: u32,
5132    pub provider: StorageProviderPosture,
5133    pub service_class: StorageBackendServiceClass,
5134}
5135
5136pub const LODESTONE_API_STORAGE_PROFILE_ATTESTATION_SHAPE_VERSION: u16 = 1;
5137pub const LODESTONE_API_STORAGE_PROFILE_ATTESTATION_FORMAT_VERSION: u16 = 1;
5138#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
5139#[serde(deny_unknown_fields)]
5140pub struct StorageProfileAttestation {
5141    pub format_version: u32,
5142    pub configuration_generation: U64,
5143    pub overall_posture: StorageOverallPosture,
5144    pub roles: Vec<StorageProfileRoleBinding>,
5145    pub default_durability: ResourceDurabilityClass,
5146    pub default_storage: ResourceStorageClass,
5147    pub default_policy_digest: Digest,
5148    pub storage_profile_digest: Digest,
5149    pub attestation_digest: Digest,
5150}
5151
5152pub const LODESTONE_API_STORAGE_PROFILE_EXPECTATION_SHAPE_VERSION: u16 = 1;
5153pub const LODESTONE_API_STORAGE_PROFILE_EXPECTATION_FORMAT_VERSION: u16 = 1;
5154#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
5155#[serde(deny_unknown_fields)]
5156pub struct StorageProfileExpectation {
5157    pub format_version: u32,
5158    #[serde(default, skip_serializing_if = "Option::is_none")]
5159    pub required_posture: Option<StorageOverallPosture>,
5160    #[serde(default, skip_serializing_if = "Option::is_none")]
5161    pub expected_storage_profile_digest: Option<Digest>,
5162}
5163
5164pub const LODESTONE_API_CORE_BINDING_FORMAT_VERSION: u16 = 3;
5165#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
5166#[serde(deny_unknown_fields)]
5167pub struct CoreBinding {
5168    pub cluster_id: Identity,
5169    pub collection_id: Identity,
5170    pub configuration_generation: U64,
5171    pub native_endpoints: Vec<String>,
5172    pub selected_stream_endpoint: String,
5173    pub schema_id: String,
5174    pub schema_digest: Digest,
5175    pub storage_profile: StorageProfileAttestation,
5176}
5177
5178pub const LODESTONE_API_READINESS_OBSERVATION_FORMAT_VERSION: u16 = 1;
5179#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
5180#[serde(deny_unknown_fields)]
5181pub struct ReadinessObservation {
5182    pub subject: String,
5183    pub state: String,
5184    #[serde(default, skip_serializing_if = "Option::is_none")]
5185    pub reason: Option<String>,
5186    pub revision: U64,
5187    pub observed_cut: U64,
5188}
5189
5190pub const LODESTONE_API_USAGE_DIMENSION_FORMAT_VERSION: u16 = 1;
5191#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
5192#[serde(deny_unknown_fields)]
5193pub struct UsageDimension {
5194    pub name: String,
5195    pub value: String,
5196}
5197
5198pub const LODESTONE_API_PHYSICAL_USAGE_VALUE_FORMAT_VERSION: u16 = 2;
5199#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
5200#[serde(deny_unknown_fields)]
5201pub struct PhysicalUsageValue {
5202    pub meter: String,
5203    pub unit: String,
5204    pub value: ExactDecimal,
5205}
5206
5207pub const LODESTONE_API_CORE_USAGE_UNITS_FORMAT_VERSION: u16 = 2;
5208#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
5209#[serde(deny_unknown_fields)]
5210pub struct CoreUsageUnits {
5211    pub sequence: U64,
5212    pub record_identity: Digest,
5213    pub index_id: Identity,
5214    pub workload_class: WorkloadClass,
5215    pub window_start: U64,
5216    pub window_end: U64,
5217    pub meter_set_version: u32,
5218    pub dimensions: Vec<UsageDimension>,
5219    pub values: Vec<PhysicalUsageValue>,
5220    pub authority_revision: U64,
5221    pub source_digest: Digest,
5222}
5223
5224pub const LODESTONE_API_CORE_USAGE_CORRECTION_FORMAT_VERSION: u16 = 2;
5225#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
5226#[serde(deny_unknown_fields)]
5227pub struct CoreUsageCorrection {
5228    pub sequence: U64,
5229    pub correction_sequence: U64,
5230    pub correction_identity: Digest,
5231    pub target_record_identity: Digest,
5232    pub index_id: Identity,
5233    pub workload_class: WorkloadClass,
5234    pub window_start: U64,
5235    pub window_end: U64,
5236    pub meter_set_version: u32,
5237    pub dimensions: Vec<UsageDimension>,
5238    pub values: Vec<PhysicalUsageValue>,
5239    pub reason_digest: Digest,
5240    pub authority_revision: U64,
5241    pub source_digest: Digest,
5242}
5243
5244pub const LODESTONE_API_RESPONSE_META_SHAPE_VERSION: u16 = 1;
5245pub const LODESTONE_API_RESPONSE_META_FORMAT_VERSION: u16 = 1;
5246#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
5247#[serde(deny_unknown_fields)]
5248pub struct ResponseMeta {
5249    pub format_version: u32,
5250    pub request_id: String,
5251    pub correlation_id: Identity,
5252    pub diagnostic_id: Identity,
5253}
5254
5255pub const LODESTONE_API_ERROR_DISPOSITION_FORMAT_VERSION: u16 = 1;
5256#[derive(Clone, Copy, Debug, Deserialize, Eq, PartialEq, Serialize)]
5257#[serde(rename_all = "snake_case")]
5258pub enum ErrorDisposition {
5259    NotSubmitted,
5260    Submitted,
5261    Resolved,
5262    KnownRetired,
5263    Indeterminate,
5264}
5265
5266pub const LODESTONE_API_RECOVERY_ACTION_FORMAT_VERSION: u16 = 1;
5267#[derive(Clone, Copy, Debug, Deserialize, Eq, PartialEq, Serialize)]
5268#[serde(rename_all = "snake_case")]
5269pub enum RecoveryAction {
5270    Retry,
5271    RetryAfter,
5272    RefreshCredential,
5273    RestartPage,
5274    ReduceRequest,
5275    Resolve,
5276    RefreshPrecondition,
5277    CorrectRange,
5278    Stop,
5279}
5280
5281pub const LODESTONE_API_LIMIT_CLASS_FORMAT_VERSION: u16 = 1;
5282#[derive(Clone, Copy, Debug, Deserialize, Eq, PartialEq, Serialize)]
5283#[serde(rename_all = "snake_case")]
5284pub enum LimitClass {
5285    RequestBound,
5286    CollectionQuota,
5287    EngineSafety,
5288}
5289
5290pub const LODESTONE_API_ERROR_DETAIL_FORMAT_VERSION: u16 = 3;
5291#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
5292#[serde(tag = "code", rename_all = "snake_case", deny_unknown_fields)]
5293pub enum ErrorDetail {
5294    Aborted {
5295        reason: String,
5296    },
5297    DeadlineExceeded,
5298    InvalidRequest {
5299        #[serde(default, skip_serializing_if = "Option::is_none")]
5300        field: Option<String>,
5301        reason: String,
5302    },
5303    UnsupportedVersion {
5304        observed: u32,
5305        maximum_supported: u32,
5306    },
5307    Unauthenticated,
5308    PermissionDenied {
5309        #[serde(default, skip_serializing_if = "Option::is_none")]
5310        action: Option<String>,
5311        #[serde(default, skip_serializing_if = "Option::is_none")]
5312        workload_class: Option<WorkloadClass>,
5313    },
5314    NotFound {
5315        #[serde(default, skip_serializing_if = "Option::is_none")]
5316        resource: Option<String>,
5317    },
5318    Conflict {
5319        #[serde(default, skip_serializing_if = "Option::is_none")]
5320        expected_revision: Option<U64>,
5321        #[serde(default, skip_serializing_if = "Option::is_none")]
5322        observed_revision: Option<U64>,
5323    },
5324    StaleCursor {
5325        restart_count: u32,
5326    },
5327    RestartBudgetExhausted {
5328        maximum_restarts: u32,
5329    },
5330    LimitExceeded {
5331        class: LimitClass,
5332        limit_id: String,
5333        maximum: U64,
5334    },
5335    CapabilityUnavailable {
5336        #[serde(default, skip_serializing_if = "Option::is_none")]
5337        capability: Option<String>,
5338    },
5339    NotSubmitted {
5340        #[serde(default, skip_serializing_if = "Option::is_none")]
5341        retry_after_millis: Option<U64>,
5342    },
5343    SubmittedIndeterminate {
5344        #[serde(default, skip_serializing_if = "Option::is_none")]
5345        locator: Option<Locator>,
5346    },
5347    ExpiredUnknown {
5348        #[serde(default, skip_serializing_if = "Option::is_none")]
5349        locator: Option<Locator>,
5350    },
5351    SecretNotEscrowed,
5352    RetentionGap {
5353        retired_through: U64,
5354    },
5355    ArtifactRangeInvalid {
5356        maximum_bytes: U64,
5357    },
5358    ChecksumMismatch {
5359        expected: Digest,
5360        observed: Digest,
5361    },
5362    TemporarilyUnavailable {
5363        #[serde(default, skip_serializing_if = "Option::is_none")]
5364        retry_after_millis: Option<U64>,
5365    },
5366    Internal,
5367}
5368
5369pub const LODESTONE_API_CONNECTION_PROFILE_SHAPE_VERSION: u16 = 4;
5370pub const LODESTONE_API_CONNECTION_PROFILE_FORMAT_VERSION: u16 = 4;
5371#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
5372#[serde(deny_unknown_fields)]
5373pub struct ConnectionProfile {
5374    pub format_version: u32,
5375    pub profile_generation: U64,
5376    pub native_endpoints: Vec<String>,
5377    pub selected_stream_endpoint: String,
5378    pub tls_server_name: String,
5379    pub tls_trust_sha256: Digest,
5380    pub expected_cluster_id: Identity,
5381    pub expected_collection_id: Identity,
5382    pub expected_principal_id: Identity,
5383    pub schema_id: String,
5384    pub schema_digest: Digest,
5385    pub credential_id: Identity,
5386    pub credential_generation: U64,
5387    #[serde(default, skip_serializing_if = "Option::is_none")]
5388    pub credential_expires_at: Option<U64>,
5389    pub secret_reference: String,
5390    #[serde(default, skip_serializing_if = "Option::is_none")]
5391    pub storage_profile_expectation: Option<StorageProfileExpectation>,
5392}
5393
5394#[derive(Clone, Copy, Debug, Eq, PartialEq)]
5395pub enum TypeKind {
5396    Enum,
5397    Struct,
5398    TaggedUnion,
5399}
5400#[derive(Clone, Copy, Debug, Eq, PartialEq)]
5401pub struct TypeContract {
5402    pub name: &'static str,
5403    pub shape_version: u16,
5404    pub instance_format_version: Option<u16>,
5405    pub kind: TypeKind,
5406    pub wire: bool,
5407}
5408pub const LODESTONE_API_TYPE_CONTRACTS: &[TypeContract] = &[
5409    TypeContract {
5410        name: "cursor",
5411        shape_version: 1,
5412        instance_format_version: None,
5413        kind: TypeKind::Struct,
5414        wire: true,
5415    },
5416    TypeContract {
5417        name: "locator",
5418        shape_version: 1,
5419        instance_format_version: None,
5420        kind: TypeKind::Struct,
5421        wire: true,
5422    },
5423    TypeContract {
5424        name: "resource",
5425        shape_version: 1,
5426        instance_format_version: None,
5427        kind: TypeKind::Struct,
5428        wire: true,
5429    },
5430    TypeContract {
5431        name: "field_promotion_configuration",
5432        shape_version: 1,
5433        instance_format_version: Some(3),
5434        kind: TypeKind::Struct,
5435        wire: true,
5436    },
5437    TypeContract {
5438        name: "overload_configuration",
5439        shape_version: 2,
5440        instance_format_version: Some(3),
5441        kind: TypeKind::Struct,
5442        wire: true,
5443    },
5444    TypeContract {
5445        name: "index_policies",
5446        shape_version: 1,
5447        instance_format_version: None,
5448        kind: TypeKind::Struct,
5449        wire: true,
5450    },
5451    TypeContract {
5452        name: "maintenance_budgets",
5453        shape_version: 1,
5454        instance_format_version: None,
5455        kind: TypeKind::Struct,
5456        wire: true,
5457    },
5458    TypeContract {
5459        name: "resource_durability_class",
5460        shape_version: 1,
5461        instance_format_version: None,
5462        kind: TypeKind::Enum,
5463        wire: true,
5464    },
5465    TypeContract {
5466        name: "resource_storage_class",
5467        shape_version: 1,
5468        instance_format_version: None,
5469        kind: TypeKind::Enum,
5470        wire: true,
5471    },
5472    TypeContract {
5473        name: "vector_quality_objective",
5474        shape_version: 1,
5475        instance_format_version: None,
5476        kind: TypeKind::Enum,
5477        wire: true,
5478    },
5479    TypeContract {
5480        name: "vector_indexing_objective",
5481        shape_version: 1,
5482        instance_format_version: None,
5483        kind: TypeKind::Enum,
5484        wire: true,
5485    },
5486    TypeContract {
5487        name: "vector_residency_intent",
5488        shape_version: 1,
5489        instance_format_version: None,
5490        kind: TypeKind::Enum,
5491        wire: true,
5492    },
5493    TypeContract {
5494        name: "vector_calibration_binding",
5495        shape_version: 1,
5496        instance_format_version: None,
5497        kind: TypeKind::Struct,
5498        wire: true,
5499    },
5500    TypeContract {
5501        name: "vector_resource_policy",
5502        shape_version: 2,
5503        instance_format_version: None,
5504        kind: TypeKind::Struct,
5505        wire: true,
5506    },
5507    TypeContract {
5508        name: "workload_class",
5509        shape_version: 1,
5510        instance_format_version: None,
5511        kind: TypeKind::Enum,
5512        wire: true,
5513    },
5514    TypeContract {
5515        name: "index_resource_spec",
5516        shape_version: 3,
5517        instance_format_version: Some(3),
5518        kind: TypeKind::Struct,
5519        wire: true,
5520    },
5521    TypeContract {
5522        name: "index_summary",
5523        shape_version: 1,
5524        instance_format_version: None,
5525        kind: TypeKind::Struct,
5526        wire: true,
5527    },
5528    TypeContract {
5529        name: "mapping_mode",
5530        shape_version: 1,
5531        instance_format_version: None,
5532        kind: TypeKind::Enum,
5533        wire: true,
5534    },
5535    TypeContract {
5536        name: "dynamic_mapping_policy",
5537        shape_version: 1,
5538        instance_format_version: None,
5539        kind: TypeKind::Enum,
5540        wire: true,
5541    },
5542    TypeContract {
5543        name: "mapping_analyzer",
5544        shape_version: 1,
5545        instance_format_version: None,
5546        kind: TypeKind::Enum,
5547        wire: true,
5548    },
5549    TypeContract {
5550        name: "keyword_normalizer",
5551        shape_version: 1,
5552        instance_format_version: None,
5553        kind: TypeKind::Enum,
5554        wire: true,
5555    },
5556    TypeContract {
5557        name: "vector_metric",
5558        shape_version: 1,
5559        instance_format_version: None,
5560        kind: TypeKind::Enum,
5561        wire: true,
5562    },
5563    TypeContract {
5564        name: "mapping_scalar",
5565        shape_version: 1,
5566        instance_format_version: None,
5567        kind: TypeKind::TaggedUnion,
5568        wire: true,
5569    },
5570    TypeContract {
5571        name: "sparse_vector_weight_type",
5572        shape_version: 1,
5573        instance_format_version: None,
5574        kind: TypeKind::Enum,
5575        wire: true,
5576    },
5577    TypeContract {
5578        name: "mapping_field_type",
5579        shape_version: 3,
5580        instance_format_version: None,
5581        kind: TypeKind::TaggedUnion,
5582        wire: true,
5583    },
5584    TypeContract {
5585        name: "mapping_field",
5586        shape_version: 1,
5587        instance_format_version: None,
5588        kind: TypeKind::Struct,
5589        wire: true,
5590    },
5591    TypeContract {
5592        name: "multi_field_projection",
5593        shape_version: 1,
5594        instance_format_version: None,
5595        kind: TypeKind::Struct,
5596        wire: true,
5597    },
5598    TypeContract {
5599        name: "analyzer_identity",
5600        shape_version: 1,
5601        instance_format_version: None,
5602        kind: TypeKind::Struct,
5603        wire: true,
5604    },
5605    TypeContract {
5606        name: "keyword_limit",
5607        shape_version: 1,
5608        instance_format_version: None,
5609        kind: TypeKind::Struct,
5610        wire: true,
5611    },
5612    TypeContract {
5613        name: "profile_privacy_action",
5614        shape_version: 1,
5615        instance_format_version: None,
5616        kind: TypeKind::Enum,
5617        wire: true,
5618    },
5619    TypeContract {
5620        name: "profile_privacy_field",
5621        shape_version: 1,
5622        instance_format_version: None,
5623        kind: TypeKind::TaggedUnion,
5624        wire: true,
5625    },
5626    TypeContract {
5627        name: "profile_privacy_rule",
5628        shape_version: 1,
5629        instance_format_version: None,
5630        kind: TypeKind::Struct,
5631        wire: true,
5632    },
5633    TypeContract {
5634        name: "profile_privacy_policy",
5635        shape_version: 1,
5636        instance_format_version: Some(1),
5637        kind: TypeKind::Struct,
5638        wire: true,
5639    },
5640    TypeContract {
5641        name: "mapping_record_model",
5642        shape_version: 3,
5643        instance_format_version: None,
5644        kind: TypeKind::TaggedUnion,
5645        wire: true,
5646    },
5647    TypeContract {
5648        name: "mapping",
5649        shape_version: 4,
5650        instance_format_version: Some(10),
5651        kind: TypeKind::Struct,
5652        wire: true,
5653    },
5654    TypeContract {
5655        name: "index_detail",
5656        shape_version: 1,
5657        instance_format_version: None,
5658        kind: TypeKind::Struct,
5659        wire: true,
5660    },
5661    TypeContract {
5662        name: "source_provider",
5663        shape_version: 1,
5664        instance_format_version: None,
5665        kind: TypeKind::Enum,
5666        wire: true,
5667    },
5668    TypeContract {
5669        name: "source_decoder",
5670        shape_version: 1,
5671        instance_format_version: None,
5672        kind: TypeKind::Enum,
5673        wire: true,
5674    },
5675    TypeContract {
5676        name: "source_replay_guarantees",
5677        shape_version: 1,
5678        instance_format_version: None,
5679        kind: TypeKind::Struct,
5680        wire: true,
5681    },
5682    TypeContract {
5683        name: "source_partition_configuration",
5684        shape_version: 1,
5685        instance_format_version: None,
5686        kind: TypeKind::Struct,
5687        wire: true,
5688    },
5689    TypeContract {
5690        name: "replayable_source_configuration",
5691        shape_version: 1,
5692        instance_format_version: None,
5693        kind: TypeKind::Struct,
5694        wire: true,
5695    },
5696    TypeContract {
5697        name: "source_partition_status",
5698        shape_version: 1,
5699        instance_format_version: None,
5700        kind: TypeKind::Struct,
5701        wire: true,
5702    },
5703    TypeContract {
5704        name: "replayable_source_status",
5705        shape_version: 1,
5706        instance_format_version: None,
5707        kind: TypeKind::Struct,
5708        wire: true,
5709    },
5710    TypeContract {
5711        name: "source_control_transition",
5712        shape_version: 1,
5713        instance_format_version: None,
5714        kind: TypeKind::Enum,
5715        wire: true,
5716    },
5717    TypeContract {
5718        name: "history_ledger_precondition",
5719        shape_version: 1,
5720        instance_format_version: None,
5721        kind: TypeKind::TaggedUnion,
5722        wire: true,
5723    },
5724    TypeContract {
5725        name: "history_retention_policy",
5726        shape_version: 1,
5727        instance_format_version: None,
5728        kind: TypeKind::Struct,
5729        wire: true,
5730    },
5731    TypeContract {
5732        name: "history_selector",
5733        shape_version: 1,
5734        instance_format_version: None,
5735        kind: TypeKind::TaggedUnion,
5736        wire: true,
5737    },
5738    TypeContract {
5739        name: "history_hold",
5740        shape_version: 1,
5741        instance_format_version: None,
5742        kind: TypeKind::Struct,
5743        wire: true,
5744    },
5745    TypeContract {
5746        name: "history_status",
5747        shape_version: 1,
5748        instance_format_version: None,
5749        kind: TypeKind::Struct,
5750        wire: true,
5751    },
5752    TypeContract {
5753        name: "history_resolution",
5754        shape_version: 1,
5755        instance_format_version: None,
5756        kind: TypeKind::Struct,
5757        wire: true,
5758    },
5759    TypeContract {
5760        name: "index_reference",
5761        shape_version: 1,
5762        instance_format_version: None,
5763        kind: TypeKind::Struct,
5764        wire: true,
5765    },
5766    TypeContract {
5767        name: "alias_target",
5768        shape_version: 1,
5769        instance_format_version: None,
5770        kind: TypeKind::Struct,
5771        wire: true,
5772    },
5773    TypeContract {
5774        name: "alias_summary",
5775        shape_version: 1,
5776        instance_format_version: None,
5777        kind: TypeKind::Struct,
5778        wire: true,
5779    },
5780    TypeContract {
5781        name: "alias_detail",
5782        shape_version: 1,
5783        instance_format_version: None,
5784        kind: TypeKind::Struct,
5785        wire: true,
5786    },
5787    TypeContract {
5788        name: "data_stream_summary",
5789        shape_version: 1,
5790        instance_format_version: None,
5791        kind: TypeKind::Struct,
5792        wire: true,
5793    },
5794    TypeContract {
5795        name: "component_template_binding",
5796        shape_version: 1,
5797        instance_format_version: None,
5798        kind: TypeKind::Struct,
5799        wire: true,
5800    },
5801    TypeContract {
5802        name: "index_template_binding",
5803        shape_version: 1,
5804        instance_format_version: None,
5805        kind: TypeKind::Struct,
5806        wire: true,
5807    },
5808    TypeContract {
5809        name: "lifecycle_policy_binding",
5810        shape_version: 1,
5811        instance_format_version: None,
5812        kind: TypeKind::Struct,
5813        wire: true,
5814    },
5815    TypeContract {
5816        name: "data_stream_detail",
5817        shape_version: 1,
5818        instance_format_version: None,
5819        kind: TypeKind::Struct,
5820        wire: true,
5821    },
5822    TypeContract {
5823        name: "component_template_summary",
5824        shape_version: 1,
5825        instance_format_version: None,
5826        kind: TypeKind::Struct,
5827        wire: true,
5828    },
5829    TypeContract {
5830        name: "component_template_detail",
5831        shape_version: 1,
5832        instance_format_version: None,
5833        kind: TypeKind::Struct,
5834        wire: true,
5835    },
5836    TypeContract {
5837        name: "index_template_summary",
5838        shape_version: 1,
5839        instance_format_version: None,
5840        kind: TypeKind::Struct,
5841        wire: true,
5842    },
5843    TypeContract {
5844        name: "index_template_detail",
5845        shape_version: 1,
5846        instance_format_version: None,
5847        kind: TypeKind::Struct,
5848        wire: true,
5849    },
5850    TypeContract {
5851        name: "ingest_pipeline_summary",
5852        shape_version: 1,
5853        instance_format_version: None,
5854        kind: TypeKind::Struct,
5855        wire: true,
5856    },
5857    TypeContract {
5858        name: "ingest_pipeline_detail",
5859        shape_version: 1,
5860        instance_format_version: None,
5861        kind: TypeKind::Struct,
5862        wire: true,
5863    },
5864    TypeContract {
5865        name: "ingest_pipeline_selection",
5866        shape_version: 1,
5867        instance_format_version: None,
5868        kind: TypeKind::Struct,
5869        wire: true,
5870    },
5871    TypeContract {
5872        name: "lifecycle_policy_summary",
5873        shape_version: 1,
5874        instance_format_version: None,
5875        kind: TypeKind::Struct,
5876        wire: true,
5877    },
5878    TypeContract {
5879        name: "rollover_thresholds",
5880        shape_version: 1,
5881        instance_format_version: None,
5882        kind: TypeKind::Struct,
5883        wire: true,
5884    },
5885    TypeContract {
5886        name: "retention_policy",
5887        shape_version: 1,
5888        instance_format_version: None,
5889        kind: TypeKind::Struct,
5890        wire: true,
5891    },
5892    TypeContract {
5893        name: "lifecycle_policy_detail",
5894        shape_version: 1,
5895        instance_format_version: None,
5896        kind: TypeKind::Struct,
5897        wire: true,
5898    },
5899    TypeContract {
5900        name: "text_query_operator",
5901        shape_version: 1,
5902        instance_format_version: None,
5903        kind: TypeKind::Enum,
5904        wire: true,
5905    },
5906    TypeContract {
5907        name: "text_query_analyzer",
5908        shape_version: 1,
5909        instance_format_version: None,
5910        kind: TypeKind::Enum,
5911        wire: true,
5912    },
5913    TypeContract {
5914        name: "zero_terms_query",
5915        shape_version: 1,
5916        instance_format_version: None,
5917        kind: TypeKind::Enum,
5918        wire: true,
5919    },
5920    TypeContract {
5921        name: "text_query_options",
5922        shape_version: 1,
5923        instance_format_version: None,
5924        kind: TypeKind::Struct,
5925        wire: true,
5926    },
5927    TypeContract {
5928        name: "multi_match_mode",
5929        shape_version: 1,
5930        instance_format_version: None,
5931        kind: TypeKind::Enum,
5932        wire: true,
5933    },
5934    TypeContract {
5935        name: "multi_match_field",
5936        shape_version: 1,
5937        instance_format_version: None,
5938        kind: TypeKind::Struct,
5939        wire: true,
5940    },
5941    TypeContract {
5942        name: "multi_match_options",
5943        shape_version: 1,
5944        instance_format_version: None,
5945        kind: TypeKind::Struct,
5946        wire: true,
5947    },
5948    TypeContract {
5949        name: "sort_order",
5950        shape_version: 1,
5951        instance_format_version: None,
5952        kind: TypeKind::Enum,
5953        wire: true,
5954    },
5955    TypeContract {
5956        name: "sort_mode",
5957        shape_version: 1,
5958        instance_format_version: None,
5959        kind: TypeKind::Enum,
5960        wire: true,
5961    },
5962    TypeContract {
5963        name: "missing_order",
5964        shape_version: 1,
5965        instance_format_version: None,
5966        kind: TypeKind::Enum,
5967        wire: true,
5968    },
5969    TypeContract {
5970        name: "nested_score_mode",
5971        shape_version: 1,
5972        instance_format_version: None,
5973        kind: TypeKind::Enum,
5974        wire: true,
5975    },
5976    TypeContract {
5977        name: "nested_inner_hits",
5978        shape_version: 1,
5979        instance_format_version: None,
5980        kind: TypeKind::Struct,
5981        wire: true,
5982    },
5983    TypeContract {
5984        name: "sort_spec",
5985        shape_version: 1,
5986        instance_format_version: None,
5987        kind: TypeKind::TaggedUnion,
5988        wire: true,
5989    },
5990    TypeContract {
5991        name: "query",
5992        shape_version: 1,
5993        instance_format_version: None,
5994        kind: TypeKind::TaggedUnion,
5995        wire: true,
5996    },
5997    TypeContract {
5998        name: "dense_retrieval_mode",
5999        shape_version: 1,
6000        instance_format_version: None,
6001        kind: TypeKind::Enum,
6002        wire: true,
6003    },
6004    TypeContract {
6005        name: "vector_achieved_mode",
6006        shape_version: 1,
6007        instance_format_version: None,
6008        kind: TypeKind::Enum,
6009        wire: true,
6010    },
6011    TypeContract {
6012        name: "vector_branch_diagnostics",
6013        shape_version: 2,
6014        instance_format_version: None,
6015        kind: TypeKind::Struct,
6016        wire: true,
6017    },
6018    TypeContract {
6019        name: "dense_vector_element_type",
6020        shape_version: 1,
6021        instance_format_version: None,
6022        kind: TypeKind::Enum,
6023        wire: true,
6024    },
6025    TypeContract {
6026        name: "dense_vector_byte_order",
6027        shape_version: 1,
6028        instance_format_version: None,
6029        kind: TypeKind::Enum,
6030        wire: true,
6031    },
6032    TypeContract {
6033        name: "vector_value",
6034        shape_version: 1,
6035        instance_format_version: None,
6036        kind: TypeKind::TaggedUnion,
6037        wire: true,
6038    },
6039    TypeContract {
6040        name: "sparse_vector_entry",
6041        shape_version: 1,
6042        instance_format_version: None,
6043        kind: TypeKind::Struct,
6044        wire: true,
6045    },
6046    TypeContract {
6047        name: "sparse_vector_value",
6048        shape_version: 1,
6049        instance_format_version: None,
6050        kind: TypeKind::Struct,
6051        wire: true,
6052    },
6053    TypeContract {
6054        name: "vector_set_value",
6055        shape_version: 1,
6056        instance_format_version: None,
6057        kind: TypeKind::Struct,
6058        wire: true,
6059    },
6060    TypeContract {
6061        name: "vector_evaluation_snapshot",
6062        shape_version: 1,
6063        instance_format_version: None,
6064        kind: TypeKind::TaggedUnion,
6065        wire: true,
6066    },
6067    TypeContract {
6068        name: "vector_evaluation_query_set",
6069        shape_version: 1,
6070        instance_format_version: None,
6071        kind: TypeKind::TaggedUnion,
6072        wire: true,
6073    },
6074    TypeContract {
6075        name: "vector_evaluation_budget",
6076        shape_version: 1,
6077        instance_format_version: None,
6078        kind: TypeKind::Struct,
6079        wire: true,
6080    },
6081    TypeContract {
6082        name: "vector_candidate_policy",
6083        shape_version: 1,
6084        instance_format_version: None,
6085        kind: TypeKind::Enum,
6086        wire: true,
6087    },
6088    TypeContract {
6089        name: "vector_calibration_objective",
6090        shape_version: 1,
6091        instance_format_version: None,
6092        kind: TypeKind::Enum,
6093        wire: true,
6094    },
6095    TypeContract {
6096        name: "vector_strategy_profile",
6097        shape_version: 1,
6098        instance_format_version: None,
6099        kind: TypeKind::Enum,
6100        wire: true,
6101    },
6102    TypeContract {
6103        name: "vector_evaluation_work",
6104        shape_version: 1,
6105        instance_format_version: None,
6106        kind: TypeKind::Struct,
6107        wire: true,
6108    },
6109    TypeContract {
6110        name: "vector_evaluation_error_code",
6111        shape_version: 1,
6112        instance_format_version: None,
6113        kind: TypeKind::Enum,
6114        wire: true,
6115    },
6116    TypeContract {
6117        name: "vector_evaluation_error",
6118        shape_version: 1,
6119        instance_format_version: None,
6120        kind: TypeKind::Struct,
6121        wire: true,
6122    },
6123    TypeContract {
6124        name: "vector_recall_result",
6125        shape_version: 1,
6126        instance_format_version: Some(1),
6127        kind: TypeKind::Struct,
6128        wire: true,
6129    },
6130    TypeContract {
6131        name: "vector_calibration_candidate",
6132        shape_version: 1,
6133        instance_format_version: None,
6134        kind: TypeKind::Struct,
6135        wire: true,
6136    },
6137    TypeContract {
6138        name: "vector_calibration_result",
6139        shape_version: 1,
6140        instance_format_version: Some(1),
6141        kind: TypeKind::Struct,
6142        wire: true,
6143    },
6144    TypeContract {
6145        name: "vector_diagnostic_result",
6146        shape_version: 1,
6147        instance_format_version: None,
6148        kind: TypeKind::TaggedUnion,
6149        wire: true,
6150    },
6151    TypeContract {
6152        name: "vector_warm_component",
6153        shape_version: 1,
6154        instance_format_version: None,
6155        kind: TypeKind::Enum,
6156        wire: true,
6157    },
6158    TypeContract {
6159        name: "vector_warm_state",
6160        shape_version: 1,
6161        instance_format_version: None,
6162        kind: TypeKind::Enum,
6163        wire: true,
6164    },
6165    TypeContract {
6166        name: "vector_warm_achievement",
6167        shape_version: 1,
6168        instance_format_version: None,
6169        kind: TypeKind::Struct,
6170        wire: true,
6171    },
6172    TypeContract {
6173        name: "vector_warm_result",
6174        shape_version: 1,
6175        instance_format_version: Some(1),
6176        kind: TypeKind::Struct,
6177        wire: true,
6178    },
6179    TypeContract {
6180        name: "dense_retrieval_threshold",
6181        shape_version: 1,
6182        instance_format_version: None,
6183        kind: TypeKind::TaggedUnion,
6184        wire: true,
6185    },
6186    TypeContract {
6187        name: "retrieval_branch",
6188        shape_version: 3,
6189        instance_format_version: None,
6190        kind: TypeKind::TaggedUnion,
6191        wire: true,
6192    },
6193    TypeContract {
6194        name: "weighted_rrf_fusion",
6195        shape_version: 1,
6196        instance_format_version: None,
6197        kind: TypeKind::Struct,
6198        wire: true,
6199    },
6200    TypeContract {
6201        name: "retrieval_plan",
6202        shape_version: 1,
6203        instance_format_version: Some(1),
6204        kind: TypeKind::Struct,
6205        wire: true,
6206    },
6207    TypeContract {
6208        name: "histogram_bounds",
6209        shape_version: 1,
6210        instance_format_version: None,
6211        kind: TypeKind::Struct,
6212        wire: true,
6213    },
6214    TypeContract {
6215        name: "date_histogram_bounds",
6216        shape_version: 1,
6217        instance_format_version: None,
6218        kind: TypeKind::Struct,
6219        wire: true,
6220    },
6221    TypeContract {
6222        name: "approximation_algorithm",
6223        shape_version: 1,
6224        instance_format_version: None,
6225        kind: TypeKind::Enum,
6226        wire: true,
6227    },
6228    TypeContract {
6229        name: "approximation",
6230        shape_version: 1,
6231        instance_format_version: None,
6232        kind: TypeKind::Struct,
6233        wire: true,
6234    },
6235    TypeContract {
6236        name: "percentile_value",
6237        shape_version: 1,
6238        instance_format_version: None,
6239        kind: TypeKind::Struct,
6240        wire: true,
6241    },
6242    TypeContract {
6243        name: "approximate_percentile_value",
6244        shape_version: 1,
6245        instance_format_version: None,
6246        kind: TypeKind::Struct,
6247        wire: true,
6248    },
6249    TypeContract {
6250        name: "time_series_operator",
6251        shape_version: 1,
6252        instance_format_version: None,
6253        kind: TypeKind::Enum,
6254        wire: true,
6255    },
6256    TypeContract {
6257        name: "time_series_missing_data",
6258        shape_version: 1,
6259        instance_format_version: None,
6260        kind: TypeKind::Enum,
6261        wire: true,
6262    },
6263    TypeContract {
6264        name: "time_series_quantile_mode",
6265        shape_version: 1,
6266        instance_format_version: None,
6267        kind: TypeKind::Enum,
6268        wire: true,
6269    },
6270    TypeContract {
6271        name: "time_series_bucket_state",
6272        shape_version: 1,
6273        instance_format_version: None,
6274        kind: TypeKind::Enum,
6275        wire: true,
6276    },
6277    TypeContract {
6278        name: "time_series_quantile_value",
6279        shape_version: 1,
6280        instance_format_version: None,
6281        kind: TypeKind::Struct,
6282        wire: true,
6283    },
6284    TypeContract {
6285        name: "time_series_value",
6286        shape_version: 1,
6287        instance_format_version: None,
6288        kind: TypeKind::TaggedUnion,
6289        wire: true,
6290    },
6291    TypeContract {
6292        name: "time_series_bucket",
6293        shape_version: 1,
6294        instance_format_version: None,
6295        kind: TypeKind::Struct,
6296        wire: true,
6297    },
6298    TypeContract {
6299        name: "relationship_traversal_direction",
6300        shape_version: 1,
6301        instance_format_version: None,
6302        kind: TypeKind::Enum,
6303        wire: true,
6304    },
6305    TypeContract {
6306        name: "relationship_traversal_filter",
6307        shape_version: 1,
6308        instance_format_version: None,
6309        kind: TypeKind::Struct,
6310        wire: true,
6311    },
6312    TypeContract {
6313        name: "relationship_traversal_budget",
6314        shape_version: 1,
6315        instance_format_version: None,
6316        kind: TypeKind::Struct,
6317        wire: true,
6318    },
6319    TypeContract {
6320        name: "traversed_relationship",
6321        shape_version: 1,
6322        instance_format_version: None,
6323        kind: TypeKind::Struct,
6324        wire: true,
6325    },
6326    TypeContract {
6327        name: "profile_query_operation",
6328        shape_version: 1,
6329        instance_format_version: None,
6330        kind: TypeKind::Enum,
6331        wire: true,
6332    },
6333    TypeContract {
6334        name: "profile_group_by",
6335        shape_version: 1,
6336        instance_format_version: None,
6337        kind: TypeKind::TaggedUnion,
6338        wire: true,
6339    },
6340    TypeContract {
6341        name: "profile_query_filter",
6342        shape_version: 1,
6343        instance_format_version: None,
6344        kind: TypeKind::Struct,
6345        wire: true,
6346    },
6347    TypeContract {
6348        name: "profile_query_budget",
6349        shape_version: 1,
6350        instance_format_version: None,
6351        kind: TypeKind::Struct,
6352        wire: true,
6353    },
6354    TypeContract {
6355        name: "profile_query_row",
6356        shape_version: 1,
6357        instance_format_version: None,
6358        kind: TypeKind::Struct,
6359        wire: true,
6360    },
6361    TypeContract {
6362        name: "temporal_input",
6363        shape_version: 1,
6364        instance_format_version: None,
6365        kind: TypeKind::Struct,
6366        wire: true,
6367    },
6368    TypeContract {
6369        name: "temporal_pattern",
6370        shape_version: 1,
6371        instance_format_version: None,
6372        kind: TypeKind::TaggedUnion,
6373        wire: true,
6374    },
6375    TypeContract {
6376        name: "historical_temporal_definition",
6377        shape_version: 1,
6378        instance_format_version: Some(1),
6379        kind: TypeKind::Struct,
6380        wire: true,
6381    },
6382    TypeContract {
6383        name: "temporal_evidence_status",
6384        shape_version: 2,
6385        instance_format_version: None,
6386        kind: TypeKind::Enum,
6387        wire: true,
6388    },
6389    TypeContract {
6390        name: "temporal_source_event",
6391        shape_version: 1,
6392        instance_format_version: None,
6393        kind: TypeKind::Struct,
6394        wire: true,
6395    },
6396    TypeContract {
6397        name: "temporal_evidence",
6398        shape_version: 2,
6399        instance_format_version: None,
6400        kind: TypeKind::Struct,
6401        wire: true,
6402    },
6403    TypeContract {
6404        name: "continuous_temporal_start",
6405        shape_version: 1,
6406        instance_format_version: None,
6407        kind: TypeKind::TaggedUnion,
6408        wire: true,
6409    },
6410    TypeContract {
6411        name: "continuous_temporal_watermark_policy",
6412        shape_version: 1,
6413        instance_format_version: None,
6414        kind: TypeKind::TaggedUnion,
6415        wire: true,
6416    },
6417    TypeContract {
6418        name: "continuous_temporal_late_data_policy",
6419        shape_version: 1,
6420        instance_format_version: None,
6421        kind: TypeKind::TaggedUnion,
6422        wire: true,
6423    },
6424    TypeContract {
6425        name: "continuous_temporal_output",
6426        shape_version: 1,
6427        instance_format_version: None,
6428        kind: TypeKind::TaggedUnion,
6429        wire: true,
6430    },
6431    TypeContract {
6432        name: "continuous_temporal_definition",
6433        shape_version: 1,
6434        instance_format_version: Some(1),
6435        kind: TypeKind::Struct,
6436        wire: true,
6437    },
6438    TypeContract {
6439        name: "continuous_temporal_frontier",
6440        shape_version: 1,
6441        instance_format_version: None,
6442        kind: TypeKind::Struct,
6443        wire: true,
6444    },
6445    TypeContract {
6446        name: "continuous_temporal_available_frontier",
6447        shape_version: 1,
6448        instance_format_version: None,
6449        kind: TypeKind::Struct,
6450        wire: true,
6451    },
6452    TypeContract {
6453        name: "continuous_temporal_gap_reason",
6454        shape_version: 1,
6455        instance_format_version: None,
6456        kind: TypeKind::Enum,
6457        wire: true,
6458    },
6459    TypeContract {
6460        name: "continuous_temporal_gap",
6461        shape_version: 1,
6462        instance_format_version: None,
6463        kind: TypeKind::Struct,
6464        wire: true,
6465    },
6466    TypeContract {
6467        name: "continuous_temporal_evaluation",
6468        shape_version: 1,
6469        instance_format_version: Some(1),
6470        kind: TypeKind::Struct,
6471        wire: true,
6472    },
6473    TypeContract {
6474        name: "composite_order",
6475        shape_version: 1,
6476        instance_format_version: None,
6477        kind: TypeKind::Enum,
6478        wire: true,
6479    },
6480    TypeContract {
6481        name: "composite_source",
6482        shape_version: 1,
6483        instance_format_version: None,
6484        kind: TypeKind::TaggedUnion,
6485        wire: true,
6486    },
6487    TypeContract {
6488        name: "aggregation",
6489        shape_version: 3,
6490        instance_format_version: None,
6491        kind: TypeKind::TaggedUnion,
6492        wire: true,
6493    },
6494    TypeContract {
6495        name: "nested_search_hit",
6496        shape_version: 2,
6497        instance_format_version: None,
6498        kind: TypeKind::Struct,
6499        wire: true,
6500    },
6501    TypeContract {
6502        name: "named_nested_inner_hits_result",
6503        shape_version: 1,
6504        instance_format_version: None,
6505        kind: TypeKind::Struct,
6506        wire: true,
6507    },
6508    TypeContract {
6509        name: "fragment_boundary",
6510        shape_version: 1,
6511        instance_format_version: None,
6512        kind: TypeKind::Enum,
6513        wire: true,
6514    },
6515    TypeContract {
6516        name: "fragment_offset_encoding",
6517        shape_version: 1,
6518        instance_format_version: None,
6519        kind: TypeKind::Enum,
6520        wire: true,
6521    },
6522    TypeContract {
6523        name: "fragment_ranker",
6524        shape_version: 1,
6525        instance_format_version: None,
6526        kind: TypeKind::Enum,
6527        wire: true,
6528    },
6529    TypeContract {
6530        name: "fragment_request",
6531        shape_version: 1,
6532        instance_format_version: None,
6533        kind: TypeKind::Struct,
6534        wire: true,
6535    },
6536    TypeContract {
6537        name: "search_fragment",
6538        shape_version: 1,
6539        instance_format_version: None,
6540        kind: TypeKind::Struct,
6541        wire: true,
6542    },
6543    TypeContract {
6544        name: "numeric_feature_transform",
6545        shape_version: 1,
6546        instance_format_version: None,
6547        kind: TypeKind::TaggedUnion,
6548        wire: true,
6549    },
6550    TypeContract {
6551        name: "numeric_result_feature",
6552        shape_version: 1,
6553        instance_format_version: None,
6554        kind: TypeKind::Struct,
6555        wire: true,
6556    },
6557    TypeContract {
6558        name: "result_feature_request",
6559        shape_version: 1,
6560        instance_format_version: None,
6561        kind: TypeKind::Struct,
6562        wire: true,
6563    },
6564    TypeContract {
6565        name: "result_diversification",
6566        shape_version: 1,
6567        instance_format_version: None,
6568        kind: TypeKind::Struct,
6569        wire: true,
6570    },
6571    TypeContract {
6572        name: "source_projection",
6573        shape_version: 1,
6574        instance_format_version: None,
6575        kind: TypeKind::TaggedUnion,
6576        wire: true,
6577    },
6578    TypeContract {
6579        name: "branch_score_kind",
6580        shape_version: 2,
6581        instance_format_version: None,
6582        kind: TypeKind::Enum,
6583        wire: true,
6584    },
6585    TypeContract {
6586        name: "result_feature",
6587        shape_version: 1,
6588        instance_format_version: None,
6589        kind: TypeKind::TaggedUnion,
6590        wire: true,
6591    },
6592    TypeContract {
6593        name: "search_hit",
6594        shape_version: 2,
6595        instance_format_version: None,
6596        kind: TypeKind::Struct,
6597        wire: true,
6598    },
6599    TypeContract {
6600        name: "aggregation_bucket",
6601        shape_version: 1,
6602        instance_format_version: None,
6603        kind: TypeKind::Struct,
6604        wire: true,
6605    },
6606    TypeContract {
6607        name: "aggregation_result",
6608        shape_version: 3,
6609        instance_format_version: None,
6610        kind: TypeKind::TaggedUnion,
6611        wire: true,
6612    },
6613    TypeContract {
6614        name: "shard_counts",
6615        shape_version: 1,
6616        instance_format_version: None,
6617        kind: TypeKind::Struct,
6618        wire: true,
6619    },
6620    TypeContract {
6621        name: "total_hits_relation",
6622        shape_version: 1,
6623        instance_format_version: None,
6624        kind: TypeKind::Enum,
6625        wire: true,
6626    },
6627    TypeContract {
6628        name: "search_total",
6629        shape_version: 1,
6630        instance_format_version: None,
6631        kind: TypeKind::Struct,
6632        wire: true,
6633    },
6634    TypeContract {
6635        name: "search_execution_freshness",
6636        shape_version: 1,
6637        instance_format_version: None,
6638        kind: TypeKind::Enum,
6639        wire: true,
6640    },
6641    TypeContract {
6642        name: "search_freshness",
6643        shape_version: 1,
6644        instance_format_version: None,
6645        kind: TypeKind::Enum,
6646        wire: true,
6647    },
6648    TypeContract {
6649        name: "search_degradation_reason",
6650        shape_version: 1,
6651        instance_format_version: None,
6652        kind: TypeKind::Enum,
6653        wire: true,
6654    },
6655    TypeContract {
6656        name: "search_achievement",
6657        shape_version: 1,
6658        instance_format_version: None,
6659        kind: TypeKind::Struct,
6660        wire: true,
6661    },
6662    TypeContract {
6663        name: "search_failure_stage",
6664        shape_version: 1,
6665        instance_format_version: None,
6666        kind: TypeKind::Enum,
6667        wire: true,
6668    },
6669    TypeContract {
6670        name: "search_failure_reason",
6671        shape_version: 1,
6672        instance_format_version: None,
6673        kind: TypeKind::Enum,
6674        wire: true,
6675    },
6676    TypeContract {
6677        name: "collection_shard",
6678        shape_version: 1,
6679        instance_format_version: None,
6680        kind: TypeKind::Struct,
6681        wire: true,
6682    },
6683    TypeContract {
6684        name: "search_partial_failure",
6685        shape_version: 1,
6686        instance_format_version: None,
6687        kind: TypeKind::Struct,
6688        wire: true,
6689    },
6690    TypeContract {
6691        name: "artifact",
6692        shape_version: 1,
6693        instance_format_version: None,
6694        kind: TypeKind::Struct,
6695        wire: true,
6696    },
6697    TypeContract {
6698        name: "portability_storage_capability",
6699        shape_version: 1,
6700        instance_format_version: None,
6701        kind: TypeKind::Struct,
6702        wire: true,
6703    },
6704    TypeContract {
6705        name: "collection_export_artifact",
6706        shape_version: 1,
6707        instance_format_version: None,
6708        kind: TypeKind::Struct,
6709        wire: true,
6710    },
6711    TypeContract {
6712        name: "index_transfer_page",
6713        shape_version: 1,
6714        instance_format_version: None,
6715        kind: TypeKind::Struct,
6716        wire: true,
6717    },
6718    TypeContract {
6719        name: "index_transfer_artifact",
6720        shape_version: 1,
6721        instance_format_version: None,
6722        kind: TypeKind::Struct,
6723        wire: true,
6724    },
6725    TypeContract {
6726        name: "search_validation_bound",
6727        shape_version: 1,
6728        instance_format_version: None,
6729        kind: TypeKind::TaggedUnion,
6730        wire: true,
6731    },
6732    TypeContract {
6733        name: "search_validation_estimates",
6734        shape_version: 1,
6735        instance_format_version: None,
6736        kind: TypeKind::Struct,
6737        wire: true,
6738    },
6739    TypeContract {
6740        name: "search_validation_limit",
6741        shape_version: 1,
6742        instance_format_version: None,
6743        kind: TypeKind::Struct,
6744        wire: true,
6745    },
6746    TypeContract {
6747        name: "operation_kind",
6748        shape_version: 2,
6749        instance_format_version: None,
6750        kind: TypeKind::Enum,
6751        wire: true,
6752    },
6753    TypeContract {
6754        name: "operation_authority",
6755        shape_version: 1,
6756        instance_format_version: None,
6757        kind: TypeKind::Enum,
6758        wire: true,
6759    },
6760    TypeContract {
6761        name: "operation_target",
6762        shape_version: 1,
6763        instance_format_version: None,
6764        kind: TypeKind::TaggedUnion,
6765        wire: true,
6766    },
6767    TypeContract {
6768        name: "operation_state",
6769        shape_version: 1,
6770        instance_format_version: None,
6771        kind: TypeKind::Enum,
6772        wire: true,
6773    },
6774    TypeContract {
6775        name: "operation_pending_state",
6776        shape_version: 1,
6777        instance_format_version: None,
6778        kind: TypeKind::Enum,
6779        wire: true,
6780    },
6781    TypeContract {
6782        name: "operation_progress_unit",
6783        shape_version: 1,
6784        instance_format_version: None,
6785        kind: TypeKind::Enum,
6786        wire: true,
6787    },
6788    TypeContract {
6789        name: "operation_progress",
6790        shape_version: 1,
6791        instance_format_version: None,
6792        kind: TypeKind::Struct,
6793        wire: true,
6794    },
6795    TypeContract {
6796        name: "operation_result",
6797        shape_version: 1,
6798        instance_format_version: None,
6799        kind: TypeKind::TaggedUnion,
6800        wire: true,
6801    },
6802    TypeContract {
6803        name: "operation_failure",
6804        shape_version: 1,
6805        instance_format_version: None,
6806        kind: TypeKind::Struct,
6807        wire: true,
6808    },
6809    TypeContract {
6810        name: "operation_cancellation",
6811        shape_version: 1,
6812        instance_format_version: None,
6813        kind: TypeKind::Enum,
6814        wire: true,
6815    },
6816    TypeContract {
6817        name: "operation_retention_state",
6818        shape_version: 1,
6819        instance_format_version: None,
6820        kind: TypeKind::Enum,
6821        wire: true,
6822    },
6823    TypeContract {
6824        name: "operation_retention",
6825        shape_version: 1,
6826        instance_format_version: None,
6827        kind: TypeKind::Struct,
6828        wire: true,
6829    },
6830    TypeContract {
6831        name: "operation",
6832        shape_version: 2,
6833        instance_format_version: None,
6834        kind: TypeKind::Struct,
6835        wire: true,
6836    },
6837    TypeContract {
6838        name: "write_durability_boundary",
6839        shape_version: 1,
6840        instance_format_version: None,
6841        kind: TypeKind::Enum,
6842        wire: true,
6843    },
6844    TypeContract {
6845        name: "write_visibility_mode",
6846        shape_version: 1,
6847        instance_format_version: None,
6848        kind: TypeKind::Enum,
6849        wire: true,
6850    },
6851    TypeContract {
6852        name: "write_response_stage",
6853        shape_version: 1,
6854        instance_format_version: None,
6855        kind: TypeKind::Enum,
6856        wire: true,
6857    },
6858    TypeContract {
6859        name: "write_achievement",
6860        shape_version: 1,
6861        instance_format_version: None,
6862        kind: TypeKind::Struct,
6863        wire: true,
6864    },
6865    TypeContract {
6866        name: "mutation_commit_position",
6867        shape_version: 1,
6868        instance_format_version: None,
6869        kind: TypeKind::Struct,
6870        wire: true,
6871    },
6872    TypeContract {
6873        name: "mutation_commit_receipt",
6874        shape_version: 1,
6875        instance_format_version: Some(1),
6876        kind: TypeKind::Struct,
6877        wire: true,
6878    },
6879    TypeContract {
6880        name: "mutation_resolver",
6881        shape_version: 1,
6882        instance_format_version: None,
6883        kind: TypeKind::Enum,
6884        wire: true,
6885    },
6886    TypeContract {
6887        name: "mutation_outcome",
6888        shape_version: 1,
6889        instance_format_version: None,
6890        kind: TypeKind::TaggedUnion,
6891        wire: true,
6892    },
6893    TypeContract {
6894        name: "submission_state",
6895        shape_version: 1,
6896        instance_format_version: None,
6897        kind: TypeKind::Enum,
6898        wire: true,
6899    },
6900    TypeContract {
6901        name: "expected_binding",
6902        shape_version: 1,
6903        instance_format_version: None,
6904        kind: TypeKind::Struct,
6905        wire: true,
6906    },
6907    TypeContract {
6908        name: "administration_alias_action",
6909        shape_version: 1,
6910        instance_format_version: None,
6911        kind: TypeKind::TaggedUnion,
6912        wire: true,
6913    },
6914    TypeContract {
6915        name: "administration_mutation",
6916        shape_version: 1,
6917        instance_format_version: None,
6918        kind: TypeKind::TaggedUnion,
6919        wire: true,
6920    },
6921    TypeContract {
6922        name: "administration_outcome",
6923        shape_version: 1,
6924        instance_format_version: None,
6925        kind: TypeKind::Struct,
6926        wire: true,
6927    },
6928    TypeContract {
6929        name: "index_change_apply_receipt",
6930        shape_version: 1,
6931        instance_format_version: None,
6932        kind: TypeKind::Struct,
6933        wire: true,
6934    },
6935    TypeContract {
6936        name: "bulk_document_item",
6937        shape_version: 2,
6938        instance_format_version: None,
6939        kind: TypeKind::Struct,
6940        wire: true,
6941    },
6942    TypeContract {
6943        name: "bulk_document_item_outcome",
6944        shape_version: 1,
6945        instance_format_version: None,
6946        kind: TypeKind::Struct,
6947        wire: true,
6948    },
6949    TypeContract {
6950        name: "bulk_document_outcome",
6951        shape_version: 1,
6952        instance_format_version: None,
6953        kind: TypeKind::Struct,
6954        wire: true,
6955    },
6956    TypeContract {
6957        name: "metric_attribute_value",
6958        shape_version: 1,
6959        instance_format_version: None,
6960        kind: TypeKind::TaggedUnion,
6961        wire: true,
6962    },
6963    TypeContract {
6964        name: "metric_attribute",
6965        shape_version: 1,
6966        instance_format_version: None,
6967        kind: TypeKind::Struct,
6968        wire: true,
6969    },
6970    TypeContract {
6971        name: "metric_number",
6972        shape_version: 1,
6973        instance_format_version: None,
6974        kind: TypeKind::TaggedUnion,
6975        wire: true,
6976    },
6977    TypeContract {
6978        name: "metric_temporality",
6979        shape_version: 1,
6980        instance_format_version: None,
6981        kind: TypeKind::Enum,
6982        wire: true,
6983    },
6984    TypeContract {
6985        name: "metric_point_kind",
6986        shape_version: 1,
6987        instance_format_version: None,
6988        kind: TypeKind::Enum,
6989        wire: true,
6990    },
6991    TypeContract {
6992        name: "metric_exponential_buckets",
6993        shape_version: 1,
6994        instance_format_version: None,
6995        kind: TypeKind::Struct,
6996        wire: true,
6997    },
6998    TypeContract {
6999        name: "metric_data",
7000        shape_version: 1,
7001        instance_format_version: None,
7002        kind: TypeKind::TaggedUnion,
7003        wire: true,
7004    },
7005    TypeContract {
7006        name: "metric_instrumentation_scope",
7007        shape_version: 1,
7008        instance_format_version: None,
7009        kind: TypeKind::Struct,
7010        wire: true,
7011    },
7012    TypeContract {
7013        name: "metric_exemplar",
7014        shape_version: 1,
7015        instance_format_version: None,
7016        kind: TypeKind::Struct,
7017        wire: true,
7018    },
7019    TypeContract {
7020        name: "metric_point",
7021        shape_version: 1,
7022        instance_format_version: Some(1),
7023        kind: TypeKind::Struct,
7024        wire: true,
7025    },
7026    TypeContract {
7027        name: "entity_ref",
7028        shape_version: 1,
7029        instance_format_version: None,
7030        kind: TypeKind::Struct,
7031        wire: true,
7032    },
7033    TypeContract {
7034        name: "relationship_evidence_ref",
7035        shape_version: 1,
7036        instance_format_version: None,
7037        kind: TypeKind::Struct,
7038        wire: true,
7039    },
7040    TypeContract {
7041        name: "relationship_directionality",
7042        shape_version: 1,
7043        instance_format_version: None,
7044        kind: TypeKind::Enum,
7045        wire: true,
7046    },
7047    TypeContract {
7048        name: "relationship_record",
7049        shape_version: 1,
7050        instance_format_version: Some(1),
7051        kind: TypeKind::Struct,
7052        wire: true,
7053    },
7054    TypeContract {
7055        name: "profile_label",
7056        shape_version: 1,
7057        instance_format_version: None,
7058        kind: TypeKind::Struct,
7059        wire: true,
7060    },
7061    TypeContract {
7062        name: "profile_sample_type",
7063        shape_version: 1,
7064        instance_format_version: None,
7065        kind: TypeKind::Struct,
7066        wire: true,
7067    },
7068    TypeContract {
7069        name: "profile_mapping",
7070        shape_version: 1,
7071        instance_format_version: None,
7072        kind: TypeKind::Struct,
7073        wire: true,
7074    },
7075    TypeContract {
7076        name: "profile_function",
7077        shape_version: 1,
7078        instance_format_version: None,
7079        kind: TypeKind::Struct,
7080        wire: true,
7081    },
7082    TypeContract {
7083        name: "profile_line",
7084        shape_version: 1,
7085        instance_format_version: None,
7086        kind: TypeKind::Struct,
7087        wire: true,
7088    },
7089    TypeContract {
7090        name: "profile_location",
7091        shape_version: 1,
7092        instance_format_version: None,
7093        kind: TypeKind::Struct,
7094        wire: true,
7095    },
7096    TypeContract {
7097        name: "profile_stack",
7098        shape_version: 1,
7099        instance_format_version: None,
7100        kind: TypeKind::Struct,
7101        wire: true,
7102    },
7103    TypeContract {
7104        name: "profile_sample",
7105        shape_version: 1,
7106        instance_format_version: None,
7107        kind: TypeKind::Struct,
7108        wire: true,
7109    },
7110    TypeContract {
7111        name: "profile_instrumentation_scope",
7112        shape_version: 1,
7113        instance_format_version: None,
7114        kind: TypeKind::Struct,
7115        wire: true,
7116    },
7117    TypeContract {
7118        name: "profile_batch",
7119        shape_version: 1,
7120        instance_format_version: Some(1),
7121        kind: TypeKind::Struct,
7122        wire: true,
7123    },
7124    TypeContract {
7125        name: "native_record",
7126        shape_version: 3,
7127        instance_format_version: None,
7128        kind: TypeKind::TaggedUnion,
7129        wire: true,
7130    },
7131    TypeContract {
7132        name: "retained_append_item",
7133        shape_version: 4,
7134        instance_format_version: None,
7135        kind: TypeKind::Struct,
7136        wire: true,
7137    },
7138    TypeContract {
7139        name: "retained_append_state",
7140        shape_version: 1,
7141        instance_format_version: None,
7142        kind: TypeKind::Enum,
7143        wire: true,
7144    },
7145    TypeContract {
7146        name: "retained_append_retry_safety",
7147        shape_version: 1,
7148        instance_format_version: None,
7149        kind: TypeKind::Enum,
7150        wire: true,
7151    },
7152    TypeContract {
7153        name: "retained_append_item_outcome",
7154        shape_version: 1,
7155        instance_format_version: None,
7156        kind: TypeKind::Struct,
7157        wire: true,
7158    },
7159    TypeContract {
7160        name: "retained_append_bulk_outcome",
7161        shape_version: 1,
7162        instance_format_version: None,
7163        kind: TypeKind::Struct,
7164        wire: true,
7165    },
7166    TypeContract {
7167        name: "retained_append_observation_state",
7168        shape_version: 1,
7169        instance_format_version: None,
7170        kind: TypeKind::Enum,
7171        wire: true,
7172    },
7173    TypeContract {
7174        name: "retained_append_observation_outcome",
7175        shape_version: 1,
7176        instance_format_version: None,
7177        kind: TypeKind::Struct,
7178        wire: true,
7179    },
7180    TypeContract {
7181        name: "binary_value",
7182        shape_version: 1,
7183        instance_format_version: None,
7184        kind: TypeKind::Struct,
7185        wire: true,
7186    },
7187    TypeContract {
7188        name: "state_hash_field",
7189        shape_version: 1,
7190        instance_format_version: None,
7191        kind: TypeKind::Struct,
7192        wire: true,
7193    },
7194    TypeContract {
7195        name: "state_set_entry",
7196        shape_version: 1,
7197        instance_format_version: None,
7198        kind: TypeKind::Struct,
7199        wire: true,
7200    },
7201    TypeContract {
7202        name: "state_set_condition",
7203        shape_version: 1,
7204        instance_format_version: None,
7205        kind: TypeKind::Enum,
7206        wire: true,
7207    },
7208    TypeContract {
7209        name: "state_operation",
7210        shape_version: 1,
7211        instance_format_version: None,
7212        kind: TypeKind::TaggedUnion,
7213        wire: true,
7214    },
7215    TypeContract {
7216        name: "state_optional_value",
7217        shape_version: 1,
7218        instance_format_version: None,
7219        kind: TypeKind::TaggedUnion,
7220        wire: true,
7221    },
7222    TypeContract {
7223        name: "state_command_result",
7224        shape_version: 1,
7225        instance_format_version: None,
7226        kind: TypeKind::TaggedUnion,
7227        wire: true,
7228    },
7229    TypeContract {
7230        name: "state_write_resolution",
7231        shape_version: 1,
7232        instance_format_version: None,
7233        kind: TypeKind::TaggedUnion,
7234        wire: true,
7235    },
7236    TypeContract {
7237        name: "service_credential_reservation",
7238        shape_version: 1,
7239        instance_format_version: None,
7240        kind: TypeKind::Struct,
7241        wire: true,
7242    },
7243    TypeContract {
7244        name: "subscription_metadata_field",
7245        shape_version: 1,
7246        instance_format_version: None,
7247        kind: TypeKind::Enum,
7248        wire: true,
7249    },
7250    TypeContract {
7251        name: "subscription_field",
7252        shape_version: 1,
7253        instance_format_version: None,
7254        kind: TypeKind::TaggedUnion,
7255        wire: true,
7256    },
7257    TypeContract {
7258        name: "subscription_filter",
7259        shape_version: 1,
7260        instance_format_version: None,
7261        kind: TypeKind::TaggedUnion,
7262        wire: true,
7263    },
7264    TypeContract {
7265        name: "subscription_cursor_entry",
7266        shape_version: 1,
7267        instance_format_version: None,
7268        kind: TypeKind::Struct,
7269        wire: true,
7270    },
7271    TypeContract {
7272        name: "subscription_route",
7273        shape_version: 1,
7274        instance_format_version: None,
7275        kind: TypeKind::Struct,
7276        wire: true,
7277    },
7278    TypeContract {
7279        name: "subscription_start_position",
7280        shape_version: 1,
7281        instance_format_version: None,
7282        kind: TypeKind::TaggedUnion,
7283        wire: true,
7284    },
7285    TypeContract {
7286        name: "subscription_start",
7287        shape_version: 1,
7288        instance_format_version: Some(1),
7289        kind: TypeKind::Struct,
7290        wire: true,
7291    },
7292    TypeContract {
7293        name: "subscription_accepted",
7294        shape_version: 1,
7295        instance_format_version: Some(1),
7296        kind: TypeKind::Struct,
7297        wire: true,
7298    },
7299    TypeContract {
7300        name: "subscription_writer_fence",
7301        shape_version: 1,
7302        instance_format_version: None,
7303        kind: TypeKind::Struct,
7304        wire: true,
7305    },
7306    TypeContract {
7307        name: "subscription_event",
7308        shape_version: 1,
7309        instance_format_version: Some(1),
7310        kind: TypeKind::Struct,
7311        wire: true,
7312    },
7313    TypeContract {
7314        name: "subscription_heartbeat",
7315        shape_version: 1,
7316        instance_format_version: Some(1),
7317        kind: TypeKind::Struct,
7318        wire: true,
7319    },
7320    TypeContract {
7321        name: "subscription_gap",
7322        shape_version: 1,
7323        instance_format_version: Some(1),
7324        kind: TypeKind::Struct,
7325        wire: true,
7326    },
7327    TypeContract {
7328        name: "subscription_terminal_reason",
7329        shape_version: 1,
7330        instance_format_version: None,
7331        kind: TypeKind::Enum,
7332        wire: true,
7333    },
7334    TypeContract {
7335        name: "subscription_terminal",
7336        shape_version: 2,
7337        instance_format_version: Some(2),
7338        kind: TypeKind::Struct,
7339        wire: true,
7340    },
7341    TypeContract {
7342        name: "subscription_frame",
7343        shape_version: 1,
7344        instance_format_version: None,
7345        kind: TypeKind::TaggedUnion,
7346        wire: true,
7347    },
7348    TypeContract {
7349        name: "stream_binding",
7350        shape_version: 1,
7351        instance_format_version: None,
7352        kind: TypeKind::Struct,
7353        wire: true,
7354    },
7355    TypeContract {
7356        name: "capability_grant",
7357        shape_version: 1,
7358        instance_format_version: None,
7359        kind: TypeKind::Struct,
7360        wire: true,
7361    },
7362    TypeContract {
7363        name: "protocol_limit",
7364        shape_version: 1,
7365        instance_format_version: None,
7366        kind: TypeKind::Struct,
7367        wire: true,
7368    },
7369    TypeContract {
7370        name: "document_mutation_condition",
7371        shape_version: 1,
7372        instance_format_version: None,
7373        kind: TypeKind::TaggedUnion,
7374        wire: true,
7375    },
7376    TypeContract {
7377        name: "audit_adapter",
7378        shape_version: 1,
7379        instance_format_version: None,
7380        kind: TypeKind::Enum,
7381        wire: true,
7382    },
7383    TypeContract {
7384        name: "audit_decision",
7385        shape_version: 1,
7386        instance_format_version: None,
7387        kind: TypeKind::Enum,
7388        wire: true,
7389    },
7390    TypeContract {
7391        name: "audit_outcome",
7392        shape_version: 1,
7393        instance_format_version: None,
7394        kind: TypeKind::Enum,
7395        wire: true,
7396    },
7397    TypeContract {
7398        name: "audit_detail",
7399        shape_version: 1,
7400        instance_format_version: None,
7401        kind: TypeKind::Enum,
7402        wire: true,
7403    },
7404    TypeContract {
7405        name: "audit_gap_reason",
7406        shape_version: 1,
7407        instance_format_version: None,
7408        kind: TypeKind::Enum,
7409        wire: true,
7410    },
7411    TypeContract {
7412        name: "audit_event",
7413        shape_version: 2,
7414        instance_format_version: None,
7415        kind: TypeKind::Struct,
7416        wire: true,
7417    },
7418    TypeContract {
7419        name: "audit_gap",
7420        shape_version: 2,
7421        instance_format_version: None,
7422        kind: TypeKind::Struct,
7423        wire: true,
7424    },
7425    TypeContract {
7426        name: "audit_stream_state",
7427        shape_version: 1,
7428        instance_format_version: None,
7429        kind: TypeKind::Struct,
7430        wire: true,
7431    },
7432    TypeContract {
7433        name: "service_credential_grant",
7434        shape_version: 1,
7435        instance_format_version: None,
7436        kind: TypeKind::Struct,
7437        wire: true,
7438    },
7439    TypeContract {
7440        name: "service_credential_summary",
7441        shape_version: 1,
7442        instance_format_version: None,
7443        kind: TypeKind::Struct,
7444        wire: true,
7445    },
7446    TypeContract {
7447        name: "security_role",
7448        shape_version: 1,
7449        instance_format_version: None,
7450        kind: TypeKind::Struct,
7451        wire: true,
7452    },
7453    TypeContract {
7454        name: "role_append_scope_change",
7455        shape_version: 1,
7456        instance_format_version: None,
7457        kind: TypeKind::TaggedUnion,
7458        wire: true,
7459    },
7460    TypeContract {
7461        name: "role_append_access_preparation",
7462        shape_version: 1,
7463        instance_format_version: None,
7464        kind: TypeKind::TaggedUnion,
7465        wire: true,
7466    },
7467    TypeContract {
7468        name: "security_action_outcome",
7469        shape_version: 1,
7470        instance_format_version: None,
7471        kind: TypeKind::TaggedUnion,
7472        wire: true,
7473    },
7474    TypeContract {
7475        name: "maintenance_work_state",
7476        shape_version: 1,
7477        instance_format_version: None,
7478        kind: TypeKind::Enum,
7479        wire: true,
7480    },
7481    TypeContract {
7482        name: "maintenance_attempt_state",
7483        shape_version: 1,
7484        instance_format_version: None,
7485        kind: TypeKind::Enum,
7486        wire: true,
7487    },
7488    TypeContract {
7489        name: "maintenance_failure_class",
7490        shape_version: 1,
7491        instance_format_version: None,
7492        kind: TypeKind::Enum,
7493        wire: true,
7494    },
7495    TypeContract {
7496        name: "maintenance_failure_class_count",
7497        shape_version: 1,
7498        instance_format_version: None,
7499        kind: TypeKind::Struct,
7500        wire: true,
7501    },
7502    TypeContract {
7503        name: "maintenance_attempt_observation",
7504        shape_version: 1,
7505        instance_format_version: None,
7506        kind: TypeKind::Struct,
7507        wire: true,
7508    },
7509    TypeContract {
7510        name: "maintenance_task_scope",
7511        shape_version: 1,
7512        instance_format_version: None,
7513        kind: TypeKind::Struct,
7514        wire: true,
7515    },
7516    TypeContract {
7517        name: "maintenance_task_status",
7518        shape_version: 1,
7519        instance_format_version: None,
7520        kind: TypeKind::Struct,
7521        wire: true,
7522    },
7523    TypeContract {
7524        name: "maintenance_status_aggregate",
7525        shape_version: 1,
7526        instance_format_version: Some(2),
7527        kind: TypeKind::Struct,
7528        wire: true,
7529    },
7530    TypeContract {
7531        name: "runtime_status_detail",
7532        shape_version: 1,
7533        instance_format_version: None,
7534        kind: TypeKind::Struct,
7535        wire: true,
7536    },
7537    TypeContract {
7538        name: "result_cache_status",
7539        shape_version: 2,
7540        instance_format_version: Some(3),
7541        kind: TypeKind::Struct,
7542        wire: true,
7543    },
7544    TypeContract {
7545        name: "field_promotion_status",
7546        shape_version: 1,
7547        instance_format_version: Some(3),
7548        kind: TypeKind::Struct,
7549        wire: true,
7550    },
7551    TypeContract {
7552        name: "overload_shard_status",
7553        shape_version: 2,
7554        instance_format_version: Some(3),
7555        kind: TypeKind::Struct,
7556        wire: true,
7557    },
7558    TypeContract {
7559        name: "external_key_binding",
7560        shape_version: 1,
7561        instance_format_version: None,
7562        kind: TypeKind::Struct,
7563        wire: true,
7564    },
7565    TypeContract {
7566        name: "rollup_measure",
7567        shape_version: 1,
7568        instance_format_version: None,
7569        kind: TypeKind::TaggedUnion,
7570        wire: true,
7571    },
7572    TypeContract {
7573        name: "aggregate_then_delete_policy",
7574        shape_version: 1,
7575        instance_format_version: None,
7576        kind: TypeKind::Struct,
7577        wire: true,
7578    },
7579    TypeContract {
7580        name: "lifecycle_binding_status",
7581        shape_version: 1,
7582        instance_format_version: None,
7583        kind: TypeKind::Struct,
7584        wire: true,
7585    },
7586    TypeContract {
7587        name: "lifecycle_rollup_status",
7588        shape_version: 1,
7589        instance_format_version: None,
7590        kind: TypeKind::Struct,
7591        wire: true,
7592    },
7593    TypeContract {
7594        name: "lifecycle_status",
7595        shape_version: 2,
7596        instance_format_version: Some(4),
7597        kind: TypeKind::Struct,
7598        wire: true,
7599    },
7600    TypeContract {
7601        name: "quota_limit",
7602        shape_version: 1,
7603        instance_format_version: None,
7604        kind: TypeKind::Struct,
7605        wire: true,
7606    },
7607    TypeContract {
7608        name: "quota_consumption",
7609        shape_version: 1,
7610        instance_format_version: None,
7611        kind: TypeKind::Struct,
7612        wire: true,
7613    },
7614    TypeContract {
7615        name: "quota_update",
7616        shape_version: 1,
7617        instance_format_version: None,
7618        kind: TypeKind::Struct,
7619        wire: true,
7620    },
7621    TypeContract {
7622        name: "storage_overall_posture",
7623        shape_version: 1,
7624        instance_format_version: None,
7625        kind: TypeKind::Enum,
7626        wire: true,
7627    },
7628    TypeContract {
7629        name: "storage_profile_role",
7630        shape_version: 1,
7631        instance_format_version: None,
7632        kind: TypeKind::Enum,
7633        wire: true,
7634    },
7635    TypeContract {
7636        name: "storage_provider_posture",
7637        shape_version: 1,
7638        instance_format_version: None,
7639        kind: TypeKind::Enum,
7640        wire: true,
7641    },
7642    TypeContract {
7643        name: "storage_backend_service_class",
7644        shape_version: 1,
7645        instance_format_version: None,
7646        kind: TypeKind::Enum,
7647        wire: true,
7648    },
7649    TypeContract {
7650        name: "storage_profile_role_binding",
7651        shape_version: 1,
7652        instance_format_version: None,
7653        kind: TypeKind::Struct,
7654        wire: true,
7655    },
7656    TypeContract {
7657        name: "storage_profile_attestation",
7658        shape_version: 1,
7659        instance_format_version: Some(1),
7660        kind: TypeKind::Struct,
7661        wire: true,
7662    },
7663    TypeContract {
7664        name: "storage_profile_expectation",
7665        shape_version: 1,
7666        instance_format_version: Some(1),
7667        kind: TypeKind::Struct,
7668        wire: true,
7669    },
7670    TypeContract {
7671        name: "core_binding",
7672        shape_version: 3,
7673        instance_format_version: None,
7674        kind: TypeKind::Struct,
7675        wire: true,
7676    },
7677    TypeContract {
7678        name: "readiness_observation",
7679        shape_version: 1,
7680        instance_format_version: None,
7681        kind: TypeKind::Struct,
7682        wire: true,
7683    },
7684    TypeContract {
7685        name: "usage_dimension",
7686        shape_version: 1,
7687        instance_format_version: None,
7688        kind: TypeKind::Struct,
7689        wire: true,
7690    },
7691    TypeContract {
7692        name: "physical_usage_value",
7693        shape_version: 2,
7694        instance_format_version: None,
7695        kind: TypeKind::Struct,
7696        wire: true,
7697    },
7698    TypeContract {
7699        name: "core_usage_units",
7700        shape_version: 2,
7701        instance_format_version: None,
7702        kind: TypeKind::Struct,
7703        wire: true,
7704    },
7705    TypeContract {
7706        name: "core_usage_correction",
7707        shape_version: 2,
7708        instance_format_version: None,
7709        kind: TypeKind::Struct,
7710        wire: true,
7711    },
7712    TypeContract {
7713        name: "response_meta",
7714        shape_version: 1,
7715        instance_format_version: Some(1),
7716        kind: TypeKind::Struct,
7717        wire: true,
7718    },
7719    TypeContract {
7720        name: "error_disposition",
7721        shape_version: 1,
7722        instance_format_version: None,
7723        kind: TypeKind::Enum,
7724        wire: true,
7725    },
7726    TypeContract {
7727        name: "recovery_action",
7728        shape_version: 1,
7729        instance_format_version: None,
7730        kind: TypeKind::Enum,
7731        wire: true,
7732    },
7733    TypeContract {
7734        name: "limit_class",
7735        shape_version: 1,
7736        instance_format_version: None,
7737        kind: TypeKind::Enum,
7738        wire: true,
7739    },
7740    TypeContract {
7741        name: "error_detail",
7742        shape_version: 3,
7743        instance_format_version: None,
7744        kind: TypeKind::TaggedUnion,
7745        wire: true,
7746    },
7747    TypeContract {
7748        name: "connection_profile",
7749        shape_version: 4,
7750        instance_format_version: Some(4),
7751        kind: TypeKind::Struct,
7752        wire: false,
7753    },
7754];
7755#[derive(Clone, Copy, Debug, Eq, PartialEq)]
7756pub struct StreamContract {
7757    pub name: &'static str,
7758    pub action: Action,
7759    pub transport: &'static str,
7760    pub service: &'static str,
7761    pub method: &'static str,
7762    pub auth_metadata: &'static str,
7763    pub auth_scheme: &'static str,
7764    pub semantic_format_version: u16,
7765    pub start_type: &'static str,
7766    pub frame_type: &'static str,
7767}
7768pub const LODESTONE_API_STREAM_CONTRACTS: &[StreamContract] = &[StreamContract {
7769    name: "subscription",
7770    action: Action::SubscriptionRead,
7771    transport: "grpc_tls",
7772    service: "lodestone.api.FilterSubscription",
7773    method: "/lodestone.api.FilterSubscription/Subscribe",
7774    auth_metadata: "authorization",
7775    auth_scheme: "ApiKey",
7776    semantic_format_version: 1,
7777    start_type: "subscription_start",
7778    frame_type: "subscription_frame",
7779}];
7780#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
7781#[serde(deny_unknown_fields)]
7782pub struct ErrorBody {
7783    pub code: ErrorCode,
7784    pub message: String,
7785    pub disposition: ErrorDisposition,
7786    pub recovery: RecoveryAction,
7787    pub details: ErrorDetail,
7788}
7789#[derive(Clone, Copy, Debug, Eq, PartialEq)]
7790pub enum ErrorShapeError {
7791    DetailCodeMismatch,
7792    OutcomeMismatch,
7793    RetryAfterOutOfRange,
7794}
7795impl ErrorBody {
7796    pub fn try_new(
7797        code: ErrorCode,
7798        message: String,
7799        disposition: ErrorDisposition,
7800        recovery: RecoveryAction,
7801        details: ErrorDetail,
7802    ) -> Result<Self, ErrorShapeError> {
7803        let body = Self {
7804            code,
7805            message,
7806            disposition,
7807            recovery,
7808            details,
7809        };
7810        validate_error_body(&body)?;
7811        Ok(body)
7812    }
7813    pub fn retry_safe(&self) -> bool {
7814        self.disposition == ErrorDisposition::NotSubmitted
7815            && matches!(
7816                self.recovery,
7817                RecoveryAction::Retry
7818                    | RecoveryAction::RetryAfter
7819                    | RecoveryAction::RefreshCredential
7820                    | RecoveryAction::RestartPage
7821                    | RecoveryAction::ReduceRequest
7822                    | RecoveryAction::RefreshPrecondition
7823                    | RecoveryAction::CorrectRange
7824            )
7825    }
7826    pub fn submitted(&self) -> bool {
7827        self.disposition != ErrorDisposition::NotSubmitted
7828    }
7829}
7830pub fn validate_error_body(body: &ErrorBody) -> Result<(), ErrorShapeError> {
7831    let detail_matches = matches!(
7832        (&body.code, &body.details),
7833        (ErrorCode::Aborted, ErrorDetail::Aborted { .. })
7834            | (ErrorCode::DeadlineExceeded, ErrorDetail::DeadlineExceeded)
7835            | (ErrorCode::InvalidRequest, ErrorDetail::InvalidRequest { .. })
7836            | (ErrorCode::UnsupportedVersion, ErrorDetail::UnsupportedVersion { .. })
7837            | (ErrorCode::Unauthenticated, ErrorDetail::Unauthenticated)
7838            | (ErrorCode::PermissionDenied, ErrorDetail::PermissionDenied { .. })
7839            | (ErrorCode::NotFound, ErrorDetail::NotFound { .. })
7840            | (ErrorCode::Conflict, ErrorDetail::Conflict { .. })
7841            | (ErrorCode::StaleCursor, ErrorDetail::StaleCursor { .. })
7842            | (
7843                ErrorCode::RestartBudgetExhausted,
7844                ErrorDetail::RestartBudgetExhausted { .. }
7845            )
7846            | (ErrorCode::LimitExceeded, ErrorDetail::LimitExceeded { .. })
7847            | (
7848                ErrorCode::CapabilityUnavailable,
7849                ErrorDetail::CapabilityUnavailable { .. }
7850            )
7851            | (ErrorCode::NotSubmitted, ErrorDetail::NotSubmitted { .. })
7852            | (
7853                ErrorCode::SubmittedIndeterminate,
7854                ErrorDetail::SubmittedIndeterminate { .. }
7855            )
7856            | (ErrorCode::ExpiredUnknown, ErrorDetail::ExpiredUnknown { .. })
7857            | (ErrorCode::SecretNotEscrowed, ErrorDetail::SecretNotEscrowed)
7858            | (ErrorCode::RetentionGap, ErrorDetail::RetentionGap { .. })
7859            | (
7860                ErrorCode::ArtifactRangeInvalid,
7861                ErrorDetail::ArtifactRangeInvalid { .. }
7862            )
7863            | (ErrorCode::ChecksumMismatch, ErrorDetail::ChecksumMismatch { .. })
7864            | (
7865                ErrorCode::TemporarilyUnavailable,
7866                ErrorDetail::TemporarilyUnavailable { .. }
7867            )
7868            | (ErrorCode::Internal, ErrorDetail::Internal)
7869    );
7870    if !detail_matches {
7871        return Err(ErrorShapeError::DetailCodeMismatch);
7872    }
7873    if !LODESTONE_API_ERROR_OUTCOMES.iter().any(|contract| {
7874        contract.code == body.code && contract.disposition == body.disposition && contract.recovery == body.recovery
7875    }) {
7876        return Err(ErrorShapeError::OutcomeMismatch);
7877    }
7878    let retry_after = match &body.details {
7879        ErrorDetail::NotSubmitted { retry_after_millis }
7880        | ErrorDetail::TemporarilyUnavailable { retry_after_millis } => retry_after_millis.as_ref(),
7881        _ => None,
7882    };
7883    if retry_after
7884        .and_then(|value| value.value.parse::<u64>().ok())
7885        .is_some_and(|value| value > 60000)
7886    {
7887        return Err(ErrorShapeError::RetryAfterOutOfRange);
7888    }
7889    Ok(())
7890}
7891#[derive(Clone, Debug, Deserialize, Eq, PartialEq, Serialize)]
7892#[serde(deny_unknown_fields)]
7893pub struct RequestMeta {
7894    pub format_version: u16,
7895    pub request_id: String,
7896    pub correlation_id: Identity,
7897    pub absolute_deadline_unix_millis: U64,
7898    pub workload_class: WorkloadClass,
7899}
7900
7901#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
7902#[serde(deny_unknown_fields)]
7903pub struct DiscoverRequest {}
7904
7905#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
7906#[serde(deny_unknown_fields)]
7907pub struct DiscoverResult {
7908    pub principal_id: Identity,
7909    pub collection_id: Identity,
7910    pub policy_revision: U64,
7911    pub artifact_version: String,
7912    pub schema_id: String,
7913    pub schema_digest: Digest,
7914    pub streams: Vec<StreamBinding>,
7915    pub capabilities: Vec<CapabilityGrant>,
7916    pub limits: Vec<ProtocolLimit>,
7917}
7918
7919#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
7920#[serde(deny_unknown_fields)]
7921pub struct ListIndexesRequest {
7922    pub page_size: u32,
7923    #[serde(default, skip_serializing_if = "Option::is_none")]
7924    pub cursor: Option<Cursor>,
7925    #[serde(default, skip_serializing_if = "Option::is_none")]
7926    pub name_prefix: Option<String>,
7927    #[serde(default, skip_serializing_if = "Option::is_none")]
7928    pub mode: Option<String>,
7929    #[serde(default, skip_serializing_if = "Option::is_none")]
7930    pub state: Option<String>,
7931    pub restart_count: u32,
7932}
7933
7934#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
7935#[serde(deny_unknown_fields)]
7936pub struct ListIndexesResult {
7937    pub items: Vec<IndexSummary>,
7938    #[serde(default, skip_serializing_if = "Option::is_none")]
7939    pub next_cursor: Option<Cursor>,
7940    pub restart_count: u32,
7941}
7942
7943#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
7944#[serde(deny_unknown_fields)]
7945pub struct GetIndexRequest {
7946    pub name: String,
7947    #[serde(default, skip_serializing_if = "Option::is_none")]
7948    pub expected_incarnation: Option<Identity>,
7949}
7950
7951#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
7952#[serde(deny_unknown_fields)]
7953pub struct GetIndexResult {
7954    pub resource: IndexDetail,
7955}
7956
7957#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
7958#[serde(deny_unknown_fields)]
7959pub struct ValidateIndexChangeRequest {
7960    pub action_kind: String,
7961    pub name: String,
7962    #[serde(default, skip_serializing_if = "Option::is_none")]
7963    pub expected_incarnation: Option<Identity>,
7964    #[serde(default, skip_serializing_if = "Option::is_none")]
7965    pub expected_revision: Option<U64>,
7966    #[serde(default, skip_serializing_if = "Option::is_none")]
7967    pub mode: Option<String>,
7968    #[serde(default, skip_serializing_if = "Option::is_none")]
7969    pub mapping: Option<Mapping>,
7970    #[serde(default, skip_serializing_if = "Option::is_none")]
7971    pub policies: Option<IndexPolicies>,
7972}
7973
7974#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
7975#[serde(deny_unknown_fields)]
7976pub struct ValidateIndexChangeResult {
7977    pub change_kind: String,
7978    pub fields_added: Vec<String>,
7979    pub policy_axes_changed: Vec<String>,
7980    pub required_capabilities: Vec<String>,
7981    pub catalog_revision: U64,
7982    pub policy_revision: U64,
7983}
7984
7985#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
7986#[serde(deny_unknown_fields)]
7987pub struct ApplyIndexChangeRequest {
7988    pub action_id: Digest,
7989    pub index: Resource,
7990    pub expected_revision: U64,
7991    #[serde(default, skip_serializing_if = "Option::is_none")]
7992    pub mapping: Option<Mapping>,
7993    #[serde(default, skip_serializing_if = "Option::is_none")]
7994    pub policies: Option<IndexPolicies>,
7995}
7996
7997#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
7998#[serde(deny_unknown_fields)]
7999pub struct ApplyIndexChangeResult {
8000    pub receipt: IndexChangeApplyReceipt,
8001}
8002
8003#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
8004#[serde(deny_unknown_fields)]
8005pub struct ApplyAdministrationMutationRequest {
8006    pub action_id: Digest,
8007    pub expected_revision: U64,
8008    pub mutation: AdministrationMutation,
8009}
8010
8011#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
8012#[serde(deny_unknown_fields)]
8013pub struct ApplyAdministrationMutationResult {
8014    pub outcome: AdministrationOutcome,
8015}
8016
8017#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
8018#[serde(deny_unknown_fields)]
8019pub struct ListAliasesRequest {
8020    pub page_size: u32,
8021    #[serde(default, skip_serializing_if = "Option::is_none")]
8022    pub cursor: Option<Cursor>,
8023    #[serde(default, skip_serializing_if = "Option::is_none")]
8024    pub name_prefix: Option<String>,
8025    pub restart_count: u32,
8026}
8027
8028#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
8029#[serde(deny_unknown_fields)]
8030pub struct ListAliasesResult {
8031    pub items: Vec<AliasSummary>,
8032    #[serde(default, skip_serializing_if = "Option::is_none")]
8033    pub next_cursor: Option<Cursor>,
8034    pub restart_count: u32,
8035}
8036
8037#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
8038#[serde(deny_unknown_fields)]
8039pub struct GetAliasRequest {
8040    pub name: String,
8041}
8042
8043#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
8044#[serde(deny_unknown_fields)]
8045pub struct GetAliasResult {
8046    pub resource: AliasDetail,
8047}
8048
8049#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
8050#[serde(deny_unknown_fields)]
8051pub struct ListDataStreamsRequest {
8052    pub page_size: u32,
8053    #[serde(default, skip_serializing_if = "Option::is_none")]
8054    pub cursor: Option<Cursor>,
8055    #[serde(default, skip_serializing_if = "Option::is_none")]
8056    pub name_prefix: Option<String>,
8057    pub restart_count: u32,
8058}
8059
8060#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
8061#[serde(deny_unknown_fields)]
8062pub struct ListDataStreamsResult {
8063    pub items: Vec<DataStreamSummary>,
8064    #[serde(default, skip_serializing_if = "Option::is_none")]
8065    pub next_cursor: Option<Cursor>,
8066    pub restart_count: u32,
8067}
8068
8069#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
8070#[serde(deny_unknown_fields)]
8071pub struct GetDataStreamRequest {
8072    pub name: String,
8073}
8074
8075#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
8076#[serde(deny_unknown_fields)]
8077pub struct GetDataStreamResult {
8078    pub resource: DataStreamDetail,
8079}
8080
8081#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
8082#[serde(deny_unknown_fields)]
8083pub struct ListComponentTemplatesRequest {
8084    pub page_size: u32,
8085    #[serde(default, skip_serializing_if = "Option::is_none")]
8086    pub cursor: Option<Cursor>,
8087    #[serde(default, skip_serializing_if = "Option::is_none")]
8088    pub name_prefix: Option<String>,
8089    pub restart_count: u32,
8090}
8091
8092#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
8093#[serde(deny_unknown_fields)]
8094pub struct ListComponentTemplatesResult {
8095    pub items: Vec<ComponentTemplateSummary>,
8096    #[serde(default, skip_serializing_if = "Option::is_none")]
8097    pub next_cursor: Option<Cursor>,
8098    pub restart_count: u32,
8099}
8100
8101#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
8102#[serde(deny_unknown_fields)]
8103pub struct GetComponentTemplateRequest {
8104    pub name: String,
8105    #[serde(default, skip_serializing_if = "Option::is_none")]
8106    pub expected_incarnation: Option<Identity>,
8107}
8108
8109#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
8110#[serde(deny_unknown_fields)]
8111pub struct GetComponentTemplateResult {
8112    pub resource: ComponentTemplateDetail,
8113}
8114
8115#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
8116#[serde(deny_unknown_fields)]
8117pub struct ListIndexTemplatesRequest {
8118    pub page_size: u32,
8119    #[serde(default, skip_serializing_if = "Option::is_none")]
8120    pub cursor: Option<Cursor>,
8121    #[serde(default, skip_serializing_if = "Option::is_none")]
8122    pub name_prefix: Option<String>,
8123    pub restart_count: u32,
8124}
8125
8126#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
8127#[serde(deny_unknown_fields)]
8128pub struct ListIndexTemplatesResult {
8129    pub items: Vec<IndexTemplateSummary>,
8130    #[serde(default, skip_serializing_if = "Option::is_none")]
8131    pub next_cursor: Option<Cursor>,
8132    pub restart_count: u32,
8133}
8134
8135#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
8136#[serde(deny_unknown_fields)]
8137pub struct GetIndexTemplateRequest {
8138    pub name: String,
8139    #[serde(default, skip_serializing_if = "Option::is_none")]
8140    pub expected_incarnation: Option<Identity>,
8141}
8142
8143#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
8144#[serde(deny_unknown_fields)]
8145pub struct GetIndexTemplateResult {
8146    pub resource: IndexTemplateDetail,
8147}
8148
8149#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
8150#[serde(deny_unknown_fields)]
8151pub struct ListIngestPipelinesRequest {
8152    pub page_size: u32,
8153    #[serde(default, skip_serializing_if = "Option::is_none")]
8154    pub cursor: Option<Cursor>,
8155    #[serde(default, skip_serializing_if = "Option::is_none")]
8156    pub name_prefix: Option<String>,
8157    pub restart_count: u32,
8158}
8159
8160#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
8161#[serde(deny_unknown_fields)]
8162pub struct ListIngestPipelinesResult {
8163    pub items: Vec<IngestPipelineSummary>,
8164    #[serde(default, skip_serializing_if = "Option::is_none")]
8165    pub next_cursor: Option<Cursor>,
8166    pub restart_count: u32,
8167}
8168
8169#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
8170#[serde(deny_unknown_fields)]
8171pub struct GetIngestPipelineRequest {
8172    pub name: String,
8173    #[serde(default, skip_serializing_if = "Option::is_none")]
8174    pub expected_incarnation: Option<Identity>,
8175}
8176
8177#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
8178#[serde(deny_unknown_fields)]
8179pub struct GetIngestPipelineResult {
8180    pub resource: IngestPipelineDetail,
8181}
8182
8183#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
8184#[serde(deny_unknown_fields)]
8185pub struct SimulateIngestPipelineRequest {
8186    #[serde(default, skip_serializing_if = "Option::is_none")]
8187    pub name: Option<String>,
8188    #[serde(default, skip_serializing_if = "Option::is_none")]
8189    pub expected: Option<ExpectedBinding>,
8190    #[serde(default, skip_serializing_if = "Option::is_none")]
8191    pub definition: Option<RawJson>,
8192    pub source: RawJson,
8193}
8194
8195#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
8196#[serde(deny_unknown_fields)]
8197pub struct SimulateIngestPipelineResult {
8198    #[serde(default, skip_serializing_if = "Option::is_none")]
8199    pub source: Option<RawJson>,
8200    pub dropped: bool,
8201    pub changed: bool,
8202}
8203
8204#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
8205#[serde(deny_unknown_fields)]
8206pub struct ReprocessByQueryRequest {
8207    pub action_id: Digest,
8208    pub index: Resource,
8209    pub query: Query,
8210    #[serde(default, skip_serializing_if = "Option::is_none")]
8211    pub pipeline: Option<IngestPipelineSelection>,
8212    pub batch_size: u32,
8213    pub max_docs: U64,
8214    pub proceed_on_conflict: bool,
8215    pub slices: u32,
8216    pub requests_per_second: u32,
8217    pub wait_for_completion: bool,
8218}
8219
8220#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
8221#[serde(deny_unknown_fields)]
8222pub struct ReprocessByQueryResult {
8223    pub task_id: Identity,
8224    pub scanned: U64,
8225    pub updated: U64,
8226    pub noops: U64,
8227    pub version_conflicts: U64,
8228    pub batches: U64,
8229    pub completed: bool,
8230}
8231
8232#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
8233#[serde(deny_unknown_fields)]
8234pub struct ListLifecyclePoliciesRequest {
8235    pub page_size: u32,
8236    #[serde(default, skip_serializing_if = "Option::is_none")]
8237    pub cursor: Option<Cursor>,
8238    #[serde(default, skip_serializing_if = "Option::is_none")]
8239    pub name_prefix: Option<String>,
8240    pub restart_count: u32,
8241}
8242
8243#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
8244#[serde(deny_unknown_fields)]
8245pub struct ListLifecyclePoliciesResult {
8246    pub items: Vec<LifecyclePolicySummary>,
8247    #[serde(default, skip_serializing_if = "Option::is_none")]
8248    pub next_cursor: Option<Cursor>,
8249    pub restart_count: u32,
8250}
8251
8252#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
8253#[serde(deny_unknown_fields)]
8254pub struct GetLifecyclePolicyRequest {
8255    pub name: String,
8256}
8257
8258#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
8259#[serde(deny_unknown_fields)]
8260pub struct GetLifecyclePolicyResult {
8261    pub resource: LifecyclePolicyDetail,
8262}
8263
8264#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
8265#[serde(deny_unknown_fields)]
8266pub struct PrepareCreateIndexRequest {
8267    pub name: String,
8268    pub mapping: Mapping,
8269    #[serde(default, skip_serializing_if = "Option::is_none")]
8270    pub resource_spec: Option<IndexResourceSpec>,
8271    #[serde(default, skip_serializing_if = "Option::is_none")]
8272    pub retained_event_identity: Option<bool>,
8273}
8274
8275#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
8276#[serde(deny_unknown_fields)]
8277pub struct PrepareCreateIndexResult {
8278    pub locator: Locator,
8279    pub expires_at: U64,
8280    pub semantic_digest: Digest,
8281    pub resource_spec: IndexResourceSpec,
8282}
8283
8284#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
8285#[serde(deny_unknown_fields)]
8286pub struct PrepareDeleteIndexRequest {
8287    pub name: String,
8288    pub expected_incarnation: Identity,
8289}
8290
8291#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
8292#[serde(deny_unknown_fields)]
8293pub struct PrepareDeleteIndexResult {
8294    #[serde(default, skip_serializing_if = "Option::is_none")]
8295    pub locator: Option<Locator>,
8296    #[serde(default, skip_serializing_if = "Option::is_none")]
8297    pub expires_at: Option<U64>,
8298    #[serde(default, skip_serializing_if = "Option::is_none")]
8299    pub semantic_digest: Option<Digest>,
8300    pub impact_digest: Digest,
8301    pub blockers: Vec<String>,
8302    pub scheduled_effects: Vec<String>,
8303    #[serde(default, skip_serializing_if = "Option::is_none")]
8304    pub estimated_documents: Option<U64>,
8305    #[serde(default, skip_serializing_if = "Option::is_none")]
8306    pub estimated_logical_bytes: Option<U64>,
8307}
8308
8309#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
8310#[serde(deny_unknown_fields)]
8311pub struct SubmitCatalogActionRequest {
8312    pub locator: Locator,
8313    pub semantic_digest: Digest,
8314    pub action_kind: String,
8315    pub name: String,
8316    #[serde(default, skip_serializing_if = "Option::is_none")]
8317    pub mapping: Option<Mapping>,
8318    #[serde(default, skip_serializing_if = "Option::is_none")]
8319    pub resource_spec: Option<IndexResourceSpec>,
8320    #[serde(default, skip_serializing_if = "Option::is_none")]
8321    pub expected_incarnation: Option<Identity>,
8322}
8323
8324#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
8325#[serde(deny_unknown_fields)]
8326pub struct SubmitCatalogActionResult {
8327    pub locator: Locator,
8328    pub state: String,
8329    pub mutation_outcome: MutationOutcome,
8330}
8331
8332#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
8333#[serde(deny_unknown_fields)]
8334pub struct ResolveCatalogActionRequest {
8335    pub locator: Locator,
8336}
8337
8338#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
8339#[serde(deny_unknown_fields)]
8340pub struct ResolveCatalogActionResult {
8341    pub locator: Locator,
8342    pub state: String,
8343    #[serde(default, skip_serializing_if = "Option::is_none")]
8344    pub resource: Option<Resource>,
8345}
8346
8347#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
8348#[serde(deny_unknown_fields)]
8349pub struct PrepareReplayableSourceIndexRequest {
8350    pub name: String,
8351    pub mapping: Mapping,
8352    #[serde(default, skip_serializing_if = "Option::is_none")]
8353    pub resource_spec: Option<IndexResourceSpec>,
8354    pub source: ReplayableSourceConfiguration,
8355}
8356
8357#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
8358#[serde(deny_unknown_fields)]
8359pub struct PrepareReplayableSourceIndexResult {
8360    pub locator: Locator,
8361    pub expires_at: U64,
8362    pub semantic_digest: Digest,
8363    pub resource_spec: IndexResourceSpec,
8364}
8365
8366#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
8367#[serde(deny_unknown_fields)]
8368pub struct SubmitReplayableSourceIndexRequest {
8369    pub locator: Locator,
8370    pub semantic_digest: Digest,
8371    pub name: String,
8372    pub mapping: Mapping,
8373    pub resource_spec: IndexResourceSpec,
8374    pub source: ReplayableSourceConfiguration,
8375}
8376
8377#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
8378#[serde(deny_unknown_fields)]
8379pub struct SubmitReplayableSourceIndexResult {
8380    pub locator: Locator,
8381    pub state: String,
8382    pub mutation_outcome: MutationOutcome,
8383}
8384
8385#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
8386#[serde(deny_unknown_fields)]
8387pub struct GetReplayableSourceRequest {
8388    pub index: Resource,
8389}
8390
8391#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
8392#[serde(deny_unknown_fields)]
8393pub struct GetReplayableSourceResult {
8394    pub status: ReplayableSourceStatus,
8395}
8396
8397#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
8398#[serde(deny_unknown_fields)]
8399pub struct ControlReplayableSourceRequest {
8400    pub index: Resource,
8401    pub expected_generation: U64,
8402    pub transition: SourceControlTransition,
8403}
8404
8405#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
8406#[serde(deny_unknown_fields)]
8407pub struct ControlReplayableSourceResult {
8408    pub status: ReplayableSourceStatus,
8409    pub mutation_outcome: MutationOutcome,
8410}
8411
8412#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
8413#[serde(deny_unknown_fields)]
8414pub struct CloneIndexRequest {
8415    pub source: Resource,
8416    pub destination_name: String,
8417    pub operation_id: Identity,
8418    pub source_cut_id: Identity,
8419}
8420
8421#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
8422#[serde(deny_unknown_fields)]
8423pub struct CloneIndexResult {
8424    pub destination: Resource,
8425    pub source_cut_id: Identity,
8426    pub mutation_outcome: MutationOutcome,
8427}
8428
8429#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
8430#[serde(deny_unknown_fields)]
8431pub struct ConfigureHistoryRequest {
8432    pub index: Resource,
8433    pub precondition: HistoryLedgerPrecondition,
8434    pub policy: HistoryRetentionPolicy,
8435}
8436
8437#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
8438#[serde(deny_unknown_fields)]
8439pub struct ConfigureHistoryResult {
8440    pub status: HistoryStatus,
8441    pub mutation_outcome: MutationOutcome,
8442}
8443
8444#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
8445#[serde(deny_unknown_fields)]
8446pub struct GetHistoryRequest {
8447    pub index: Resource,
8448}
8449
8450#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
8451#[serde(deny_unknown_fields)]
8452pub struct GetHistoryResult {
8453    pub status: HistoryStatus,
8454}
8455
8456#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
8457#[serde(deny_unknown_fields)]
8458pub struct ResolveHistoryRequest {
8459    pub index: Resource,
8460    pub selector: HistorySelector,
8461}
8462
8463#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
8464#[serde(deny_unknown_fields)]
8465pub struct ResolveHistoryResult {
8466    pub resolution: HistoryResolution,
8467}
8468
8469#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
8470#[serde(deny_unknown_fields)]
8471pub struct PlaceHistoryHoldRequest {
8472    pub index: Resource,
8473    pub expected_ledger_revision: U64,
8474    pub hold: HistoryHold,
8475}
8476
8477#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
8478#[serde(deny_unknown_fields)]
8479pub struct PlaceHistoryHoldResult {
8480    pub status: HistoryStatus,
8481    pub mutation_outcome: MutationOutcome,
8482}
8483
8484#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
8485#[serde(deny_unknown_fields)]
8486pub struct ReleaseHistoryHoldRequest {
8487    pub index: Resource,
8488    pub expected_ledger_revision: U64,
8489    pub hold_id: Identity,
8490}
8491
8492#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
8493#[serde(deny_unknown_fields)]
8494pub struct ReleaseHistoryHoldResult {
8495    pub status: HistoryStatus,
8496    pub mutation_outcome: MutationOutcome,
8497}
8498
8499#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
8500#[serde(deny_unknown_fields)]
8501pub struct PrepareDocumentMutationRequest {
8502    pub index: Resource,
8503    pub document_id: String,
8504    pub operation: String,
8505    #[serde(default, skip_serializing_if = "Option::is_none")]
8506    pub source: Option<RawJson>,
8507    #[serde(default, skip_serializing_if = "Option::is_none")]
8508    pub record: Option<NativeRecord>,
8509    #[serde(default, skip_serializing_if = "Option::is_none")]
8510    pub routing: Option<String>,
8511    #[serde(default, skip_serializing_if = "Option::is_none")]
8512    pub condition: Option<DocumentMutationCondition>,
8513    #[serde(default, skip_serializing_if = "Option::is_none")]
8514    pub pipeline: Option<IngestPipelineSelection>,
8515}
8516
8517#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
8518#[serde(deny_unknown_fields)]
8519pub struct PrepareDocumentMutationResult {
8520    pub locator: Locator,
8521    pub semantic_digest: Digest,
8522    pub retention_max_entries: U64,
8523    pub retention_sequence_window: U64,
8524}
8525
8526#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
8527#[serde(deny_unknown_fields)]
8528pub struct SubmitDocumentMutationRequest {
8529    pub locator: Locator,
8530    pub semantic_digest: Digest,
8531    pub index: Resource,
8532    pub document_id: String,
8533    pub operation: String,
8534    #[serde(default, skip_serializing_if = "Option::is_none")]
8535    pub source: Option<RawJson>,
8536    #[serde(default, skip_serializing_if = "Option::is_none")]
8537    pub record: Option<NativeRecord>,
8538    #[serde(default, skip_serializing_if = "Option::is_none")]
8539    pub routing: Option<String>,
8540    #[serde(default, skip_serializing_if = "Option::is_none")]
8541    pub condition: Option<DocumentMutationCondition>,
8542    #[serde(default, skip_serializing_if = "Option::is_none")]
8543    pub pipeline: Option<IngestPipelineSelection>,
8544}
8545
8546#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
8547#[serde(deny_unknown_fields)]
8548pub struct SubmitDocumentMutationResult {
8549    pub locator: Locator,
8550    pub state: String,
8551    pub mutation_outcome: MutationOutcome,
8552    #[serde(default, skip_serializing_if = "Option::is_none")]
8553    pub achievement: Option<WriteAchievement>,
8554    #[serde(default, skip_serializing_if = "Option::is_none")]
8555    pub sequence: Option<U64>,
8556    #[serde(default, skip_serializing_if = "Option::is_none")]
8557    pub mapping_generation: Option<U64>,
8558    pub mapping_adopted: bool,
8559    #[serde(default, skip_serializing_if = "Option::is_none")]
8560    pub commit_receipt: Option<MutationCommitReceipt>,
8561}
8562
8563#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
8564#[serde(deny_unknown_fields)]
8565pub struct PrepareDocumentBulkRequest {
8566    pub batch_id: Digest,
8567    pub index: Resource,
8568    pub items: Vec<BulkDocumentItem>,
8569}
8570
8571#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
8572#[serde(deny_unknown_fields)]
8573pub struct PrepareDocumentBulkResult {
8574    pub outcome: BulkDocumentOutcome,
8575}
8576
8577#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
8578#[serde(deny_unknown_fields)]
8579pub struct SubmitDocumentBulkRequest {
8580    pub batch_id: Digest,
8581    pub index: Resource,
8582    pub items: Vec<BulkDocumentItem>,
8583    pub preparations: Vec<BulkDocumentItemOutcome>,
8584}
8585
8586#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
8587#[serde(deny_unknown_fields)]
8588pub struct SubmitDocumentBulkResult {
8589    pub outcome: BulkDocumentOutcome,
8590}
8591
8592#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
8593#[serde(deny_unknown_fields)]
8594pub struct ResolveDocumentBulkRequest {
8595    pub batch_id: Digest,
8596    pub index: Resource,
8597    pub items: Vec<BulkDocumentItemOutcome>,
8598}
8599
8600#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
8601#[serde(deny_unknown_fields)]
8602pub struct ResolveDocumentBulkResult {
8603    pub outcome: BulkDocumentOutcome,
8604}
8605
8606#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
8607#[serde(deny_unknown_fields)]
8608pub struct PrepareAppendBulkRequest {
8609    pub batch_id: Digest,
8610    pub index: Resource,
8611    pub items: Vec<RetainedAppendItem>,
8612}
8613
8614#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
8615#[serde(deny_unknown_fields)]
8616pub struct PrepareAppendBulkResult {
8617    pub outcome: RetainedAppendBulkOutcome,
8618}
8619
8620#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
8621#[serde(deny_unknown_fields)]
8622pub struct SubmitAppendBulkRequest {
8623    pub batch_id: Digest,
8624    pub index: Resource,
8625    pub items: Vec<RetainedAppendItem>,
8626    pub preparations: Vec<RetainedAppendItemOutcome>,
8627}
8628
8629#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
8630#[serde(deny_unknown_fields)]
8631pub struct SubmitAppendBulkResult {
8632    pub outcome: RetainedAppendBulkOutcome,
8633}
8634
8635#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
8636#[serde(deny_unknown_fields)]
8637pub struct ResolveAppendBulkRequest {
8638    pub batch_id: Digest,
8639    pub index: Resource,
8640    pub items: Vec<RetainedAppendItemOutcome>,
8641}
8642
8643#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
8644#[serde(deny_unknown_fields)]
8645pub struct ResolveAppendBulkResult {
8646    pub outcome: RetainedAppendBulkOutcome,
8647}
8648
8649#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
8650#[serde(deny_unknown_fields)]
8651pub struct ObserveAppendCommittedRequest {
8652    pub index: Resource,
8653    pub locator: Locator,
8654}
8655
8656#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
8657#[serde(deny_unknown_fields)]
8658pub struct ObserveAppendCommittedResult {
8659    pub outcome: RetainedAppendObservationOutcome,
8660}
8661
8662#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
8663#[serde(deny_unknown_fields)]
8664pub struct ResolveDocumentMutationRequest {
8665    pub locator: Locator,
8666}
8667
8668#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
8669#[serde(deny_unknown_fields)]
8670pub struct ResolveDocumentMutationResult {
8671    pub locator: Locator,
8672    pub state: String,
8673    #[serde(default, skip_serializing_if = "Option::is_none")]
8674    pub sequence: Option<U64>,
8675    #[serde(default, skip_serializing_if = "Option::is_none")]
8676    pub mapping_generation: Option<U64>,
8677    pub mapping_adopted: bool,
8678    #[serde(default, skip_serializing_if = "Option::is_none")]
8679    pub source: Option<RawJson>,
8680    #[serde(default, skip_serializing_if = "Option::is_none")]
8681    pub commit_receipt: Option<MutationCommitReceipt>,
8682}
8683
8684#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
8685#[serde(deny_unknown_fields)]
8686pub struct GetDocumentRequest {
8687    pub index: Resource,
8688    pub document_id: String,
8689    #[serde(default, skip_serializing_if = "Option::is_none")]
8690    pub routing: Option<String>,
8691}
8692
8693#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
8694#[serde(deny_unknown_fields)]
8695pub struct GetDocumentResult {
8696    pub found: bool,
8697    #[serde(default, skip_serializing_if = "Option::is_none")]
8698    pub source: Option<RawJson>,
8699    #[serde(default, skip_serializing_if = "Option::is_none")]
8700    pub sequence: Option<U64>,
8701    #[serde(default, skip_serializing_if = "Option::is_none")]
8702    pub primary_term: Option<U64>,
8703}
8704
8705#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
8706#[serde(deny_unknown_fields)]
8707pub struct SearchRequest {
8708    #[serde(default, skip_serializing_if = "Option::is_none")]
8709    pub indexes: Option<Vec<Resource>>,
8710    #[serde(default, skip_serializing_if = "Option::is_none")]
8711    pub query: Option<Query>,
8712    #[serde(default, skip_serializing_if = "Option::is_none")]
8713    pub retrieval: Option<RetrievalPlan>,
8714    #[serde(default, skip_serializing_if = "Option::is_none")]
8715    pub aggregations: Option<Vec<Aggregation>>,
8716    pub sort: Vec<SortSpec>,
8717    #[serde(default, skip_serializing_if = "Option::is_none")]
8718    pub routing: Option<Vec<String>>,
8719    pub freshness: SearchFreshness,
8720    pub page_size: u32,
8721    #[serde(default, skip_serializing_if = "Option::is_none")]
8722    pub cursor: Option<Cursor>,
8723    #[serde(default, skip_serializing_if = "Option::is_none")]
8724    pub pit: Option<Cursor>,
8725    pub allow_partial: bool,
8726    #[serde(default, skip_serializing_if = "Option::is_none")]
8727    pub total_hits_threshold: Option<U64>,
8728    pub diagnostics: bool,
8729    #[serde(default, skip_serializing_if = "Option::is_none")]
8730    pub fragments: Option<FragmentRequest>,
8731    #[serde(default, skip_serializing_if = "Option::is_none")]
8732    pub features: Option<ResultFeatureRequest>,
8733    #[serde(default, skip_serializing_if = "Option::is_none")]
8734    pub diversification: Option<ResultDiversification>,
8735    #[serde(default, skip_serializing_if = "Option::is_none")]
8736    pub source_projection: Option<SourceProjection>,
8737}
8738
8739#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
8740#[serde(deny_unknown_fields)]
8741pub struct SearchResult {
8742    pub hits: Vec<SearchHit>,
8743    pub aggregations: Vec<AggregationResult>,
8744    #[serde(default, skip_serializing_if = "Option::is_none")]
8745    pub next_cursor: Option<Cursor>,
8746    pub timed_out: bool,
8747    pub partial: bool,
8748    pub achieved: SearchAchievement,
8749    pub shards: ShardCounts,
8750    pub total: SearchTotal,
8751    pub failures: Vec<SearchPartialFailure>,
8752    pub vector_diagnostics: Vec<VectorBranchDiagnostics>,
8753}
8754
8755#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
8756#[serde(deny_unknown_fields)]
8757pub struct TraverseRelationshipsRequest {
8758    pub pit: Cursor,
8759    pub indexes: Vec<Resource>,
8760    pub seeds: Vec<EntityRef>,
8761    pub direction: RelationshipTraversalDirection,
8762    pub filter: RelationshipTraversalFilter,
8763    pub budget: RelationshipTraversalBudget,
8764    pub allow_partial: bool,
8765}
8766
8767#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
8768#[serde(deny_unknown_fields)]
8769pub struct TraverseRelationshipsResult {
8770    pub relationships: Vec<TraversedRelationship>,
8771    pub visited_entities: Vec<EntityRef>,
8772    pub input_cut_digest: Digest,
8773    pub partial: bool,
8774    pub incomplete_frontier: Vec<EntityRef>,
8775    pub failures: Vec<SearchPartialFailure>,
8776}
8777
8778#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
8779#[serde(deny_unknown_fields)]
8780pub struct QueryProfilesRequest {
8781    pub pit: Cursor,
8782    pub indexes: Vec<Resource>,
8783    pub operation: ProfileQueryOperation,
8784    pub start_unix_nanos: U64,
8785    pub end_unix_nanos: U64,
8786    pub sample_type: String,
8787    pub unit: String,
8788    pub filter: ProfileQueryFilter,
8789    #[serde(default, skip_serializing_if = "Option::is_none")]
8790    pub group_by: Option<ProfileGroupBy>,
8791    pub budget: ProfileQueryBudget,
8792    pub allow_partial: bool,
8793}
8794
8795#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
8796#[serde(deny_unknown_fields)]
8797pub struct QueryProfilesResult {
8798    pub rows: Vec<ProfileQueryRow>,
8799    pub evaluated_batches: u32,
8800    pub evaluated_samples: u32,
8801    pub input_cut_digest: Digest,
8802    pub partial: bool,
8803    pub approximate: bool,
8804    pub failures: Vec<SearchPartialFailure>,
8805}
8806
8807#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
8808#[serde(deny_unknown_fields)]
8809pub struct EvaluateTemporalEvidenceRequest {
8810    pub pit: Cursor,
8811    pub definition: HistoricalTemporalDefinition,
8812}
8813
8814#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
8815#[serde(deny_unknown_fields)]
8816pub struct EvaluateTemporalEvidenceResult {
8817    pub evidence: Vec<TemporalEvidence>,
8818    pub input_cut_digest: Digest,
8819    pub pattern_digest: Digest,
8820    pub evaluated_events: u32,
8821}
8822
8823#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
8824#[serde(deny_unknown_fields)]
8825pub struct CreateContinuousTemporalEvaluationRequest {
8826    pub action_id: Digest,
8827    pub definition: ContinuousTemporalDefinition,
8828}
8829
8830#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
8831#[serde(deny_unknown_fields)]
8832pub struct CreateContinuousTemporalEvaluationResult {
8833    pub evaluation: ContinuousTemporalEvaluation,
8834    pub mutation_outcome: MutationOutcome,
8835}
8836
8837#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
8838#[serde(deny_unknown_fields)]
8839pub struct GetContinuousTemporalEvaluationRequest {
8840    pub evaluation_id: Identity,
8841}
8842
8843#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
8844#[serde(deny_unknown_fields)]
8845pub struct GetContinuousTemporalEvaluationResult {
8846    pub evaluation: ContinuousTemporalEvaluation,
8847}
8848
8849#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
8850#[serde(deny_unknown_fields)]
8851pub struct PauseContinuousTemporalEvaluationRequest {
8852    pub action_id: Digest,
8853    pub evaluation_id: Identity,
8854    pub expected_revision: U64,
8855}
8856
8857#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
8858#[serde(deny_unknown_fields)]
8859pub struct PauseContinuousTemporalEvaluationResult {
8860    pub evaluation: ContinuousTemporalEvaluation,
8861    pub mutation_outcome: MutationOutcome,
8862}
8863
8864#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
8865#[serde(deny_unknown_fields)]
8866pub struct ResumeContinuousTemporalEvaluationRequest {
8867    pub action_id: Digest,
8868    pub evaluation_id: Identity,
8869    pub expected_revision: U64,
8870}
8871
8872#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
8873#[serde(deny_unknown_fields)]
8874pub struct ResumeContinuousTemporalEvaluationResult {
8875    pub evaluation: ContinuousTemporalEvaluation,
8876    pub mutation_outcome: MutationOutcome,
8877}
8878
8879#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
8880#[serde(deny_unknown_fields)]
8881pub struct ReplaceContinuousTemporalEvaluationRequest {
8882    pub action_id: Digest,
8883    pub expected_revision: U64,
8884    pub definition: ContinuousTemporalDefinition,
8885}
8886
8887#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
8888#[serde(deny_unknown_fields)]
8889pub struct ReplaceContinuousTemporalEvaluationResult {
8890    pub evaluation: ContinuousTemporalEvaluation,
8891    pub mutation_outcome: MutationOutcome,
8892}
8893
8894#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
8895#[serde(deny_unknown_fields)]
8896pub struct RetireContinuousTemporalEvaluationRequest {
8897    pub action_id: Digest,
8898    pub evaluation_id: Identity,
8899    pub expected_revision: U64,
8900}
8901
8902#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
8903#[serde(deny_unknown_fields)]
8904pub struct RetireContinuousTemporalEvaluationResult {
8905    #[serde(default, skip_serializing_if = "Option::is_none")]
8906    pub evaluation: Option<ContinuousTemporalEvaluation>,
8907    pub mutation_outcome: MutationOutcome,
8908}
8909
8910#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
8911#[serde(deny_unknown_fields)]
8912pub struct ReadContinuousTemporalEvidenceRequest {
8913    pub evaluation_id: Identity,
8914    pub expected_revision: U64,
8915    pub minimum_event_time_unix_nanos: U64,
8916    pub page_size: u32,
8917    #[serde(default, skip_serializing_if = "Option::is_none")]
8918    pub cursor: Option<Cursor>,
8919}
8920
8921#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
8922#[serde(deny_unknown_fields)]
8923pub struct ReadContinuousTemporalEvidenceResult {
8924    pub evidence: Vec<TemporalEvidence>,
8925    #[serde(default, skip_serializing_if = "Option::is_none")]
8926    pub next_cursor: Option<Cursor>,
8927    pub retained_floor_unix_nanos: U64,
8928    pub evaluation_revision: U64,
8929}
8930
8931#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
8932#[serde(deny_unknown_fields)]
8933pub struct ValidateSearchRequest {
8934    pub indexes: Vec<Resource>,
8935    #[serde(default, skip_serializing_if = "Option::is_none")]
8936    pub query: Option<Query>,
8937    #[serde(default, skip_serializing_if = "Option::is_none")]
8938    pub retrieval: Option<RetrievalPlan>,
8939    #[serde(default, skip_serializing_if = "Option::is_none")]
8940    pub aggregations: Option<Vec<Aggregation>>,
8941    pub sort: Vec<SortSpec>,
8942    #[serde(default, skip_serializing_if = "Option::is_none")]
8943    pub routing: Option<Vec<String>>,
8944    pub freshness: SearchFreshness,
8945    pub page_size: u32,
8946    pub allow_partial: bool,
8947    #[serde(default, skip_serializing_if = "Option::is_none")]
8948    pub total_hits_threshold: Option<U64>,
8949    #[serde(default, skip_serializing_if = "Option::is_none")]
8950    pub fragments: Option<FragmentRequest>,
8951    #[serde(default, skip_serializing_if = "Option::is_none")]
8952    pub features: Option<ResultFeatureRequest>,
8953    #[serde(default, skip_serializing_if = "Option::is_none")]
8954    pub diversification: Option<ResultDiversification>,
8955    #[serde(default, skip_serializing_if = "Option::is_none")]
8956    pub source_projection: Option<SourceProjection>,
8957}
8958
8959#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
8960#[serde(deny_unknown_fields)]
8961pub struct ValidateSearchResult {
8962    pub catalog_revision: U64,
8963    pub resolved_indexes: Vec<Resource>,
8964    pub authorized: bool,
8965    pub capabilities: Vec<String>,
8966    pub shape_digest: Digest,
8967    pub warnings: Vec<String>,
8968    pub refusals: Vec<String>,
8969    pub limits: Vec<SearchValidationLimit>,
8970    pub estimates: SearchValidationEstimates,
8971}
8972
8973#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
8974#[serde(deny_unknown_fields)]
8975pub struct OpenPitRequest {
8976    pub indexes: Vec<Resource>,
8977    pub keep_alive_millis: U64,
8978}
8979
8980#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
8981#[serde(deny_unknown_fields)]
8982pub struct OpenPitResult {
8983    pub pit: Cursor,
8984    pub expires_at: U64,
8985    pub shard_count: u32,
8986}
8987
8988#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
8989#[serde(deny_unknown_fields)]
8990pub struct RenewPitRequest {
8991    pub pit: Cursor,
8992    pub keep_alive_millis: U64,
8993}
8994
8995#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
8996#[serde(deny_unknown_fields)]
8997pub struct RenewPitResult {
8998    pub pit: Cursor,
8999    pub expires_at: U64,
9000    pub shard_count: u32,
9001}
9002
9003#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
9004#[serde(deny_unknown_fields)]
9005pub struct ClosePitRequest {
9006    pub pit: Cursor,
9007}
9008
9009#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
9010#[serde(deny_unknown_fields)]
9011pub struct ClosePitResult {
9012    pub removed: bool,
9013}
9014
9015#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
9016#[serde(deny_unknown_fields)]
9017pub struct ListOperationsRequest {
9018    pub page_size: u32,
9019    #[serde(default, skip_serializing_if = "Option::is_none")]
9020    pub cursor: Option<Cursor>,
9021}
9022
9023#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
9024#[serde(deny_unknown_fields)]
9025pub struct ListOperationsResult {
9026    pub items: Vec<Operation>,
9027    #[serde(default, skip_serializing_if = "Option::is_none")]
9028    pub next_cursor: Option<Cursor>,
9029}
9030
9031#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
9032#[serde(deny_unknown_fields)]
9033pub struct GetOperationRequest {
9034    pub locator: Locator,
9035}
9036
9037#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
9038#[serde(deny_unknown_fields)]
9039pub struct GetOperationResult {
9040    pub operation: Operation,
9041}
9042
9043#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
9044#[serde(deny_unknown_fields)]
9045pub struct WaitOperationRequest {
9046    pub locator: Locator,
9047    pub after_authority_revision: U64,
9048    pub maximum_attempts: u32,
9049    pub interval_millis: U64,
9050}
9051
9052#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
9053#[serde(deny_unknown_fields)]
9054pub struct WaitOperationResult {
9055    pub operation: Operation,
9056    pub attempts: u32,
9057}
9058
9059#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
9060#[serde(deny_unknown_fields)]
9061pub struct CancelOperationRequest {
9062    pub locator: Locator,
9063    pub expected_authority_revision: U64,
9064    pub cancel_action: Identity,
9065}
9066
9067#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
9068#[serde(deny_unknown_fields)]
9069pub struct CancelOperationResult {
9070    pub locator: Locator,
9071    pub cancel_generation: U64,
9072    pub mutation_outcome: MutationOutcome,
9073}
9074
9075#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
9076#[serde(deny_unknown_fields)]
9077pub struct ListAuditEventsRequest {
9078    pub start_time: U64,
9079    pub end_time: U64,
9080    pub actions: Vec<String>,
9081    pub page_size: u32,
9082    #[serde(default, skip_serializing_if = "Option::is_none")]
9083    pub cursor: Option<Cursor>,
9084}
9085
9086#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
9087#[serde(deny_unknown_fields)]
9088pub struct ListAuditEventsResult {
9089    pub stream: AuditStreamState,
9090    pub events: Vec<AuditEvent>,
9091    #[serde(default, skip_serializing_if = "Option::is_none")]
9092    pub next_cursor: Option<Cursor>,
9093    pub gaps: Vec<AuditGap>,
9094    pub object_reads: u32,
9095}
9096
9097#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
9098#[serde(deny_unknown_fields)]
9099pub struct ExportAuditEventsRequest {
9100    pub start_time: U64,
9101    pub end_time: U64,
9102    pub actions: Vec<String>,
9103    pub page_size: u32,
9104    #[serde(default, skip_serializing_if = "Option::is_none")]
9105    pub cursor: Option<Cursor>,
9106}
9107
9108#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
9109#[serde(deny_unknown_fields)]
9110pub struct ExportAuditEventsResult {
9111    pub stream: AuditStreamState,
9112    pub events: Vec<AuditEvent>,
9113    #[serde(default, skip_serializing_if = "Option::is_none")]
9114    pub next_cursor: Option<Cursor>,
9115    pub gaps: Vec<AuditGap>,
9116    pub object_reads: u32,
9117}
9118
9119#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
9120#[serde(deny_unknown_fields)]
9121pub struct ReserveServiceCredentialRequest {
9122    pub reservation_action_id: Digest,
9123    pub activation_action_id: Digest,
9124    pub role_grants: Vec<ServiceCredentialGrant>,
9125    pub credential_expires_at: U64,
9126    pub reservation_expires_at: U64,
9127}
9128
9129#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
9130#[serde(deny_unknown_fields)]
9131pub struct ReserveServiceCredentialResult {
9132    pub reservation: ServiceCredentialReservation,
9133}
9134
9135#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
9136#[serde(deny_unknown_fields)]
9137pub struct ReserveServiceCredentialRotationRequest {
9138    pub reservation_action_id: Digest,
9139    pub activation_action_id: Digest,
9140    pub current_api_key_id: Identity,
9141    pub expected_generation: U64,
9142    pub credential_expires_at: U64,
9143    pub overlap_until: U64,
9144    pub reservation_expires_at: U64,
9145}
9146
9147#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
9148#[serde(deny_unknown_fields)]
9149pub struct ReserveServiceCredentialRotationResult {
9150    pub reservation: ServiceCredentialReservation,
9151}
9152
9153#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
9154#[serde(deny_unknown_fields)]
9155pub struct ActivateServiceCredentialRequest {
9156    pub reservation: ServiceCredentialReservation,
9157    pub verifier: Digest,
9158}
9159
9160#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
9161#[serde(deny_unknown_fields)]
9162pub struct ActivateServiceCredentialResult {
9163    pub locator: Locator,
9164    pub outcome: SecurityActionOutcome,
9165    pub secret_escrowed: bool,
9166}
9167
9168#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
9169#[serde(deny_unknown_fields)]
9170pub struct ResolveServiceCredentialReservationRequest {
9171    pub reservation_action_id: Digest,
9172}
9173
9174#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
9175#[serde(deny_unknown_fields)]
9176pub struct ResolveServiceCredentialReservationResult {
9177    pub state: String,
9178    #[serde(default, skip_serializing_if = "Option::is_none")]
9179    pub reservation: Option<ServiceCredentialReservation>,
9180    #[serde(default, skip_serializing_if = "Option::is_none")]
9181    pub outcome: Option<SecurityActionOutcome>,
9182}
9183
9184#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
9185#[serde(deny_unknown_fields)]
9186pub struct PrepareRevokeServiceCredentialRequest {
9187    pub api_key_id: Identity,
9188    pub expected_generation: U64,
9189}
9190
9191#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
9192#[serde(deny_unknown_fields)]
9193pub struct PrepareRevokeServiceCredentialResult {
9194    pub locator: Locator,
9195    pub semantic_digest: Digest,
9196    pub expires_at: U64,
9197}
9198
9199#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
9200#[serde(deny_unknown_fields)]
9201pub struct RevokeServiceCredentialRequest {
9202    pub locator: Locator,
9203    pub api_key_id: Identity,
9204    pub expected_generation: U64,
9205}
9206
9207#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
9208#[serde(deny_unknown_fields)]
9209pub struct RevokeServiceCredentialResult {
9210    pub locator: Locator,
9211    pub principal_id: Identity,
9212    pub api_key_id: Identity,
9213    pub state: String,
9214}
9215
9216#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
9217#[serde(deny_unknown_fields)]
9218pub struct ResolveSecurityActionRequest {
9219    pub locator: Locator,
9220}
9221
9222#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
9223#[serde(deny_unknown_fields)]
9224pub struct ResolveSecurityActionResult {
9225    pub locator: Locator,
9226    pub state: String,
9227    #[serde(default, skip_serializing_if = "Option::is_none")]
9228    pub result: Option<SecurityActionOutcome>,
9229    pub secret_escrowed: bool,
9230}
9231
9232#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
9233#[serde(deny_unknown_fields)]
9234pub struct GetSecurityRoleRequest {
9235    pub role_name: String,
9236}
9237
9238#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
9239#[serde(deny_unknown_fields)]
9240pub struct GetSecurityRoleResult {
9241    pub role: SecurityRole,
9242}
9243
9244#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
9245#[serde(deny_unknown_fields)]
9246pub struct PrepareRoleAppendAccessChangeRequest {
9247    pub role_name: String,
9248    pub expected_role_version: U64,
9249    pub changes: Vec<RoleAppendScopeChange>,
9250}
9251
9252#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
9253#[serde(deny_unknown_fields)]
9254pub struct PrepareRoleAppendAccessChangeResult {
9255    pub preparation: RoleAppendAccessPreparation,
9256}
9257
9258#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
9259#[serde(deny_unknown_fields)]
9260pub struct SubmitRoleAppendAccessChangeRequest {
9261    pub locator: Locator,
9262    pub semantic_digest: Digest,
9263    pub role_name: String,
9264    pub expected_role_version: U64,
9265    pub changes: Vec<RoleAppendScopeChange>,
9266}
9267
9268#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
9269#[serde(deny_unknown_fields)]
9270pub struct SubmitRoleAppendAccessChangeResult {
9271    pub locator: Locator,
9272    pub state: String,
9273    pub target_policy_revision: U64,
9274    pub role: SecurityRole,
9275}
9276
9277#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
9278#[serde(deny_unknown_fields)]
9279pub struct ListServiceCredentialsRequest {
9280    pub page_size: u32,
9281    #[serde(default, skip_serializing_if = "Option::is_none")]
9282    pub cursor: Option<Cursor>,
9283}
9284
9285#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
9286#[serde(deny_unknown_fields)]
9287pub struct ListServiceCredentialsResult {
9288    pub items: Vec<ServiceCredentialSummary>,
9289    #[serde(default, skip_serializing_if = "Option::is_none")]
9290    pub next_cursor: Option<Cursor>,
9291}
9292
9293#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
9294#[serde(deny_unknown_fields)]
9295pub struct GetRuntimeStatusRequest {}
9296
9297#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
9298#[serde(deny_unknown_fields)]
9299pub struct GetRuntimeStatusResult {
9300    pub ready: bool,
9301    pub recovery_era: Identity,
9302    pub catalog_revision: U64,
9303    pub policy_revision: U64,
9304    pub redacted: RuntimeStatusDetail,
9305}
9306
9307#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
9308#[serde(deny_unknown_fields)]
9309pub struct GetResultCacheStatusRequest {}
9310
9311#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
9312#[serde(deny_unknown_fields)]
9313pub struct GetResultCacheStatusResult {
9314    pub status: ResultCacheStatus,
9315}
9316
9317#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
9318#[serde(deny_unknown_fields)]
9319pub struct GetFieldPromotionStatusRequest {
9320    pub index: Resource,
9321}
9322
9323#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
9324#[serde(deny_unknown_fields)]
9325pub struct GetFieldPromotionStatusResult {
9326    pub status: FieldPromotionStatus,
9327}
9328
9329#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
9330#[serde(deny_unknown_fields)]
9331pub struct GetOverloadStatusRequest {
9332    pub index: Resource,
9333}
9334
9335#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
9336#[serde(deny_unknown_fields)]
9337pub struct GetOverloadStatusResult {
9338    pub runtime_observed: bool,
9339    pub shards: Vec<OverloadShardStatus>,
9340}
9341
9342#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
9343#[serde(deny_unknown_fields)]
9344pub struct ConfigureExternalKeyRequest {
9345    pub index: Resource,
9346    pub expected_authority_revision: U64,
9347    pub binding: ExternalKeyBinding,
9348}
9349
9350#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
9351#[serde(deny_unknown_fields)]
9352pub struct ConfigureExternalKeyResult {
9353    pub status: LifecycleStatus,
9354    pub mutation_outcome: MutationOutcome,
9355}
9356
9357#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
9358#[serde(deny_unknown_fields)]
9359pub struct RotateExternalKeyBindingRequest {
9360    pub index: Resource,
9361    pub expected_authority_revision: U64,
9362    pub predecessor_binding_id: Identity,
9363    pub binding: ExternalKeyBinding,
9364}
9365
9366#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
9367#[serde(deny_unknown_fields)]
9368pub struct RotateExternalKeyBindingResult {
9369    pub status: LifecycleStatus,
9370    pub mutation_outcome: MutationOutcome,
9371}
9372
9373#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
9374#[serde(deny_unknown_fields)]
9375pub struct ConfigureAggregateThenDeleteRequest {
9376    pub index: Resource,
9377    pub expected_authority_revision: U64,
9378    pub policy: AggregateThenDeletePolicy,
9379}
9380
9381#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
9382#[serde(deny_unknown_fields)]
9383pub struct ConfigureAggregateThenDeleteResult {
9384    pub status: LifecycleStatus,
9385    pub mutation_outcome: MutationOutcome,
9386}
9387
9388#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
9389#[serde(deny_unknown_fields)]
9390pub struct GetLifecycleStatusRequest {
9391    pub index: Resource,
9392}
9393
9394#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
9395#[serde(deny_unknown_fields)]
9396pub struct GetLifecycleStatusResult {
9397    pub status: LifecycleStatus,
9398}
9399
9400#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
9401#[serde(deny_unknown_fields)]
9402pub struct GetQuotaRequest {}
9403
9404#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
9405#[serde(deny_unknown_fields)]
9406pub struct GetQuotaResult {
9407    pub revision: U64,
9408    pub limits: Vec<QuotaLimit>,
9409    pub usage: Vec<QuotaConsumption>,
9410}
9411
9412#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
9413#[serde(deny_unknown_fields)]
9414pub struct UpdateQuotaRequest {
9415    pub expected_revision: U64,
9416    pub limits: Vec<QuotaLimit>,
9417}
9418
9419#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
9420#[serde(deny_unknown_fields)]
9421pub struct UpdateQuotaResult {
9422    pub update: QuotaUpdate,
9423}
9424
9425#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
9426#[serde(deny_unknown_fields)]
9427pub struct GetBindingRequest {}
9428
9429#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
9430#[serde(deny_unknown_fields)]
9431pub struct GetBindingResult {
9432    pub binding: CoreBinding,
9433    pub derived: bool,
9434    pub revision: U64,
9435}
9436
9437#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
9438#[serde(deny_unknown_fields)]
9439pub struct GetAdmissionStatusRequest {}
9440
9441#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
9442#[serde(deny_unknown_fields)]
9443pub struct GetAdmissionStatusResult {
9444    pub state: String,
9445    pub revision: U64,
9446    pub converged: bool,
9447}
9448
9449#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
9450#[serde(deny_unknown_fields)]
9451pub struct SetAdmissionRequest {
9452    pub expected_revision: U64,
9453    pub state: String,
9454}
9455
9456#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
9457#[serde(deny_unknown_fields)]
9458pub struct SetAdmissionResult {
9459    pub state: String,
9460    pub revision: U64,
9461    pub converged: bool,
9462}
9463
9464#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
9465#[serde(deny_unknown_fields)]
9466pub struct GetQuiesceStatusRequest {}
9467
9468#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
9469#[serde(deny_unknown_fields)]
9470pub struct GetQuiesceStatusResult {
9471    pub ready: bool,
9472    pub blockers: Vec<String>,
9473    pub observations: Vec<ReadinessObservation>,
9474    pub recovery_era: Identity,
9475    pub observed_at: U64,
9476    pub expires_at: U64,
9477}
9478
9479#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
9480#[serde(deny_unknown_fields)]
9481pub struct GetDecommissionReadinessRequest {}
9482
9483#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
9484#[serde(deny_unknown_fields)]
9485pub struct GetDecommissionReadinessResult {
9486    pub ready: bool,
9487    pub blockers: Vec<String>,
9488    pub observations: Vec<ReadinessObservation>,
9489    pub recovery_era: Identity,
9490    pub observed_at: U64,
9491    pub expires_at: U64,
9492}
9493
9494#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
9495#[serde(deny_unknown_fields)]
9496pub struct GetUpgradeReadinessRequest {}
9497
9498#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
9499#[serde(deny_unknown_fields)]
9500pub struct GetUpgradeReadinessResult {
9501    pub ready: bool,
9502    pub blockers: Vec<String>,
9503    pub observations: Vec<ReadinessObservation>,
9504    pub recovery_era: Identity,
9505    pub observed_at: U64,
9506    pub expires_at: U64,
9507}
9508
9509#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
9510#[serde(deny_unknown_fields)]
9511pub struct GetMaintenanceStatusRequest {
9512    pub page_size: u32,
9513    #[serde(default, skip_serializing_if = "Option::is_none")]
9514    pub cursor: Option<Cursor>,
9515    #[serde(default, skip_serializing_if = "Option::is_none")]
9516    pub index: Option<Resource>,
9517}
9518
9519#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
9520#[serde(deny_unknown_fields)]
9521pub struct GetMaintenanceStatusResult {
9522    pub aggregate: MaintenanceStatusAggregate,
9523    pub items: Vec<MaintenanceTaskStatus>,
9524    #[serde(default, skip_serializing_if = "Option::is_none")]
9525    pub next_cursor: Option<Cursor>,
9526}
9527
9528#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
9529#[serde(deny_unknown_fields)]
9530pub struct WarmVectorIndexRequest {
9531    pub index: Resource,
9532    #[serde(default, skip_serializing_if = "Option::is_none")]
9533    pub expected_root_digest: Option<Digest>,
9534    pub components: Vec<VectorWarmComponent>,
9535    pub maximum_requests: u32,
9536    pub maximum_bytes: U64,
9537    pub maximum_achievements: u32,
9538    pub expires_at: U64,
9539}
9540
9541#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
9542#[serde(deny_unknown_fields)]
9543pub struct WarmVectorIndexResult {
9544    pub result: VectorWarmResult,
9545}
9546
9547#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
9548#[serde(deny_unknown_fields)]
9549pub struct EvaluateVectorRecallRequest {
9550    pub action_id: Digest,
9551    pub index: Resource,
9552    pub field: String,
9553    pub mapping_generation: U64,
9554    pub snapshot: VectorEvaluationSnapshot,
9555    pub query_set: VectorEvaluationQuerySet,
9556    #[serde(default, skip_serializing_if = "Option::is_none")]
9557    pub filter: Option<Query>,
9558    pub metric: VectorMetric,
9559    pub k: u32,
9560    pub candidate_policy: VectorCandidatePolicy,
9561    pub budget: VectorEvaluationBudget,
9562    pub maximum_bytes: U64,
9563}
9564
9565#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
9566#[serde(deny_unknown_fields)]
9567pub struct EvaluateVectorRecallResult {
9568    pub operation: Operation,
9569}
9570
9571#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
9572#[serde(deny_unknown_fields)]
9573pub struct CalibrateVectorStrategyRequest {
9574    pub action_id: Digest,
9575    pub index: Resource,
9576    pub field: String,
9577    pub mapping_generation: U64,
9578    pub snapshot: VectorEvaluationSnapshot,
9579    pub query_set: VectorEvaluationQuerySet,
9580    #[serde(default, skip_serializing_if = "Option::is_none")]
9581    pub filter: Option<Query>,
9582    pub metric: VectorMetric,
9583    pub k: u32,
9584    pub objective: VectorCalibrationObjective,
9585    pub minimum_recall_basis_points: u32,
9586    pub budget: VectorEvaluationBudget,
9587    pub maximum_bytes: U64,
9588}
9589
9590#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
9591#[serde(deny_unknown_fields)]
9592pub struct CalibrateVectorStrategyResult {
9593    pub operation: Operation,
9594}
9595
9596#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
9597#[serde(deny_unknown_fields)]
9598pub struct GetVectorDiagnosticRequest {
9599    pub locator: Locator,
9600}
9601
9602#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
9603#[serde(deny_unknown_fields)]
9604pub struct GetVectorDiagnosticResult {
9605    pub operation: Operation,
9606    pub artifacts: Vec<Artifact>,
9607    #[serde(default, skip_serializing_if = "Option::is_none")]
9608    pub result: Option<VectorDiagnosticResult>,
9609}
9610
9611#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
9612#[serde(deny_unknown_fields)]
9613pub struct CreateDiagnosticRequest {
9614    pub scope: String,
9615    pub maximum_bytes: U64,
9616}
9617
9618#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
9619#[serde(deny_unknown_fields)]
9620pub struct CreateDiagnosticResult {
9621    pub operation: Operation,
9622}
9623
9624#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
9625#[serde(deny_unknown_fields)]
9626pub struct GetDiagnosticRequest {
9627    pub locator: Locator,
9628}
9629
9630#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
9631#[serde(deny_unknown_fields)]
9632pub struct GetDiagnosticResult {
9633    pub operation: Operation,
9634    pub artifacts: Vec<Artifact>,
9635}
9636
9637#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
9638#[serde(deny_unknown_fields)]
9639pub struct PrepareCollectionExportRequest {
9640    pub action_id: Digest,
9641    pub storage: PortabilityStorageCapability,
9642}
9643
9644#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
9645#[serde(deny_unknown_fields)]
9646pub struct PrepareCollectionExportResult {
9647    pub semantic_digest: Digest,
9648    pub maximum_bytes: U64,
9649}
9650
9651#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
9652#[serde(deny_unknown_fields)]
9653pub struct StartCollectionExportRequest {
9654    pub action_id: Digest,
9655    pub semantic_digest: Digest,
9656    pub storage: PortabilityStorageCapability,
9657}
9658
9659#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
9660#[serde(deny_unknown_fields)]
9661pub struct StartCollectionExportResult {
9662    pub operation: Operation,
9663}
9664
9665#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
9666#[serde(deny_unknown_fields)]
9667pub struct ResolveCollectionExportRequest {
9668    pub action_id: Digest,
9669    pub semantic_digest: Digest,
9670    pub storage: PortabilityStorageCapability,
9671}
9672
9673#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
9674#[serde(deny_unknown_fields)]
9675pub struct ResolveCollectionExportResult {
9676    #[serde(default, skip_serializing_if = "Option::is_none")]
9677    pub operation: Option<Operation>,
9678    #[serde(default, skip_serializing_if = "Option::is_none")]
9679    pub artifact: Option<CollectionExportArtifact>,
9680    pub expired_unknown: bool,
9681}
9682
9683#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
9684#[serde(deny_unknown_fields)]
9685pub struct VerifyCollectionExportRequest {
9686    pub artifact: CollectionExportArtifact,
9687    pub storage: PortabilityStorageCapability,
9688}
9689
9690#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
9691#[serde(deny_unknown_fields)]
9692pub struct VerifyCollectionExportResult {
9693    pub verified: bool,
9694    pub source_collection_id: Identity,
9695    pub source_catalog_revision: U64,
9696    pub index_count: u32,
9697    pub document_count: U64,
9698}
9699
9700#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
9701#[serde(deny_unknown_fields)]
9702pub struct PrepareCollectionRestoreRequest {
9703    pub action_id: Digest,
9704    pub artifact: CollectionExportArtifact,
9705    pub storage: PortabilityStorageCapability,
9706}
9707
9708#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
9709#[serde(deny_unknown_fields)]
9710pub struct PrepareCollectionRestoreResult {
9711    pub semantic_digest: Digest,
9712    pub source_collection_id: Identity,
9713    pub maximum_bytes: U64,
9714}
9715
9716#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
9717#[serde(deny_unknown_fields)]
9718pub struct StartCollectionRestoreRequest {
9719    pub action_id: Digest,
9720    pub semantic_digest: Digest,
9721    pub artifact: CollectionExportArtifact,
9722    pub storage: PortabilityStorageCapability,
9723}
9724
9725#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
9726#[serde(deny_unknown_fields)]
9727pub struct StartCollectionRestoreResult {
9728    pub operation: Operation,
9729}
9730
9731#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
9732#[serde(deny_unknown_fields)]
9733pub struct ResolveCollectionRestoreRequest {
9734    pub action_id: Digest,
9735    pub semantic_digest: Digest,
9736    pub artifact: CollectionExportArtifact,
9737    pub storage: PortabilityStorageCapability,
9738}
9739
9740#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
9741#[serde(deny_unknown_fields)]
9742pub struct ResolveCollectionRestoreResult {
9743    #[serde(default, skip_serializing_if = "Option::is_none")]
9744    pub operation: Option<Operation>,
9745    pub expired_unknown: bool,
9746}
9747
9748#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
9749#[serde(deny_unknown_fields)]
9750pub struct PrepareIndexExportRequest {
9751    pub action_id: Digest,
9752    pub index: Resource,
9753    pub storage: PortabilityStorageCapability,
9754    pub maximum_records: u32,
9755    pub maximum_pages: u32,
9756    pub maximum_page_bytes: U64,
9757}
9758
9759#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
9760#[serde(deny_unknown_fields)]
9761pub struct PrepareIndexExportResult {
9762    pub semantic_digest: Digest,
9763    pub maximum_bytes: U64,
9764}
9765
9766#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
9767#[serde(deny_unknown_fields)]
9768pub struct StartIndexExportRequest {
9769    pub action_id: Digest,
9770    pub semantic_digest: Digest,
9771    pub index: Resource,
9772    pub storage: PortabilityStorageCapability,
9773    pub maximum_records: u32,
9774    pub maximum_pages: u32,
9775    pub maximum_page_bytes: U64,
9776}
9777
9778#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
9779#[serde(deny_unknown_fields)]
9780pub struct StartIndexExportResult {
9781    pub operation: Operation,
9782}
9783
9784#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
9785#[serde(deny_unknown_fields)]
9786pub struct ResolveIndexExportRequest {
9787    pub action_id: Digest,
9788    pub semantic_digest: Digest,
9789    pub index: Resource,
9790    pub storage: PortabilityStorageCapability,
9791    pub maximum_records: u32,
9792    pub maximum_pages: u32,
9793    pub maximum_page_bytes: U64,
9794}
9795
9796#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
9797#[serde(deny_unknown_fields)]
9798pub struct ResolveIndexExportResult {
9799    #[serde(default, skip_serializing_if = "Option::is_none")]
9800    pub operation: Option<Operation>,
9801    #[serde(default, skip_serializing_if = "Option::is_none")]
9802    pub artifact: Option<IndexTransferArtifact>,
9803    pub expired_unknown: bool,
9804}
9805
9806#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
9807#[serde(deny_unknown_fields)]
9808pub struct VerifyIndexExportRequest {
9809    pub artifact: IndexTransferArtifact,
9810    pub storage: PortabilityStorageCapability,
9811}
9812
9813#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
9814#[serde(deny_unknown_fields)]
9815pub struct VerifyIndexExportResult {
9816    pub verified: bool,
9817    pub source_cluster_storage_id: Identity,
9818    pub source_collection_id: Identity,
9819    pub source_index: Resource,
9820    pub source_catalog_revision: U64,
9821    pub source_cut_digest: Digest,
9822    pub page_count: u32,
9823    pub record_count: u32,
9824}
9825
9826#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
9827#[serde(deny_unknown_fields)]
9828pub struct PrepareIndexImportRequest {
9829    pub action_id: Digest,
9830    pub artifact: IndexTransferArtifact,
9831    pub storage: PortabilityStorageCapability,
9832    pub destination_name: String,
9833    pub expected_name_absent: bool,
9834    pub destination_policies: IndexPolicies,
9835    pub destination_resource_spec: IndexResourceSpec,
9836}
9837
9838#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
9839#[serde(deny_unknown_fields)]
9840pub struct PrepareIndexImportResult {
9841    pub semantic_digest: Digest,
9842    pub source_cluster_storage_id: Identity,
9843    pub source_collection_id: Identity,
9844    pub source_index: Resource,
9845    pub maximum_bytes: U64,
9846}
9847
9848#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
9849#[serde(deny_unknown_fields)]
9850pub struct StartIndexImportRequest {
9851    pub action_id: Digest,
9852    pub semantic_digest: Digest,
9853    pub artifact: IndexTransferArtifact,
9854    pub storage: PortabilityStorageCapability,
9855    pub destination_name: String,
9856    pub expected_name_absent: bool,
9857    pub destination_policies: IndexPolicies,
9858    pub destination_resource_spec: IndexResourceSpec,
9859}
9860
9861#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
9862#[serde(deny_unknown_fields)]
9863pub struct StartIndexImportResult {
9864    pub operation: Operation,
9865}
9866
9867#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
9868#[serde(deny_unknown_fields)]
9869pub struct ResolveIndexImportRequest {
9870    pub action_id: Digest,
9871    pub semantic_digest: Digest,
9872    pub artifact: IndexTransferArtifact,
9873    pub storage: PortabilityStorageCapability,
9874    pub destination_name: String,
9875    pub expected_name_absent: bool,
9876    pub destination_policies: IndexPolicies,
9877    pub destination_resource_spec: IndexResourceSpec,
9878}
9879
9880#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
9881#[serde(deny_unknown_fields)]
9882pub struct ResolveIndexImportResult {
9883    #[serde(default, skip_serializing_if = "Option::is_none")]
9884    pub operation: Option<Operation>,
9885    #[serde(default, skip_serializing_if = "Option::is_none")]
9886    pub destination: Option<Resource>,
9887    pub expired_unknown: bool,
9888}
9889
9890#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
9891#[serde(deny_unknown_fields)]
9892pub struct ReadArtifactChunkRequest {
9893    pub artifact: Artifact,
9894    pub offset: U64,
9895    pub length: u32,
9896}
9897
9898#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
9899#[serde(deny_unknown_fields)]
9900pub struct ReadArtifactChunkResult {
9901    pub offset: U64,
9902    pub bytes_base64: String,
9903    pub chunk_sha256: String,
9904    pub artifact_sha256: String,
9905    pub complete: bool,
9906}
9907
9908#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
9909#[serde(deny_unknown_fields)]
9910pub struct ExportUsageRequest {
9911    pub window_start: U64,
9912    pub window_end: U64,
9913    pub page_size: u32,
9914    #[serde(default, skip_serializing_if = "Option::is_none")]
9915    pub cursor: Option<Cursor>,
9916}
9917
9918#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
9919#[serde(deny_unknown_fields)]
9920pub struct ExportUsageResult {
9921    pub units: Vec<CoreUsageUnits>,
9922    pub corrections: Vec<CoreUsageCorrection>,
9923    #[serde(default, skip_serializing_if = "Option::is_none")]
9924    pub next_cursor: Option<Cursor>,
9925    pub cumulative_through: U64,
9926}
9927
9928#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
9929#[serde(deny_unknown_fields)]
9930pub struct ExecuteStateReadRequest {
9931    pub index: Resource,
9932    pub operation: StateOperation,
9933}
9934
9935#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
9936#[serde(deny_unknown_fields)]
9937pub struct ExecuteStateReadResult {
9938    pub result: StateCommandResult,
9939}
9940
9941#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
9942#[serde(deny_unknown_fields)]
9943pub struct PrepareStateWriteRequest {
9944    pub index: Resource,
9945    pub action_id: Digest,
9946    pub operation: StateOperation,
9947}
9948
9949#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
9950#[serde(deny_unknown_fields)]
9951pub struct PrepareStateWriteResult {
9952    pub locator: Locator,
9953    pub semantic_digest: Digest,
9954    pub retention_max_entries: U64,
9955    pub retention_sequence_window: U64,
9956}
9957
9958#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
9959#[serde(deny_unknown_fields)]
9960pub struct SubmitStateWriteRequest {
9961    pub index: Resource,
9962    pub action_id: Digest,
9963    pub operation: StateOperation,
9964    pub locator: Locator,
9965    pub semantic_digest: Digest,
9966}
9967
9968#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
9969#[serde(deny_unknown_fields)]
9970pub struct SubmitStateWriteResult {
9971    #[serde(default, skip_serializing_if = "Option::is_none")]
9972    pub result: Option<StateCommandResult>,
9973    #[serde(default, skip_serializing_if = "Option::is_none")]
9974    pub resolution: Option<StateWriteResolution>,
9975    pub mutation_outcome: MutationOutcome,
9976    #[serde(default, skip_serializing_if = "Option::is_none")]
9977    pub achievement: Option<WriteAchievement>,
9978}
9979
9980#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
9981#[serde(deny_unknown_fields)]
9982pub struct ResolveStateWriteRequest {
9983    pub index: Resource,
9984    pub action_id: Digest,
9985    pub operation: StateOperation,
9986    pub locator: Locator,
9987    pub semantic_digest: Digest,
9988}
9989
9990#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
9991#[serde(deny_unknown_fields)]
9992pub struct ResolveStateWriteResult {
9993    pub resolution: StateWriteResolution,
9994}
9995
9996#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
9997#[serde(tag = "command", content = "body", rename_all = "snake_case")]
9998pub enum RequestBody {
9999    Discover(DiscoverRequest),
10000    ListIndexes(ListIndexesRequest),
10001    GetIndex(GetIndexRequest),
10002    ValidateIndexChange(ValidateIndexChangeRequest),
10003    ApplyIndexChange(ApplyIndexChangeRequest),
10004    ApplyAdministrationMutation(ApplyAdministrationMutationRequest),
10005    ListAliases(ListAliasesRequest),
10006    GetAlias(GetAliasRequest),
10007    ListDataStreams(ListDataStreamsRequest),
10008    GetDataStream(GetDataStreamRequest),
10009    ListComponentTemplates(ListComponentTemplatesRequest),
10010    GetComponentTemplate(GetComponentTemplateRequest),
10011    ListIndexTemplates(ListIndexTemplatesRequest),
10012    GetIndexTemplate(GetIndexTemplateRequest),
10013    ListIngestPipelines(ListIngestPipelinesRequest),
10014    GetIngestPipeline(GetIngestPipelineRequest),
10015    SimulateIngestPipeline(SimulateIngestPipelineRequest),
10016    ReprocessByQuery(ReprocessByQueryRequest),
10017    ListLifecyclePolicies(ListLifecyclePoliciesRequest),
10018    GetLifecyclePolicy(GetLifecyclePolicyRequest),
10019    PrepareCreateIndex(PrepareCreateIndexRequest),
10020    PrepareDeleteIndex(PrepareDeleteIndexRequest),
10021    SubmitCatalogAction(SubmitCatalogActionRequest),
10022    ResolveCatalogAction(ResolveCatalogActionRequest),
10023    PrepareReplayableSourceIndex(PrepareReplayableSourceIndexRequest),
10024    SubmitReplayableSourceIndex(SubmitReplayableSourceIndexRequest),
10025    GetReplayableSource(GetReplayableSourceRequest),
10026    ControlReplayableSource(ControlReplayableSourceRequest),
10027    CloneIndex(CloneIndexRequest),
10028    ConfigureHistory(ConfigureHistoryRequest),
10029    GetHistory(GetHistoryRequest),
10030    ResolveHistory(ResolveHistoryRequest),
10031    PlaceHistoryHold(PlaceHistoryHoldRequest),
10032    ReleaseHistoryHold(ReleaseHistoryHoldRequest),
10033    PrepareDocumentMutation(PrepareDocumentMutationRequest),
10034    SubmitDocumentMutation(SubmitDocumentMutationRequest),
10035    PrepareDocumentBulk(PrepareDocumentBulkRequest),
10036    SubmitDocumentBulk(SubmitDocumentBulkRequest),
10037    ResolveDocumentBulk(ResolveDocumentBulkRequest),
10038    PrepareAppendBulk(PrepareAppendBulkRequest),
10039    SubmitAppendBulk(SubmitAppendBulkRequest),
10040    ResolveAppendBulk(ResolveAppendBulkRequest),
10041    ObserveAppendCommitted(ObserveAppendCommittedRequest),
10042    ResolveDocumentMutation(ResolveDocumentMutationRequest),
10043    GetDocument(GetDocumentRequest),
10044    Search(SearchRequest),
10045    TraverseRelationships(TraverseRelationshipsRequest),
10046    QueryProfiles(QueryProfilesRequest),
10047    EvaluateTemporalEvidence(EvaluateTemporalEvidenceRequest),
10048    CreateContinuousTemporalEvaluation(CreateContinuousTemporalEvaluationRequest),
10049    GetContinuousTemporalEvaluation(GetContinuousTemporalEvaluationRequest),
10050    PauseContinuousTemporalEvaluation(PauseContinuousTemporalEvaluationRequest),
10051    ResumeContinuousTemporalEvaluation(ResumeContinuousTemporalEvaluationRequest),
10052    ReplaceContinuousTemporalEvaluation(ReplaceContinuousTemporalEvaluationRequest),
10053    RetireContinuousTemporalEvaluation(RetireContinuousTemporalEvaluationRequest),
10054    ReadContinuousTemporalEvidence(ReadContinuousTemporalEvidenceRequest),
10055    ValidateSearch(ValidateSearchRequest),
10056    OpenPit(OpenPitRequest),
10057    RenewPit(RenewPitRequest),
10058    ClosePit(ClosePitRequest),
10059    ListOperations(ListOperationsRequest),
10060    GetOperation(GetOperationRequest),
10061    WaitOperation(WaitOperationRequest),
10062    CancelOperation(CancelOperationRequest),
10063    ListAuditEvents(ListAuditEventsRequest),
10064    ExportAuditEvents(ExportAuditEventsRequest),
10065    ReserveServiceCredential(ReserveServiceCredentialRequest),
10066    ReserveServiceCredentialRotation(ReserveServiceCredentialRotationRequest),
10067    ActivateServiceCredential(ActivateServiceCredentialRequest),
10068    ResolveServiceCredentialReservation(ResolveServiceCredentialReservationRequest),
10069    PrepareRevokeServiceCredential(PrepareRevokeServiceCredentialRequest),
10070    RevokeServiceCredential(RevokeServiceCredentialRequest),
10071    ResolveSecurityAction(ResolveSecurityActionRequest),
10072    GetSecurityRole(GetSecurityRoleRequest),
10073    PrepareRoleAppendAccessChange(PrepareRoleAppendAccessChangeRequest),
10074    SubmitRoleAppendAccessChange(SubmitRoleAppendAccessChangeRequest),
10075    ListServiceCredentials(ListServiceCredentialsRequest),
10076    GetRuntimeStatus(GetRuntimeStatusRequest),
10077    GetResultCacheStatus(GetResultCacheStatusRequest),
10078    GetFieldPromotionStatus(GetFieldPromotionStatusRequest),
10079    GetOverloadStatus(GetOverloadStatusRequest),
10080    ConfigureExternalKey(ConfigureExternalKeyRequest),
10081    RotateExternalKeyBinding(RotateExternalKeyBindingRequest),
10082    ConfigureAggregateThenDelete(ConfigureAggregateThenDeleteRequest),
10083    GetLifecycleStatus(GetLifecycleStatusRequest),
10084    GetQuota(GetQuotaRequest),
10085    UpdateQuota(UpdateQuotaRequest),
10086    GetBinding(GetBindingRequest),
10087    GetAdmissionStatus(GetAdmissionStatusRequest),
10088    SetAdmission(SetAdmissionRequest),
10089    GetQuiesceStatus(GetQuiesceStatusRequest),
10090    GetDecommissionReadiness(GetDecommissionReadinessRequest),
10091    GetUpgradeReadiness(GetUpgradeReadinessRequest),
10092    GetMaintenanceStatus(GetMaintenanceStatusRequest),
10093    WarmVectorIndex(WarmVectorIndexRequest),
10094    EvaluateVectorRecall(EvaluateVectorRecallRequest),
10095    CalibrateVectorStrategy(CalibrateVectorStrategyRequest),
10096    GetVectorDiagnostic(GetVectorDiagnosticRequest),
10097    CreateDiagnostic(CreateDiagnosticRequest),
10098    GetDiagnostic(GetDiagnosticRequest),
10099    PrepareCollectionExport(PrepareCollectionExportRequest),
10100    StartCollectionExport(StartCollectionExportRequest),
10101    ResolveCollectionExport(ResolveCollectionExportRequest),
10102    VerifyCollectionExport(VerifyCollectionExportRequest),
10103    PrepareCollectionRestore(PrepareCollectionRestoreRequest),
10104    StartCollectionRestore(StartCollectionRestoreRequest),
10105    ResolveCollectionRestore(ResolveCollectionRestoreRequest),
10106    PrepareIndexExport(PrepareIndexExportRequest),
10107    StartIndexExport(StartIndexExportRequest),
10108    ResolveIndexExport(ResolveIndexExportRequest),
10109    VerifyIndexExport(VerifyIndexExportRequest),
10110    PrepareIndexImport(PrepareIndexImportRequest),
10111    StartIndexImport(StartIndexImportRequest),
10112    ResolveIndexImport(ResolveIndexImportRequest),
10113    ReadArtifactChunk(ReadArtifactChunkRequest),
10114    ExportUsage(ExportUsageRequest),
10115    ExecuteStateRead(ExecuteStateReadRequest),
10116    PrepareStateWrite(PrepareStateWriteRequest),
10117    SubmitStateWrite(SubmitStateWriteRequest),
10118    ResolveStateWrite(ResolveStateWriteRequest),
10119}
10120
10121// INVARIANT: the response envelope already boxes this closed wire union; boxing
10122// individual variants would add a second allocation without changing the wire.
10123#[allow(clippy::large_enum_variant)]
10124#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
10125#[serde(tag = "command", content = "body", rename_all = "snake_case")]
10126pub enum ResultBody {
10127    Discover(DiscoverResult),
10128    ListIndexes(ListIndexesResult),
10129    GetIndex(GetIndexResult),
10130    ValidateIndexChange(ValidateIndexChangeResult),
10131    ApplyIndexChange(ApplyIndexChangeResult),
10132    ApplyAdministrationMutation(ApplyAdministrationMutationResult),
10133    ListAliases(ListAliasesResult),
10134    GetAlias(GetAliasResult),
10135    ListDataStreams(ListDataStreamsResult),
10136    GetDataStream(GetDataStreamResult),
10137    ListComponentTemplates(ListComponentTemplatesResult),
10138    GetComponentTemplate(GetComponentTemplateResult),
10139    ListIndexTemplates(ListIndexTemplatesResult),
10140    GetIndexTemplate(GetIndexTemplateResult),
10141    ListIngestPipelines(ListIngestPipelinesResult),
10142    GetIngestPipeline(GetIngestPipelineResult),
10143    SimulateIngestPipeline(SimulateIngestPipelineResult),
10144    ReprocessByQuery(ReprocessByQueryResult),
10145    ListLifecyclePolicies(ListLifecyclePoliciesResult),
10146    GetLifecyclePolicy(GetLifecyclePolicyResult),
10147    PrepareCreateIndex(PrepareCreateIndexResult),
10148    PrepareDeleteIndex(PrepareDeleteIndexResult),
10149    SubmitCatalogAction(SubmitCatalogActionResult),
10150    ResolveCatalogAction(ResolveCatalogActionResult),
10151    PrepareReplayableSourceIndex(PrepareReplayableSourceIndexResult),
10152    SubmitReplayableSourceIndex(SubmitReplayableSourceIndexResult),
10153    GetReplayableSource(GetReplayableSourceResult),
10154    ControlReplayableSource(ControlReplayableSourceResult),
10155    CloneIndex(CloneIndexResult),
10156    ConfigureHistory(ConfigureHistoryResult),
10157    GetHistory(GetHistoryResult),
10158    ResolveHistory(ResolveHistoryResult),
10159    PlaceHistoryHold(PlaceHistoryHoldResult),
10160    ReleaseHistoryHold(ReleaseHistoryHoldResult),
10161    PrepareDocumentMutation(PrepareDocumentMutationResult),
10162    SubmitDocumentMutation(SubmitDocumentMutationResult),
10163    PrepareDocumentBulk(PrepareDocumentBulkResult),
10164    SubmitDocumentBulk(SubmitDocumentBulkResult),
10165    ResolveDocumentBulk(ResolveDocumentBulkResult),
10166    PrepareAppendBulk(PrepareAppendBulkResult),
10167    SubmitAppendBulk(SubmitAppendBulkResult),
10168    ResolveAppendBulk(ResolveAppendBulkResult),
10169    ObserveAppendCommitted(ObserveAppendCommittedResult),
10170    ResolveDocumentMutation(ResolveDocumentMutationResult),
10171    GetDocument(GetDocumentResult),
10172    Search(SearchResult),
10173    TraverseRelationships(TraverseRelationshipsResult),
10174    QueryProfiles(QueryProfilesResult),
10175    EvaluateTemporalEvidence(EvaluateTemporalEvidenceResult),
10176    CreateContinuousTemporalEvaluation(CreateContinuousTemporalEvaluationResult),
10177    GetContinuousTemporalEvaluation(GetContinuousTemporalEvaluationResult),
10178    PauseContinuousTemporalEvaluation(PauseContinuousTemporalEvaluationResult),
10179    ResumeContinuousTemporalEvaluation(ResumeContinuousTemporalEvaluationResult),
10180    ReplaceContinuousTemporalEvaluation(ReplaceContinuousTemporalEvaluationResult),
10181    RetireContinuousTemporalEvaluation(RetireContinuousTemporalEvaluationResult),
10182    ReadContinuousTemporalEvidence(ReadContinuousTemporalEvidenceResult),
10183    ValidateSearch(ValidateSearchResult),
10184    OpenPit(OpenPitResult),
10185    RenewPit(RenewPitResult),
10186    ClosePit(ClosePitResult),
10187    ListOperations(ListOperationsResult),
10188    GetOperation(GetOperationResult),
10189    WaitOperation(WaitOperationResult),
10190    CancelOperation(CancelOperationResult),
10191    ListAuditEvents(ListAuditEventsResult),
10192    ExportAuditEvents(ExportAuditEventsResult),
10193    ReserveServiceCredential(ReserveServiceCredentialResult),
10194    ReserveServiceCredentialRotation(ReserveServiceCredentialRotationResult),
10195    ActivateServiceCredential(ActivateServiceCredentialResult),
10196    ResolveServiceCredentialReservation(ResolveServiceCredentialReservationResult),
10197    PrepareRevokeServiceCredential(PrepareRevokeServiceCredentialResult),
10198    RevokeServiceCredential(RevokeServiceCredentialResult),
10199    ResolveSecurityAction(ResolveSecurityActionResult),
10200    GetSecurityRole(GetSecurityRoleResult),
10201    PrepareRoleAppendAccessChange(PrepareRoleAppendAccessChangeResult),
10202    SubmitRoleAppendAccessChange(SubmitRoleAppendAccessChangeResult),
10203    ListServiceCredentials(ListServiceCredentialsResult),
10204    GetRuntimeStatus(GetRuntimeStatusResult),
10205    GetResultCacheStatus(GetResultCacheStatusResult),
10206    GetFieldPromotionStatus(GetFieldPromotionStatusResult),
10207    GetOverloadStatus(GetOverloadStatusResult),
10208    ConfigureExternalKey(ConfigureExternalKeyResult),
10209    RotateExternalKeyBinding(RotateExternalKeyBindingResult),
10210    ConfigureAggregateThenDelete(ConfigureAggregateThenDeleteResult),
10211    GetLifecycleStatus(GetLifecycleStatusResult),
10212    GetQuota(GetQuotaResult),
10213    UpdateQuota(UpdateQuotaResult),
10214    GetBinding(GetBindingResult),
10215    GetAdmissionStatus(GetAdmissionStatusResult),
10216    SetAdmission(SetAdmissionResult),
10217    GetQuiesceStatus(GetQuiesceStatusResult),
10218    GetDecommissionReadiness(GetDecommissionReadinessResult),
10219    GetUpgradeReadiness(GetUpgradeReadinessResult),
10220    GetMaintenanceStatus(GetMaintenanceStatusResult),
10221    WarmVectorIndex(WarmVectorIndexResult),
10222    EvaluateVectorRecall(EvaluateVectorRecallResult),
10223    CalibrateVectorStrategy(CalibrateVectorStrategyResult),
10224    GetVectorDiagnostic(GetVectorDiagnosticResult),
10225    CreateDiagnostic(CreateDiagnosticResult),
10226    GetDiagnostic(GetDiagnosticResult),
10227    PrepareCollectionExport(PrepareCollectionExportResult),
10228    StartCollectionExport(StartCollectionExportResult),
10229    ResolveCollectionExport(ResolveCollectionExportResult),
10230    VerifyCollectionExport(VerifyCollectionExportResult),
10231    PrepareCollectionRestore(PrepareCollectionRestoreResult),
10232    StartCollectionRestore(StartCollectionRestoreResult),
10233    ResolveCollectionRestore(ResolveCollectionRestoreResult),
10234    PrepareIndexExport(PrepareIndexExportResult),
10235    StartIndexExport(StartIndexExportResult),
10236    ResolveIndexExport(ResolveIndexExportResult),
10237    VerifyIndexExport(VerifyIndexExportResult),
10238    PrepareIndexImport(PrepareIndexImportResult),
10239    StartIndexImport(StartIndexImportResult),
10240    ResolveIndexImport(ResolveIndexImportResult),
10241    ReadArtifactChunk(ReadArtifactChunkResult),
10242    ExportUsage(ExportUsageResult),
10243    ExecuteStateRead(ExecuteStateReadResult),
10244    PrepareStateWrite(PrepareStateWriteResult),
10245    SubmitStateWrite(SubmitStateWriteResult),
10246    ResolveStateWrite(ResolveStateWriteResult),
10247}
10248
10249pub const fn command_for_request(value: &RequestBody) -> Command {
10250    match value {
10251        RequestBody::Discover(_) => Command::Discover,
10252        RequestBody::ListIndexes(_) => Command::ListIndexes,
10253        RequestBody::GetIndex(_) => Command::GetIndex,
10254        RequestBody::ValidateIndexChange(_) => Command::ValidateIndexChange,
10255        RequestBody::ApplyIndexChange(_) => Command::ApplyIndexChange,
10256        RequestBody::ApplyAdministrationMutation(_) => Command::ApplyAdministrationMutation,
10257        RequestBody::ListAliases(_) => Command::ListAliases,
10258        RequestBody::GetAlias(_) => Command::GetAlias,
10259        RequestBody::ListDataStreams(_) => Command::ListDataStreams,
10260        RequestBody::GetDataStream(_) => Command::GetDataStream,
10261        RequestBody::ListComponentTemplates(_) => Command::ListComponentTemplates,
10262        RequestBody::GetComponentTemplate(_) => Command::GetComponentTemplate,
10263        RequestBody::ListIndexTemplates(_) => Command::ListIndexTemplates,
10264        RequestBody::GetIndexTemplate(_) => Command::GetIndexTemplate,
10265        RequestBody::ListIngestPipelines(_) => Command::ListIngestPipelines,
10266        RequestBody::GetIngestPipeline(_) => Command::GetIngestPipeline,
10267        RequestBody::SimulateIngestPipeline(_) => Command::SimulateIngestPipeline,
10268        RequestBody::ReprocessByQuery(_) => Command::ReprocessByQuery,
10269        RequestBody::ListLifecyclePolicies(_) => Command::ListLifecyclePolicies,
10270        RequestBody::GetLifecyclePolicy(_) => Command::GetLifecyclePolicy,
10271        RequestBody::PrepareCreateIndex(_) => Command::PrepareCreateIndex,
10272        RequestBody::PrepareDeleteIndex(_) => Command::PrepareDeleteIndex,
10273        RequestBody::SubmitCatalogAction(_) => Command::SubmitCatalogAction,
10274        RequestBody::ResolveCatalogAction(_) => Command::ResolveCatalogAction,
10275        RequestBody::PrepareReplayableSourceIndex(_) => Command::PrepareReplayableSourceIndex,
10276        RequestBody::SubmitReplayableSourceIndex(_) => Command::SubmitReplayableSourceIndex,
10277        RequestBody::GetReplayableSource(_) => Command::GetReplayableSource,
10278        RequestBody::ControlReplayableSource(_) => Command::ControlReplayableSource,
10279        RequestBody::CloneIndex(_) => Command::CloneIndex,
10280        RequestBody::ConfigureHistory(_) => Command::ConfigureHistory,
10281        RequestBody::GetHistory(_) => Command::GetHistory,
10282        RequestBody::ResolveHistory(_) => Command::ResolveHistory,
10283        RequestBody::PlaceHistoryHold(_) => Command::PlaceHistoryHold,
10284        RequestBody::ReleaseHistoryHold(_) => Command::ReleaseHistoryHold,
10285        RequestBody::PrepareDocumentMutation(_) => Command::PrepareDocumentMutation,
10286        RequestBody::SubmitDocumentMutation(_) => Command::SubmitDocumentMutation,
10287        RequestBody::PrepareDocumentBulk(_) => Command::PrepareDocumentBulk,
10288        RequestBody::SubmitDocumentBulk(_) => Command::SubmitDocumentBulk,
10289        RequestBody::ResolveDocumentBulk(_) => Command::ResolveDocumentBulk,
10290        RequestBody::PrepareAppendBulk(_) => Command::PrepareAppendBulk,
10291        RequestBody::SubmitAppendBulk(_) => Command::SubmitAppendBulk,
10292        RequestBody::ResolveAppendBulk(_) => Command::ResolveAppendBulk,
10293        RequestBody::ObserveAppendCommitted(_) => Command::ObserveAppendCommitted,
10294        RequestBody::ResolveDocumentMutation(_) => Command::ResolveDocumentMutation,
10295        RequestBody::GetDocument(_) => Command::GetDocument,
10296        RequestBody::Search(_) => Command::Search,
10297        RequestBody::TraverseRelationships(_) => Command::TraverseRelationships,
10298        RequestBody::QueryProfiles(_) => Command::QueryProfiles,
10299        RequestBody::EvaluateTemporalEvidence(_) => Command::EvaluateTemporalEvidence,
10300        RequestBody::CreateContinuousTemporalEvaluation(_) => Command::CreateContinuousTemporalEvaluation,
10301        RequestBody::GetContinuousTemporalEvaluation(_) => Command::GetContinuousTemporalEvaluation,
10302        RequestBody::PauseContinuousTemporalEvaluation(_) => Command::PauseContinuousTemporalEvaluation,
10303        RequestBody::ResumeContinuousTemporalEvaluation(_) => Command::ResumeContinuousTemporalEvaluation,
10304        RequestBody::ReplaceContinuousTemporalEvaluation(_) => Command::ReplaceContinuousTemporalEvaluation,
10305        RequestBody::RetireContinuousTemporalEvaluation(_) => Command::RetireContinuousTemporalEvaluation,
10306        RequestBody::ReadContinuousTemporalEvidence(_) => Command::ReadContinuousTemporalEvidence,
10307        RequestBody::ValidateSearch(_) => Command::ValidateSearch,
10308        RequestBody::OpenPit(_) => Command::OpenPit,
10309        RequestBody::RenewPit(_) => Command::RenewPit,
10310        RequestBody::ClosePit(_) => Command::ClosePit,
10311        RequestBody::ListOperations(_) => Command::ListOperations,
10312        RequestBody::GetOperation(_) => Command::GetOperation,
10313        RequestBody::WaitOperation(_) => Command::WaitOperation,
10314        RequestBody::CancelOperation(_) => Command::CancelOperation,
10315        RequestBody::ListAuditEvents(_) => Command::ListAuditEvents,
10316        RequestBody::ExportAuditEvents(_) => Command::ExportAuditEvents,
10317        RequestBody::ReserveServiceCredential(_) => Command::ReserveServiceCredential,
10318        RequestBody::ReserveServiceCredentialRotation(_) => Command::ReserveServiceCredentialRotation,
10319        RequestBody::ActivateServiceCredential(_) => Command::ActivateServiceCredential,
10320        RequestBody::ResolveServiceCredentialReservation(_) => Command::ResolveServiceCredentialReservation,
10321        RequestBody::PrepareRevokeServiceCredential(_) => Command::PrepareRevokeServiceCredential,
10322        RequestBody::RevokeServiceCredential(_) => Command::RevokeServiceCredential,
10323        RequestBody::ResolveSecurityAction(_) => Command::ResolveSecurityAction,
10324        RequestBody::GetSecurityRole(_) => Command::GetSecurityRole,
10325        RequestBody::PrepareRoleAppendAccessChange(_) => Command::PrepareRoleAppendAccessChange,
10326        RequestBody::SubmitRoleAppendAccessChange(_) => Command::SubmitRoleAppendAccessChange,
10327        RequestBody::ListServiceCredentials(_) => Command::ListServiceCredentials,
10328        RequestBody::GetRuntimeStatus(_) => Command::GetRuntimeStatus,
10329        RequestBody::GetResultCacheStatus(_) => Command::GetResultCacheStatus,
10330        RequestBody::GetFieldPromotionStatus(_) => Command::GetFieldPromotionStatus,
10331        RequestBody::GetOverloadStatus(_) => Command::GetOverloadStatus,
10332        RequestBody::ConfigureExternalKey(_) => Command::ConfigureExternalKey,
10333        RequestBody::RotateExternalKeyBinding(_) => Command::RotateExternalKeyBinding,
10334        RequestBody::ConfigureAggregateThenDelete(_) => Command::ConfigureAggregateThenDelete,
10335        RequestBody::GetLifecycleStatus(_) => Command::GetLifecycleStatus,
10336        RequestBody::GetQuota(_) => Command::GetQuota,
10337        RequestBody::UpdateQuota(_) => Command::UpdateQuota,
10338        RequestBody::GetBinding(_) => Command::GetBinding,
10339        RequestBody::GetAdmissionStatus(_) => Command::GetAdmissionStatus,
10340        RequestBody::SetAdmission(_) => Command::SetAdmission,
10341        RequestBody::GetQuiesceStatus(_) => Command::GetQuiesceStatus,
10342        RequestBody::GetDecommissionReadiness(_) => Command::GetDecommissionReadiness,
10343        RequestBody::GetUpgradeReadiness(_) => Command::GetUpgradeReadiness,
10344        RequestBody::GetMaintenanceStatus(_) => Command::GetMaintenanceStatus,
10345        RequestBody::WarmVectorIndex(_) => Command::WarmVectorIndex,
10346        RequestBody::EvaluateVectorRecall(_) => Command::EvaluateVectorRecall,
10347        RequestBody::CalibrateVectorStrategy(_) => Command::CalibrateVectorStrategy,
10348        RequestBody::GetVectorDiagnostic(_) => Command::GetVectorDiagnostic,
10349        RequestBody::CreateDiagnostic(_) => Command::CreateDiagnostic,
10350        RequestBody::GetDiagnostic(_) => Command::GetDiagnostic,
10351        RequestBody::PrepareCollectionExport(_) => Command::PrepareCollectionExport,
10352        RequestBody::StartCollectionExport(_) => Command::StartCollectionExport,
10353        RequestBody::ResolveCollectionExport(_) => Command::ResolveCollectionExport,
10354        RequestBody::VerifyCollectionExport(_) => Command::VerifyCollectionExport,
10355        RequestBody::PrepareCollectionRestore(_) => Command::PrepareCollectionRestore,
10356        RequestBody::StartCollectionRestore(_) => Command::StartCollectionRestore,
10357        RequestBody::ResolveCollectionRestore(_) => Command::ResolveCollectionRestore,
10358        RequestBody::PrepareIndexExport(_) => Command::PrepareIndexExport,
10359        RequestBody::StartIndexExport(_) => Command::StartIndexExport,
10360        RequestBody::ResolveIndexExport(_) => Command::ResolveIndexExport,
10361        RequestBody::VerifyIndexExport(_) => Command::VerifyIndexExport,
10362        RequestBody::PrepareIndexImport(_) => Command::PrepareIndexImport,
10363        RequestBody::StartIndexImport(_) => Command::StartIndexImport,
10364        RequestBody::ResolveIndexImport(_) => Command::ResolveIndexImport,
10365        RequestBody::ReadArtifactChunk(_) => Command::ReadArtifactChunk,
10366        RequestBody::ExportUsage(_) => Command::ExportUsage,
10367        RequestBody::ExecuteStateRead(_) => Command::ExecuteStateRead,
10368        RequestBody::PrepareStateWrite(_) => Command::PrepareStateWrite,
10369        RequestBody::SubmitStateWrite(_) => Command::SubmitStateWrite,
10370        RequestBody::ResolveStateWrite(_) => Command::ResolveStateWrite,
10371    }
10372}
10373
10374pub const fn command_for_result(value: &ResultBody) -> Command {
10375    match value {
10376        ResultBody::Discover(_) => Command::Discover,
10377        ResultBody::ListIndexes(_) => Command::ListIndexes,
10378        ResultBody::GetIndex(_) => Command::GetIndex,
10379        ResultBody::ValidateIndexChange(_) => Command::ValidateIndexChange,
10380        ResultBody::ApplyIndexChange(_) => Command::ApplyIndexChange,
10381        ResultBody::ApplyAdministrationMutation(_) => Command::ApplyAdministrationMutation,
10382        ResultBody::ListAliases(_) => Command::ListAliases,
10383        ResultBody::GetAlias(_) => Command::GetAlias,
10384        ResultBody::ListDataStreams(_) => Command::ListDataStreams,
10385        ResultBody::GetDataStream(_) => Command::GetDataStream,
10386        ResultBody::ListComponentTemplates(_) => Command::ListComponentTemplates,
10387        ResultBody::GetComponentTemplate(_) => Command::GetComponentTemplate,
10388        ResultBody::ListIndexTemplates(_) => Command::ListIndexTemplates,
10389        ResultBody::GetIndexTemplate(_) => Command::GetIndexTemplate,
10390        ResultBody::ListIngestPipelines(_) => Command::ListIngestPipelines,
10391        ResultBody::GetIngestPipeline(_) => Command::GetIngestPipeline,
10392        ResultBody::SimulateIngestPipeline(_) => Command::SimulateIngestPipeline,
10393        ResultBody::ReprocessByQuery(_) => Command::ReprocessByQuery,
10394        ResultBody::ListLifecyclePolicies(_) => Command::ListLifecyclePolicies,
10395        ResultBody::GetLifecyclePolicy(_) => Command::GetLifecyclePolicy,
10396        ResultBody::PrepareCreateIndex(_) => Command::PrepareCreateIndex,
10397        ResultBody::PrepareDeleteIndex(_) => Command::PrepareDeleteIndex,
10398        ResultBody::SubmitCatalogAction(_) => Command::SubmitCatalogAction,
10399        ResultBody::ResolveCatalogAction(_) => Command::ResolveCatalogAction,
10400        ResultBody::PrepareReplayableSourceIndex(_) => Command::PrepareReplayableSourceIndex,
10401        ResultBody::SubmitReplayableSourceIndex(_) => Command::SubmitReplayableSourceIndex,
10402        ResultBody::GetReplayableSource(_) => Command::GetReplayableSource,
10403        ResultBody::ControlReplayableSource(_) => Command::ControlReplayableSource,
10404        ResultBody::CloneIndex(_) => Command::CloneIndex,
10405        ResultBody::ConfigureHistory(_) => Command::ConfigureHistory,
10406        ResultBody::GetHistory(_) => Command::GetHistory,
10407        ResultBody::ResolveHistory(_) => Command::ResolveHistory,
10408        ResultBody::PlaceHistoryHold(_) => Command::PlaceHistoryHold,
10409        ResultBody::ReleaseHistoryHold(_) => Command::ReleaseHistoryHold,
10410        ResultBody::PrepareDocumentMutation(_) => Command::PrepareDocumentMutation,
10411        ResultBody::SubmitDocumentMutation(_) => Command::SubmitDocumentMutation,
10412        ResultBody::PrepareDocumentBulk(_) => Command::PrepareDocumentBulk,
10413        ResultBody::SubmitDocumentBulk(_) => Command::SubmitDocumentBulk,
10414        ResultBody::ResolveDocumentBulk(_) => Command::ResolveDocumentBulk,
10415        ResultBody::PrepareAppendBulk(_) => Command::PrepareAppendBulk,
10416        ResultBody::SubmitAppendBulk(_) => Command::SubmitAppendBulk,
10417        ResultBody::ResolveAppendBulk(_) => Command::ResolveAppendBulk,
10418        ResultBody::ObserveAppendCommitted(_) => Command::ObserveAppendCommitted,
10419        ResultBody::ResolveDocumentMutation(_) => Command::ResolveDocumentMutation,
10420        ResultBody::GetDocument(_) => Command::GetDocument,
10421        ResultBody::Search(_) => Command::Search,
10422        ResultBody::TraverseRelationships(_) => Command::TraverseRelationships,
10423        ResultBody::QueryProfiles(_) => Command::QueryProfiles,
10424        ResultBody::EvaluateTemporalEvidence(_) => Command::EvaluateTemporalEvidence,
10425        ResultBody::CreateContinuousTemporalEvaluation(_) => Command::CreateContinuousTemporalEvaluation,
10426        ResultBody::GetContinuousTemporalEvaluation(_) => Command::GetContinuousTemporalEvaluation,
10427        ResultBody::PauseContinuousTemporalEvaluation(_) => Command::PauseContinuousTemporalEvaluation,
10428        ResultBody::ResumeContinuousTemporalEvaluation(_) => Command::ResumeContinuousTemporalEvaluation,
10429        ResultBody::ReplaceContinuousTemporalEvaluation(_) => Command::ReplaceContinuousTemporalEvaluation,
10430        ResultBody::RetireContinuousTemporalEvaluation(_) => Command::RetireContinuousTemporalEvaluation,
10431        ResultBody::ReadContinuousTemporalEvidence(_) => Command::ReadContinuousTemporalEvidence,
10432        ResultBody::ValidateSearch(_) => Command::ValidateSearch,
10433        ResultBody::OpenPit(_) => Command::OpenPit,
10434        ResultBody::RenewPit(_) => Command::RenewPit,
10435        ResultBody::ClosePit(_) => Command::ClosePit,
10436        ResultBody::ListOperations(_) => Command::ListOperations,
10437        ResultBody::GetOperation(_) => Command::GetOperation,
10438        ResultBody::WaitOperation(_) => Command::WaitOperation,
10439        ResultBody::CancelOperation(_) => Command::CancelOperation,
10440        ResultBody::ListAuditEvents(_) => Command::ListAuditEvents,
10441        ResultBody::ExportAuditEvents(_) => Command::ExportAuditEvents,
10442        ResultBody::ReserveServiceCredential(_) => Command::ReserveServiceCredential,
10443        ResultBody::ReserveServiceCredentialRotation(_) => Command::ReserveServiceCredentialRotation,
10444        ResultBody::ActivateServiceCredential(_) => Command::ActivateServiceCredential,
10445        ResultBody::ResolveServiceCredentialReservation(_) => Command::ResolveServiceCredentialReservation,
10446        ResultBody::PrepareRevokeServiceCredential(_) => Command::PrepareRevokeServiceCredential,
10447        ResultBody::RevokeServiceCredential(_) => Command::RevokeServiceCredential,
10448        ResultBody::ResolveSecurityAction(_) => Command::ResolveSecurityAction,
10449        ResultBody::GetSecurityRole(_) => Command::GetSecurityRole,
10450        ResultBody::PrepareRoleAppendAccessChange(_) => Command::PrepareRoleAppendAccessChange,
10451        ResultBody::SubmitRoleAppendAccessChange(_) => Command::SubmitRoleAppendAccessChange,
10452        ResultBody::ListServiceCredentials(_) => Command::ListServiceCredentials,
10453        ResultBody::GetRuntimeStatus(_) => Command::GetRuntimeStatus,
10454        ResultBody::GetResultCacheStatus(_) => Command::GetResultCacheStatus,
10455        ResultBody::GetFieldPromotionStatus(_) => Command::GetFieldPromotionStatus,
10456        ResultBody::GetOverloadStatus(_) => Command::GetOverloadStatus,
10457        ResultBody::ConfigureExternalKey(_) => Command::ConfigureExternalKey,
10458        ResultBody::RotateExternalKeyBinding(_) => Command::RotateExternalKeyBinding,
10459        ResultBody::ConfigureAggregateThenDelete(_) => Command::ConfigureAggregateThenDelete,
10460        ResultBody::GetLifecycleStatus(_) => Command::GetLifecycleStatus,
10461        ResultBody::GetQuota(_) => Command::GetQuota,
10462        ResultBody::UpdateQuota(_) => Command::UpdateQuota,
10463        ResultBody::GetBinding(_) => Command::GetBinding,
10464        ResultBody::GetAdmissionStatus(_) => Command::GetAdmissionStatus,
10465        ResultBody::SetAdmission(_) => Command::SetAdmission,
10466        ResultBody::GetQuiesceStatus(_) => Command::GetQuiesceStatus,
10467        ResultBody::GetDecommissionReadiness(_) => Command::GetDecommissionReadiness,
10468        ResultBody::GetUpgradeReadiness(_) => Command::GetUpgradeReadiness,
10469        ResultBody::GetMaintenanceStatus(_) => Command::GetMaintenanceStatus,
10470        ResultBody::WarmVectorIndex(_) => Command::WarmVectorIndex,
10471        ResultBody::EvaluateVectorRecall(_) => Command::EvaluateVectorRecall,
10472        ResultBody::CalibrateVectorStrategy(_) => Command::CalibrateVectorStrategy,
10473        ResultBody::GetVectorDiagnostic(_) => Command::GetVectorDiagnostic,
10474        ResultBody::CreateDiagnostic(_) => Command::CreateDiagnostic,
10475        ResultBody::GetDiagnostic(_) => Command::GetDiagnostic,
10476        ResultBody::PrepareCollectionExport(_) => Command::PrepareCollectionExport,
10477        ResultBody::StartCollectionExport(_) => Command::StartCollectionExport,
10478        ResultBody::ResolveCollectionExport(_) => Command::ResolveCollectionExport,
10479        ResultBody::VerifyCollectionExport(_) => Command::VerifyCollectionExport,
10480        ResultBody::PrepareCollectionRestore(_) => Command::PrepareCollectionRestore,
10481        ResultBody::StartCollectionRestore(_) => Command::StartCollectionRestore,
10482        ResultBody::ResolveCollectionRestore(_) => Command::ResolveCollectionRestore,
10483        ResultBody::PrepareIndexExport(_) => Command::PrepareIndexExport,
10484        ResultBody::StartIndexExport(_) => Command::StartIndexExport,
10485        ResultBody::ResolveIndexExport(_) => Command::ResolveIndexExport,
10486        ResultBody::VerifyIndexExport(_) => Command::VerifyIndexExport,
10487        ResultBody::PrepareIndexImport(_) => Command::PrepareIndexImport,
10488        ResultBody::StartIndexImport(_) => Command::StartIndexImport,
10489        ResultBody::ResolveIndexImport(_) => Command::ResolveIndexImport,
10490        ResultBody::ReadArtifactChunk(_) => Command::ReadArtifactChunk,
10491        ResultBody::ExportUsage(_) => Command::ExportUsage,
10492        ResultBody::ExecuteStateRead(_) => Command::ExecuteStateRead,
10493        ResultBody::PrepareStateWrite(_) => Command::PrepareStateWrite,
10494        ResultBody::SubmitStateWrite(_) => Command::SubmitStateWrite,
10495        ResultBody::ResolveStateWrite(_) => Command::ResolveStateWrite,
10496    }
10497}
10498
10499#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
10500#[serde(deny_unknown_fields)]
10501pub struct RequestEnvelope {
10502    pub meta: RequestMeta,
10503    pub request: RequestBody,
10504}
10505#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
10506#[serde(tag = "outcome", rename_all = "snake_case")]
10507pub enum ResponseEnvelope {
10508    Success {
10509        meta: ResponseMeta,
10510        result: Box<ResultBody>,
10511    },
10512    Error {
10513        meta: ResponseMeta,
10514        error: ErrorBody,
10515    },
10516}
10517
10518#[derive(Clone, Copy, Debug, Eq, PartialEq)]
10519pub struct CommandContract {
10520    pub command: Command,
10521    pub action: Action,
10522    pub cancellable: bool,
10523    pub mutation: &'static str,
10524}
10525pub const LODESTONE_API_COMMAND_CONTRACTS: &[CommandContract] = &[
10526    CommandContract {
10527        command: Command::Discover,
10528        action: Action::IdentityDiscovery,
10529        cancellable: true,
10530        mutation: "read_only",
10531    },
10532    CommandContract {
10533        command: Command::ListIndexes,
10534        action: Action::CatalogRead,
10535        cancellable: true,
10536        mutation: "read_only",
10537    },
10538    CommandContract {
10539        command: Command::GetIndex,
10540        action: Action::CatalogRead,
10541        cancellable: true,
10542        mutation: "read_only",
10543    },
10544    CommandContract {
10545        command: Command::ValidateIndexChange,
10546        action: Action::IndexAdmin,
10547        cancellable: true,
10548        mutation: "read_only",
10549    },
10550    CommandContract {
10551        command: Command::ApplyIndexChange,
10552        action: Action::IndexAdmin,
10553        cancellable: true,
10554        mutation: "catalog_submit",
10555    },
10556    CommandContract {
10557        command: Command::ApplyAdministrationMutation,
10558        action: Action::LifecycleAdmin,
10559        cancellable: true,
10560        mutation: "administration_submit",
10561    },
10562    CommandContract {
10563        command: Command::ListAliases,
10564        action: Action::CatalogRead,
10565        cancellable: true,
10566        mutation: "read_only",
10567    },
10568    CommandContract {
10569        command: Command::GetAlias,
10570        action: Action::CatalogRead,
10571        cancellable: true,
10572        mutation: "read_only",
10573    },
10574    CommandContract {
10575        command: Command::ListDataStreams,
10576        action: Action::CatalogRead,
10577        cancellable: true,
10578        mutation: "read_only",
10579    },
10580    CommandContract {
10581        command: Command::GetDataStream,
10582        action: Action::CatalogRead,
10583        cancellable: true,
10584        mutation: "read_only",
10585    },
10586    CommandContract {
10587        command: Command::ListComponentTemplates,
10588        action: Action::CatalogRead,
10589        cancellable: true,
10590        mutation: "read_only",
10591    },
10592    CommandContract {
10593        command: Command::GetComponentTemplate,
10594        action: Action::CatalogRead,
10595        cancellable: true,
10596        mutation: "read_only",
10597    },
10598    CommandContract {
10599        command: Command::ListIndexTemplates,
10600        action: Action::CatalogRead,
10601        cancellable: true,
10602        mutation: "read_only",
10603    },
10604    CommandContract {
10605        command: Command::GetIndexTemplate,
10606        action: Action::CatalogRead,
10607        cancellable: true,
10608        mutation: "read_only",
10609    },
10610    CommandContract {
10611        command: Command::ListIngestPipelines,
10612        action: Action::LifecycleAdmin,
10613        cancellable: true,
10614        mutation: "read_only",
10615    },
10616    CommandContract {
10617        command: Command::GetIngestPipeline,
10618        action: Action::LifecycleAdmin,
10619        cancellable: true,
10620        mutation: "read_only",
10621    },
10622    CommandContract {
10623        command: Command::SimulateIngestPipeline,
10624        action: Action::LifecycleAdmin,
10625        cancellable: true,
10626        mutation: "read_only",
10627    },
10628    CommandContract {
10629        command: Command::ReprocessByQuery,
10630        action: Action::DataWrite,
10631        cancellable: true,
10632        mutation: "authority_submit",
10633    },
10634    CommandContract {
10635        command: Command::ListLifecyclePolicies,
10636        action: Action::CatalogRead,
10637        cancellable: true,
10638        mutation: "read_only",
10639    },
10640    CommandContract {
10641        command: Command::GetLifecyclePolicy,
10642        action: Action::CatalogRead,
10643        cancellable: true,
10644        mutation: "read_only",
10645    },
10646    CommandContract {
10647        command: Command::PrepareCreateIndex,
10648        action: Action::IndexAdmin,
10649        cancellable: true,
10650        mutation: "catalog_prepare",
10651    },
10652    CommandContract {
10653        command: Command::PrepareDeleteIndex,
10654        action: Action::IndexAdmin,
10655        cancellable: true,
10656        mutation: "catalog_prepare",
10657    },
10658    CommandContract {
10659        command: Command::SubmitCatalogAction,
10660        action: Action::IndexAdmin,
10661        cancellable: true,
10662        mutation: "catalog_submit",
10663    },
10664    CommandContract {
10665        command: Command::ResolveCatalogAction,
10666        action: Action::IndexAdmin,
10667        cancellable: true,
10668        mutation: "read_only",
10669    },
10670    CommandContract {
10671        command: Command::PrepareReplayableSourceIndex,
10672        action: Action::IndexAdmin,
10673        cancellable: true,
10674        mutation: "catalog_prepare",
10675    },
10676    CommandContract {
10677        command: Command::SubmitReplayableSourceIndex,
10678        action: Action::IndexAdmin,
10679        cancellable: true,
10680        mutation: "catalog_submit",
10681    },
10682    CommandContract {
10683        command: Command::GetReplayableSource,
10684        action: Action::CatalogRead,
10685        cancellable: true,
10686        mutation: "read_only",
10687    },
10688    CommandContract {
10689        command: Command::ControlReplayableSource,
10690        action: Action::IndexAdmin,
10691        cancellable: true,
10692        mutation: "catalog_submit",
10693    },
10694    CommandContract {
10695        command: Command::CloneIndex,
10696        action: Action::IndexAdmin,
10697        cancellable: true,
10698        mutation: "catalog_submit",
10699    },
10700    CommandContract {
10701        command: Command::ConfigureHistory,
10702        action: Action::IndexAdmin,
10703        cancellable: true,
10704        mutation: "catalog_submit",
10705    },
10706    CommandContract {
10707        command: Command::GetHistory,
10708        action: Action::CatalogRead,
10709        cancellable: true,
10710        mutation: "read_only",
10711    },
10712    CommandContract {
10713        command: Command::ResolveHistory,
10714        action: Action::DataRead,
10715        cancellable: true,
10716        mutation: "read_only",
10717    },
10718    CommandContract {
10719        command: Command::PlaceHistoryHold,
10720        action: Action::IndexAdmin,
10721        cancellable: true,
10722        mutation: "catalog_submit",
10723    },
10724    CommandContract {
10725        command: Command::ReleaseHistoryHold,
10726        action: Action::IndexAdmin,
10727        cancellable: true,
10728        mutation: "catalog_submit",
10729    },
10730    CommandContract {
10731        command: Command::PrepareDocumentMutation,
10732        action: Action::DataWrite,
10733        cancellable: true,
10734        mutation: "read_only_prepare",
10735    },
10736    CommandContract {
10737        command: Command::SubmitDocumentMutation,
10738        action: Action::DataWrite,
10739        cancellable: true,
10740        mutation: "wal_submit",
10741    },
10742    CommandContract {
10743        command: Command::PrepareDocumentBulk,
10744        action: Action::DataWrite,
10745        cancellable: true,
10746        mutation: "read_only_prepare",
10747    },
10748    CommandContract {
10749        command: Command::SubmitDocumentBulk,
10750        action: Action::DataWrite,
10751        cancellable: true,
10752        mutation: "wal_submit",
10753    },
10754    CommandContract {
10755        command: Command::ResolveDocumentBulk,
10756        action: Action::DataRead,
10757        cancellable: true,
10758        mutation: "read_only",
10759    },
10760    CommandContract {
10761        command: Command::PrepareAppendBulk,
10762        action: Action::Append,
10763        cancellable: true,
10764        mutation: "read_only_prepare",
10765    },
10766    CommandContract {
10767        command: Command::SubmitAppendBulk,
10768        action: Action::Append,
10769        cancellable: true,
10770        mutation: "wal_submit",
10771    },
10772    CommandContract {
10773        command: Command::ResolveAppendBulk,
10774        action: Action::ResolveAppend,
10775        cancellable: true,
10776        mutation: "read_only",
10777    },
10778    CommandContract {
10779        command: Command::ObserveAppendCommitted,
10780        action: Action::ResolveAppend,
10781        cancellable: true,
10782        mutation: "read_only",
10783    },
10784    CommandContract {
10785        command: Command::ResolveDocumentMutation,
10786        action: Action::DataRead,
10787        cancellable: true,
10788        mutation: "read_only",
10789    },
10790    CommandContract {
10791        command: Command::GetDocument,
10792        action: Action::DataRead,
10793        cancellable: true,
10794        mutation: "read_only",
10795    },
10796    CommandContract {
10797        command: Command::Search,
10798        action: Action::DataRead,
10799        cancellable: true,
10800        mutation: "read_only",
10801    },
10802    CommandContract {
10803        command: Command::TraverseRelationships,
10804        action: Action::DataRead,
10805        cancellable: true,
10806        mutation: "read_only",
10807    },
10808    CommandContract {
10809        command: Command::QueryProfiles,
10810        action: Action::DataRead,
10811        cancellable: true,
10812        mutation: "read_only",
10813    },
10814    CommandContract {
10815        command: Command::EvaluateTemporalEvidence,
10816        action: Action::DataRead,
10817        cancellable: true,
10818        mutation: "read_only",
10819    },
10820    CommandContract {
10821        command: Command::CreateContinuousTemporalEvaluation,
10822        action: Action::LifecycleAdmin,
10823        cancellable: true,
10824        mutation: "catalog_submit",
10825    },
10826    CommandContract {
10827        command: Command::GetContinuousTemporalEvaluation,
10828        action: Action::CatalogRead,
10829        cancellable: true,
10830        mutation: "read_only",
10831    },
10832    CommandContract {
10833        command: Command::PauseContinuousTemporalEvaluation,
10834        action: Action::LifecycleAdmin,
10835        cancellable: true,
10836        mutation: "catalog_submit",
10837    },
10838    CommandContract {
10839        command: Command::ResumeContinuousTemporalEvaluation,
10840        action: Action::LifecycleAdmin,
10841        cancellable: true,
10842        mutation: "catalog_submit",
10843    },
10844    CommandContract {
10845        command: Command::ReplaceContinuousTemporalEvaluation,
10846        action: Action::LifecycleAdmin,
10847        cancellable: true,
10848        mutation: "catalog_submit",
10849    },
10850    CommandContract {
10851        command: Command::RetireContinuousTemporalEvaluation,
10852        action: Action::LifecycleAdmin,
10853        cancellable: true,
10854        mutation: "catalog_submit",
10855    },
10856    CommandContract {
10857        command: Command::ReadContinuousTemporalEvidence,
10858        action: Action::DataRead,
10859        cancellable: true,
10860        mutation: "read_only",
10861    },
10862    CommandContract {
10863        command: Command::ValidateSearch,
10864        action: Action::DataRead,
10865        cancellable: true,
10866        mutation: "read_only",
10867    },
10868    CommandContract {
10869        command: Command::OpenPit,
10870        action: Action::DataRead,
10871        cancellable: true,
10872        mutation: "authority_submit",
10873    },
10874    CommandContract {
10875        command: Command::RenewPit,
10876        action: Action::DataRead,
10877        cancellable: true,
10878        mutation: "authority_submit",
10879    },
10880    CommandContract {
10881        command: Command::ClosePit,
10882        action: Action::DataRead,
10883        cancellable: true,
10884        mutation: "authority_submit",
10885    },
10886    CommandContract {
10887        command: Command::ListOperations,
10888        action: Action::OperationRead,
10889        cancellable: true,
10890        mutation: "read_only",
10891    },
10892    CommandContract {
10893        command: Command::GetOperation,
10894        action: Action::OperationRead,
10895        cancellable: true,
10896        mutation: "read_only",
10897    },
10898    CommandContract {
10899        command: Command::WaitOperation,
10900        action: Action::OperationRead,
10901        cancellable: true,
10902        mutation: "read_only",
10903    },
10904    CommandContract {
10905        command: Command::CancelOperation,
10906        action: Action::OperationCancel,
10907        cancellable: true,
10908        mutation: "authority_submit",
10909    },
10910    CommandContract {
10911        command: Command::ListAuditEvents,
10912        action: Action::AuditRead,
10913        cancellable: true,
10914        mutation: "read_only",
10915    },
10916    CommandContract {
10917        command: Command::ExportAuditEvents,
10918        action: Action::AuditRead,
10919        cancellable: true,
10920        mutation: "read_only",
10921    },
10922    CommandContract {
10923        command: Command::ReserveServiceCredential,
10924        action: Action::SecurityAdmin,
10925        cancellable: true,
10926        mutation: "security_reserve",
10927    },
10928    CommandContract {
10929        command: Command::ReserveServiceCredentialRotation,
10930        action: Action::SecurityAdmin,
10931        cancellable: true,
10932        mutation: "security_reserve",
10933    },
10934    CommandContract {
10935        command: Command::ActivateServiceCredential,
10936        action: Action::SecurityAdmin,
10937        cancellable: true,
10938        mutation: "security_submit",
10939    },
10940    CommandContract {
10941        command: Command::ResolveServiceCredentialReservation,
10942        action: Action::SecurityRead,
10943        cancellable: true,
10944        mutation: "read_only",
10945    },
10946    CommandContract {
10947        command: Command::PrepareRevokeServiceCredential,
10948        action: Action::SecurityAdmin,
10949        cancellable: true,
10950        mutation: "read_only_prepare",
10951    },
10952    CommandContract {
10953        command: Command::RevokeServiceCredential,
10954        action: Action::SecurityAdmin,
10955        cancellable: true,
10956        mutation: "security_submit",
10957    },
10958    CommandContract {
10959        command: Command::ResolveSecurityAction,
10960        action: Action::SecurityRead,
10961        cancellable: true,
10962        mutation: "read_only",
10963    },
10964    CommandContract {
10965        command: Command::GetSecurityRole,
10966        action: Action::SecurityRead,
10967        cancellable: true,
10968        mutation: "read_only",
10969    },
10970    CommandContract {
10971        command: Command::PrepareRoleAppendAccessChange,
10972        action: Action::SecurityAdmin,
10973        cancellable: true,
10974        mutation: "read_only_prepare",
10975    },
10976    CommandContract {
10977        command: Command::SubmitRoleAppendAccessChange,
10978        action: Action::SecurityAdmin,
10979        cancellable: true,
10980        mutation: "security_submit",
10981    },
10982    CommandContract {
10983        command: Command::ListServiceCredentials,
10984        action: Action::SecurityRead,
10985        cancellable: true,
10986        mutation: "read_only",
10987    },
10988    CommandContract {
10989        command: Command::GetRuntimeStatus,
10990        action: Action::CatalogRead,
10991        cancellable: true,
10992        mutation: "read_only",
10993    },
10994    CommandContract {
10995        command: Command::GetResultCacheStatus,
10996        action: Action::CatalogRead,
10997        cancellable: true,
10998        mutation: "read_only",
10999    },
11000    CommandContract {
11001        command: Command::GetFieldPromotionStatus,
11002        action: Action::CatalogRead,
11003        cancellable: true,
11004        mutation: "read_only",
11005    },
11006    CommandContract {
11007        command: Command::GetOverloadStatus,
11008        action: Action::CatalogRead,
11009        cancellable: true,
11010        mutation: "read_only",
11011    },
11012    CommandContract {
11013        command: Command::ConfigureExternalKey,
11014        action: Action::LifecycleAdmin,
11015        cancellable: true,
11016        mutation: "authority_submit",
11017    },
11018    CommandContract {
11019        command: Command::RotateExternalKeyBinding,
11020        action: Action::LifecycleAdmin,
11021        cancellable: true,
11022        mutation: "authority_submit",
11023    },
11024    CommandContract {
11025        command: Command::ConfigureAggregateThenDelete,
11026        action: Action::LifecycleAdmin,
11027        cancellable: true,
11028        mutation: "authority_submit",
11029    },
11030    CommandContract {
11031        command: Command::GetLifecycleStatus,
11032        action: Action::CatalogRead,
11033        cancellable: true,
11034        mutation: "read_only",
11035    },
11036    CommandContract {
11037        command: Command::GetQuota,
11038        action: Action::QuotaRead,
11039        cancellable: true,
11040        mutation: "read_only",
11041    },
11042    CommandContract {
11043        command: Command::UpdateQuota,
11044        action: Action::QuotaAdmin,
11045        cancellable: true,
11046        mutation: "quota_submit",
11047    },
11048    CommandContract {
11049        command: Command::GetBinding,
11050        action: Action::BindingRead,
11051        cancellable: true,
11052        mutation: "read_only",
11053    },
11054    CommandContract {
11055        command: Command::GetAdmissionStatus,
11056        action: Action::AdmissionRead,
11057        cancellable: true,
11058        mutation: "read_only",
11059    },
11060    CommandContract {
11061        command: Command::SetAdmission,
11062        action: Action::AdmissionAdmin,
11063        cancellable: true,
11064        mutation: "admission_submit",
11065    },
11066    CommandContract {
11067        command: Command::GetQuiesceStatus,
11068        action: Action::AdmissionRead,
11069        cancellable: true,
11070        mutation: "read_only",
11071    },
11072    CommandContract {
11073        command: Command::GetDecommissionReadiness,
11074        action: Action::AdmissionRead,
11075        cancellable: true,
11076        mutation: "read_only",
11077    },
11078    CommandContract {
11079        command: Command::GetUpgradeReadiness,
11080        action: Action::TaskRead,
11081        cancellable: true,
11082        mutation: "read_only",
11083    },
11084    CommandContract {
11085        command: Command::GetMaintenanceStatus,
11086        action: Action::TaskRead,
11087        cancellable: true,
11088        mutation: "read_only",
11089    },
11090    CommandContract {
11091        command: Command::WarmVectorIndex,
11092        action: Action::DataRead,
11093        cancellable: true,
11094        mutation: "read_only",
11095    },
11096    CommandContract {
11097        command: Command::EvaluateVectorRecall,
11098        action: Action::DiagnosticsCreate,
11099        cancellable: true,
11100        mutation: "diagnostic_submit",
11101    },
11102    CommandContract {
11103        command: Command::CalibrateVectorStrategy,
11104        action: Action::DiagnosticsCreate,
11105        cancellable: true,
11106        mutation: "diagnostic_submit",
11107    },
11108    CommandContract {
11109        command: Command::GetVectorDiagnostic,
11110        action: Action::DiagnosticsRead,
11111        cancellable: true,
11112        mutation: "read_only",
11113    },
11114    CommandContract {
11115        command: Command::CreateDiagnostic,
11116        action: Action::DiagnosticsCreate,
11117        cancellable: true,
11118        mutation: "diagnostic_submit",
11119    },
11120    CommandContract {
11121        command: Command::GetDiagnostic,
11122        action: Action::DiagnosticsRead,
11123        cancellable: true,
11124        mutation: "read_only",
11125    },
11126    CommandContract {
11127        command: Command::PrepareCollectionExport,
11128        action: Action::CollectionExport,
11129        cancellable: true,
11130        mutation: "read_only_prepare",
11131    },
11132    CommandContract {
11133        command: Command::StartCollectionExport,
11134        action: Action::CollectionExport,
11135        cancellable: true,
11136        mutation: "portability_submit",
11137    },
11138    CommandContract {
11139        command: Command::ResolveCollectionExport,
11140        action: Action::CollectionExport,
11141        cancellable: true,
11142        mutation: "read_only",
11143    },
11144    CommandContract {
11145        command: Command::VerifyCollectionExport,
11146        action: Action::CollectionExport,
11147        cancellable: true,
11148        mutation: "read_only",
11149    },
11150    CommandContract {
11151        command: Command::PrepareCollectionRestore,
11152        action: Action::CollectionRestore,
11153        cancellable: true,
11154        mutation: "read_only_prepare",
11155    },
11156    CommandContract {
11157        command: Command::StartCollectionRestore,
11158        action: Action::CollectionRestore,
11159        cancellable: true,
11160        mutation: "portability_submit",
11161    },
11162    CommandContract {
11163        command: Command::ResolveCollectionRestore,
11164        action: Action::CollectionRestore,
11165        cancellable: true,
11166        mutation: "read_only",
11167    },
11168    CommandContract {
11169        command: Command::PrepareIndexExport,
11170        action: Action::IndexExport,
11171        cancellable: true,
11172        mutation: "read_only_prepare",
11173    },
11174    CommandContract {
11175        command: Command::StartIndexExport,
11176        action: Action::IndexExport,
11177        cancellable: true,
11178        mutation: "portability_submit",
11179    },
11180    CommandContract {
11181        command: Command::ResolveIndexExport,
11182        action: Action::IndexExport,
11183        cancellable: true,
11184        mutation: "read_only",
11185    },
11186    CommandContract {
11187        command: Command::VerifyIndexExport,
11188        action: Action::IndexExport,
11189        cancellable: true,
11190        mutation: "read_only",
11191    },
11192    CommandContract {
11193        command: Command::PrepareIndexImport,
11194        action: Action::IndexImport,
11195        cancellable: true,
11196        mutation: "read_only_prepare",
11197    },
11198    CommandContract {
11199        command: Command::StartIndexImport,
11200        action: Action::IndexImport,
11201        cancellable: true,
11202        mutation: "portability_submit",
11203    },
11204    CommandContract {
11205        command: Command::ResolveIndexImport,
11206        action: Action::IndexImport,
11207        cancellable: true,
11208        mutation: "read_only",
11209    },
11210    CommandContract {
11211        command: Command::ReadArtifactChunk,
11212        action: Action::OperationRead,
11213        cancellable: true,
11214        mutation: "read_only",
11215    },
11216    CommandContract {
11217        command: Command::ExportUsage,
11218        action: Action::UsageRead,
11219        cancellable: true,
11220        mutation: "read_only",
11221    },
11222    CommandContract {
11223        command: Command::ExecuteStateRead,
11224        action: Action::DataRead,
11225        cancellable: true,
11226        mutation: "read_only",
11227    },
11228    CommandContract {
11229        command: Command::PrepareStateWrite,
11230        action: Action::DataWrite,
11231        cancellable: true,
11232        mutation: "read_only_prepare",
11233    },
11234    CommandContract {
11235        command: Command::SubmitStateWrite,
11236        action: Action::DataWrite,
11237        cancellable: true,
11238        mutation: "state_submit",
11239    },
11240    CommandContract {
11241        command: Command::ResolveStateWrite,
11242        action: Action::DataRead,
11243        cancellable: true,
11244        mutation: "read_only",
11245    },
11246];
11247#[derive(Clone, Copy, Debug, Eq, PartialEq)]
11248pub struct CommandSemanticContract {
11249    pub command: Command,
11250    pub admissible_errors: &'static [ErrorCode],
11251    pub limit_ids: &'static [&'static str],
11252    pub effect_class: &'static str,
11253    pub risk_flags: &'static [&'static str],
11254    pub capability_family: &'static str,
11255    pub retry_safety: &'static str,
11256    pub identity_requirement: &'static str,
11257    pub resolver: Option<Command>,
11258    pub cancellation: &'static str,
11259    pub side_effects: &'static [&'static str],
11260    pub recovery: &'static str,
11261    pub collection_index_ref: &'static str,
11262}
11263pub const LODESTONE_API_COMMAND_SEMANTICS: &[CommandSemanticContract] = &[
11264    CommandSemanticContract {
11265        command: Command::Discover,
11266        admissible_errors: &[
11267            ErrorCode::Aborted,
11268            ErrorCode::DeadlineExceeded,
11269            ErrorCode::InvalidRequest,
11270            ErrorCode::UnsupportedVersion,
11271            ErrorCode::Unauthenticated,
11272            ErrorCode::PermissionDenied,
11273            ErrorCode::NotFound,
11274            ErrorCode::LimitExceeded,
11275            ErrorCode::CapabilityUnavailable,
11276            ErrorCode::TemporarilyUnavailable,
11277            ErrorCode::Internal,
11278        ],
11279        limit_ids: &["request_bytes", "response_bytes"],
11280        effect_class: "read_only",
11281        risk_flags: &[],
11282        capability_family: "discovery",
11283        retry_safety: "safe",
11284        identity_requirement: "none",
11285        resolver: None,
11286        cancellation: "per_call",
11287        side_effects: &[],
11288        recovery: "retry",
11289        collection_index_ref: "none",
11290    },
11291    CommandSemanticContract {
11292        command: Command::ListIndexes,
11293        admissible_errors: &[
11294            ErrorCode::Aborted,
11295            ErrorCode::DeadlineExceeded,
11296            ErrorCode::InvalidRequest,
11297            ErrorCode::UnsupportedVersion,
11298            ErrorCode::Unauthenticated,
11299            ErrorCode::PermissionDenied,
11300            ErrorCode::NotFound,
11301            ErrorCode::StaleCursor,
11302            ErrorCode::RestartBudgetExhausted,
11303            ErrorCode::LimitExceeded,
11304            ErrorCode::CapabilityUnavailable,
11305            ErrorCode::TemporarilyUnavailable,
11306            ErrorCode::Internal,
11307        ],
11308        limit_ids: &[
11309            "request_bytes",
11310            "response_bytes",
11311            "page_size",
11312            "catalog_page_size",
11313            "catalog_restart_budget",
11314        ],
11315        effect_class: "read_only",
11316        risk_flags: &[],
11317        capability_family: "catalog",
11318        retry_safety: "safe",
11319        identity_requirement: "none",
11320        resolver: None,
11321        cancellation: "per_call",
11322        side_effects: &[],
11323        recovery: "retry",
11324        collection_index_ref: "none",
11325    },
11326    CommandSemanticContract {
11327        command: Command::GetIndex,
11328        admissible_errors: &[
11329            ErrorCode::Aborted,
11330            ErrorCode::DeadlineExceeded,
11331            ErrorCode::InvalidRequest,
11332            ErrorCode::UnsupportedVersion,
11333            ErrorCode::Unauthenticated,
11334            ErrorCode::PermissionDenied,
11335            ErrorCode::NotFound,
11336            ErrorCode::LimitExceeded,
11337            ErrorCode::CapabilityUnavailable,
11338            ErrorCode::TemporarilyUnavailable,
11339            ErrorCode::Internal,
11340        ],
11341        limit_ids: &["request_bytes", "response_bytes"],
11342        effect_class: "read_only",
11343        risk_flags: &[],
11344        capability_family: "catalog",
11345        retry_safety: "safe",
11346        identity_requirement: "none",
11347        resolver: None,
11348        cancellation: "per_call",
11349        side_effects: &[],
11350        recovery: "retry",
11351        collection_index_ref: "none",
11352    },
11353    CommandSemanticContract {
11354        command: Command::ValidateIndexChange,
11355        admissible_errors: &[
11356            ErrorCode::Aborted,
11357            ErrorCode::DeadlineExceeded,
11358            ErrorCode::InvalidRequest,
11359            ErrorCode::UnsupportedVersion,
11360            ErrorCode::Unauthenticated,
11361            ErrorCode::PermissionDenied,
11362            ErrorCode::NotFound,
11363            ErrorCode::LimitExceeded,
11364            ErrorCode::CapabilityUnavailable,
11365            ErrorCode::TemporarilyUnavailable,
11366            ErrorCode::Internal,
11367        ],
11368        limit_ids: &["request_bytes", "response_bytes"],
11369        effect_class: "read_only",
11370        risk_flags: &[],
11371        capability_family: "catalog",
11372        retry_safety: "safe",
11373        identity_requirement: "none",
11374        resolver: None,
11375        cancellation: "per_call",
11376        side_effects: &[],
11377        recovery: "retry",
11378        collection_index_ref: "request_name",
11379    },
11380    CommandSemanticContract {
11381        command: Command::ApplyIndexChange,
11382        admissible_errors: &[
11383            ErrorCode::Aborted,
11384            ErrorCode::DeadlineExceeded,
11385            ErrorCode::InvalidRequest,
11386            ErrorCode::UnsupportedVersion,
11387            ErrorCode::Unauthenticated,
11388            ErrorCode::PermissionDenied,
11389            ErrorCode::NotFound,
11390            ErrorCode::Conflict,
11391            ErrorCode::LimitExceeded,
11392            ErrorCode::CapabilityUnavailable,
11393            ErrorCode::NotSubmitted,
11394            ErrorCode::SubmittedIndeterminate,
11395            ErrorCode::ExpiredUnknown,
11396            ErrorCode::TemporarilyUnavailable,
11397            ErrorCode::Internal,
11398        ],
11399        limit_ids: &["request_bytes", "response_bytes"],
11400        effect_class: "durable_submit",
11401        risk_flags: &[],
11402        capability_family: "catalog",
11403        retry_safety: "pre_submit_only",
11404        identity_requirement: "caller_action_id",
11405        resolver: None,
11406        cancellation: "per_call_until_submission_then_resolve",
11407        side_effects: &["commits_authoritative_state"],
11408        recovery: "retry_if_not_submitted",
11409        collection_index_ref: "request_index",
11410    },
11411    CommandSemanticContract {
11412        command: Command::ApplyAdministrationMutation,
11413        admissible_errors: &[
11414            ErrorCode::Aborted,
11415            ErrorCode::DeadlineExceeded,
11416            ErrorCode::InvalidRequest,
11417            ErrorCode::UnsupportedVersion,
11418            ErrorCode::Unauthenticated,
11419            ErrorCode::PermissionDenied,
11420            ErrorCode::NotFound,
11421            ErrorCode::Conflict,
11422            ErrorCode::LimitExceeded,
11423            ErrorCode::CapabilityUnavailable,
11424            ErrorCode::NotSubmitted,
11425            ErrorCode::SubmittedIndeterminate,
11426            ErrorCode::ExpiredUnknown,
11427            ErrorCode::TemporarilyUnavailable,
11428            ErrorCode::Internal,
11429        ],
11430        limit_ids: &["request_bytes", "response_bytes"],
11431        effect_class: "control_write",
11432        risk_flags: &[],
11433        capability_family: "lifecycle",
11434        retry_safety: "pre_submit_only",
11435        identity_requirement: "caller_action_id",
11436        resolver: None,
11437        cancellation: "per_call_until_submission_then_resolve",
11438        side_effects: &["commits_authoritative_state"],
11439        recovery: "retry_if_not_submitted",
11440        collection_index_ref: "none",
11441    },
11442    CommandSemanticContract {
11443        command: Command::ListAliases,
11444        admissible_errors: &[
11445            ErrorCode::Aborted,
11446            ErrorCode::DeadlineExceeded,
11447            ErrorCode::InvalidRequest,
11448            ErrorCode::UnsupportedVersion,
11449            ErrorCode::Unauthenticated,
11450            ErrorCode::PermissionDenied,
11451            ErrorCode::NotFound,
11452            ErrorCode::StaleCursor,
11453            ErrorCode::RestartBudgetExhausted,
11454            ErrorCode::LimitExceeded,
11455            ErrorCode::CapabilityUnavailable,
11456            ErrorCode::TemporarilyUnavailable,
11457            ErrorCode::Internal,
11458        ],
11459        limit_ids: &[
11460            "request_bytes",
11461            "response_bytes",
11462            "page_size",
11463            "catalog_page_size",
11464            "catalog_restart_budget",
11465        ],
11466        effect_class: "read_only",
11467        risk_flags: &[],
11468        capability_family: "catalog",
11469        retry_safety: "safe",
11470        identity_requirement: "none",
11471        resolver: None,
11472        cancellation: "per_call",
11473        side_effects: &[],
11474        recovery: "retry",
11475        collection_index_ref: "none",
11476    },
11477    CommandSemanticContract {
11478        command: Command::GetAlias,
11479        admissible_errors: &[
11480            ErrorCode::Aborted,
11481            ErrorCode::DeadlineExceeded,
11482            ErrorCode::InvalidRequest,
11483            ErrorCode::UnsupportedVersion,
11484            ErrorCode::Unauthenticated,
11485            ErrorCode::PermissionDenied,
11486            ErrorCode::NotFound,
11487            ErrorCode::LimitExceeded,
11488            ErrorCode::CapabilityUnavailable,
11489            ErrorCode::TemporarilyUnavailable,
11490            ErrorCode::Internal,
11491        ],
11492        limit_ids: &["request_bytes", "response_bytes"],
11493        effect_class: "read_only",
11494        risk_flags: &[],
11495        capability_family: "catalog",
11496        retry_safety: "safe",
11497        identity_requirement: "none",
11498        resolver: None,
11499        cancellation: "per_call",
11500        side_effects: &[],
11501        recovery: "retry",
11502        collection_index_ref: "none",
11503    },
11504    CommandSemanticContract {
11505        command: Command::ListDataStreams,
11506        admissible_errors: &[
11507            ErrorCode::Aborted,
11508            ErrorCode::DeadlineExceeded,
11509            ErrorCode::InvalidRequest,
11510            ErrorCode::UnsupportedVersion,
11511            ErrorCode::Unauthenticated,
11512            ErrorCode::PermissionDenied,
11513            ErrorCode::NotFound,
11514            ErrorCode::StaleCursor,
11515            ErrorCode::RestartBudgetExhausted,
11516            ErrorCode::LimitExceeded,
11517            ErrorCode::CapabilityUnavailable,
11518            ErrorCode::TemporarilyUnavailable,
11519            ErrorCode::Internal,
11520        ],
11521        limit_ids: &[
11522            "request_bytes",
11523            "response_bytes",
11524            "page_size",
11525            "catalog_page_size",
11526            "catalog_restart_budget",
11527        ],
11528        effect_class: "read_only",
11529        risk_flags: &[],
11530        capability_family: "catalog",
11531        retry_safety: "safe",
11532        identity_requirement: "none",
11533        resolver: None,
11534        cancellation: "per_call",
11535        side_effects: &[],
11536        recovery: "retry",
11537        collection_index_ref: "none",
11538    },
11539    CommandSemanticContract {
11540        command: Command::GetDataStream,
11541        admissible_errors: &[
11542            ErrorCode::Aborted,
11543            ErrorCode::DeadlineExceeded,
11544            ErrorCode::InvalidRequest,
11545            ErrorCode::UnsupportedVersion,
11546            ErrorCode::Unauthenticated,
11547            ErrorCode::PermissionDenied,
11548            ErrorCode::NotFound,
11549            ErrorCode::LimitExceeded,
11550            ErrorCode::CapabilityUnavailable,
11551            ErrorCode::TemporarilyUnavailable,
11552            ErrorCode::Internal,
11553        ],
11554        limit_ids: &["request_bytes", "response_bytes"],
11555        effect_class: "read_only",
11556        risk_flags: &[],
11557        capability_family: "catalog",
11558        retry_safety: "safe",
11559        identity_requirement: "none",
11560        resolver: None,
11561        cancellation: "per_call",
11562        side_effects: &[],
11563        recovery: "retry",
11564        collection_index_ref: "none",
11565    },
11566    CommandSemanticContract {
11567        command: Command::ListComponentTemplates,
11568        admissible_errors: &[
11569            ErrorCode::Aborted,
11570            ErrorCode::DeadlineExceeded,
11571            ErrorCode::InvalidRequest,
11572            ErrorCode::UnsupportedVersion,
11573            ErrorCode::Unauthenticated,
11574            ErrorCode::PermissionDenied,
11575            ErrorCode::NotFound,
11576            ErrorCode::StaleCursor,
11577            ErrorCode::RestartBudgetExhausted,
11578            ErrorCode::LimitExceeded,
11579            ErrorCode::CapabilityUnavailable,
11580            ErrorCode::TemporarilyUnavailable,
11581            ErrorCode::Internal,
11582        ],
11583        limit_ids: &[
11584            "request_bytes",
11585            "response_bytes",
11586            "page_size",
11587            "catalog_page_size",
11588            "catalog_restart_budget",
11589        ],
11590        effect_class: "read_only",
11591        risk_flags: &[],
11592        capability_family: "catalog",
11593        retry_safety: "safe",
11594        identity_requirement: "none",
11595        resolver: None,
11596        cancellation: "per_call",
11597        side_effects: &[],
11598        recovery: "retry",
11599        collection_index_ref: "none",
11600    },
11601    CommandSemanticContract {
11602        command: Command::GetComponentTemplate,
11603        admissible_errors: &[
11604            ErrorCode::Aborted,
11605            ErrorCode::DeadlineExceeded,
11606            ErrorCode::InvalidRequest,
11607            ErrorCode::UnsupportedVersion,
11608            ErrorCode::Unauthenticated,
11609            ErrorCode::PermissionDenied,
11610            ErrorCode::NotFound,
11611            ErrorCode::LimitExceeded,
11612            ErrorCode::CapabilityUnavailable,
11613            ErrorCode::TemporarilyUnavailable,
11614            ErrorCode::Internal,
11615        ],
11616        limit_ids: &["request_bytes", "response_bytes"],
11617        effect_class: "read_only",
11618        risk_flags: &[],
11619        capability_family: "catalog",
11620        retry_safety: "safe",
11621        identity_requirement: "none",
11622        resolver: None,
11623        cancellation: "per_call",
11624        side_effects: &[],
11625        recovery: "retry",
11626        collection_index_ref: "none",
11627    },
11628    CommandSemanticContract {
11629        command: Command::ListIndexTemplates,
11630        admissible_errors: &[
11631            ErrorCode::Aborted,
11632            ErrorCode::DeadlineExceeded,
11633            ErrorCode::InvalidRequest,
11634            ErrorCode::UnsupportedVersion,
11635            ErrorCode::Unauthenticated,
11636            ErrorCode::PermissionDenied,
11637            ErrorCode::NotFound,
11638            ErrorCode::StaleCursor,
11639            ErrorCode::RestartBudgetExhausted,
11640            ErrorCode::LimitExceeded,
11641            ErrorCode::CapabilityUnavailable,
11642            ErrorCode::TemporarilyUnavailable,
11643            ErrorCode::Internal,
11644        ],
11645        limit_ids: &[
11646            "request_bytes",
11647            "response_bytes",
11648            "page_size",
11649            "catalog_page_size",
11650            "catalog_restart_budget",
11651        ],
11652        effect_class: "read_only",
11653        risk_flags: &[],
11654        capability_family: "catalog",
11655        retry_safety: "safe",
11656        identity_requirement: "none",
11657        resolver: None,
11658        cancellation: "per_call",
11659        side_effects: &[],
11660        recovery: "retry",
11661        collection_index_ref: "none",
11662    },
11663    CommandSemanticContract {
11664        command: Command::GetIndexTemplate,
11665        admissible_errors: &[
11666            ErrorCode::Aborted,
11667            ErrorCode::DeadlineExceeded,
11668            ErrorCode::InvalidRequest,
11669            ErrorCode::UnsupportedVersion,
11670            ErrorCode::Unauthenticated,
11671            ErrorCode::PermissionDenied,
11672            ErrorCode::NotFound,
11673            ErrorCode::LimitExceeded,
11674            ErrorCode::CapabilityUnavailable,
11675            ErrorCode::TemporarilyUnavailable,
11676            ErrorCode::Internal,
11677        ],
11678        limit_ids: &["request_bytes", "response_bytes"],
11679        effect_class: "read_only",
11680        risk_flags: &[],
11681        capability_family: "catalog",
11682        retry_safety: "safe",
11683        identity_requirement: "none",
11684        resolver: None,
11685        cancellation: "per_call",
11686        side_effects: &[],
11687        recovery: "retry",
11688        collection_index_ref: "none",
11689    },
11690    CommandSemanticContract {
11691        command: Command::ListIngestPipelines,
11692        admissible_errors: &[
11693            ErrorCode::Aborted,
11694            ErrorCode::DeadlineExceeded,
11695            ErrorCode::InvalidRequest,
11696            ErrorCode::UnsupportedVersion,
11697            ErrorCode::Unauthenticated,
11698            ErrorCode::PermissionDenied,
11699            ErrorCode::NotFound,
11700            ErrorCode::StaleCursor,
11701            ErrorCode::RestartBudgetExhausted,
11702            ErrorCode::LimitExceeded,
11703            ErrorCode::CapabilityUnavailable,
11704            ErrorCode::TemporarilyUnavailable,
11705            ErrorCode::Internal,
11706        ],
11707        limit_ids: &[
11708            "request_bytes",
11709            "response_bytes",
11710            "page_size",
11711            "catalog_page_size",
11712            "catalog_restart_budget",
11713        ],
11714        effect_class: "read_only",
11715        risk_flags: &[],
11716        capability_family: "lifecycle",
11717        retry_safety: "safe",
11718        identity_requirement: "none",
11719        resolver: None,
11720        cancellation: "per_call",
11721        side_effects: &[],
11722        recovery: "retry",
11723        collection_index_ref: "none",
11724    },
11725    CommandSemanticContract {
11726        command: Command::GetIngestPipeline,
11727        admissible_errors: &[
11728            ErrorCode::Aborted,
11729            ErrorCode::DeadlineExceeded,
11730            ErrorCode::InvalidRequest,
11731            ErrorCode::UnsupportedVersion,
11732            ErrorCode::Unauthenticated,
11733            ErrorCode::PermissionDenied,
11734            ErrorCode::NotFound,
11735            ErrorCode::LimitExceeded,
11736            ErrorCode::CapabilityUnavailable,
11737            ErrorCode::TemporarilyUnavailable,
11738            ErrorCode::Internal,
11739        ],
11740        limit_ids: &["request_bytes", "response_bytes"],
11741        effect_class: "read_only",
11742        risk_flags: &[],
11743        capability_family: "lifecycle",
11744        retry_safety: "safe",
11745        identity_requirement: "none",
11746        resolver: None,
11747        cancellation: "per_call",
11748        side_effects: &[],
11749        recovery: "retry",
11750        collection_index_ref: "none",
11751    },
11752    CommandSemanticContract {
11753        command: Command::SimulateIngestPipeline,
11754        admissible_errors: &[
11755            ErrorCode::Aborted,
11756            ErrorCode::DeadlineExceeded,
11757            ErrorCode::InvalidRequest,
11758            ErrorCode::UnsupportedVersion,
11759            ErrorCode::Unauthenticated,
11760            ErrorCode::PermissionDenied,
11761            ErrorCode::NotFound,
11762            ErrorCode::LimitExceeded,
11763            ErrorCode::CapabilityUnavailable,
11764            ErrorCode::TemporarilyUnavailable,
11765            ErrorCode::Internal,
11766        ],
11767        limit_ids: &["request_bytes", "response_bytes"],
11768        effect_class: "read_only",
11769        risk_flags: &[],
11770        capability_family: "lifecycle",
11771        retry_safety: "safe",
11772        identity_requirement: "none",
11773        resolver: None,
11774        cancellation: "per_call",
11775        side_effects: &[],
11776        recovery: "retry",
11777        collection_index_ref: "none",
11778    },
11779    CommandSemanticContract {
11780        command: Command::ReprocessByQuery,
11781        admissible_errors: &[
11782            ErrorCode::Aborted,
11783            ErrorCode::DeadlineExceeded,
11784            ErrorCode::InvalidRequest,
11785            ErrorCode::UnsupportedVersion,
11786            ErrorCode::Unauthenticated,
11787            ErrorCode::PermissionDenied,
11788            ErrorCode::NotFound,
11789            ErrorCode::Conflict,
11790            ErrorCode::LimitExceeded,
11791            ErrorCode::CapabilityUnavailable,
11792            ErrorCode::NotSubmitted,
11793            ErrorCode::SubmittedIndeterminate,
11794            ErrorCode::ExpiredUnknown,
11795            ErrorCode::TemporarilyUnavailable,
11796            ErrorCode::Internal,
11797        ],
11798        limit_ids: &["request_bytes", "response_bytes"],
11799        effect_class: "durable_submit",
11800        risk_flags: &[],
11801        capability_family: "data",
11802        retry_safety: "safe",
11803        identity_requirement: "caller_action_id",
11804        resolver: None,
11805        cancellation: "per_call_until_submission_then_resolve",
11806        side_effects: &["commits_authoritative_state"],
11807        recovery: "retry",
11808        collection_index_ref: "request_index",
11809    },
11810    CommandSemanticContract {
11811        command: Command::ListLifecyclePolicies,
11812        admissible_errors: &[
11813            ErrorCode::Aborted,
11814            ErrorCode::DeadlineExceeded,
11815            ErrorCode::InvalidRequest,
11816            ErrorCode::UnsupportedVersion,
11817            ErrorCode::Unauthenticated,
11818            ErrorCode::PermissionDenied,
11819            ErrorCode::NotFound,
11820            ErrorCode::StaleCursor,
11821            ErrorCode::RestartBudgetExhausted,
11822            ErrorCode::LimitExceeded,
11823            ErrorCode::CapabilityUnavailable,
11824            ErrorCode::TemporarilyUnavailable,
11825            ErrorCode::Internal,
11826        ],
11827        limit_ids: &[
11828            "request_bytes",
11829            "response_bytes",
11830            "page_size",
11831            "catalog_page_size",
11832            "catalog_restart_budget",
11833        ],
11834        effect_class: "read_only",
11835        risk_flags: &[],
11836        capability_family: "catalog",
11837        retry_safety: "safe",
11838        identity_requirement: "none",
11839        resolver: None,
11840        cancellation: "per_call",
11841        side_effects: &[],
11842        recovery: "retry",
11843        collection_index_ref: "none",
11844    },
11845    CommandSemanticContract {
11846        command: Command::GetLifecyclePolicy,
11847        admissible_errors: &[
11848            ErrorCode::Aborted,
11849            ErrorCode::DeadlineExceeded,
11850            ErrorCode::InvalidRequest,
11851            ErrorCode::UnsupportedVersion,
11852            ErrorCode::Unauthenticated,
11853            ErrorCode::PermissionDenied,
11854            ErrorCode::NotFound,
11855            ErrorCode::LimitExceeded,
11856            ErrorCode::CapabilityUnavailable,
11857            ErrorCode::TemporarilyUnavailable,
11858            ErrorCode::Internal,
11859        ],
11860        limit_ids: &["request_bytes", "response_bytes"],
11861        effect_class: "read_only",
11862        risk_flags: &[],
11863        capability_family: "catalog",
11864        retry_safety: "safe",
11865        identity_requirement: "none",
11866        resolver: None,
11867        cancellation: "per_call",
11868        side_effects: &[],
11869        recovery: "retry",
11870        collection_index_ref: "none",
11871    },
11872    CommandSemanticContract {
11873        command: Command::PrepareCreateIndex,
11874        admissible_errors: &[
11875            ErrorCode::Aborted,
11876            ErrorCode::DeadlineExceeded,
11877            ErrorCode::InvalidRequest,
11878            ErrorCode::UnsupportedVersion,
11879            ErrorCode::Unauthenticated,
11880            ErrorCode::PermissionDenied,
11881            ErrorCode::NotFound,
11882            ErrorCode::LimitExceeded,
11883            ErrorCode::CapabilityUnavailable,
11884            ErrorCode::TemporarilyUnavailable,
11885            ErrorCode::Internal,
11886        ],
11887        limit_ids: &[
11888            "request_bytes",
11889            "response_bytes",
11890            "resource_initial_shards",
11891            "resource_target_shard_bytes",
11892            "resource_admission_weight",
11893            "resource_ram_bytes",
11894            "resource_nvme_bytes",
11895            "resource_refresh_millis",
11896            "resource_memtable_bytes",
11897            "resource_parallelism",
11898        ],
11899        effect_class: "prepare",
11900        risk_flags: &[],
11901        capability_family: "catalog",
11902        retry_safety: "safe",
11903        identity_requirement: "server_locator",
11904        resolver: None,
11905        cancellation: "per_call",
11906        side_effects: &["creates_bounded_preparation"],
11907        recovery: "retry",
11908        collection_index_ref: "request_name",
11909    },
11910    CommandSemanticContract {
11911        command: Command::PrepareDeleteIndex,
11912        admissible_errors: &[
11913            ErrorCode::Aborted,
11914            ErrorCode::DeadlineExceeded,
11915            ErrorCode::InvalidRequest,
11916            ErrorCode::UnsupportedVersion,
11917            ErrorCode::Unauthenticated,
11918            ErrorCode::PermissionDenied,
11919            ErrorCode::NotFound,
11920            ErrorCode::LimitExceeded,
11921            ErrorCode::CapabilityUnavailable,
11922            ErrorCode::TemporarilyUnavailable,
11923            ErrorCode::Internal,
11924        ],
11925        limit_ids: &["request_bytes", "response_bytes"],
11926        effect_class: "prepare",
11927        risk_flags: &["destructive"],
11928        capability_family: "catalog",
11929        retry_safety: "safe",
11930        identity_requirement: "server_locator",
11931        resolver: None,
11932        cancellation: "per_call",
11933        side_effects: &["creates_bounded_preparation"],
11934        recovery: "retry",
11935        collection_index_ref: "request_name",
11936    },
11937    CommandSemanticContract {
11938        command: Command::SubmitCatalogAction,
11939        admissible_errors: &[
11940            ErrorCode::Aborted,
11941            ErrorCode::DeadlineExceeded,
11942            ErrorCode::InvalidRequest,
11943            ErrorCode::UnsupportedVersion,
11944            ErrorCode::Unauthenticated,
11945            ErrorCode::PermissionDenied,
11946            ErrorCode::NotFound,
11947            ErrorCode::Conflict,
11948            ErrorCode::LimitExceeded,
11949            ErrorCode::CapabilityUnavailable,
11950            ErrorCode::NotSubmitted,
11951            ErrorCode::SubmittedIndeterminate,
11952            ErrorCode::ExpiredUnknown,
11953            ErrorCode::TemporarilyUnavailable,
11954            ErrorCode::Internal,
11955        ],
11956        limit_ids: &[
11957            "request_bytes",
11958            "response_bytes",
11959            "resource_initial_shards",
11960            "resource_target_shard_bytes",
11961            "resource_admission_weight",
11962            "resource_ram_bytes",
11963            "resource_nvme_bytes",
11964            "resource_refresh_millis",
11965            "resource_memtable_bytes",
11966            "resource_parallelism",
11967        ],
11968        effect_class: "durable_submit",
11969        risk_flags: &[],
11970        capability_family: "catalog",
11971        retry_safety: "pre_submit_only",
11972        identity_requirement: "request_locator",
11973        resolver: Some(Command::ResolveCatalogAction),
11974        cancellation: "per_call_until_submission_then_resolve",
11975        side_effects: &["commits_authoritative_state"],
11976        recovery: "resolve_with_resolve_catalog_action",
11977        collection_index_ref: "request_name",
11978    },
11979    CommandSemanticContract {
11980        command: Command::ResolveCatalogAction,
11981        admissible_errors: &[
11982            ErrorCode::Aborted,
11983            ErrorCode::DeadlineExceeded,
11984            ErrorCode::InvalidRequest,
11985            ErrorCode::UnsupportedVersion,
11986            ErrorCode::Unauthenticated,
11987            ErrorCode::PermissionDenied,
11988            ErrorCode::NotFound,
11989            ErrorCode::LimitExceeded,
11990            ErrorCode::CapabilityUnavailable,
11991            ErrorCode::TemporarilyUnavailable,
11992            ErrorCode::Internal,
11993        ],
11994        limit_ids: &["request_bytes", "response_bytes"],
11995        effect_class: "read_only",
11996        risk_flags: &[],
11997        capability_family: "catalog",
11998        retry_safety: "safe",
11999        identity_requirement: "request_locator",
12000        resolver: None,
12001        cancellation: "per_call",
12002        side_effects: &[],
12003        recovery: "retry",
12004        collection_index_ref: "caller",
12005    },
12006    CommandSemanticContract {
12007        command: Command::PrepareReplayableSourceIndex,
12008        admissible_errors: &[
12009            ErrorCode::Aborted,
12010            ErrorCode::DeadlineExceeded,
12011            ErrorCode::InvalidRequest,
12012            ErrorCode::UnsupportedVersion,
12013            ErrorCode::Unauthenticated,
12014            ErrorCode::PermissionDenied,
12015            ErrorCode::NotFound,
12016            ErrorCode::LimitExceeded,
12017            ErrorCode::CapabilityUnavailable,
12018            ErrorCode::RetentionGap,
12019            ErrorCode::TemporarilyUnavailable,
12020            ErrorCode::Internal,
12021        ],
12022        limit_ids: &[
12023            "request_bytes",
12024            "response_bytes",
12025            "resource_initial_shards",
12026            "resource_target_shard_bytes",
12027            "resource_admission_weight",
12028            "resource_ram_bytes",
12029            "resource_nvme_bytes",
12030            "resource_refresh_millis",
12031            "resource_memtable_bytes",
12032            "resource_parallelism",
12033        ],
12034        effect_class: "prepare",
12035        risk_flags: &[],
12036        capability_family: "catalog",
12037        retry_safety: "safe",
12038        identity_requirement: "server_locator",
12039        resolver: None,
12040        cancellation: "per_call",
12041        side_effects: &["creates_bounded_preparation"],
12042        recovery: "retry",
12043        collection_index_ref: "request_name",
12044    },
12045    CommandSemanticContract {
12046        command: Command::SubmitReplayableSourceIndex,
12047        admissible_errors: &[
12048            ErrorCode::Aborted,
12049            ErrorCode::DeadlineExceeded,
12050            ErrorCode::InvalidRequest,
12051            ErrorCode::UnsupportedVersion,
12052            ErrorCode::Unauthenticated,
12053            ErrorCode::PermissionDenied,
12054            ErrorCode::NotFound,
12055            ErrorCode::Conflict,
12056            ErrorCode::LimitExceeded,
12057            ErrorCode::CapabilityUnavailable,
12058            ErrorCode::NotSubmitted,
12059            ErrorCode::SubmittedIndeterminate,
12060            ErrorCode::ExpiredUnknown,
12061            ErrorCode::RetentionGap,
12062            ErrorCode::TemporarilyUnavailable,
12063            ErrorCode::Internal,
12064        ],
12065        limit_ids: &[
12066            "request_bytes",
12067            "response_bytes",
12068            "resource_initial_shards",
12069            "resource_target_shard_bytes",
12070            "resource_admission_weight",
12071            "resource_ram_bytes",
12072            "resource_nvme_bytes",
12073            "resource_refresh_millis",
12074            "resource_memtable_bytes",
12075            "resource_parallelism",
12076        ],
12077        effect_class: "durable_submit",
12078        risk_flags: &[],
12079        capability_family: "catalog",
12080        retry_safety: "pre_submit_only",
12081        identity_requirement: "request_locator",
12082        resolver: Some(Command::ResolveCatalogAction),
12083        cancellation: "per_call_until_submission_then_resolve",
12084        side_effects: &["commits_authoritative_state"],
12085        recovery: "resolve_with_resolve_catalog_action",
12086        collection_index_ref: "request_name",
12087    },
12088    CommandSemanticContract {
12089        command: Command::GetReplayableSource,
12090        admissible_errors: &[
12091            ErrorCode::Aborted,
12092            ErrorCode::DeadlineExceeded,
12093            ErrorCode::InvalidRequest,
12094            ErrorCode::UnsupportedVersion,
12095            ErrorCode::Unauthenticated,
12096            ErrorCode::PermissionDenied,
12097            ErrorCode::NotFound,
12098            ErrorCode::LimitExceeded,
12099            ErrorCode::CapabilityUnavailable,
12100            ErrorCode::RetentionGap,
12101            ErrorCode::TemporarilyUnavailable,
12102            ErrorCode::Internal,
12103        ],
12104        limit_ids: &["request_bytes", "response_bytes"],
12105        effect_class: "read_only",
12106        risk_flags: &[],
12107        capability_family: "catalog",
12108        retry_safety: "safe",
12109        identity_requirement: "none",
12110        resolver: None,
12111        cancellation: "per_call",
12112        side_effects: &[],
12113        recovery: "retry",
12114        collection_index_ref: "none",
12115    },
12116    CommandSemanticContract {
12117        command: Command::ControlReplayableSource,
12118        admissible_errors: &[
12119            ErrorCode::Aborted,
12120            ErrorCode::DeadlineExceeded,
12121            ErrorCode::InvalidRequest,
12122            ErrorCode::UnsupportedVersion,
12123            ErrorCode::Unauthenticated,
12124            ErrorCode::PermissionDenied,
12125            ErrorCode::NotFound,
12126            ErrorCode::Conflict,
12127            ErrorCode::LimitExceeded,
12128            ErrorCode::CapabilityUnavailable,
12129            ErrorCode::NotSubmitted,
12130            ErrorCode::SubmittedIndeterminate,
12131            ErrorCode::ExpiredUnknown,
12132            ErrorCode::RetentionGap,
12133            ErrorCode::TemporarilyUnavailable,
12134            ErrorCode::Internal,
12135        ],
12136        limit_ids: &["request_bytes", "response_bytes"],
12137        effect_class: "durable_submit",
12138        risk_flags: &[],
12139        capability_family: "catalog",
12140        retry_safety: "pre_submit_only",
12141        identity_requirement: "none",
12142        resolver: None,
12143        cancellation: "per_call_until_submission_then_resolve",
12144        side_effects: &["commits_authoritative_state"],
12145        recovery: "retry_if_not_submitted",
12146        collection_index_ref: "request_index",
12147    },
12148    CommandSemanticContract {
12149        command: Command::CloneIndex,
12150        admissible_errors: &[
12151            ErrorCode::Aborted,
12152            ErrorCode::DeadlineExceeded,
12153            ErrorCode::InvalidRequest,
12154            ErrorCode::UnsupportedVersion,
12155            ErrorCode::Unauthenticated,
12156            ErrorCode::PermissionDenied,
12157            ErrorCode::NotFound,
12158            ErrorCode::Conflict,
12159            ErrorCode::LimitExceeded,
12160            ErrorCode::CapabilityUnavailable,
12161            ErrorCode::NotSubmitted,
12162            ErrorCode::SubmittedIndeterminate,
12163            ErrorCode::ExpiredUnknown,
12164            ErrorCode::TemporarilyUnavailable,
12165            ErrorCode::Internal,
12166        ],
12167        limit_ids: &["request_bytes", "response_bytes"],
12168        effect_class: "durable_submit",
12169        risk_flags: &[],
12170        capability_family: "catalog",
12171        retry_safety: "pre_submit_only",
12172        identity_requirement: "caller_action_id",
12173        resolver: Some(Command::CloneIndex),
12174        cancellation: "per_call_until_submission_then_resolve",
12175        side_effects: &["commits_authoritative_state"],
12176        recovery: "resolve_with_clone_index",
12177        collection_index_ref: "caller",
12178    },
12179    CommandSemanticContract {
12180        command: Command::ConfigureHistory,
12181        admissible_errors: &[
12182            ErrorCode::Aborted,
12183            ErrorCode::DeadlineExceeded,
12184            ErrorCode::InvalidRequest,
12185            ErrorCode::UnsupportedVersion,
12186            ErrorCode::Unauthenticated,
12187            ErrorCode::PermissionDenied,
12188            ErrorCode::NotFound,
12189            ErrorCode::Conflict,
12190            ErrorCode::LimitExceeded,
12191            ErrorCode::CapabilityUnavailable,
12192            ErrorCode::NotSubmitted,
12193            ErrorCode::SubmittedIndeterminate,
12194            ErrorCode::ExpiredUnknown,
12195            ErrorCode::TemporarilyUnavailable,
12196            ErrorCode::Internal,
12197        ],
12198        limit_ids: &["request_bytes", "response_bytes"],
12199        effect_class: "durable_submit",
12200        risk_flags: &[],
12201        capability_family: "catalog",
12202        retry_safety: "pre_submit_only",
12203        identity_requirement: "none",
12204        resolver: Some(Command::GetHistory),
12205        cancellation: "per_call_until_submission_then_resolve",
12206        side_effects: &["commits_authoritative_state"],
12207        recovery: "resolve_with_get_history",
12208        collection_index_ref: "request_index",
12209    },
12210    CommandSemanticContract {
12211        command: Command::GetHistory,
12212        admissible_errors: &[
12213            ErrorCode::Aborted,
12214            ErrorCode::DeadlineExceeded,
12215            ErrorCode::InvalidRequest,
12216            ErrorCode::UnsupportedVersion,
12217            ErrorCode::Unauthenticated,
12218            ErrorCode::PermissionDenied,
12219            ErrorCode::NotFound,
12220            ErrorCode::LimitExceeded,
12221            ErrorCode::CapabilityUnavailable,
12222            ErrorCode::TemporarilyUnavailable,
12223            ErrorCode::Internal,
12224        ],
12225        limit_ids: &["request_bytes", "response_bytes"],
12226        effect_class: "read_only",
12227        risk_flags: &[],
12228        capability_family: "catalog",
12229        retry_safety: "safe",
12230        identity_requirement: "none",
12231        resolver: None,
12232        cancellation: "per_call",
12233        side_effects: &[],
12234        recovery: "retry",
12235        collection_index_ref: "none",
12236    },
12237    CommandSemanticContract {
12238        command: Command::ResolveHistory,
12239        admissible_errors: &[
12240            ErrorCode::Aborted,
12241            ErrorCode::DeadlineExceeded,
12242            ErrorCode::InvalidRequest,
12243            ErrorCode::UnsupportedVersion,
12244            ErrorCode::Unauthenticated,
12245            ErrorCode::PermissionDenied,
12246            ErrorCode::NotFound,
12247            ErrorCode::LimitExceeded,
12248            ErrorCode::CapabilityUnavailable,
12249            ErrorCode::RetentionGap,
12250            ErrorCode::TemporarilyUnavailable,
12251            ErrorCode::Internal,
12252        ],
12253        limit_ids: &["request_bytes", "response_bytes"],
12254        effect_class: "read_only",
12255        risk_flags: &[],
12256        capability_family: "data",
12257        retry_safety: "safe",
12258        identity_requirement: "none",
12259        resolver: None,
12260        cancellation: "per_call",
12261        side_effects: &[],
12262        recovery: "retry",
12263        collection_index_ref: "request_index",
12264    },
12265    CommandSemanticContract {
12266        command: Command::PlaceHistoryHold,
12267        admissible_errors: &[
12268            ErrorCode::Aborted,
12269            ErrorCode::DeadlineExceeded,
12270            ErrorCode::InvalidRequest,
12271            ErrorCode::UnsupportedVersion,
12272            ErrorCode::Unauthenticated,
12273            ErrorCode::PermissionDenied,
12274            ErrorCode::NotFound,
12275            ErrorCode::Conflict,
12276            ErrorCode::LimitExceeded,
12277            ErrorCode::CapabilityUnavailable,
12278            ErrorCode::NotSubmitted,
12279            ErrorCode::SubmittedIndeterminate,
12280            ErrorCode::ExpiredUnknown,
12281            ErrorCode::TemporarilyUnavailable,
12282            ErrorCode::Internal,
12283        ],
12284        limit_ids: &["request_bytes", "response_bytes"],
12285        effect_class: "durable_submit",
12286        risk_flags: &[],
12287        capability_family: "catalog",
12288        retry_safety: "pre_submit_only",
12289        identity_requirement: "none",
12290        resolver: Some(Command::GetHistory),
12291        cancellation: "per_call_until_submission_then_resolve",
12292        side_effects: &["commits_authoritative_state"],
12293        recovery: "resolve_with_get_history",
12294        collection_index_ref: "request_index",
12295    },
12296    CommandSemanticContract {
12297        command: Command::ReleaseHistoryHold,
12298        admissible_errors: &[
12299            ErrorCode::Aborted,
12300            ErrorCode::DeadlineExceeded,
12301            ErrorCode::InvalidRequest,
12302            ErrorCode::UnsupportedVersion,
12303            ErrorCode::Unauthenticated,
12304            ErrorCode::PermissionDenied,
12305            ErrorCode::NotFound,
12306            ErrorCode::Conflict,
12307            ErrorCode::LimitExceeded,
12308            ErrorCode::CapabilityUnavailable,
12309            ErrorCode::NotSubmitted,
12310            ErrorCode::SubmittedIndeterminate,
12311            ErrorCode::ExpiredUnknown,
12312            ErrorCode::TemporarilyUnavailable,
12313            ErrorCode::Internal,
12314        ],
12315        limit_ids: &["request_bytes", "response_bytes"],
12316        effect_class: "durable_submit",
12317        risk_flags: &[],
12318        capability_family: "catalog",
12319        retry_safety: "pre_submit_only",
12320        identity_requirement: "none",
12321        resolver: Some(Command::GetHistory),
12322        cancellation: "per_call_until_submission_then_resolve",
12323        side_effects: &["commits_authoritative_state"],
12324        recovery: "resolve_with_get_history",
12325        collection_index_ref: "request_index",
12326    },
12327    CommandSemanticContract {
12328        command: Command::PrepareDocumentMutation,
12329        admissible_errors: &[
12330            ErrorCode::Aborted,
12331            ErrorCode::DeadlineExceeded,
12332            ErrorCode::InvalidRequest,
12333            ErrorCode::UnsupportedVersion,
12334            ErrorCode::Unauthenticated,
12335            ErrorCode::PermissionDenied,
12336            ErrorCode::NotFound,
12337            ErrorCode::LimitExceeded,
12338            ErrorCode::CapabilityUnavailable,
12339            ErrorCode::TemporarilyUnavailable,
12340            ErrorCode::Internal,
12341        ],
12342        limit_ids: &["request_bytes", "response_bytes"],
12343        effect_class: "prepare",
12344        risk_flags: &[],
12345        capability_family: "data",
12346        retry_safety: "safe",
12347        identity_requirement: "server_locator",
12348        resolver: None,
12349        cancellation: "per_call",
12350        side_effects: &["creates_bounded_preparation"],
12351        recovery: "retry",
12352        collection_index_ref: "request_index",
12353    },
12354    CommandSemanticContract {
12355        command: Command::SubmitDocumentMutation,
12356        admissible_errors: &[
12357            ErrorCode::Aborted,
12358            ErrorCode::DeadlineExceeded,
12359            ErrorCode::InvalidRequest,
12360            ErrorCode::UnsupportedVersion,
12361            ErrorCode::Unauthenticated,
12362            ErrorCode::PermissionDenied,
12363            ErrorCode::NotFound,
12364            ErrorCode::Conflict,
12365            ErrorCode::LimitExceeded,
12366            ErrorCode::CapabilityUnavailable,
12367            ErrorCode::NotSubmitted,
12368            ErrorCode::SubmittedIndeterminate,
12369            ErrorCode::ExpiredUnknown,
12370            ErrorCode::TemporarilyUnavailable,
12371            ErrorCode::Internal,
12372        ],
12373        limit_ids: &["request_bytes", "response_bytes"],
12374        effect_class: "durable_submit",
12375        risk_flags: &[],
12376        capability_family: "data",
12377        retry_safety: "pre_submit_only",
12378        identity_requirement: "request_locator",
12379        resolver: Some(Command::ResolveDocumentMutation),
12380        cancellation: "per_call_until_submission_then_resolve",
12381        side_effects: &["commits_authoritative_state"],
12382        recovery: "resolve_with_resolve_document_mutation",
12383        collection_index_ref: "request_index",
12384    },
12385    CommandSemanticContract {
12386        command: Command::PrepareDocumentBulk,
12387        admissible_errors: &[
12388            ErrorCode::Aborted,
12389            ErrorCode::DeadlineExceeded,
12390            ErrorCode::InvalidRequest,
12391            ErrorCode::UnsupportedVersion,
12392            ErrorCode::Unauthenticated,
12393            ErrorCode::PermissionDenied,
12394            ErrorCode::NotFound,
12395            ErrorCode::LimitExceeded,
12396            ErrorCode::CapabilityUnavailable,
12397            ErrorCode::TemporarilyUnavailable,
12398            ErrorCode::Internal,
12399        ],
12400        limit_ids: &[
12401            "request_bytes",
12402            "response_bytes",
12403            "bulk_document_items",
12404            "bulk_document_bytes",
12405        ],
12406        effect_class: "prepare",
12407        risk_flags: &[],
12408        capability_family: "data",
12409        retry_safety: "safe",
12410        identity_requirement: "caller_action_id",
12411        resolver: None,
12412        cancellation: "per_call",
12413        side_effects: &["creates_bounded_preparation"],
12414        recovery: "retry",
12415        collection_index_ref: "request_index",
12416    },
12417    CommandSemanticContract {
12418        command: Command::SubmitDocumentBulk,
12419        admissible_errors: &[
12420            ErrorCode::Aborted,
12421            ErrorCode::DeadlineExceeded,
12422            ErrorCode::InvalidRequest,
12423            ErrorCode::UnsupportedVersion,
12424            ErrorCode::Unauthenticated,
12425            ErrorCode::PermissionDenied,
12426            ErrorCode::NotFound,
12427            ErrorCode::Conflict,
12428            ErrorCode::LimitExceeded,
12429            ErrorCode::CapabilityUnavailable,
12430            ErrorCode::NotSubmitted,
12431            ErrorCode::SubmittedIndeterminate,
12432            ErrorCode::ExpiredUnknown,
12433            ErrorCode::TemporarilyUnavailable,
12434            ErrorCode::Internal,
12435        ],
12436        limit_ids: &[
12437            "request_bytes",
12438            "response_bytes",
12439            "bulk_document_items",
12440            "bulk_document_bytes",
12441        ],
12442        effect_class: "durable_submit",
12443        risk_flags: &[],
12444        capability_family: "data",
12445        retry_safety: "pre_submit_only",
12446        identity_requirement: "caller_action_id",
12447        resolver: Some(Command::ResolveDocumentBulk),
12448        cancellation: "per_call_until_submission_then_resolve",
12449        side_effects: &["commits_authoritative_state"],
12450        recovery: "resolve_with_resolve_document_bulk",
12451        collection_index_ref: "request_index",
12452    },
12453    CommandSemanticContract {
12454        command: Command::ResolveDocumentBulk,
12455        admissible_errors: &[
12456            ErrorCode::Aborted,
12457            ErrorCode::DeadlineExceeded,
12458            ErrorCode::InvalidRequest,
12459            ErrorCode::UnsupportedVersion,
12460            ErrorCode::Unauthenticated,
12461            ErrorCode::PermissionDenied,
12462            ErrorCode::NotFound,
12463            ErrorCode::LimitExceeded,
12464            ErrorCode::CapabilityUnavailable,
12465            ErrorCode::TemporarilyUnavailable,
12466            ErrorCode::Internal,
12467        ],
12468        limit_ids: &[
12469            "request_bytes",
12470            "response_bytes",
12471            "bulk_document_items",
12472            "bulk_document_bytes",
12473        ],
12474        effect_class: "read_only",
12475        risk_flags: &[],
12476        capability_family: "data",
12477        retry_safety: "safe",
12478        identity_requirement: "caller_action_id",
12479        resolver: None,
12480        cancellation: "per_call",
12481        side_effects: &[],
12482        recovery: "retry",
12483        collection_index_ref: "request_index",
12484    },
12485    CommandSemanticContract {
12486        command: Command::PrepareAppendBulk,
12487        admissible_errors: &[
12488            ErrorCode::Aborted,
12489            ErrorCode::DeadlineExceeded,
12490            ErrorCode::InvalidRequest,
12491            ErrorCode::UnsupportedVersion,
12492            ErrorCode::Unauthenticated,
12493            ErrorCode::PermissionDenied,
12494            ErrorCode::NotFound,
12495            ErrorCode::LimitExceeded,
12496            ErrorCode::CapabilityUnavailable,
12497            ErrorCode::TemporarilyUnavailable,
12498            ErrorCode::Internal,
12499        ],
12500        limit_ids: &[
12501            "request_bytes",
12502            "response_bytes",
12503            "bulk_document_items",
12504            "bulk_document_bytes",
12505        ],
12506        effect_class: "prepare",
12507        risk_flags: &[],
12508        capability_family: "data",
12509        retry_safety: "safe",
12510        identity_requirement: "caller_action_id",
12511        resolver: None,
12512        cancellation: "per_call",
12513        side_effects: &[],
12514        recovery: "retry",
12515        collection_index_ref: "request_index",
12516    },
12517    CommandSemanticContract {
12518        command: Command::SubmitAppendBulk,
12519        admissible_errors: &[
12520            ErrorCode::Aborted,
12521            ErrorCode::DeadlineExceeded,
12522            ErrorCode::InvalidRequest,
12523            ErrorCode::UnsupportedVersion,
12524            ErrorCode::Unauthenticated,
12525            ErrorCode::PermissionDenied,
12526            ErrorCode::NotFound,
12527            ErrorCode::Conflict,
12528            ErrorCode::LimitExceeded,
12529            ErrorCode::CapabilityUnavailable,
12530            ErrorCode::NotSubmitted,
12531            ErrorCode::SubmittedIndeterminate,
12532            ErrorCode::TemporarilyUnavailable,
12533            ErrorCode::Internal,
12534        ],
12535        limit_ids: &[
12536            "request_bytes",
12537            "response_bytes",
12538            "bulk_document_items",
12539            "bulk_document_bytes",
12540        ],
12541        effect_class: "durable_submit",
12542        risk_flags: &[],
12543        capability_family: "data",
12544        retry_safety: "pre_submit_only",
12545        identity_requirement: "request_locator",
12546        resolver: Some(Command::ResolveAppendBulk),
12547        cancellation: "per_call_until_submission_then_resolve",
12548        side_effects: &["commits_authoritative_state"],
12549        recovery: "resolve_with_resolve_append_bulk",
12550        collection_index_ref: "request_index",
12551    },
12552    CommandSemanticContract {
12553        command: Command::ResolveAppendBulk,
12554        admissible_errors: &[
12555            ErrorCode::Aborted,
12556            ErrorCode::DeadlineExceeded,
12557            ErrorCode::InvalidRequest,
12558            ErrorCode::UnsupportedVersion,
12559            ErrorCode::Unauthenticated,
12560            ErrorCode::PermissionDenied,
12561            ErrorCode::NotFound,
12562            ErrorCode::Conflict,
12563            ErrorCode::LimitExceeded,
12564            ErrorCode::CapabilityUnavailable,
12565            ErrorCode::TemporarilyUnavailable,
12566            ErrorCode::Internal,
12567        ],
12568        limit_ids: &[
12569            "request_bytes",
12570            "response_bytes",
12571            "bulk_document_items",
12572            "bulk_document_bytes",
12573        ],
12574        effect_class: "read_only",
12575        risk_flags: &[],
12576        capability_family: "data",
12577        retry_safety: "safe",
12578        identity_requirement: "request_locator",
12579        resolver: None,
12580        cancellation: "per_call",
12581        side_effects: &[],
12582        recovery: "retry",
12583        collection_index_ref: "request_index",
12584    },
12585    CommandSemanticContract {
12586        command: Command::ObserveAppendCommitted,
12587        admissible_errors: &[
12588            ErrorCode::Aborted,
12589            ErrorCode::DeadlineExceeded,
12590            ErrorCode::InvalidRequest,
12591            ErrorCode::UnsupportedVersion,
12592            ErrorCode::Unauthenticated,
12593            ErrorCode::PermissionDenied,
12594            ErrorCode::NotFound,
12595            ErrorCode::Conflict,
12596            ErrorCode::LimitExceeded,
12597            ErrorCode::CapabilityUnavailable,
12598            ErrorCode::TemporarilyUnavailable,
12599            ErrorCode::Internal,
12600        ],
12601        limit_ids: &["request_bytes", "response_bytes"],
12602        effect_class: "read_only",
12603        risk_flags: &[],
12604        capability_family: "data",
12605        retry_safety: "safe",
12606        identity_requirement: "request_locator",
12607        resolver: None,
12608        cancellation: "per_call",
12609        side_effects: &[],
12610        recovery: "retry",
12611        collection_index_ref: "request_index",
12612    },
12613    CommandSemanticContract {
12614        command: Command::ResolveDocumentMutation,
12615        admissible_errors: &[
12616            ErrorCode::Aborted,
12617            ErrorCode::DeadlineExceeded,
12618            ErrorCode::InvalidRequest,
12619            ErrorCode::UnsupportedVersion,
12620            ErrorCode::Unauthenticated,
12621            ErrorCode::PermissionDenied,
12622            ErrorCode::NotFound,
12623            ErrorCode::LimitExceeded,
12624            ErrorCode::CapabilityUnavailable,
12625            ErrorCode::TemporarilyUnavailable,
12626            ErrorCode::Internal,
12627        ],
12628        limit_ids: &["request_bytes", "response_bytes"],
12629        effect_class: "read_only",
12630        risk_flags: &[],
12631        capability_family: "data",
12632        retry_safety: "safe",
12633        identity_requirement: "request_locator",
12634        resolver: None,
12635        cancellation: "per_call",
12636        side_effects: &[],
12637        recovery: "retry",
12638        collection_index_ref: "caller",
12639    },
12640    CommandSemanticContract {
12641        command: Command::GetDocument,
12642        admissible_errors: &[
12643            ErrorCode::Aborted,
12644            ErrorCode::DeadlineExceeded,
12645            ErrorCode::InvalidRequest,
12646            ErrorCode::UnsupportedVersion,
12647            ErrorCode::Unauthenticated,
12648            ErrorCode::PermissionDenied,
12649            ErrorCode::NotFound,
12650            ErrorCode::LimitExceeded,
12651            ErrorCode::CapabilityUnavailable,
12652            ErrorCode::TemporarilyUnavailable,
12653            ErrorCode::Internal,
12654        ],
12655        limit_ids: &["request_bytes", "response_bytes"],
12656        effect_class: "read_only",
12657        risk_flags: &[],
12658        capability_family: "data",
12659        retry_safety: "safe",
12660        identity_requirement: "none",
12661        resolver: None,
12662        cancellation: "per_call",
12663        side_effects: &[],
12664        recovery: "retry",
12665        collection_index_ref: "request_index",
12666    },
12667    CommandSemanticContract {
12668        command: Command::Search,
12669        admissible_errors: &[
12670            ErrorCode::Aborted,
12671            ErrorCode::DeadlineExceeded,
12672            ErrorCode::InvalidRequest,
12673            ErrorCode::UnsupportedVersion,
12674            ErrorCode::Unauthenticated,
12675            ErrorCode::PermissionDenied,
12676            ErrorCode::NotFound,
12677            ErrorCode::StaleCursor,
12678            ErrorCode::RestartBudgetExhausted,
12679            ErrorCode::LimitExceeded,
12680            ErrorCode::CapabilityUnavailable,
12681            ErrorCode::TemporarilyUnavailable,
12682            ErrorCode::Internal,
12683        ],
12684        limit_ids: &[
12685            "request_bytes",
12686            "response_bytes",
12687            "page_size",
12688            "query_clauses",
12689            "aggregation_nodes",
12690            "aggregation_buckets",
12691            "routing_values",
12692            "routing_value_bytes",
12693            "query_recursion_depth",
12694            "text_query_bytes",
12695            "text_query_fields",
12696            "text_query_slop",
12697            "text_query_boost",
12698            "text_query_fuzzy_expansions",
12699            "text_query_fuzzy_distance",
12700            "text_query_dictionary_scan_terms",
12701            "text_query_dictionary_scan_bytes",
12702            "text_query_fuzzy_work_units",
12703            "vector_dimensions",
12704            "vector_query_bytes",
12705            "vector_request_bytes",
12706            "vector_candidates",
12707            "vector_set_query_vectors",
12708            "vector_set_query_bytes",
12709            "retrieval_branches",
12710            "retrieval_branch_name_bytes",
12711            "retrieval_window",
12712            "fragment_fields",
12713            "fragments_per_field",
12714            "fragment_bytes",
12715            "fragment_total_bytes",
12716            "result_feature_hits",
12717            "result_features",
12718            "diversification_fields",
12719            "diversification_per_group",
12720            "source_projection_patterns",
12721            "source_projection_pattern_bytes",
12722            "search_result_window",
12723        ],
12724        effect_class: "read_only",
12725        risk_flags: &[],
12726        capability_family: "data",
12727        retry_safety: "safe",
12728        identity_requirement: "none",
12729        resolver: None,
12730        cancellation: "per_call",
12731        side_effects: &[],
12732        recovery: "retry",
12733        collection_index_ref: "request_indexes_or_pit_authority",
12734    },
12735    CommandSemanticContract {
12736        command: Command::TraverseRelationships,
12737        admissible_errors: &[
12738            ErrorCode::Aborted,
12739            ErrorCode::DeadlineExceeded,
12740            ErrorCode::InvalidRequest,
12741            ErrorCode::UnsupportedVersion,
12742            ErrorCode::Unauthenticated,
12743            ErrorCode::PermissionDenied,
12744            ErrorCode::NotFound,
12745            ErrorCode::LimitExceeded,
12746            ErrorCode::CapabilityUnavailable,
12747            ErrorCode::TemporarilyUnavailable,
12748            ErrorCode::Internal,
12749        ],
12750        limit_ids: &[
12751            "request_bytes",
12752            "response_bytes",
12753            "relationship_indexes",
12754            "relationship_seeds",
12755            "relationship_filter_values",
12756            "relationship_depth",
12757            "relationship_fan_out",
12758            "relationship_visited_entities",
12759            "relationship_visited_records",
12760            "relationship_returned_records",
12761            "relationship_memory_bytes",
12762            "search_result_window",
12763        ],
12764        effect_class: "read_only",
12765        risk_flags: &[],
12766        capability_family: "data",
12767        retry_safety: "safe",
12768        identity_requirement: "none",
12769        resolver: None,
12770        cancellation: "per_call",
12771        side_effects: &[],
12772        recovery: "retry",
12773        collection_index_ref: "pit_authority",
12774    },
12775    CommandSemanticContract {
12776        command: Command::QueryProfiles,
12777        admissible_errors: &[
12778            ErrorCode::Aborted,
12779            ErrorCode::DeadlineExceeded,
12780            ErrorCode::InvalidRequest,
12781            ErrorCode::UnsupportedVersion,
12782            ErrorCode::Unauthenticated,
12783            ErrorCode::PermissionDenied,
12784            ErrorCode::NotFound,
12785            ErrorCode::LimitExceeded,
12786            ErrorCode::CapabilityUnavailable,
12787            ErrorCode::TemporarilyUnavailable,
12788            ErrorCode::Internal,
12789        ],
12790        limit_ids: &[
12791            "request_bytes",
12792            "response_bytes",
12793            "profile_indexes",
12794            "profile_filter_values",
12795            "profile_batches",
12796            "profile_samples",
12797            "profile_results",
12798            "profile_memory_bytes",
12799            "search_result_window",
12800        ],
12801        effect_class: "read_only",
12802        risk_flags: &[],
12803        capability_family: "data",
12804        retry_safety: "safe",
12805        identity_requirement: "none",
12806        resolver: None,
12807        cancellation: "per_call",
12808        side_effects: &[],
12809        recovery: "retry",
12810        collection_index_ref: "pit_authority",
12811    },
12812    CommandSemanticContract {
12813        command: Command::EvaluateTemporalEvidence,
12814        admissible_errors: &[
12815            ErrorCode::Aborted,
12816            ErrorCode::DeadlineExceeded,
12817            ErrorCode::InvalidRequest,
12818            ErrorCode::UnsupportedVersion,
12819            ErrorCode::Unauthenticated,
12820            ErrorCode::PermissionDenied,
12821            ErrorCode::NotFound,
12822            ErrorCode::LimitExceeded,
12823            ErrorCode::CapabilityUnavailable,
12824            ErrorCode::TemporarilyUnavailable,
12825            ErrorCode::Internal,
12826        ],
12827        limit_ids: &[
12828            "request_bytes",
12829            "response_bytes",
12830            "query_clauses",
12831            "query_recursion_depth",
12832            "search_result_window",
12833            "temporal_inputs",
12834            "temporal_pattern_nodes",
12835            "temporal_pattern_depth",
12836            "temporal_pattern_branches",
12837            "temporal_correlation_keys",
12838            "temporal_events",
12839            "temporal_states",
12840            "temporal_captured_events",
12841            "temporal_results",
12842            "temporal_state_bytes",
12843            "temporal_interval_nanos",
12844        ],
12845        effect_class: "read_only",
12846        risk_flags: &[],
12847        capability_family: "data",
12848        retry_safety: "safe",
12849        identity_requirement: "none",
12850        resolver: None,
12851        cancellation: "per_call",
12852        side_effects: &[],
12853        recovery: "retry",
12854        collection_index_ref: "pit_authority",
12855    },
12856    CommandSemanticContract {
12857        command: Command::CreateContinuousTemporalEvaluation,
12858        admissible_errors: &[
12859            ErrorCode::Aborted,
12860            ErrorCode::DeadlineExceeded,
12861            ErrorCode::InvalidRequest,
12862            ErrorCode::UnsupportedVersion,
12863            ErrorCode::Unauthenticated,
12864            ErrorCode::PermissionDenied,
12865            ErrorCode::NotFound,
12866            ErrorCode::Conflict,
12867            ErrorCode::LimitExceeded,
12868            ErrorCode::CapabilityUnavailable,
12869            ErrorCode::NotSubmitted,
12870            ErrorCode::SubmittedIndeterminate,
12871            ErrorCode::TemporarilyUnavailable,
12872            ErrorCode::Internal,
12873        ],
12874        limit_ids: &[
12875            "request_bytes",
12876            "response_bytes",
12877            "temporal_inputs",
12878            "temporal_pattern_nodes",
12879            "temporal_pattern_depth",
12880            "temporal_pattern_branches",
12881            "temporal_correlation_keys",
12882            "temporal_events",
12883            "temporal_states",
12884            "temporal_captured_events",
12885            "temporal_results",
12886            "temporal_state_bytes",
12887            "temporal_interval_nanos",
12888        ],
12889        effect_class: "durable_submit",
12890        risk_flags: &[],
12891        capability_family: "lifecycle",
12892        retry_safety: "pre_submit_only",
12893        identity_requirement: "caller_action_id",
12894        resolver: Some(Command::GetContinuousTemporalEvaluation),
12895        cancellation: "per_call_until_submission_then_resolve",
12896        side_effects: &["commits_authoritative_state"],
12897        recovery: "resolve_with_get_continuous_temporal_evaluation",
12898        collection_index_ref: "request_temporal_inputs",
12899    },
12900    CommandSemanticContract {
12901        command: Command::GetContinuousTemporalEvaluation,
12902        admissible_errors: &[
12903            ErrorCode::Aborted,
12904            ErrorCode::DeadlineExceeded,
12905            ErrorCode::InvalidRequest,
12906            ErrorCode::UnsupportedVersion,
12907            ErrorCode::Unauthenticated,
12908            ErrorCode::PermissionDenied,
12909            ErrorCode::NotFound,
12910            ErrorCode::LimitExceeded,
12911            ErrorCode::CapabilityUnavailable,
12912            ErrorCode::TemporarilyUnavailable,
12913            ErrorCode::Internal,
12914        ],
12915        limit_ids: &["request_bytes", "response_bytes"],
12916        effect_class: "read_only",
12917        risk_flags: &[],
12918        capability_family: "lifecycle",
12919        retry_safety: "safe",
12920        identity_requirement: "none",
12921        resolver: None,
12922        cancellation: "per_call",
12923        side_effects: &[],
12924        recovery: "retry",
12925        collection_index_ref: "request_evaluation",
12926    },
12927    CommandSemanticContract {
12928        command: Command::PauseContinuousTemporalEvaluation,
12929        admissible_errors: &[
12930            ErrorCode::Aborted,
12931            ErrorCode::DeadlineExceeded,
12932            ErrorCode::InvalidRequest,
12933            ErrorCode::UnsupportedVersion,
12934            ErrorCode::Unauthenticated,
12935            ErrorCode::PermissionDenied,
12936            ErrorCode::NotFound,
12937            ErrorCode::Conflict,
12938            ErrorCode::LimitExceeded,
12939            ErrorCode::CapabilityUnavailable,
12940            ErrorCode::NotSubmitted,
12941            ErrorCode::SubmittedIndeterminate,
12942            ErrorCode::TemporarilyUnavailable,
12943            ErrorCode::Internal,
12944        ],
12945        limit_ids: &["request_bytes", "response_bytes"],
12946        effect_class: "durable_submit",
12947        risk_flags: &[],
12948        capability_family: "lifecycle",
12949        retry_safety: "pre_submit_only",
12950        identity_requirement: "caller_action_id",
12951        resolver: Some(Command::GetContinuousTemporalEvaluation),
12952        cancellation: "per_call_until_submission_then_resolve",
12953        side_effects: &["commits_authoritative_state"],
12954        recovery: "resolve_with_get_continuous_temporal_evaluation",
12955        collection_index_ref: "request_evaluation",
12956    },
12957    CommandSemanticContract {
12958        command: Command::ResumeContinuousTemporalEvaluation,
12959        admissible_errors: &[
12960            ErrorCode::Aborted,
12961            ErrorCode::DeadlineExceeded,
12962            ErrorCode::InvalidRequest,
12963            ErrorCode::UnsupportedVersion,
12964            ErrorCode::Unauthenticated,
12965            ErrorCode::PermissionDenied,
12966            ErrorCode::NotFound,
12967            ErrorCode::Conflict,
12968            ErrorCode::LimitExceeded,
12969            ErrorCode::CapabilityUnavailable,
12970            ErrorCode::NotSubmitted,
12971            ErrorCode::SubmittedIndeterminate,
12972            ErrorCode::TemporarilyUnavailable,
12973            ErrorCode::Internal,
12974        ],
12975        limit_ids: &["request_bytes", "response_bytes"],
12976        effect_class: "durable_submit",
12977        risk_flags: &[],
12978        capability_family: "lifecycle",
12979        retry_safety: "pre_submit_only",
12980        identity_requirement: "caller_action_id",
12981        resolver: Some(Command::GetContinuousTemporalEvaluation),
12982        cancellation: "per_call_until_submission_then_resolve",
12983        side_effects: &["commits_authoritative_state"],
12984        recovery: "resolve_with_get_continuous_temporal_evaluation",
12985        collection_index_ref: "request_evaluation",
12986    },
12987    CommandSemanticContract {
12988        command: Command::ReplaceContinuousTemporalEvaluation,
12989        admissible_errors: &[
12990            ErrorCode::Aborted,
12991            ErrorCode::DeadlineExceeded,
12992            ErrorCode::InvalidRequest,
12993            ErrorCode::UnsupportedVersion,
12994            ErrorCode::Unauthenticated,
12995            ErrorCode::PermissionDenied,
12996            ErrorCode::NotFound,
12997            ErrorCode::Conflict,
12998            ErrorCode::LimitExceeded,
12999            ErrorCode::CapabilityUnavailable,
13000            ErrorCode::NotSubmitted,
13001            ErrorCode::SubmittedIndeterminate,
13002            ErrorCode::TemporarilyUnavailable,
13003            ErrorCode::Internal,
13004        ],
13005        limit_ids: &[
13006            "request_bytes",
13007            "response_bytes",
13008            "temporal_inputs",
13009            "temporal_pattern_nodes",
13010            "temporal_pattern_depth",
13011            "temporal_pattern_branches",
13012            "temporal_correlation_keys",
13013            "temporal_events",
13014            "temporal_states",
13015            "temporal_captured_events",
13016            "temporal_results",
13017            "temporal_state_bytes",
13018            "temporal_interval_nanos",
13019        ],
13020        effect_class: "durable_submit",
13021        risk_flags: &[],
13022        capability_family: "lifecycle",
13023        retry_safety: "pre_submit_only",
13024        identity_requirement: "caller_action_id",
13025        resolver: Some(Command::GetContinuousTemporalEvaluation),
13026        cancellation: "per_call_until_submission_then_resolve",
13027        side_effects: &["commits_authoritative_state"],
13028        recovery: "resolve_with_get_continuous_temporal_evaluation",
13029        collection_index_ref: "request_temporal_inputs",
13030    },
13031    CommandSemanticContract {
13032        command: Command::RetireContinuousTemporalEvaluation,
13033        admissible_errors: &[
13034            ErrorCode::Aborted,
13035            ErrorCode::DeadlineExceeded,
13036            ErrorCode::InvalidRequest,
13037            ErrorCode::UnsupportedVersion,
13038            ErrorCode::Unauthenticated,
13039            ErrorCode::PermissionDenied,
13040            ErrorCode::NotFound,
13041            ErrorCode::Conflict,
13042            ErrorCode::LimitExceeded,
13043            ErrorCode::CapabilityUnavailable,
13044            ErrorCode::NotSubmitted,
13045            ErrorCode::SubmittedIndeterminate,
13046            ErrorCode::TemporarilyUnavailable,
13047            ErrorCode::Internal,
13048        ],
13049        limit_ids: &["request_bytes", "response_bytes"],
13050        effect_class: "durable_submit",
13051        risk_flags: &["destructive"],
13052        capability_family: "lifecycle",
13053        retry_safety: "pre_submit_only",
13054        identity_requirement: "caller_action_id",
13055        resolver: Some(Command::GetContinuousTemporalEvaluation),
13056        cancellation: "per_call_until_submission_then_resolve",
13057        side_effects: &["commits_authoritative_state"],
13058        recovery: "resolve_with_get_continuous_temporal_evaluation",
13059        collection_index_ref: "request_evaluation",
13060    },
13061    CommandSemanticContract {
13062        command: Command::ReadContinuousTemporalEvidence,
13063        admissible_errors: &[
13064            ErrorCode::Aborted,
13065            ErrorCode::DeadlineExceeded,
13066            ErrorCode::InvalidRequest,
13067            ErrorCode::UnsupportedVersion,
13068            ErrorCode::Unauthenticated,
13069            ErrorCode::PermissionDenied,
13070            ErrorCode::NotFound,
13071            ErrorCode::Conflict,
13072            ErrorCode::RetentionGap,
13073            ErrorCode::LimitExceeded,
13074            ErrorCode::CapabilityUnavailable,
13075            ErrorCode::TemporarilyUnavailable,
13076            ErrorCode::Internal,
13077        ],
13078        limit_ids: &["request_bytes", "response_bytes", "page_size", "temporal_results"],
13079        effect_class: "read_only",
13080        risk_flags: &[],
13081        capability_family: "data",
13082        retry_safety: "safe",
13083        identity_requirement: "none",
13084        resolver: None,
13085        cancellation: "per_call",
13086        side_effects: &[],
13087        recovery: "retry",
13088        collection_index_ref: "request_evaluation",
13089    },
13090    CommandSemanticContract {
13091        command: Command::ValidateSearch,
13092        admissible_errors: &[
13093            ErrorCode::Aborted,
13094            ErrorCode::DeadlineExceeded,
13095            ErrorCode::InvalidRequest,
13096            ErrorCode::UnsupportedVersion,
13097            ErrorCode::Unauthenticated,
13098            ErrorCode::PermissionDenied,
13099            ErrorCode::NotFound,
13100            ErrorCode::LimitExceeded,
13101            ErrorCode::CapabilityUnavailable,
13102            ErrorCode::TemporarilyUnavailable,
13103            ErrorCode::Internal,
13104        ],
13105        limit_ids: &[
13106            "request_bytes",
13107            "response_bytes",
13108            "page_size",
13109            "query_clauses",
13110            "aggregation_nodes",
13111            "aggregation_buckets",
13112            "routing_values",
13113            "routing_value_bytes",
13114            "query_recursion_depth",
13115            "source_projection_patterns",
13116            "source_projection_pattern_bytes",
13117            "search_result_window",
13118        ],
13119        effect_class: "read_only",
13120        risk_flags: &[],
13121        capability_family: "data",
13122        retry_safety: "safe",
13123        identity_requirement: "none",
13124        resolver: None,
13125        cancellation: "per_call",
13126        side_effects: &[],
13127        recovery: "retry",
13128        collection_index_ref: "request_indexes_uniform",
13129    },
13130    CommandSemanticContract {
13131        command: Command::OpenPit,
13132        admissible_errors: &[
13133            ErrorCode::Aborted,
13134            ErrorCode::DeadlineExceeded,
13135            ErrorCode::InvalidRequest,
13136            ErrorCode::UnsupportedVersion,
13137            ErrorCode::Unauthenticated,
13138            ErrorCode::PermissionDenied,
13139            ErrorCode::NotFound,
13140            ErrorCode::Conflict,
13141            ErrorCode::LimitExceeded,
13142            ErrorCode::CapabilityUnavailable,
13143            ErrorCode::NotSubmitted,
13144            ErrorCode::SubmittedIndeterminate,
13145            ErrorCode::ExpiredUnknown,
13146            ErrorCode::TemporarilyUnavailable,
13147            ErrorCode::Internal,
13148        ],
13149        limit_ids: &["request_bytes", "response_bytes"],
13150        effect_class: "lease_renewing_read",
13151        risk_flags: &[],
13152        capability_family: "data",
13153        retry_safety: "pre_submit_only",
13154        identity_requirement: "none",
13155        resolver: None,
13156        cancellation: "per_call_until_submission_then_resolve",
13157        side_effects: &["renews_or_closes_existing_lease"],
13158        recovery: "retry_if_not_submitted",
13159        collection_index_ref: "request_indexes_uniform",
13160    },
13161    CommandSemanticContract {
13162        command: Command::RenewPit,
13163        admissible_errors: &[
13164            ErrorCode::Aborted,
13165            ErrorCode::DeadlineExceeded,
13166            ErrorCode::InvalidRequest,
13167            ErrorCode::UnsupportedVersion,
13168            ErrorCode::Unauthenticated,
13169            ErrorCode::PermissionDenied,
13170            ErrorCode::NotFound,
13171            ErrorCode::Conflict,
13172            ErrorCode::LimitExceeded,
13173            ErrorCode::CapabilityUnavailable,
13174            ErrorCode::NotSubmitted,
13175            ErrorCode::SubmittedIndeterminate,
13176            ErrorCode::ExpiredUnknown,
13177            ErrorCode::TemporarilyUnavailable,
13178            ErrorCode::Internal,
13179        ],
13180        limit_ids: &["request_bytes", "response_bytes"],
13181        effect_class: "lease_renewing_read",
13182        risk_flags: &[],
13183        capability_family: "data",
13184        retry_safety: "pre_submit_only",
13185        identity_requirement: "none",
13186        resolver: None,
13187        cancellation: "per_call_until_submission_then_resolve",
13188        side_effects: &["renews_or_closes_existing_lease"],
13189        recovery: "retry_if_not_submitted",
13190        collection_index_ref: "pit_authority",
13191    },
13192    CommandSemanticContract {
13193        command: Command::ClosePit,
13194        admissible_errors: &[
13195            ErrorCode::Aborted,
13196            ErrorCode::DeadlineExceeded,
13197            ErrorCode::InvalidRequest,
13198            ErrorCode::UnsupportedVersion,
13199            ErrorCode::Unauthenticated,
13200            ErrorCode::PermissionDenied,
13201            ErrorCode::NotFound,
13202            ErrorCode::Conflict,
13203            ErrorCode::LimitExceeded,
13204            ErrorCode::CapabilityUnavailable,
13205            ErrorCode::NotSubmitted,
13206            ErrorCode::SubmittedIndeterminate,
13207            ErrorCode::ExpiredUnknown,
13208            ErrorCode::TemporarilyUnavailable,
13209            ErrorCode::Internal,
13210        ],
13211        limit_ids: &["request_bytes", "response_bytes"],
13212        effect_class: "lease_renewing_read",
13213        risk_flags: &[],
13214        capability_family: "data",
13215        retry_safety: "pre_submit_only",
13216        identity_requirement: "none",
13217        resolver: None,
13218        cancellation: "per_call_until_submission_then_resolve",
13219        side_effects: &["renews_or_closes_existing_lease"],
13220        recovery: "retry_if_not_submitted",
13221        collection_index_ref: "pit_authority",
13222    },
13223    CommandSemanticContract {
13224        command: Command::ListOperations,
13225        admissible_errors: &[
13226            ErrorCode::Aborted,
13227            ErrorCode::DeadlineExceeded,
13228            ErrorCode::InvalidRequest,
13229            ErrorCode::UnsupportedVersion,
13230            ErrorCode::Unauthenticated,
13231            ErrorCode::PermissionDenied,
13232            ErrorCode::NotFound,
13233            ErrorCode::StaleCursor,
13234            ErrorCode::RestartBudgetExhausted,
13235            ErrorCode::LimitExceeded,
13236            ErrorCode::CapabilityUnavailable,
13237            ErrorCode::TemporarilyUnavailable,
13238            ErrorCode::Internal,
13239        ],
13240        limit_ids: &["request_bytes", "response_bytes", "page_size", "operation_page_size"],
13241        effect_class: "read_only",
13242        risk_flags: &[],
13243        capability_family: "operations",
13244        retry_safety: "safe",
13245        identity_requirement: "none",
13246        resolver: None,
13247        cancellation: "per_call",
13248        side_effects: &[],
13249        recovery: "retry",
13250        collection_index_ref: "none",
13251    },
13252    CommandSemanticContract {
13253        command: Command::GetOperation,
13254        admissible_errors: &[
13255            ErrorCode::Aborted,
13256            ErrorCode::DeadlineExceeded,
13257            ErrorCode::InvalidRequest,
13258            ErrorCode::UnsupportedVersion,
13259            ErrorCode::Unauthenticated,
13260            ErrorCode::PermissionDenied,
13261            ErrorCode::NotFound,
13262            ErrorCode::LimitExceeded,
13263            ErrorCode::CapabilityUnavailable,
13264            ErrorCode::TemporarilyUnavailable,
13265            ErrorCode::Internal,
13266        ],
13267        limit_ids: &["request_bytes", "response_bytes"],
13268        effect_class: "read_only",
13269        risk_flags: &[],
13270        capability_family: "operations",
13271        retry_safety: "safe",
13272        identity_requirement: "request_locator",
13273        resolver: None,
13274        cancellation: "per_call",
13275        side_effects: &[],
13276        recovery: "retry",
13277        collection_index_ref: "none",
13278    },
13279    CommandSemanticContract {
13280        command: Command::WaitOperation,
13281        admissible_errors: &[
13282            ErrorCode::Aborted,
13283            ErrorCode::DeadlineExceeded,
13284            ErrorCode::InvalidRequest,
13285            ErrorCode::UnsupportedVersion,
13286            ErrorCode::Unauthenticated,
13287            ErrorCode::PermissionDenied,
13288            ErrorCode::NotFound,
13289            ErrorCode::Conflict,
13290            ErrorCode::LimitExceeded,
13291            ErrorCode::CapabilityUnavailable,
13292            ErrorCode::TemporarilyUnavailable,
13293            ErrorCode::Internal,
13294        ],
13295        limit_ids: &[
13296            "request_bytes",
13297            "response_bytes",
13298            "operation_wait_attempts",
13299            "operation_wait_interval_millis",
13300        ],
13301        effect_class: "read_only",
13302        risk_flags: &[],
13303        capability_family: "operations",
13304        retry_safety: "safe",
13305        identity_requirement: "request_locator",
13306        resolver: None,
13307        cancellation: "per_call",
13308        side_effects: &[],
13309        recovery: "retry",
13310        collection_index_ref: "none",
13311    },
13312    CommandSemanticContract {
13313        command: Command::CancelOperation,
13314        admissible_errors: &[
13315            ErrorCode::Aborted,
13316            ErrorCode::DeadlineExceeded,
13317            ErrorCode::InvalidRequest,
13318            ErrorCode::UnsupportedVersion,
13319            ErrorCode::Unauthenticated,
13320            ErrorCode::PermissionDenied,
13321            ErrorCode::NotFound,
13322            ErrorCode::Conflict,
13323            ErrorCode::LimitExceeded,
13324            ErrorCode::CapabilityUnavailable,
13325            ErrorCode::NotSubmitted,
13326            ErrorCode::SubmittedIndeterminate,
13327            ErrorCode::ExpiredUnknown,
13328            ErrorCode::TemporarilyUnavailable,
13329            ErrorCode::Internal,
13330        ],
13331        limit_ids: &["request_bytes", "response_bytes"],
13332        effect_class: "control_write",
13333        risk_flags: &[],
13334        capability_family: "operations",
13335        retry_safety: "pre_submit_only",
13336        identity_requirement: "request_locator",
13337        resolver: None,
13338        cancellation: "per_call_until_submission_then_resolve",
13339        side_effects: &["commits_authoritative_state"],
13340        recovery: "retry_if_not_submitted",
13341        collection_index_ref: "none",
13342    },
13343    CommandSemanticContract {
13344        command: Command::ListAuditEvents,
13345        admissible_errors: &[
13346            ErrorCode::Aborted,
13347            ErrorCode::DeadlineExceeded,
13348            ErrorCode::InvalidRequest,
13349            ErrorCode::UnsupportedVersion,
13350            ErrorCode::Unauthenticated,
13351            ErrorCode::PermissionDenied,
13352            ErrorCode::NotFound,
13353            ErrorCode::StaleCursor,
13354            ErrorCode::RestartBudgetExhausted,
13355            ErrorCode::LimitExceeded,
13356            ErrorCode::CapabilityUnavailable,
13357            ErrorCode::TemporarilyUnavailable,
13358            ErrorCode::Internal,
13359        ],
13360        limit_ids: &["request_bytes", "response_bytes", "page_size"],
13361        effect_class: "read_only",
13362        risk_flags: &[],
13363        capability_family: "audit",
13364        retry_safety: "safe",
13365        identity_requirement: "none",
13366        resolver: None,
13367        cancellation: "per_call",
13368        side_effects: &[],
13369        recovery: "retry",
13370        collection_index_ref: "none",
13371    },
13372    CommandSemanticContract {
13373        command: Command::ExportAuditEvents,
13374        admissible_errors: &[
13375            ErrorCode::Aborted,
13376            ErrorCode::DeadlineExceeded,
13377            ErrorCode::InvalidRequest,
13378            ErrorCode::UnsupportedVersion,
13379            ErrorCode::Unauthenticated,
13380            ErrorCode::PermissionDenied,
13381            ErrorCode::NotFound,
13382            ErrorCode::StaleCursor,
13383            ErrorCode::RestartBudgetExhausted,
13384            ErrorCode::LimitExceeded,
13385            ErrorCode::CapabilityUnavailable,
13386            ErrorCode::TemporarilyUnavailable,
13387            ErrorCode::Internal,
13388        ],
13389        limit_ids: &["request_bytes", "response_bytes", "page_size"],
13390        effect_class: "read_only",
13391        risk_flags: &[],
13392        capability_family: "audit",
13393        retry_safety: "safe",
13394        identity_requirement: "none",
13395        resolver: None,
13396        cancellation: "per_call",
13397        side_effects: &[],
13398        recovery: "retry",
13399        collection_index_ref: "none",
13400    },
13401    CommandSemanticContract {
13402        command: Command::ReserveServiceCredential,
13403        admissible_errors: &[
13404            ErrorCode::Aborted,
13405            ErrorCode::DeadlineExceeded,
13406            ErrorCode::InvalidRequest,
13407            ErrorCode::UnsupportedVersion,
13408            ErrorCode::Unauthenticated,
13409            ErrorCode::PermissionDenied,
13410            ErrorCode::NotFound,
13411            ErrorCode::Conflict,
13412            ErrorCode::LimitExceeded,
13413            ErrorCode::CapabilityUnavailable,
13414            ErrorCode::NotSubmitted,
13415            ErrorCode::SubmittedIndeterminate,
13416            ErrorCode::ExpiredUnknown,
13417            ErrorCode::SecretNotEscrowed,
13418            ErrorCode::TemporarilyUnavailable,
13419            ErrorCode::Internal,
13420        ],
13421        limit_ids: &["request_bytes", "response_bytes"],
13422        effect_class: "durable_submit",
13423        risk_flags: &["credential_sensitive"],
13424        capability_family: "security",
13425        retry_safety: "pre_submit_only",
13426        identity_requirement: "caller_action_id",
13427        resolver: Some(Command::ResolveServiceCredentialReservation),
13428        cancellation: "per_call_until_submission_then_resolve",
13429        side_effects: &["commits_authoritative_state"],
13430        recovery: "resolve_with_resolve_service_credential_reservation",
13431        collection_index_ref: "none",
13432    },
13433    CommandSemanticContract {
13434        command: Command::ReserveServiceCredentialRotation,
13435        admissible_errors: &[
13436            ErrorCode::Aborted,
13437            ErrorCode::DeadlineExceeded,
13438            ErrorCode::InvalidRequest,
13439            ErrorCode::UnsupportedVersion,
13440            ErrorCode::Unauthenticated,
13441            ErrorCode::PermissionDenied,
13442            ErrorCode::NotFound,
13443            ErrorCode::Conflict,
13444            ErrorCode::LimitExceeded,
13445            ErrorCode::CapabilityUnavailable,
13446            ErrorCode::NotSubmitted,
13447            ErrorCode::SubmittedIndeterminate,
13448            ErrorCode::ExpiredUnknown,
13449            ErrorCode::SecretNotEscrowed,
13450            ErrorCode::TemporarilyUnavailable,
13451            ErrorCode::Internal,
13452        ],
13453        limit_ids: &["request_bytes", "response_bytes"],
13454        effect_class: "durable_submit",
13455        risk_flags: &["credential_sensitive"],
13456        capability_family: "security",
13457        retry_safety: "pre_submit_only",
13458        identity_requirement: "caller_action_id",
13459        resolver: Some(Command::ResolveServiceCredentialReservation),
13460        cancellation: "per_call_until_submission_then_resolve",
13461        side_effects: &["commits_authoritative_state"],
13462        recovery: "resolve_with_resolve_service_credential_reservation",
13463        collection_index_ref: "none",
13464    },
13465    CommandSemanticContract {
13466        command: Command::ActivateServiceCredential,
13467        admissible_errors: &[
13468            ErrorCode::Aborted,
13469            ErrorCode::DeadlineExceeded,
13470            ErrorCode::InvalidRequest,
13471            ErrorCode::UnsupportedVersion,
13472            ErrorCode::Unauthenticated,
13473            ErrorCode::PermissionDenied,
13474            ErrorCode::NotFound,
13475            ErrorCode::Conflict,
13476            ErrorCode::LimitExceeded,
13477            ErrorCode::CapabilityUnavailable,
13478            ErrorCode::NotSubmitted,
13479            ErrorCode::SubmittedIndeterminate,
13480            ErrorCode::ExpiredUnknown,
13481            ErrorCode::SecretNotEscrowed,
13482            ErrorCode::TemporarilyUnavailable,
13483            ErrorCode::Internal,
13484        ],
13485        limit_ids: &["request_bytes", "response_bytes"],
13486        effect_class: "durable_submit",
13487        risk_flags: &["credential_sensitive"],
13488        capability_family: "security",
13489        retry_safety: "pre_submit_only",
13490        identity_requirement: "server_locator",
13491        resolver: Some(Command::ResolveServiceCredentialReservation),
13492        cancellation: "per_call_until_submission_then_resolve",
13493        side_effects: &["commits_authoritative_state"],
13494        recovery: "resolve_with_resolve_service_credential_reservation",
13495        collection_index_ref: "none",
13496    },
13497    CommandSemanticContract {
13498        command: Command::ResolveServiceCredentialReservation,
13499        admissible_errors: &[
13500            ErrorCode::Aborted,
13501            ErrorCode::DeadlineExceeded,
13502            ErrorCode::InvalidRequest,
13503            ErrorCode::UnsupportedVersion,
13504            ErrorCode::Unauthenticated,
13505            ErrorCode::PermissionDenied,
13506            ErrorCode::NotFound,
13507            ErrorCode::LimitExceeded,
13508            ErrorCode::CapabilityUnavailable,
13509            ErrorCode::SecretNotEscrowed,
13510            ErrorCode::TemporarilyUnavailable,
13511            ErrorCode::Internal,
13512        ],
13513        limit_ids: &["request_bytes", "response_bytes"],
13514        effect_class: "read_only",
13515        risk_flags: &["credential_sensitive"],
13516        capability_family: "security",
13517        retry_safety: "safe",
13518        identity_requirement: "caller_action_id",
13519        resolver: None,
13520        cancellation: "per_call",
13521        side_effects: &[],
13522        recovery: "retry",
13523        collection_index_ref: "none",
13524    },
13525    CommandSemanticContract {
13526        command: Command::PrepareRevokeServiceCredential,
13527        admissible_errors: &[
13528            ErrorCode::Aborted,
13529            ErrorCode::DeadlineExceeded,
13530            ErrorCode::InvalidRequest,
13531            ErrorCode::UnsupportedVersion,
13532            ErrorCode::Unauthenticated,
13533            ErrorCode::PermissionDenied,
13534            ErrorCode::NotFound,
13535            ErrorCode::LimitExceeded,
13536            ErrorCode::CapabilityUnavailable,
13537            ErrorCode::SecretNotEscrowed,
13538            ErrorCode::TemporarilyUnavailable,
13539            ErrorCode::Internal,
13540        ],
13541        limit_ids: &["request_bytes", "response_bytes"],
13542        effect_class: "prepare",
13543        risk_flags: &["destructive", "credential_sensitive"],
13544        capability_family: "security",
13545        retry_safety: "safe",
13546        identity_requirement: "server_locator",
13547        resolver: None,
13548        cancellation: "per_call",
13549        side_effects: &["creates_bounded_preparation"],
13550        recovery: "retry",
13551        collection_index_ref: "none",
13552    },
13553    CommandSemanticContract {
13554        command: Command::RevokeServiceCredential,
13555        admissible_errors: &[
13556            ErrorCode::Aborted,
13557            ErrorCode::DeadlineExceeded,
13558            ErrorCode::InvalidRequest,
13559            ErrorCode::UnsupportedVersion,
13560            ErrorCode::Unauthenticated,
13561            ErrorCode::PermissionDenied,
13562            ErrorCode::NotFound,
13563            ErrorCode::Conflict,
13564            ErrorCode::LimitExceeded,
13565            ErrorCode::CapabilityUnavailable,
13566            ErrorCode::NotSubmitted,
13567            ErrorCode::SubmittedIndeterminate,
13568            ErrorCode::ExpiredUnknown,
13569            ErrorCode::SecretNotEscrowed,
13570            ErrorCode::TemporarilyUnavailable,
13571            ErrorCode::Internal,
13572        ],
13573        limit_ids: &["request_bytes", "response_bytes"],
13574        effect_class: "durable_submit",
13575        risk_flags: &["destructive", "credential_sensitive"],
13576        capability_family: "security",
13577        retry_safety: "pre_submit_only",
13578        identity_requirement: "request_locator",
13579        resolver: Some(Command::ResolveSecurityAction),
13580        cancellation: "per_call_until_submission_then_resolve",
13581        side_effects: &["commits_authoritative_state"],
13582        recovery: "resolve_with_resolve_security_action",
13583        collection_index_ref: "none",
13584    },
13585    CommandSemanticContract {
13586        command: Command::ResolveSecurityAction,
13587        admissible_errors: &[
13588            ErrorCode::Aborted,
13589            ErrorCode::DeadlineExceeded,
13590            ErrorCode::InvalidRequest,
13591            ErrorCode::UnsupportedVersion,
13592            ErrorCode::Unauthenticated,
13593            ErrorCode::PermissionDenied,
13594            ErrorCode::NotFound,
13595            ErrorCode::LimitExceeded,
13596            ErrorCode::CapabilityUnavailable,
13597            ErrorCode::SecretNotEscrowed,
13598            ErrorCode::TemporarilyUnavailable,
13599            ErrorCode::Internal,
13600        ],
13601        limit_ids: &["request_bytes", "response_bytes"],
13602        effect_class: "read_only",
13603        risk_flags: &[],
13604        capability_family: "security",
13605        retry_safety: "safe",
13606        identity_requirement: "request_locator",
13607        resolver: None,
13608        cancellation: "per_call",
13609        side_effects: &[],
13610        recovery: "retry",
13611        collection_index_ref: "none",
13612    },
13613    CommandSemanticContract {
13614        command: Command::GetSecurityRole,
13615        admissible_errors: &[
13616            ErrorCode::Aborted,
13617            ErrorCode::DeadlineExceeded,
13618            ErrorCode::InvalidRequest,
13619            ErrorCode::UnsupportedVersion,
13620            ErrorCode::Unauthenticated,
13621            ErrorCode::PermissionDenied,
13622            ErrorCode::NotFound,
13623            ErrorCode::LimitExceeded,
13624            ErrorCode::CapabilityUnavailable,
13625            ErrorCode::TemporarilyUnavailable,
13626            ErrorCode::Internal,
13627        ],
13628        limit_ids: &["request_bytes", "response_bytes"],
13629        effect_class: "read_only",
13630        risk_flags: &[],
13631        capability_family: "security",
13632        retry_safety: "safe",
13633        identity_requirement: "none",
13634        resolver: None,
13635        cancellation: "per_call",
13636        side_effects: &[],
13637        recovery: "retry",
13638        collection_index_ref: "none",
13639    },
13640    CommandSemanticContract {
13641        command: Command::PrepareRoleAppendAccessChange,
13642        admissible_errors: &[
13643            ErrorCode::Aborted,
13644            ErrorCode::DeadlineExceeded,
13645            ErrorCode::InvalidRequest,
13646            ErrorCode::UnsupportedVersion,
13647            ErrorCode::Unauthenticated,
13648            ErrorCode::PermissionDenied,
13649            ErrorCode::NotFound,
13650            ErrorCode::Conflict,
13651            ErrorCode::LimitExceeded,
13652            ErrorCode::CapabilityUnavailable,
13653            ErrorCode::TemporarilyUnavailable,
13654            ErrorCode::Internal,
13655        ],
13656        limit_ids: &["request_bytes", "response_bytes"],
13657        effect_class: "prepare",
13658        risk_flags: &["destructive"],
13659        capability_family: "security",
13660        retry_safety: "safe",
13661        identity_requirement: "server_locator",
13662        resolver: None,
13663        cancellation: "per_call",
13664        side_effects: &["creates_bounded_preparation"],
13665        recovery: "retry",
13666        collection_index_ref: "none",
13667    },
13668    CommandSemanticContract {
13669        command: Command::SubmitRoleAppendAccessChange,
13670        admissible_errors: &[
13671            ErrorCode::Aborted,
13672            ErrorCode::DeadlineExceeded,
13673            ErrorCode::InvalidRequest,
13674            ErrorCode::UnsupportedVersion,
13675            ErrorCode::Unauthenticated,
13676            ErrorCode::PermissionDenied,
13677            ErrorCode::NotFound,
13678            ErrorCode::Conflict,
13679            ErrorCode::LimitExceeded,
13680            ErrorCode::CapabilityUnavailable,
13681            ErrorCode::NotSubmitted,
13682            ErrorCode::SubmittedIndeterminate,
13683            ErrorCode::ExpiredUnknown,
13684            ErrorCode::TemporarilyUnavailable,
13685            ErrorCode::Internal,
13686        ],
13687        limit_ids: &["request_bytes", "response_bytes"],
13688        effect_class: "durable_submit",
13689        risk_flags: &["destructive"],
13690        capability_family: "security",
13691        retry_safety: "pre_submit_only",
13692        identity_requirement: "request_locator",
13693        resolver: Some(Command::ResolveSecurityAction),
13694        cancellation: "per_call_until_submission_then_resolve",
13695        side_effects: &["commits_authoritative_state"],
13696        recovery: "resolve_with_resolve_security_action",
13697        collection_index_ref: "none",
13698    },
13699    CommandSemanticContract {
13700        command: Command::ListServiceCredentials,
13701        admissible_errors: &[
13702            ErrorCode::Aborted,
13703            ErrorCode::DeadlineExceeded,
13704            ErrorCode::InvalidRequest,
13705            ErrorCode::UnsupportedVersion,
13706            ErrorCode::Unauthenticated,
13707            ErrorCode::PermissionDenied,
13708            ErrorCode::NotFound,
13709            ErrorCode::StaleCursor,
13710            ErrorCode::RestartBudgetExhausted,
13711            ErrorCode::LimitExceeded,
13712            ErrorCode::CapabilityUnavailable,
13713            ErrorCode::SecretNotEscrowed,
13714            ErrorCode::TemporarilyUnavailable,
13715            ErrorCode::Internal,
13716        ],
13717        limit_ids: &["request_bytes", "response_bytes", "page_size"],
13718        effect_class: "read_only",
13719        risk_flags: &["credential_sensitive"],
13720        capability_family: "security",
13721        retry_safety: "safe",
13722        identity_requirement: "none",
13723        resolver: None,
13724        cancellation: "per_call",
13725        side_effects: &[],
13726        recovery: "retry",
13727        collection_index_ref: "none",
13728    },
13729    CommandSemanticContract {
13730        command: Command::GetRuntimeStatus,
13731        admissible_errors: &[
13732            ErrorCode::Aborted,
13733            ErrorCode::DeadlineExceeded,
13734            ErrorCode::InvalidRequest,
13735            ErrorCode::UnsupportedVersion,
13736            ErrorCode::Unauthenticated,
13737            ErrorCode::PermissionDenied,
13738            ErrorCode::NotFound,
13739            ErrorCode::LimitExceeded,
13740            ErrorCode::CapabilityUnavailable,
13741            ErrorCode::TemporarilyUnavailable,
13742            ErrorCode::Internal,
13743        ],
13744        limit_ids: &["request_bytes", "response_bytes"],
13745        effect_class: "read_only",
13746        risk_flags: &[],
13747        capability_family: "catalog",
13748        retry_safety: "safe",
13749        identity_requirement: "none",
13750        resolver: None,
13751        cancellation: "per_call",
13752        side_effects: &[],
13753        recovery: "retry",
13754        collection_index_ref: "none",
13755    },
13756    CommandSemanticContract {
13757        command: Command::GetResultCacheStatus,
13758        admissible_errors: &[
13759            ErrorCode::Aborted,
13760            ErrorCode::DeadlineExceeded,
13761            ErrorCode::InvalidRequest,
13762            ErrorCode::UnsupportedVersion,
13763            ErrorCode::Unauthenticated,
13764            ErrorCode::PermissionDenied,
13765            ErrorCode::NotFound,
13766            ErrorCode::LimitExceeded,
13767            ErrorCode::CapabilityUnavailable,
13768            ErrorCode::TemporarilyUnavailable,
13769            ErrorCode::Internal,
13770        ],
13771        limit_ids: &["request_bytes", "response_bytes"],
13772        effect_class: "read_only",
13773        risk_flags: &[],
13774        capability_family: "catalog",
13775        retry_safety: "safe",
13776        identity_requirement: "none",
13777        resolver: None,
13778        cancellation: "per_call",
13779        side_effects: &[],
13780        recovery: "retry",
13781        collection_index_ref: "none",
13782    },
13783    CommandSemanticContract {
13784        command: Command::GetFieldPromotionStatus,
13785        admissible_errors: &[
13786            ErrorCode::Aborted,
13787            ErrorCode::DeadlineExceeded,
13788            ErrorCode::InvalidRequest,
13789            ErrorCode::UnsupportedVersion,
13790            ErrorCode::Unauthenticated,
13791            ErrorCode::PermissionDenied,
13792            ErrorCode::NotFound,
13793            ErrorCode::LimitExceeded,
13794            ErrorCode::CapabilityUnavailable,
13795            ErrorCode::TemporarilyUnavailable,
13796            ErrorCode::Internal,
13797        ],
13798        limit_ids: &["request_bytes", "response_bytes"],
13799        effect_class: "read_only",
13800        risk_flags: &[],
13801        capability_family: "catalog",
13802        retry_safety: "safe",
13803        identity_requirement: "none",
13804        resolver: None,
13805        cancellation: "per_call",
13806        side_effects: &[],
13807        recovery: "retry",
13808        collection_index_ref: "none",
13809    },
13810    CommandSemanticContract {
13811        command: Command::GetOverloadStatus,
13812        admissible_errors: &[
13813            ErrorCode::Aborted,
13814            ErrorCode::DeadlineExceeded,
13815            ErrorCode::InvalidRequest,
13816            ErrorCode::UnsupportedVersion,
13817            ErrorCode::Unauthenticated,
13818            ErrorCode::PermissionDenied,
13819            ErrorCode::NotFound,
13820            ErrorCode::LimitExceeded,
13821            ErrorCode::CapabilityUnavailable,
13822            ErrorCode::TemporarilyUnavailable,
13823            ErrorCode::Internal,
13824        ],
13825        limit_ids: &["request_bytes", "response_bytes"],
13826        effect_class: "read_only",
13827        risk_flags: &[],
13828        capability_family: "catalog",
13829        retry_safety: "safe",
13830        identity_requirement: "none",
13831        resolver: None,
13832        cancellation: "per_call",
13833        side_effects: &[],
13834        recovery: "retry",
13835        collection_index_ref: "none",
13836    },
13837    CommandSemanticContract {
13838        command: Command::ConfigureExternalKey,
13839        admissible_errors: &[
13840            ErrorCode::Aborted,
13841            ErrorCode::DeadlineExceeded,
13842            ErrorCode::InvalidRequest,
13843            ErrorCode::UnsupportedVersion,
13844            ErrorCode::Unauthenticated,
13845            ErrorCode::PermissionDenied,
13846            ErrorCode::NotFound,
13847            ErrorCode::Conflict,
13848            ErrorCode::LimitExceeded,
13849            ErrorCode::CapabilityUnavailable,
13850            ErrorCode::NotSubmitted,
13851            ErrorCode::SubmittedIndeterminate,
13852            ErrorCode::ExpiredUnknown,
13853            ErrorCode::TemporarilyUnavailable,
13854            ErrorCode::Internal,
13855        ],
13856        limit_ids: &["request_bytes", "response_bytes"],
13857        effect_class: "control_write",
13858        risk_flags: &[],
13859        capability_family: "lifecycle",
13860        retry_safety: "pre_submit_only",
13861        identity_requirement: "none",
13862        resolver: None,
13863        cancellation: "per_call_until_submission_then_resolve",
13864        side_effects: &["commits_authoritative_state"],
13865        recovery: "retry_if_not_submitted",
13866        collection_index_ref: "request_index",
13867    },
13868    CommandSemanticContract {
13869        command: Command::RotateExternalKeyBinding,
13870        admissible_errors: &[
13871            ErrorCode::Aborted,
13872            ErrorCode::DeadlineExceeded,
13873            ErrorCode::InvalidRequest,
13874            ErrorCode::UnsupportedVersion,
13875            ErrorCode::Unauthenticated,
13876            ErrorCode::PermissionDenied,
13877            ErrorCode::NotFound,
13878            ErrorCode::Conflict,
13879            ErrorCode::LimitExceeded,
13880            ErrorCode::CapabilityUnavailable,
13881            ErrorCode::NotSubmitted,
13882            ErrorCode::SubmittedIndeterminate,
13883            ErrorCode::ExpiredUnknown,
13884            ErrorCode::TemporarilyUnavailable,
13885            ErrorCode::Internal,
13886        ],
13887        limit_ids: &["request_bytes", "response_bytes"],
13888        effect_class: "control_write",
13889        risk_flags: &[],
13890        capability_family: "lifecycle",
13891        retry_safety: "pre_submit_only",
13892        identity_requirement: "none",
13893        resolver: None,
13894        cancellation: "per_call_until_submission_then_resolve",
13895        side_effects: &["commits_authoritative_state"],
13896        recovery: "retry_if_not_submitted",
13897        collection_index_ref: "request_index",
13898    },
13899    CommandSemanticContract {
13900        command: Command::ConfigureAggregateThenDelete,
13901        admissible_errors: &[
13902            ErrorCode::Aborted,
13903            ErrorCode::DeadlineExceeded,
13904            ErrorCode::InvalidRequest,
13905            ErrorCode::UnsupportedVersion,
13906            ErrorCode::Unauthenticated,
13907            ErrorCode::PermissionDenied,
13908            ErrorCode::NotFound,
13909            ErrorCode::Conflict,
13910            ErrorCode::LimitExceeded,
13911            ErrorCode::CapabilityUnavailable,
13912            ErrorCode::NotSubmitted,
13913            ErrorCode::SubmittedIndeterminate,
13914            ErrorCode::ExpiredUnknown,
13915            ErrorCode::TemporarilyUnavailable,
13916            ErrorCode::Internal,
13917        ],
13918        limit_ids: &["request_bytes", "response_bytes"],
13919        effect_class: "control_write",
13920        risk_flags: &["destructive"],
13921        capability_family: "lifecycle",
13922        retry_safety: "pre_submit_only",
13923        identity_requirement: "none",
13924        resolver: None,
13925        cancellation: "per_call_until_submission_then_resolve",
13926        side_effects: &["commits_authoritative_state"],
13927        recovery: "retry_if_not_submitted",
13928        collection_index_ref: "request_index",
13929    },
13930    CommandSemanticContract {
13931        command: Command::GetLifecycleStatus,
13932        admissible_errors: &[
13933            ErrorCode::Aborted,
13934            ErrorCode::DeadlineExceeded,
13935            ErrorCode::InvalidRequest,
13936            ErrorCode::UnsupportedVersion,
13937            ErrorCode::Unauthenticated,
13938            ErrorCode::PermissionDenied,
13939            ErrorCode::NotFound,
13940            ErrorCode::LimitExceeded,
13941            ErrorCode::CapabilityUnavailable,
13942            ErrorCode::TemporarilyUnavailable,
13943            ErrorCode::Internal,
13944        ],
13945        limit_ids: &["request_bytes", "response_bytes"],
13946        effect_class: "read_only",
13947        risk_flags: &[],
13948        capability_family: "catalog",
13949        retry_safety: "safe",
13950        identity_requirement: "none",
13951        resolver: None,
13952        cancellation: "per_call",
13953        side_effects: &[],
13954        recovery: "retry",
13955        collection_index_ref: "none",
13956    },
13957    CommandSemanticContract {
13958        command: Command::GetQuota,
13959        admissible_errors: &[
13960            ErrorCode::Aborted,
13961            ErrorCode::DeadlineExceeded,
13962            ErrorCode::InvalidRequest,
13963            ErrorCode::UnsupportedVersion,
13964            ErrorCode::Unauthenticated,
13965            ErrorCode::PermissionDenied,
13966            ErrorCode::NotFound,
13967            ErrorCode::LimitExceeded,
13968            ErrorCode::CapabilityUnavailable,
13969            ErrorCode::TemporarilyUnavailable,
13970            ErrorCode::Internal,
13971        ],
13972        limit_ids: &["request_bytes", "response_bytes"],
13973        effect_class: "read_only",
13974        risk_flags: &[],
13975        capability_family: "quota",
13976        retry_safety: "safe",
13977        identity_requirement: "none",
13978        resolver: None,
13979        cancellation: "per_call",
13980        side_effects: &[],
13981        recovery: "retry",
13982        collection_index_ref: "none",
13983    },
13984    CommandSemanticContract {
13985        command: Command::UpdateQuota,
13986        admissible_errors: &[
13987            ErrorCode::Aborted,
13988            ErrorCode::DeadlineExceeded,
13989            ErrorCode::InvalidRequest,
13990            ErrorCode::UnsupportedVersion,
13991            ErrorCode::Unauthenticated,
13992            ErrorCode::PermissionDenied,
13993            ErrorCode::NotFound,
13994            ErrorCode::Conflict,
13995            ErrorCode::LimitExceeded,
13996            ErrorCode::CapabilityUnavailable,
13997            ErrorCode::NotSubmitted,
13998            ErrorCode::SubmittedIndeterminate,
13999            ErrorCode::ExpiredUnknown,
14000            ErrorCode::TemporarilyUnavailable,
14001            ErrorCode::Internal,
14002        ],
14003        limit_ids: &["request_bytes", "response_bytes"],
14004        effect_class: "control_write",
14005        risk_flags: &[],
14006        capability_family: "quota",
14007        retry_safety: "pre_submit_only",
14008        identity_requirement: "none",
14009        resolver: None,
14010        cancellation: "per_call_until_submission_then_resolve",
14011        side_effects: &["commits_authoritative_state"],
14012        recovery: "retry_if_not_submitted",
14013        collection_index_ref: "none",
14014    },
14015    CommandSemanticContract {
14016        command: Command::GetBinding,
14017        admissible_errors: &[
14018            ErrorCode::Aborted,
14019            ErrorCode::DeadlineExceeded,
14020            ErrorCode::InvalidRequest,
14021            ErrorCode::UnsupportedVersion,
14022            ErrorCode::Unauthenticated,
14023            ErrorCode::PermissionDenied,
14024            ErrorCode::NotFound,
14025            ErrorCode::LimitExceeded,
14026            ErrorCode::CapabilityUnavailable,
14027            ErrorCode::TemporarilyUnavailable,
14028            ErrorCode::Internal,
14029        ],
14030        limit_ids: &["request_bytes", "response_bytes"],
14031        effect_class: "read_only",
14032        risk_flags: &[],
14033        capability_family: "runtime_control",
14034        retry_safety: "safe",
14035        identity_requirement: "none",
14036        resolver: None,
14037        cancellation: "per_call",
14038        side_effects: &[],
14039        recovery: "retry",
14040        collection_index_ref: "none",
14041    },
14042    CommandSemanticContract {
14043        command: Command::GetAdmissionStatus,
14044        admissible_errors: &[
14045            ErrorCode::Aborted,
14046            ErrorCode::DeadlineExceeded,
14047            ErrorCode::InvalidRequest,
14048            ErrorCode::UnsupportedVersion,
14049            ErrorCode::Unauthenticated,
14050            ErrorCode::PermissionDenied,
14051            ErrorCode::NotFound,
14052            ErrorCode::LimitExceeded,
14053            ErrorCode::CapabilityUnavailable,
14054            ErrorCode::TemporarilyUnavailable,
14055            ErrorCode::Internal,
14056        ],
14057        limit_ids: &["request_bytes", "response_bytes"],
14058        effect_class: "read_only",
14059        risk_flags: &[],
14060        capability_family: "runtime_control",
14061        retry_safety: "safe",
14062        identity_requirement: "none",
14063        resolver: None,
14064        cancellation: "per_call",
14065        side_effects: &[],
14066        recovery: "retry",
14067        collection_index_ref: "none",
14068    },
14069    CommandSemanticContract {
14070        command: Command::SetAdmission,
14071        admissible_errors: &[
14072            ErrorCode::Aborted,
14073            ErrorCode::DeadlineExceeded,
14074            ErrorCode::InvalidRequest,
14075            ErrorCode::UnsupportedVersion,
14076            ErrorCode::Unauthenticated,
14077            ErrorCode::PermissionDenied,
14078            ErrorCode::NotFound,
14079            ErrorCode::Conflict,
14080            ErrorCode::LimitExceeded,
14081            ErrorCode::CapabilityUnavailable,
14082            ErrorCode::NotSubmitted,
14083            ErrorCode::SubmittedIndeterminate,
14084            ErrorCode::ExpiredUnknown,
14085            ErrorCode::TemporarilyUnavailable,
14086            ErrorCode::Internal,
14087        ],
14088        limit_ids: &["request_bytes", "response_bytes"],
14089        effect_class: "control_write",
14090        risk_flags: &[],
14091        capability_family: "runtime_control",
14092        retry_safety: "pre_submit_only",
14093        identity_requirement: "none",
14094        resolver: None,
14095        cancellation: "per_call_until_submission_then_resolve",
14096        side_effects: &["commits_authoritative_state"],
14097        recovery: "retry_if_not_submitted",
14098        collection_index_ref: "none",
14099    },
14100    CommandSemanticContract {
14101        command: Command::GetQuiesceStatus,
14102        admissible_errors: &[
14103            ErrorCode::Aborted,
14104            ErrorCode::DeadlineExceeded,
14105            ErrorCode::InvalidRequest,
14106            ErrorCode::UnsupportedVersion,
14107            ErrorCode::Unauthenticated,
14108            ErrorCode::PermissionDenied,
14109            ErrorCode::NotFound,
14110            ErrorCode::LimitExceeded,
14111            ErrorCode::CapabilityUnavailable,
14112            ErrorCode::TemporarilyUnavailable,
14113            ErrorCode::Internal,
14114        ],
14115        limit_ids: &["request_bytes", "response_bytes"],
14116        effect_class: "read_only",
14117        risk_flags: &[],
14118        capability_family: "runtime_control",
14119        retry_safety: "safe",
14120        identity_requirement: "none",
14121        resolver: None,
14122        cancellation: "per_call",
14123        side_effects: &[],
14124        recovery: "retry",
14125        collection_index_ref: "none",
14126    },
14127    CommandSemanticContract {
14128        command: Command::GetDecommissionReadiness,
14129        admissible_errors: &[
14130            ErrorCode::Aborted,
14131            ErrorCode::DeadlineExceeded,
14132            ErrorCode::InvalidRequest,
14133            ErrorCode::UnsupportedVersion,
14134            ErrorCode::Unauthenticated,
14135            ErrorCode::PermissionDenied,
14136            ErrorCode::NotFound,
14137            ErrorCode::LimitExceeded,
14138            ErrorCode::CapabilityUnavailable,
14139            ErrorCode::TemporarilyUnavailable,
14140            ErrorCode::Internal,
14141        ],
14142        limit_ids: &["request_bytes", "response_bytes"],
14143        effect_class: "read_only",
14144        risk_flags: &[],
14145        capability_family: "runtime_control",
14146        retry_safety: "safe",
14147        identity_requirement: "none",
14148        resolver: None,
14149        cancellation: "per_call",
14150        side_effects: &[],
14151        recovery: "retry",
14152        collection_index_ref: "none",
14153    },
14154    CommandSemanticContract {
14155        command: Command::GetUpgradeReadiness,
14156        admissible_errors: &[
14157            ErrorCode::Aborted,
14158            ErrorCode::DeadlineExceeded,
14159            ErrorCode::InvalidRequest,
14160            ErrorCode::UnsupportedVersion,
14161            ErrorCode::Unauthenticated,
14162            ErrorCode::PermissionDenied,
14163            ErrorCode::NotFound,
14164            ErrorCode::LimitExceeded,
14165            ErrorCode::CapabilityUnavailable,
14166            ErrorCode::TemporarilyUnavailable,
14167            ErrorCode::Internal,
14168        ],
14169        limit_ids: &["request_bytes", "response_bytes"],
14170        effect_class: "read_only",
14171        risk_flags: &[],
14172        capability_family: "operations",
14173        retry_safety: "safe",
14174        identity_requirement: "none",
14175        resolver: None,
14176        cancellation: "per_call",
14177        side_effects: &[],
14178        recovery: "retry",
14179        collection_index_ref: "none",
14180    },
14181    CommandSemanticContract {
14182        command: Command::GetMaintenanceStatus,
14183        admissible_errors: &[
14184            ErrorCode::Aborted,
14185            ErrorCode::DeadlineExceeded,
14186            ErrorCode::InvalidRequest,
14187            ErrorCode::UnsupportedVersion,
14188            ErrorCode::Unauthenticated,
14189            ErrorCode::PermissionDenied,
14190            ErrorCode::NotFound,
14191            ErrorCode::StaleCursor,
14192            ErrorCode::LimitExceeded,
14193            ErrorCode::CapabilityUnavailable,
14194            ErrorCode::TemporarilyUnavailable,
14195            ErrorCode::Internal,
14196        ],
14197        limit_ids: &["request_bytes", "response_bytes", "page_size", "operation_page_size"],
14198        effect_class: "read_only",
14199        risk_flags: &[],
14200        capability_family: "operations",
14201        retry_safety: "safe",
14202        identity_requirement: "none",
14203        resolver: None,
14204        cancellation: "per_call",
14205        side_effects: &[],
14206        recovery: "retry",
14207        collection_index_ref: "optional_request_index",
14208    },
14209    CommandSemanticContract {
14210        command: Command::WarmVectorIndex,
14211        admissible_errors: &[
14212            ErrorCode::Aborted,
14213            ErrorCode::DeadlineExceeded,
14214            ErrorCode::InvalidRequest,
14215            ErrorCode::UnsupportedVersion,
14216            ErrorCode::Unauthenticated,
14217            ErrorCode::PermissionDenied,
14218            ErrorCode::NotFound,
14219            ErrorCode::Conflict,
14220            ErrorCode::LimitExceeded,
14221            ErrorCode::CapabilityUnavailable,
14222            ErrorCode::TemporarilyUnavailable,
14223            ErrorCode::Internal,
14224        ],
14225        limit_ids: &[
14226            "request_bytes",
14227            "response_bytes",
14228            "vector_warm_components",
14229            "vector_warm_requests",
14230            "vector_warm_bytes",
14231            "vector_warm_achievements",
14232            "vector_warm_ttl_millis",
14233        ],
14234        effect_class: "read_only",
14235        risk_flags: &[],
14236        capability_family: "data",
14237        retry_safety: "safe",
14238        identity_requirement: "exact_root",
14239        resolver: None,
14240        cancellation: "per_call",
14241        side_effects: &["populates_reconstructible_cache"],
14242        recovery: "retry",
14243        collection_index_ref: "request_index",
14244    },
14245    CommandSemanticContract {
14246        command: Command::EvaluateVectorRecall,
14247        admissible_errors: &[
14248            ErrorCode::Aborted,
14249            ErrorCode::DeadlineExceeded,
14250            ErrorCode::InvalidRequest,
14251            ErrorCode::UnsupportedVersion,
14252            ErrorCode::Unauthenticated,
14253            ErrorCode::PermissionDenied,
14254            ErrorCode::NotFound,
14255            ErrorCode::Conflict,
14256            ErrorCode::LimitExceeded,
14257            ErrorCode::CapabilityUnavailable,
14258            ErrorCode::NotSubmitted,
14259            ErrorCode::SubmittedIndeterminate,
14260            ErrorCode::ExpiredUnknown,
14261            ErrorCode::TemporarilyUnavailable,
14262            ErrorCode::Internal,
14263        ],
14264        limit_ids: &[
14265            "request_bytes",
14266            "response_bytes",
14267            "vector_dimensions",
14268            "vector_query_bytes",
14269            "vector_request_bytes",
14270            "vector_candidates",
14271            "vector_evaluation_queries",
14272            "vector_evaluation_k",
14273            "vector_evaluation_artifact_bytes",
14274        ],
14275        effect_class: "durable_submit",
14276        risk_flags: &[],
14277        capability_family: "diagnostics",
14278        retry_safety: "pre_submit_only",
14279        identity_requirement: "caller_action_id",
14280        resolver: None,
14281        cancellation: "per_call_until_submission_then_resolve",
14282        side_effects: &["commits_authoritative_state"],
14283        recovery: "retry_if_not_submitted",
14284        collection_index_ref: "request_index",
14285    },
14286    CommandSemanticContract {
14287        command: Command::CalibrateVectorStrategy,
14288        admissible_errors: &[
14289            ErrorCode::Aborted,
14290            ErrorCode::DeadlineExceeded,
14291            ErrorCode::InvalidRequest,
14292            ErrorCode::UnsupportedVersion,
14293            ErrorCode::Unauthenticated,
14294            ErrorCode::PermissionDenied,
14295            ErrorCode::NotFound,
14296            ErrorCode::Conflict,
14297            ErrorCode::LimitExceeded,
14298            ErrorCode::CapabilityUnavailable,
14299            ErrorCode::NotSubmitted,
14300            ErrorCode::SubmittedIndeterminate,
14301            ErrorCode::ExpiredUnknown,
14302            ErrorCode::TemporarilyUnavailable,
14303            ErrorCode::Internal,
14304        ],
14305        limit_ids: &[
14306            "request_bytes",
14307            "response_bytes",
14308            "vector_dimensions",
14309            "vector_query_bytes",
14310            "vector_request_bytes",
14311            "vector_candidates",
14312            "vector_evaluation_queries",
14313            "vector_evaluation_k",
14314            "vector_evaluation_profiles",
14315            "vector_evaluation_artifact_bytes",
14316        ],
14317        effect_class: "durable_submit",
14318        risk_flags: &[],
14319        capability_family: "diagnostics",
14320        retry_safety: "pre_submit_only",
14321        identity_requirement: "caller_action_id",
14322        resolver: None,
14323        cancellation: "per_call_until_submission_then_resolve",
14324        side_effects: &["commits_authoritative_state"],
14325        recovery: "retry_if_not_submitted",
14326        collection_index_ref: "request_index",
14327    },
14328    CommandSemanticContract {
14329        command: Command::GetVectorDiagnostic,
14330        admissible_errors: &[
14331            ErrorCode::Aborted,
14332            ErrorCode::DeadlineExceeded,
14333            ErrorCode::InvalidRequest,
14334            ErrorCode::UnsupportedVersion,
14335            ErrorCode::Unauthenticated,
14336            ErrorCode::PermissionDenied,
14337            ErrorCode::NotFound,
14338            ErrorCode::LimitExceeded,
14339            ErrorCode::CapabilityUnavailable,
14340            ErrorCode::TemporarilyUnavailable,
14341            ErrorCode::Internal,
14342        ],
14343        limit_ids: &["request_bytes", "response_bytes"],
14344        effect_class: "read_only",
14345        risk_flags: &[],
14346        capability_family: "diagnostics",
14347        retry_safety: "safe",
14348        identity_requirement: "request_locator",
14349        resolver: None,
14350        cancellation: "per_call",
14351        side_effects: &[],
14352        recovery: "retry",
14353        collection_index_ref: "none",
14354    },
14355    CommandSemanticContract {
14356        command: Command::CreateDiagnostic,
14357        admissible_errors: &[
14358            ErrorCode::Aborted,
14359            ErrorCode::DeadlineExceeded,
14360            ErrorCode::InvalidRequest,
14361            ErrorCode::UnsupportedVersion,
14362            ErrorCode::Unauthenticated,
14363            ErrorCode::PermissionDenied,
14364            ErrorCode::NotFound,
14365            ErrorCode::Conflict,
14366            ErrorCode::LimitExceeded,
14367            ErrorCode::CapabilityUnavailable,
14368            ErrorCode::NotSubmitted,
14369            ErrorCode::SubmittedIndeterminate,
14370            ErrorCode::ExpiredUnknown,
14371            ErrorCode::TemporarilyUnavailable,
14372            ErrorCode::Internal,
14373        ],
14374        limit_ids: &["request_bytes", "response_bytes"],
14375        effect_class: "durable_submit",
14376        risk_flags: &[],
14377        capability_family: "diagnostics",
14378        retry_safety: "pre_submit_only",
14379        identity_requirement: "none",
14380        resolver: None,
14381        cancellation: "per_call_until_submission_then_resolve",
14382        side_effects: &["commits_authoritative_state"],
14383        recovery: "retry_if_not_submitted",
14384        collection_index_ref: "none",
14385    },
14386    CommandSemanticContract {
14387        command: Command::GetDiagnostic,
14388        admissible_errors: &[
14389            ErrorCode::Aborted,
14390            ErrorCode::DeadlineExceeded,
14391            ErrorCode::InvalidRequest,
14392            ErrorCode::UnsupportedVersion,
14393            ErrorCode::Unauthenticated,
14394            ErrorCode::PermissionDenied,
14395            ErrorCode::NotFound,
14396            ErrorCode::LimitExceeded,
14397            ErrorCode::CapabilityUnavailable,
14398            ErrorCode::TemporarilyUnavailable,
14399            ErrorCode::Internal,
14400        ],
14401        limit_ids: &["request_bytes", "response_bytes"],
14402        effect_class: "read_only",
14403        risk_flags: &[],
14404        capability_family: "diagnostics",
14405        retry_safety: "safe",
14406        identity_requirement: "request_locator",
14407        resolver: None,
14408        cancellation: "per_call",
14409        side_effects: &[],
14410        recovery: "retry",
14411        collection_index_ref: "none",
14412    },
14413    CommandSemanticContract {
14414        command: Command::PrepareCollectionExport,
14415        admissible_errors: &[
14416            ErrorCode::Aborted,
14417            ErrorCode::DeadlineExceeded,
14418            ErrorCode::InvalidRequest,
14419            ErrorCode::UnsupportedVersion,
14420            ErrorCode::Unauthenticated,
14421            ErrorCode::PermissionDenied,
14422            ErrorCode::NotFound,
14423            ErrorCode::LimitExceeded,
14424            ErrorCode::CapabilityUnavailable,
14425            ErrorCode::TemporarilyUnavailable,
14426            ErrorCode::Internal,
14427        ],
14428        limit_ids: &[
14429            "request_bytes",
14430            "response_bytes",
14431            "collection_export_bytes",
14432            "portability_prefix_bytes",
14433        ],
14434        effect_class: "prepare",
14435        risk_flags: &[],
14436        capability_family: "portability",
14437        retry_safety: "safe",
14438        identity_requirement: "caller_action_id",
14439        resolver: None,
14440        cancellation: "per_call",
14441        side_effects: &[],
14442        recovery: "retry",
14443        collection_index_ref: "none",
14444    },
14445    CommandSemanticContract {
14446        command: Command::StartCollectionExport,
14447        admissible_errors: &[
14448            ErrorCode::Aborted,
14449            ErrorCode::DeadlineExceeded,
14450            ErrorCode::InvalidRequest,
14451            ErrorCode::UnsupportedVersion,
14452            ErrorCode::Unauthenticated,
14453            ErrorCode::PermissionDenied,
14454            ErrorCode::NotFound,
14455            ErrorCode::Conflict,
14456            ErrorCode::LimitExceeded,
14457            ErrorCode::CapabilityUnavailable,
14458            ErrorCode::NotSubmitted,
14459            ErrorCode::SubmittedIndeterminate,
14460            ErrorCode::ExpiredUnknown,
14461            ErrorCode::TemporarilyUnavailable,
14462            ErrorCode::Internal,
14463        ],
14464        limit_ids: &[
14465            "request_bytes",
14466            "response_bytes",
14467            "collection_export_bytes",
14468            "collection_export_documents",
14469            "portability_prefix_bytes",
14470        ],
14471        effect_class: "durable_submit",
14472        risk_flags: &[],
14473        capability_family: "portability",
14474        retry_safety: "pre_submit_only",
14475        identity_requirement: "caller_action_id",
14476        resolver: Some(Command::ResolveCollectionExport),
14477        cancellation: "per_call_until_submission_then_resolve",
14478        side_effects: &["commits_authoritative_state", "writes_external_artifact"],
14479        recovery: "resolve_with_resolve_collection_export",
14480        collection_index_ref: "none",
14481    },
14482    CommandSemanticContract {
14483        command: Command::ResolveCollectionExport,
14484        admissible_errors: &[
14485            ErrorCode::Aborted,
14486            ErrorCode::DeadlineExceeded,
14487            ErrorCode::InvalidRequest,
14488            ErrorCode::UnsupportedVersion,
14489            ErrorCode::Unauthenticated,
14490            ErrorCode::PermissionDenied,
14491            ErrorCode::NotFound,
14492            ErrorCode::LimitExceeded,
14493            ErrorCode::CapabilityUnavailable,
14494            ErrorCode::TemporarilyUnavailable,
14495            ErrorCode::Internal,
14496        ],
14497        limit_ids: &["request_bytes", "response_bytes", "portability_prefix_bytes"],
14498        effect_class: "read_only",
14499        risk_flags: &[],
14500        capability_family: "portability",
14501        retry_safety: "safe",
14502        identity_requirement: "caller_action_id",
14503        resolver: None,
14504        cancellation: "per_call",
14505        side_effects: &[],
14506        recovery: "retry",
14507        collection_index_ref: "none",
14508    },
14509    CommandSemanticContract {
14510        command: Command::VerifyCollectionExport,
14511        admissible_errors: &[
14512            ErrorCode::Aborted,
14513            ErrorCode::DeadlineExceeded,
14514            ErrorCode::InvalidRequest,
14515            ErrorCode::UnsupportedVersion,
14516            ErrorCode::Unauthenticated,
14517            ErrorCode::PermissionDenied,
14518            ErrorCode::NotFound,
14519            ErrorCode::LimitExceeded,
14520            ErrorCode::CapabilityUnavailable,
14521            ErrorCode::ChecksumMismatch,
14522            ErrorCode::TemporarilyUnavailable,
14523            ErrorCode::Internal,
14524        ],
14525        limit_ids: &[
14526            "request_bytes",
14527            "response_bytes",
14528            "collection_export_bytes",
14529            "portability_prefix_bytes",
14530        ],
14531        effect_class: "read_only",
14532        risk_flags: &[],
14533        capability_family: "portability",
14534        retry_safety: "safe",
14535        identity_requirement: "request_locator",
14536        resolver: None,
14537        cancellation: "per_call",
14538        side_effects: &[],
14539        recovery: "retry",
14540        collection_index_ref: "none",
14541    },
14542    CommandSemanticContract {
14543        command: Command::PrepareCollectionRestore,
14544        admissible_errors: &[
14545            ErrorCode::Aborted,
14546            ErrorCode::DeadlineExceeded,
14547            ErrorCode::InvalidRequest,
14548            ErrorCode::UnsupportedVersion,
14549            ErrorCode::Unauthenticated,
14550            ErrorCode::PermissionDenied,
14551            ErrorCode::NotFound,
14552            ErrorCode::Conflict,
14553            ErrorCode::LimitExceeded,
14554            ErrorCode::CapabilityUnavailable,
14555            ErrorCode::ChecksumMismatch,
14556            ErrorCode::TemporarilyUnavailable,
14557            ErrorCode::Internal,
14558        ],
14559        limit_ids: &[
14560            "request_bytes",
14561            "response_bytes",
14562            "collection_export_bytes",
14563            "portability_prefix_bytes",
14564        ],
14565        effect_class: "prepare",
14566        risk_flags: &[],
14567        capability_family: "portability",
14568        retry_safety: "safe",
14569        identity_requirement: "caller_action_id",
14570        resolver: None,
14571        cancellation: "per_call",
14572        side_effects: &[],
14573        recovery: "retry",
14574        collection_index_ref: "none",
14575    },
14576    CommandSemanticContract {
14577        command: Command::StartCollectionRestore,
14578        admissible_errors: &[
14579            ErrorCode::Aborted,
14580            ErrorCode::DeadlineExceeded,
14581            ErrorCode::InvalidRequest,
14582            ErrorCode::UnsupportedVersion,
14583            ErrorCode::Unauthenticated,
14584            ErrorCode::PermissionDenied,
14585            ErrorCode::NotFound,
14586            ErrorCode::Conflict,
14587            ErrorCode::LimitExceeded,
14588            ErrorCode::CapabilityUnavailable,
14589            ErrorCode::NotSubmitted,
14590            ErrorCode::SubmittedIndeterminate,
14591            ErrorCode::ExpiredUnknown,
14592            ErrorCode::ChecksumMismatch,
14593            ErrorCode::TemporarilyUnavailable,
14594            ErrorCode::Internal,
14595        ],
14596        limit_ids: &[
14597            "request_bytes",
14598            "response_bytes",
14599            "collection_export_bytes",
14600            "collection_export_documents",
14601            "portability_prefix_bytes",
14602        ],
14603        effect_class: "durable_submit",
14604        risk_flags: &[],
14605        capability_family: "portability",
14606        retry_safety: "pre_submit_only",
14607        identity_requirement: "caller_action_id",
14608        resolver: Some(Command::ResolveCollectionRestore),
14609        cancellation: "per_call_until_submission_then_resolve",
14610        side_effects: &["commits_authoritative_state", "creates_destination_owned_data"],
14611        recovery: "resolve_with_resolve_collection_restore",
14612        collection_index_ref: "none",
14613    },
14614    CommandSemanticContract {
14615        command: Command::ResolveCollectionRestore,
14616        admissible_errors: &[
14617            ErrorCode::Aborted,
14618            ErrorCode::DeadlineExceeded,
14619            ErrorCode::InvalidRequest,
14620            ErrorCode::UnsupportedVersion,
14621            ErrorCode::Unauthenticated,
14622            ErrorCode::PermissionDenied,
14623            ErrorCode::NotFound,
14624            ErrorCode::LimitExceeded,
14625            ErrorCode::CapabilityUnavailable,
14626            ErrorCode::TemporarilyUnavailable,
14627            ErrorCode::Internal,
14628        ],
14629        limit_ids: &["request_bytes", "response_bytes", "portability_prefix_bytes"],
14630        effect_class: "read_only",
14631        risk_flags: &[],
14632        capability_family: "portability",
14633        retry_safety: "safe",
14634        identity_requirement: "caller_action_id",
14635        resolver: None,
14636        cancellation: "per_call",
14637        side_effects: &[],
14638        recovery: "retry",
14639        collection_index_ref: "none",
14640    },
14641    CommandSemanticContract {
14642        command: Command::PrepareIndexExport,
14643        admissible_errors: &[
14644            ErrorCode::Aborted,
14645            ErrorCode::DeadlineExceeded,
14646            ErrorCode::InvalidRequest,
14647            ErrorCode::UnsupportedVersion,
14648            ErrorCode::Unauthenticated,
14649            ErrorCode::PermissionDenied,
14650            ErrorCode::NotFound,
14651            ErrorCode::LimitExceeded,
14652            ErrorCode::CapabilityUnavailable,
14653            ErrorCode::TemporarilyUnavailable,
14654            ErrorCode::Internal,
14655        ],
14656        limit_ids: &[
14657            "request_bytes",
14658            "response_bytes",
14659            "index_transfer_bytes",
14660            "index_transfer_records",
14661            "index_transfer_pages",
14662            "portability_prefix_bytes",
14663        ],
14664        effect_class: "prepare",
14665        risk_flags: &[],
14666        capability_family: "portability",
14667        retry_safety: "safe",
14668        identity_requirement: "caller_action_id",
14669        resolver: None,
14670        cancellation: "per_call",
14671        side_effects: &[],
14672        recovery: "retry",
14673        collection_index_ref: "request_index",
14674    },
14675    CommandSemanticContract {
14676        command: Command::StartIndexExport,
14677        admissible_errors: &[
14678            ErrorCode::Aborted,
14679            ErrorCode::DeadlineExceeded,
14680            ErrorCode::InvalidRequest,
14681            ErrorCode::UnsupportedVersion,
14682            ErrorCode::Unauthenticated,
14683            ErrorCode::PermissionDenied,
14684            ErrorCode::NotFound,
14685            ErrorCode::Conflict,
14686            ErrorCode::LimitExceeded,
14687            ErrorCode::CapabilityUnavailable,
14688            ErrorCode::NotSubmitted,
14689            ErrorCode::SubmittedIndeterminate,
14690            ErrorCode::ExpiredUnknown,
14691            ErrorCode::TemporarilyUnavailable,
14692            ErrorCode::Internal,
14693        ],
14694        limit_ids: &[
14695            "request_bytes",
14696            "response_bytes",
14697            "index_transfer_bytes",
14698            "index_transfer_records",
14699            "index_transfer_pages",
14700            "portability_prefix_bytes",
14701        ],
14702        effect_class: "durable_submit",
14703        risk_flags: &[],
14704        capability_family: "portability",
14705        retry_safety: "pre_submit_only",
14706        identity_requirement: "caller_action_id",
14707        resolver: Some(Command::ResolveIndexExport),
14708        cancellation: "per_call_until_submission_then_resolve",
14709        side_effects: &["commits_authoritative_state", "writes_external_artifact"],
14710        recovery: "resolve_with_resolve_index_export",
14711        collection_index_ref: "request_index",
14712    },
14713    CommandSemanticContract {
14714        command: Command::ResolveIndexExport,
14715        admissible_errors: &[
14716            ErrorCode::Aborted,
14717            ErrorCode::DeadlineExceeded,
14718            ErrorCode::InvalidRequest,
14719            ErrorCode::UnsupportedVersion,
14720            ErrorCode::Unauthenticated,
14721            ErrorCode::PermissionDenied,
14722            ErrorCode::NotFound,
14723            ErrorCode::LimitExceeded,
14724            ErrorCode::CapabilityUnavailable,
14725            ErrorCode::ChecksumMismatch,
14726            ErrorCode::TemporarilyUnavailable,
14727            ErrorCode::Internal,
14728        ],
14729        limit_ids: &[
14730            "request_bytes",
14731            "response_bytes",
14732            "index_transfer_bytes",
14733            "index_transfer_pages",
14734            "portability_prefix_bytes",
14735        ],
14736        effect_class: "read_only",
14737        risk_flags: &[],
14738        capability_family: "portability",
14739        retry_safety: "safe",
14740        identity_requirement: "caller_action_id",
14741        resolver: None,
14742        cancellation: "per_call",
14743        side_effects: &[],
14744        recovery: "retry",
14745        collection_index_ref: "request_index",
14746    },
14747    CommandSemanticContract {
14748        command: Command::VerifyIndexExport,
14749        admissible_errors: &[
14750            ErrorCode::Aborted,
14751            ErrorCode::DeadlineExceeded,
14752            ErrorCode::InvalidRequest,
14753            ErrorCode::UnsupportedVersion,
14754            ErrorCode::Unauthenticated,
14755            ErrorCode::PermissionDenied,
14756            ErrorCode::NotFound,
14757            ErrorCode::LimitExceeded,
14758            ErrorCode::CapabilityUnavailable,
14759            ErrorCode::ChecksumMismatch,
14760            ErrorCode::TemporarilyUnavailable,
14761            ErrorCode::Internal,
14762        ],
14763        limit_ids: &[
14764            "request_bytes",
14765            "response_bytes",
14766            "index_transfer_bytes",
14767            "index_transfer_pages",
14768            "portability_prefix_bytes",
14769        ],
14770        effect_class: "read_only",
14771        risk_flags: &[],
14772        capability_family: "portability",
14773        retry_safety: "safe",
14774        identity_requirement: "request_locator",
14775        resolver: None,
14776        cancellation: "per_call",
14777        side_effects: &[],
14778        recovery: "retry",
14779        collection_index_ref: "request_artifact_source_index",
14780    },
14781    CommandSemanticContract {
14782        command: Command::PrepareIndexImport,
14783        admissible_errors: &[
14784            ErrorCode::Aborted,
14785            ErrorCode::DeadlineExceeded,
14786            ErrorCode::InvalidRequest,
14787            ErrorCode::UnsupportedVersion,
14788            ErrorCode::Unauthenticated,
14789            ErrorCode::PermissionDenied,
14790            ErrorCode::NotFound,
14791            ErrorCode::Conflict,
14792            ErrorCode::LimitExceeded,
14793            ErrorCode::CapabilityUnavailable,
14794            ErrorCode::ChecksumMismatch,
14795            ErrorCode::TemporarilyUnavailable,
14796            ErrorCode::Internal,
14797        ],
14798        limit_ids: &[
14799            "request_bytes",
14800            "response_bytes",
14801            "index_transfer_bytes",
14802            "index_transfer_pages",
14803            "portability_prefix_bytes",
14804            "resource_initial_shards",
14805            "resource_target_shard_bytes",
14806            "resource_admission_weight",
14807            "resource_ram_bytes",
14808            "resource_nvme_bytes",
14809            "resource_refresh_millis",
14810            "resource_memtable_bytes",
14811            "resource_parallelism",
14812        ],
14813        effect_class: "prepare",
14814        risk_flags: &[],
14815        capability_family: "portability",
14816        retry_safety: "safe",
14817        identity_requirement: "caller_action_id",
14818        resolver: None,
14819        cancellation: "per_call",
14820        side_effects: &[],
14821        recovery: "retry",
14822        collection_index_ref: "request_destination_name",
14823    },
14824    CommandSemanticContract {
14825        command: Command::StartIndexImport,
14826        admissible_errors: &[
14827            ErrorCode::Aborted,
14828            ErrorCode::DeadlineExceeded,
14829            ErrorCode::InvalidRequest,
14830            ErrorCode::UnsupportedVersion,
14831            ErrorCode::Unauthenticated,
14832            ErrorCode::PermissionDenied,
14833            ErrorCode::NotFound,
14834            ErrorCode::Conflict,
14835            ErrorCode::LimitExceeded,
14836            ErrorCode::CapabilityUnavailable,
14837            ErrorCode::NotSubmitted,
14838            ErrorCode::SubmittedIndeterminate,
14839            ErrorCode::ExpiredUnknown,
14840            ErrorCode::ChecksumMismatch,
14841            ErrorCode::TemporarilyUnavailable,
14842            ErrorCode::Internal,
14843        ],
14844        limit_ids: &[
14845            "request_bytes",
14846            "response_bytes",
14847            "index_transfer_bytes",
14848            "index_transfer_pages",
14849            "portability_prefix_bytes",
14850            "resource_initial_shards",
14851            "resource_target_shard_bytes",
14852            "resource_admission_weight",
14853            "resource_ram_bytes",
14854            "resource_nvme_bytes",
14855            "resource_refresh_millis",
14856            "resource_memtable_bytes",
14857            "resource_parallelism",
14858        ],
14859        effect_class: "durable_submit",
14860        risk_flags: &[],
14861        capability_family: "portability",
14862        retry_safety: "pre_submit_only",
14863        identity_requirement: "caller_action_id",
14864        resolver: Some(Command::ResolveIndexImport),
14865        cancellation: "per_call_until_submission_then_resolve",
14866        side_effects: &["commits_authoritative_state", "creates_destination_owned_data"],
14867        recovery: "resolve_with_resolve_index_import",
14868        collection_index_ref: "request_destination_name",
14869    },
14870    CommandSemanticContract {
14871        command: Command::ResolveIndexImport,
14872        admissible_errors: &[
14873            ErrorCode::Aborted,
14874            ErrorCode::DeadlineExceeded,
14875            ErrorCode::InvalidRequest,
14876            ErrorCode::UnsupportedVersion,
14877            ErrorCode::Unauthenticated,
14878            ErrorCode::PermissionDenied,
14879            ErrorCode::NotFound,
14880            ErrorCode::LimitExceeded,
14881            ErrorCode::CapabilityUnavailable,
14882            ErrorCode::ChecksumMismatch,
14883            ErrorCode::TemporarilyUnavailable,
14884            ErrorCode::Internal,
14885        ],
14886        limit_ids: &[
14887            "request_bytes",
14888            "response_bytes",
14889            "index_transfer_bytes",
14890            "index_transfer_pages",
14891            "portability_prefix_bytes",
14892        ],
14893        effect_class: "read_only",
14894        risk_flags: &[],
14895        capability_family: "portability",
14896        retry_safety: "safe",
14897        identity_requirement: "caller_action_id",
14898        resolver: None,
14899        cancellation: "per_call",
14900        side_effects: &[],
14901        recovery: "retry",
14902        collection_index_ref: "request_destination_name",
14903    },
14904    CommandSemanticContract {
14905        command: Command::ReadArtifactChunk,
14906        admissible_errors: &[
14907            ErrorCode::Aborted,
14908            ErrorCode::DeadlineExceeded,
14909            ErrorCode::InvalidRequest,
14910            ErrorCode::UnsupportedVersion,
14911            ErrorCode::Unauthenticated,
14912            ErrorCode::PermissionDenied,
14913            ErrorCode::NotFound,
14914            ErrorCode::LimitExceeded,
14915            ErrorCode::CapabilityUnavailable,
14916            ErrorCode::ArtifactRangeInvalid,
14917            ErrorCode::ChecksumMismatch,
14918            ErrorCode::TemporarilyUnavailable,
14919            ErrorCode::Internal,
14920        ],
14921        limit_ids: &["request_bytes", "response_bytes", "artifact_chunk_bytes"],
14922        effect_class: "read_only",
14923        risk_flags: &[],
14924        capability_family: "operations",
14925        retry_safety: "safe",
14926        identity_requirement: "none",
14927        resolver: None,
14928        cancellation: "per_call",
14929        side_effects: &[],
14930        recovery: "retry",
14931        collection_index_ref: "none",
14932    },
14933    CommandSemanticContract {
14934        command: Command::ExportUsage,
14935        admissible_errors: &[
14936            ErrorCode::Aborted,
14937            ErrorCode::DeadlineExceeded,
14938            ErrorCode::InvalidRequest,
14939            ErrorCode::UnsupportedVersion,
14940            ErrorCode::Unauthenticated,
14941            ErrorCode::PermissionDenied,
14942            ErrorCode::NotFound,
14943            ErrorCode::StaleCursor,
14944            ErrorCode::RestartBudgetExhausted,
14945            ErrorCode::LimitExceeded,
14946            ErrorCode::CapabilityUnavailable,
14947            ErrorCode::TemporarilyUnavailable,
14948            ErrorCode::Internal,
14949        ],
14950        limit_ids: &["request_bytes", "response_bytes", "page_size"],
14951        effect_class: "read_only",
14952        risk_flags: &[],
14953        capability_family: "usage",
14954        retry_safety: "safe",
14955        identity_requirement: "none",
14956        resolver: None,
14957        cancellation: "per_call",
14958        side_effects: &[],
14959        recovery: "retry",
14960        collection_index_ref: "none",
14961    },
14962    CommandSemanticContract {
14963        command: Command::ExecuteStateRead,
14964        admissible_errors: &[
14965            ErrorCode::Aborted,
14966            ErrorCode::DeadlineExceeded,
14967            ErrorCode::InvalidRequest,
14968            ErrorCode::UnsupportedVersion,
14969            ErrorCode::Unauthenticated,
14970            ErrorCode::PermissionDenied,
14971            ErrorCode::NotFound,
14972            ErrorCode::LimitExceeded,
14973            ErrorCode::CapabilityUnavailable,
14974            ErrorCode::TemporarilyUnavailable,
14975            ErrorCode::Internal,
14976        ],
14977        limit_ids: &[
14978            "request_bytes",
14979            "response_bytes",
14980            "state_command_keys",
14981            "state_command_value_bytes",
14982        ],
14983        effect_class: "read_only",
14984        risk_flags: &[],
14985        capability_family: "data",
14986        retry_safety: "safe",
14987        identity_requirement: "none",
14988        resolver: None,
14989        cancellation: "per_call",
14990        side_effects: &[],
14991        recovery: "retry",
14992        collection_index_ref: "request_index",
14993    },
14994    CommandSemanticContract {
14995        command: Command::PrepareStateWrite,
14996        admissible_errors: &[
14997            ErrorCode::Aborted,
14998            ErrorCode::DeadlineExceeded,
14999            ErrorCode::InvalidRequest,
15000            ErrorCode::UnsupportedVersion,
15001            ErrorCode::Unauthenticated,
15002            ErrorCode::PermissionDenied,
15003            ErrorCode::NotFound,
15004            ErrorCode::LimitExceeded,
15005            ErrorCode::CapabilityUnavailable,
15006            ErrorCode::TemporarilyUnavailable,
15007            ErrorCode::Internal,
15008        ],
15009        limit_ids: &[
15010            "request_bytes",
15011            "response_bytes",
15012            "state_command_keys",
15013            "state_command_value_bytes",
15014        ],
15015        effect_class: "prepare",
15016        risk_flags: &[],
15017        capability_family: "data",
15018        retry_safety: "safe",
15019        identity_requirement: "caller_action_id",
15020        resolver: None,
15021        cancellation: "per_call",
15022        side_effects: &["creates_bounded_preparation"],
15023        recovery: "retry",
15024        collection_index_ref: "request_index",
15025    },
15026    CommandSemanticContract {
15027        command: Command::SubmitStateWrite,
15028        admissible_errors: &[
15029            ErrorCode::Aborted,
15030            ErrorCode::DeadlineExceeded,
15031            ErrorCode::InvalidRequest,
15032            ErrorCode::UnsupportedVersion,
15033            ErrorCode::Unauthenticated,
15034            ErrorCode::PermissionDenied,
15035            ErrorCode::NotFound,
15036            ErrorCode::Conflict,
15037            ErrorCode::LimitExceeded,
15038            ErrorCode::CapabilityUnavailable,
15039            ErrorCode::NotSubmitted,
15040            ErrorCode::SubmittedIndeterminate,
15041            ErrorCode::ExpiredUnknown,
15042            ErrorCode::TemporarilyUnavailable,
15043            ErrorCode::Internal,
15044        ],
15045        limit_ids: &[
15046            "request_bytes",
15047            "response_bytes",
15048            "state_command_keys",
15049            "state_command_value_bytes",
15050        ],
15051        effect_class: "durable_submit",
15052        risk_flags: &[],
15053        capability_family: "data",
15054        retry_safety: "pre_submit_only",
15055        identity_requirement: "request_locator",
15056        resolver: Some(Command::ResolveStateWrite),
15057        cancellation: "per_call_until_submission_then_resolve",
15058        side_effects: &["commits_authoritative_state"],
15059        recovery: "resolve_with_resolve_state_write",
15060        collection_index_ref: "request_index",
15061    },
15062    CommandSemanticContract {
15063        command: Command::ResolveStateWrite,
15064        admissible_errors: &[
15065            ErrorCode::Aborted,
15066            ErrorCode::DeadlineExceeded,
15067            ErrorCode::InvalidRequest,
15068            ErrorCode::UnsupportedVersion,
15069            ErrorCode::Unauthenticated,
15070            ErrorCode::PermissionDenied,
15071            ErrorCode::NotFound,
15072            ErrorCode::LimitExceeded,
15073            ErrorCode::CapabilityUnavailable,
15074            ErrorCode::TemporarilyUnavailable,
15075            ErrorCode::Internal,
15076        ],
15077        limit_ids: &[
15078            "request_bytes",
15079            "response_bytes",
15080            "state_command_keys",
15081            "state_command_value_bytes",
15082        ],
15083        effect_class: "read_only",
15084        risk_flags: &[],
15085        capability_family: "data",
15086        retry_safety: "safe",
15087        identity_requirement: "request_locator",
15088        resolver: None,
15089        cancellation: "per_call",
15090        side_effects: &[],
15091        recovery: "retry",
15092        collection_index_ref: "request_index",
15093    },
15094];
15095#[derive(Clone, Copy, Debug, Eq, PartialEq)]
15096pub struct CommandOutcomeContract {
15097    pub command: Command,
15098    pub possible_submission_states: &'static [&'static str],
15099    pub identity_requirement: &'static str,
15100    pub resolver_command: Option<Command>,
15101    pub cancellation: &'static str,
15102}
15103pub const LODESTONE_API_COMMAND_OUTCOMES: &[CommandOutcomeContract] = &[
15104    CommandOutcomeContract {
15105        command: Command::Discover,
15106        possible_submission_states: &["not_submitted", "resolved"],
15107        identity_requirement: "none",
15108        resolver_command: None,
15109        cancellation: "per_call",
15110    },
15111    CommandOutcomeContract {
15112        command: Command::ListIndexes,
15113        possible_submission_states: &["not_submitted", "resolved"],
15114        identity_requirement: "none",
15115        resolver_command: None,
15116        cancellation: "per_call",
15117    },
15118    CommandOutcomeContract {
15119        command: Command::GetIndex,
15120        possible_submission_states: &["not_submitted", "resolved"],
15121        identity_requirement: "none",
15122        resolver_command: None,
15123        cancellation: "per_call",
15124    },
15125    CommandOutcomeContract {
15126        command: Command::ValidateIndexChange,
15127        possible_submission_states: &["not_submitted", "resolved"],
15128        identity_requirement: "none",
15129        resolver_command: None,
15130        cancellation: "per_call",
15131    },
15132    CommandOutcomeContract {
15133        command: Command::ApplyIndexChange,
15134        possible_submission_states: &["not_submitted", "submitted", "indeterminate", "resolved"],
15135        identity_requirement: "caller_action_id",
15136        resolver_command: None,
15137        cancellation: "per_call_until_submission_then_resolve",
15138    },
15139    CommandOutcomeContract {
15140        command: Command::ApplyAdministrationMutation,
15141        possible_submission_states: &["not_submitted", "submitted", "indeterminate", "resolved"],
15142        identity_requirement: "caller_action_id",
15143        resolver_command: None,
15144        cancellation: "per_call_until_submission_then_resolve",
15145    },
15146    CommandOutcomeContract {
15147        command: Command::ListAliases,
15148        possible_submission_states: &["not_submitted", "resolved"],
15149        identity_requirement: "none",
15150        resolver_command: None,
15151        cancellation: "per_call",
15152    },
15153    CommandOutcomeContract {
15154        command: Command::GetAlias,
15155        possible_submission_states: &["not_submitted", "resolved"],
15156        identity_requirement: "none",
15157        resolver_command: None,
15158        cancellation: "per_call",
15159    },
15160    CommandOutcomeContract {
15161        command: Command::ListDataStreams,
15162        possible_submission_states: &["not_submitted", "resolved"],
15163        identity_requirement: "none",
15164        resolver_command: None,
15165        cancellation: "per_call",
15166    },
15167    CommandOutcomeContract {
15168        command: Command::GetDataStream,
15169        possible_submission_states: &["not_submitted", "resolved"],
15170        identity_requirement: "none",
15171        resolver_command: None,
15172        cancellation: "per_call",
15173    },
15174    CommandOutcomeContract {
15175        command: Command::ListComponentTemplates,
15176        possible_submission_states: &["not_submitted", "resolved"],
15177        identity_requirement: "none",
15178        resolver_command: None,
15179        cancellation: "per_call",
15180    },
15181    CommandOutcomeContract {
15182        command: Command::GetComponentTemplate,
15183        possible_submission_states: &["not_submitted", "resolved"],
15184        identity_requirement: "none",
15185        resolver_command: None,
15186        cancellation: "per_call",
15187    },
15188    CommandOutcomeContract {
15189        command: Command::ListIndexTemplates,
15190        possible_submission_states: &["not_submitted", "resolved"],
15191        identity_requirement: "none",
15192        resolver_command: None,
15193        cancellation: "per_call",
15194    },
15195    CommandOutcomeContract {
15196        command: Command::GetIndexTemplate,
15197        possible_submission_states: &["not_submitted", "resolved"],
15198        identity_requirement: "none",
15199        resolver_command: None,
15200        cancellation: "per_call",
15201    },
15202    CommandOutcomeContract {
15203        command: Command::ListIngestPipelines,
15204        possible_submission_states: &["not_submitted", "resolved"],
15205        identity_requirement: "none",
15206        resolver_command: None,
15207        cancellation: "per_call",
15208    },
15209    CommandOutcomeContract {
15210        command: Command::GetIngestPipeline,
15211        possible_submission_states: &["not_submitted", "resolved"],
15212        identity_requirement: "none",
15213        resolver_command: None,
15214        cancellation: "per_call",
15215    },
15216    CommandOutcomeContract {
15217        command: Command::SimulateIngestPipeline,
15218        possible_submission_states: &["not_submitted", "resolved"],
15219        identity_requirement: "none",
15220        resolver_command: None,
15221        cancellation: "per_call",
15222    },
15223    CommandOutcomeContract {
15224        command: Command::ReprocessByQuery,
15225        possible_submission_states: &[
15226            "not_submitted",
15227            "submitted",
15228            "known_retired",
15229            "indeterminate",
15230            "resolved",
15231        ],
15232        identity_requirement: "caller_action_id",
15233        resolver_command: None,
15234        cancellation: "per_call_until_submission_then_resolve",
15235    },
15236    CommandOutcomeContract {
15237        command: Command::ListLifecyclePolicies,
15238        possible_submission_states: &["not_submitted", "resolved"],
15239        identity_requirement: "none",
15240        resolver_command: None,
15241        cancellation: "per_call",
15242    },
15243    CommandOutcomeContract {
15244        command: Command::GetLifecyclePolicy,
15245        possible_submission_states: &["not_submitted", "resolved"],
15246        identity_requirement: "none",
15247        resolver_command: None,
15248        cancellation: "per_call",
15249    },
15250    CommandOutcomeContract {
15251        command: Command::PrepareCreateIndex,
15252        possible_submission_states: &["not_submitted", "resolved"],
15253        identity_requirement: "server_locator",
15254        resolver_command: None,
15255        cancellation: "per_call",
15256    },
15257    CommandOutcomeContract {
15258        command: Command::PrepareDeleteIndex,
15259        possible_submission_states: &["not_submitted", "resolved"],
15260        identity_requirement: "server_locator",
15261        resolver_command: None,
15262        cancellation: "per_call",
15263    },
15264    CommandOutcomeContract {
15265        command: Command::SubmitCatalogAction,
15266        possible_submission_states: &[
15267            "not_submitted",
15268            "submitted",
15269            "known_retired",
15270            "indeterminate",
15271            "resolved",
15272        ],
15273        identity_requirement: "request_locator",
15274        resolver_command: Some(Command::ResolveCatalogAction),
15275        cancellation: "per_call_until_submission_then_resolve",
15276    },
15277    CommandOutcomeContract {
15278        command: Command::ResolveCatalogAction,
15279        possible_submission_states: &["not_submitted", "resolved"],
15280        identity_requirement: "request_locator",
15281        resolver_command: None,
15282        cancellation: "per_call",
15283    },
15284    CommandOutcomeContract {
15285        command: Command::PrepareReplayableSourceIndex,
15286        possible_submission_states: &["not_submitted", "resolved"],
15287        identity_requirement: "server_locator",
15288        resolver_command: None,
15289        cancellation: "per_call",
15290    },
15291    CommandOutcomeContract {
15292        command: Command::SubmitReplayableSourceIndex,
15293        possible_submission_states: &[
15294            "not_submitted",
15295            "submitted",
15296            "known_retired",
15297            "indeterminate",
15298            "resolved",
15299        ],
15300        identity_requirement: "request_locator",
15301        resolver_command: Some(Command::ResolveCatalogAction),
15302        cancellation: "per_call_until_submission_then_resolve",
15303    },
15304    CommandOutcomeContract {
15305        command: Command::GetReplayableSource,
15306        possible_submission_states: &["not_submitted", "resolved"],
15307        identity_requirement: "none",
15308        resolver_command: None,
15309        cancellation: "per_call",
15310    },
15311    CommandOutcomeContract {
15312        command: Command::ControlReplayableSource,
15313        possible_submission_states: &["not_submitted", "submitted", "indeterminate", "resolved"],
15314        identity_requirement: "none",
15315        resolver_command: None,
15316        cancellation: "per_call_until_submission_then_resolve",
15317    },
15318    CommandOutcomeContract {
15319        command: Command::CloneIndex,
15320        possible_submission_states: &[
15321            "not_submitted",
15322            "submitted",
15323            "known_retired",
15324            "indeterminate",
15325            "resolved",
15326        ],
15327        identity_requirement: "caller_action_id",
15328        resolver_command: Some(Command::CloneIndex),
15329        cancellation: "per_call_until_submission_then_resolve",
15330    },
15331    CommandOutcomeContract {
15332        command: Command::ConfigureHistory,
15333        possible_submission_states: &[
15334            "not_submitted",
15335            "submitted",
15336            "known_retired",
15337            "indeterminate",
15338            "resolved",
15339        ],
15340        identity_requirement: "none",
15341        resolver_command: Some(Command::GetHistory),
15342        cancellation: "per_call_until_submission_then_resolve",
15343    },
15344    CommandOutcomeContract {
15345        command: Command::GetHistory,
15346        possible_submission_states: &["not_submitted", "resolved"],
15347        identity_requirement: "none",
15348        resolver_command: None,
15349        cancellation: "per_call",
15350    },
15351    CommandOutcomeContract {
15352        command: Command::ResolveHistory,
15353        possible_submission_states: &["not_submitted", "resolved"],
15354        identity_requirement: "none",
15355        resolver_command: None,
15356        cancellation: "per_call",
15357    },
15358    CommandOutcomeContract {
15359        command: Command::PlaceHistoryHold,
15360        possible_submission_states: &[
15361            "not_submitted",
15362            "submitted",
15363            "known_retired",
15364            "indeterminate",
15365            "resolved",
15366        ],
15367        identity_requirement: "none",
15368        resolver_command: Some(Command::GetHistory),
15369        cancellation: "per_call_until_submission_then_resolve",
15370    },
15371    CommandOutcomeContract {
15372        command: Command::ReleaseHistoryHold,
15373        possible_submission_states: &[
15374            "not_submitted",
15375            "submitted",
15376            "known_retired",
15377            "indeterminate",
15378            "resolved",
15379        ],
15380        identity_requirement: "none",
15381        resolver_command: Some(Command::GetHistory),
15382        cancellation: "per_call_until_submission_then_resolve",
15383    },
15384    CommandOutcomeContract {
15385        command: Command::PrepareDocumentMutation,
15386        possible_submission_states: &["not_submitted", "resolved"],
15387        identity_requirement: "server_locator",
15388        resolver_command: None,
15389        cancellation: "per_call",
15390    },
15391    CommandOutcomeContract {
15392        command: Command::SubmitDocumentMutation,
15393        possible_submission_states: &[
15394            "not_submitted",
15395            "submitted",
15396            "known_retired",
15397            "indeterminate",
15398            "resolved",
15399        ],
15400        identity_requirement: "request_locator",
15401        resolver_command: Some(Command::ResolveDocumentMutation),
15402        cancellation: "per_call_until_submission_then_resolve",
15403    },
15404    CommandOutcomeContract {
15405        command: Command::PrepareDocumentBulk,
15406        possible_submission_states: &["not_submitted", "resolved"],
15407        identity_requirement: "caller_action_id",
15408        resolver_command: None,
15409        cancellation: "per_call",
15410    },
15411    CommandOutcomeContract {
15412        command: Command::SubmitDocumentBulk,
15413        possible_submission_states: &[
15414            "not_submitted",
15415            "submitted",
15416            "known_retired",
15417            "indeterminate",
15418            "resolved",
15419        ],
15420        identity_requirement: "caller_action_id",
15421        resolver_command: Some(Command::ResolveDocumentBulk),
15422        cancellation: "per_call_until_submission_then_resolve",
15423    },
15424    CommandOutcomeContract {
15425        command: Command::ResolveDocumentBulk,
15426        possible_submission_states: &["not_submitted", "resolved"],
15427        identity_requirement: "caller_action_id",
15428        resolver_command: None,
15429        cancellation: "per_call",
15430    },
15431    CommandOutcomeContract {
15432        command: Command::PrepareAppendBulk,
15433        possible_submission_states: &["not_submitted", "resolved"],
15434        identity_requirement: "caller_action_id",
15435        resolver_command: None,
15436        cancellation: "per_call",
15437    },
15438    CommandOutcomeContract {
15439        command: Command::SubmitAppendBulk,
15440        possible_submission_states: &["not_submitted", "submitted", "indeterminate", "resolved"],
15441        identity_requirement: "request_locator",
15442        resolver_command: Some(Command::ResolveAppendBulk),
15443        cancellation: "per_call_until_submission_then_resolve",
15444    },
15445    CommandOutcomeContract {
15446        command: Command::ResolveAppendBulk,
15447        possible_submission_states: &["not_submitted", "resolved"],
15448        identity_requirement: "request_locator",
15449        resolver_command: None,
15450        cancellation: "per_call",
15451    },
15452    CommandOutcomeContract {
15453        command: Command::ObserveAppendCommitted,
15454        possible_submission_states: &["not_submitted", "resolved"],
15455        identity_requirement: "request_locator",
15456        resolver_command: None,
15457        cancellation: "per_call",
15458    },
15459    CommandOutcomeContract {
15460        command: Command::ResolveDocumentMutation,
15461        possible_submission_states: &["not_submitted", "resolved"],
15462        identity_requirement: "request_locator",
15463        resolver_command: None,
15464        cancellation: "per_call",
15465    },
15466    CommandOutcomeContract {
15467        command: Command::GetDocument,
15468        possible_submission_states: &["not_submitted", "resolved"],
15469        identity_requirement: "none",
15470        resolver_command: None,
15471        cancellation: "per_call",
15472    },
15473    CommandOutcomeContract {
15474        command: Command::Search,
15475        possible_submission_states: &["not_submitted", "resolved"],
15476        identity_requirement: "none",
15477        resolver_command: None,
15478        cancellation: "per_call",
15479    },
15480    CommandOutcomeContract {
15481        command: Command::TraverseRelationships,
15482        possible_submission_states: &["not_submitted", "resolved"],
15483        identity_requirement: "none",
15484        resolver_command: None,
15485        cancellation: "per_call",
15486    },
15487    CommandOutcomeContract {
15488        command: Command::QueryProfiles,
15489        possible_submission_states: &["not_submitted", "resolved"],
15490        identity_requirement: "none",
15491        resolver_command: None,
15492        cancellation: "per_call",
15493    },
15494    CommandOutcomeContract {
15495        command: Command::EvaluateTemporalEvidence,
15496        possible_submission_states: &["not_submitted", "resolved"],
15497        identity_requirement: "none",
15498        resolver_command: None,
15499        cancellation: "per_call",
15500    },
15501    CommandOutcomeContract {
15502        command: Command::CreateContinuousTemporalEvaluation,
15503        possible_submission_states: &["not_submitted", "submitted", "indeterminate", "resolved"],
15504        identity_requirement: "caller_action_id",
15505        resolver_command: Some(Command::GetContinuousTemporalEvaluation),
15506        cancellation: "per_call_until_submission_then_resolve",
15507    },
15508    CommandOutcomeContract {
15509        command: Command::GetContinuousTemporalEvaluation,
15510        possible_submission_states: &["not_submitted", "resolved"],
15511        identity_requirement: "none",
15512        resolver_command: None,
15513        cancellation: "per_call",
15514    },
15515    CommandOutcomeContract {
15516        command: Command::PauseContinuousTemporalEvaluation,
15517        possible_submission_states: &["not_submitted", "submitted", "indeterminate", "resolved"],
15518        identity_requirement: "caller_action_id",
15519        resolver_command: Some(Command::GetContinuousTemporalEvaluation),
15520        cancellation: "per_call_until_submission_then_resolve",
15521    },
15522    CommandOutcomeContract {
15523        command: Command::ResumeContinuousTemporalEvaluation,
15524        possible_submission_states: &["not_submitted", "submitted", "indeterminate", "resolved"],
15525        identity_requirement: "caller_action_id",
15526        resolver_command: Some(Command::GetContinuousTemporalEvaluation),
15527        cancellation: "per_call_until_submission_then_resolve",
15528    },
15529    CommandOutcomeContract {
15530        command: Command::ReplaceContinuousTemporalEvaluation,
15531        possible_submission_states: &["not_submitted", "submitted", "indeterminate", "resolved"],
15532        identity_requirement: "caller_action_id",
15533        resolver_command: Some(Command::GetContinuousTemporalEvaluation),
15534        cancellation: "per_call_until_submission_then_resolve",
15535    },
15536    CommandOutcomeContract {
15537        command: Command::RetireContinuousTemporalEvaluation,
15538        possible_submission_states: &["not_submitted", "submitted", "indeterminate", "resolved"],
15539        identity_requirement: "caller_action_id",
15540        resolver_command: Some(Command::GetContinuousTemporalEvaluation),
15541        cancellation: "per_call_until_submission_then_resolve",
15542    },
15543    CommandOutcomeContract {
15544        command: Command::ReadContinuousTemporalEvidence,
15545        possible_submission_states: &["not_submitted", "resolved"],
15546        identity_requirement: "none",
15547        resolver_command: None,
15548        cancellation: "per_call",
15549    },
15550    CommandOutcomeContract {
15551        command: Command::ValidateSearch,
15552        possible_submission_states: &["not_submitted", "resolved"],
15553        identity_requirement: "none",
15554        resolver_command: None,
15555        cancellation: "per_call",
15556    },
15557    CommandOutcomeContract {
15558        command: Command::OpenPit,
15559        possible_submission_states: &["not_submitted", "submitted", "indeterminate", "resolved"],
15560        identity_requirement: "none",
15561        resolver_command: None,
15562        cancellation: "per_call_until_submission_then_resolve",
15563    },
15564    CommandOutcomeContract {
15565        command: Command::RenewPit,
15566        possible_submission_states: &["not_submitted", "submitted", "indeterminate", "resolved"],
15567        identity_requirement: "none",
15568        resolver_command: None,
15569        cancellation: "per_call_until_submission_then_resolve",
15570    },
15571    CommandOutcomeContract {
15572        command: Command::ClosePit,
15573        possible_submission_states: &["not_submitted", "submitted", "indeterminate", "resolved"],
15574        identity_requirement: "none",
15575        resolver_command: None,
15576        cancellation: "per_call_until_submission_then_resolve",
15577    },
15578    CommandOutcomeContract {
15579        command: Command::ListOperations,
15580        possible_submission_states: &["not_submitted", "resolved"],
15581        identity_requirement: "none",
15582        resolver_command: None,
15583        cancellation: "per_call",
15584    },
15585    CommandOutcomeContract {
15586        command: Command::GetOperation,
15587        possible_submission_states: &["not_submitted", "resolved"],
15588        identity_requirement: "request_locator",
15589        resolver_command: None,
15590        cancellation: "per_call",
15591    },
15592    CommandOutcomeContract {
15593        command: Command::WaitOperation,
15594        possible_submission_states: &["not_submitted", "resolved"],
15595        identity_requirement: "request_locator",
15596        resolver_command: None,
15597        cancellation: "per_call",
15598    },
15599    CommandOutcomeContract {
15600        command: Command::CancelOperation,
15601        possible_submission_states: &["not_submitted", "submitted", "indeterminate", "resolved"],
15602        identity_requirement: "request_locator",
15603        resolver_command: None,
15604        cancellation: "per_call_until_submission_then_resolve",
15605    },
15606    CommandOutcomeContract {
15607        command: Command::ListAuditEvents,
15608        possible_submission_states: &["not_submitted", "resolved"],
15609        identity_requirement: "none",
15610        resolver_command: None,
15611        cancellation: "per_call",
15612    },
15613    CommandOutcomeContract {
15614        command: Command::ExportAuditEvents,
15615        possible_submission_states: &["not_submitted", "resolved"],
15616        identity_requirement: "none",
15617        resolver_command: None,
15618        cancellation: "per_call",
15619    },
15620    CommandOutcomeContract {
15621        command: Command::ReserveServiceCredential,
15622        possible_submission_states: &[
15623            "not_submitted",
15624            "submitted",
15625            "known_retired",
15626            "indeterminate",
15627            "resolved",
15628        ],
15629        identity_requirement: "caller_action_id",
15630        resolver_command: Some(Command::ResolveServiceCredentialReservation),
15631        cancellation: "per_call_until_submission_then_resolve",
15632    },
15633    CommandOutcomeContract {
15634        command: Command::ReserveServiceCredentialRotation,
15635        possible_submission_states: &[
15636            "not_submitted",
15637            "submitted",
15638            "known_retired",
15639            "indeterminate",
15640            "resolved",
15641        ],
15642        identity_requirement: "caller_action_id",
15643        resolver_command: Some(Command::ResolveServiceCredentialReservation),
15644        cancellation: "per_call_until_submission_then_resolve",
15645    },
15646    CommandOutcomeContract {
15647        command: Command::ActivateServiceCredential,
15648        possible_submission_states: &[
15649            "not_submitted",
15650            "submitted",
15651            "known_retired",
15652            "indeterminate",
15653            "resolved",
15654        ],
15655        identity_requirement: "server_locator",
15656        resolver_command: Some(Command::ResolveServiceCredentialReservation),
15657        cancellation: "per_call_until_submission_then_resolve",
15658    },
15659    CommandOutcomeContract {
15660        command: Command::ResolveServiceCredentialReservation,
15661        possible_submission_states: &["not_submitted", "resolved"],
15662        identity_requirement: "caller_action_id",
15663        resolver_command: None,
15664        cancellation: "per_call",
15665    },
15666    CommandOutcomeContract {
15667        command: Command::PrepareRevokeServiceCredential,
15668        possible_submission_states: &["not_submitted", "resolved"],
15669        identity_requirement: "server_locator",
15670        resolver_command: None,
15671        cancellation: "per_call",
15672    },
15673    CommandOutcomeContract {
15674        command: Command::RevokeServiceCredential,
15675        possible_submission_states: &[
15676            "not_submitted",
15677            "submitted",
15678            "known_retired",
15679            "indeterminate",
15680            "resolved",
15681        ],
15682        identity_requirement: "request_locator",
15683        resolver_command: Some(Command::ResolveSecurityAction),
15684        cancellation: "per_call_until_submission_then_resolve",
15685    },
15686    CommandOutcomeContract {
15687        command: Command::ResolveSecurityAction,
15688        possible_submission_states: &["not_submitted", "resolved"],
15689        identity_requirement: "request_locator",
15690        resolver_command: None,
15691        cancellation: "per_call",
15692    },
15693    CommandOutcomeContract {
15694        command: Command::GetSecurityRole,
15695        possible_submission_states: &["not_submitted", "resolved"],
15696        identity_requirement: "none",
15697        resolver_command: None,
15698        cancellation: "per_call",
15699    },
15700    CommandOutcomeContract {
15701        command: Command::PrepareRoleAppendAccessChange,
15702        possible_submission_states: &["not_submitted", "resolved"],
15703        identity_requirement: "server_locator",
15704        resolver_command: None,
15705        cancellation: "per_call",
15706    },
15707    CommandOutcomeContract {
15708        command: Command::SubmitRoleAppendAccessChange,
15709        possible_submission_states: &[
15710            "not_submitted",
15711            "submitted",
15712            "known_retired",
15713            "indeterminate",
15714            "resolved",
15715        ],
15716        identity_requirement: "request_locator",
15717        resolver_command: Some(Command::ResolveSecurityAction),
15718        cancellation: "per_call_until_submission_then_resolve",
15719    },
15720    CommandOutcomeContract {
15721        command: Command::ListServiceCredentials,
15722        possible_submission_states: &["not_submitted", "resolved"],
15723        identity_requirement: "none",
15724        resolver_command: None,
15725        cancellation: "per_call",
15726    },
15727    CommandOutcomeContract {
15728        command: Command::GetRuntimeStatus,
15729        possible_submission_states: &["not_submitted", "resolved"],
15730        identity_requirement: "none",
15731        resolver_command: None,
15732        cancellation: "per_call",
15733    },
15734    CommandOutcomeContract {
15735        command: Command::GetResultCacheStatus,
15736        possible_submission_states: &["not_submitted", "resolved"],
15737        identity_requirement: "none",
15738        resolver_command: None,
15739        cancellation: "per_call",
15740    },
15741    CommandOutcomeContract {
15742        command: Command::GetFieldPromotionStatus,
15743        possible_submission_states: &["not_submitted", "resolved"],
15744        identity_requirement: "none",
15745        resolver_command: None,
15746        cancellation: "per_call",
15747    },
15748    CommandOutcomeContract {
15749        command: Command::GetOverloadStatus,
15750        possible_submission_states: &["not_submitted", "resolved"],
15751        identity_requirement: "none",
15752        resolver_command: None,
15753        cancellation: "per_call",
15754    },
15755    CommandOutcomeContract {
15756        command: Command::ConfigureExternalKey,
15757        possible_submission_states: &["not_submitted", "submitted", "indeterminate", "resolved"],
15758        identity_requirement: "none",
15759        resolver_command: None,
15760        cancellation: "per_call_until_submission_then_resolve",
15761    },
15762    CommandOutcomeContract {
15763        command: Command::RotateExternalKeyBinding,
15764        possible_submission_states: &["not_submitted", "submitted", "indeterminate", "resolved"],
15765        identity_requirement: "none",
15766        resolver_command: None,
15767        cancellation: "per_call_until_submission_then_resolve",
15768    },
15769    CommandOutcomeContract {
15770        command: Command::ConfigureAggregateThenDelete,
15771        possible_submission_states: &["not_submitted", "submitted", "indeterminate", "resolved"],
15772        identity_requirement: "none",
15773        resolver_command: None,
15774        cancellation: "per_call_until_submission_then_resolve",
15775    },
15776    CommandOutcomeContract {
15777        command: Command::GetLifecycleStatus,
15778        possible_submission_states: &["not_submitted", "resolved"],
15779        identity_requirement: "none",
15780        resolver_command: None,
15781        cancellation: "per_call",
15782    },
15783    CommandOutcomeContract {
15784        command: Command::GetQuota,
15785        possible_submission_states: &["not_submitted", "resolved"],
15786        identity_requirement: "none",
15787        resolver_command: None,
15788        cancellation: "per_call",
15789    },
15790    CommandOutcomeContract {
15791        command: Command::UpdateQuota,
15792        possible_submission_states: &["not_submitted", "submitted", "indeterminate", "resolved"],
15793        identity_requirement: "none",
15794        resolver_command: None,
15795        cancellation: "per_call_until_submission_then_resolve",
15796    },
15797    CommandOutcomeContract {
15798        command: Command::GetBinding,
15799        possible_submission_states: &["not_submitted", "resolved"],
15800        identity_requirement: "none",
15801        resolver_command: None,
15802        cancellation: "per_call",
15803    },
15804    CommandOutcomeContract {
15805        command: Command::GetAdmissionStatus,
15806        possible_submission_states: &["not_submitted", "resolved"],
15807        identity_requirement: "none",
15808        resolver_command: None,
15809        cancellation: "per_call",
15810    },
15811    CommandOutcomeContract {
15812        command: Command::SetAdmission,
15813        possible_submission_states: &["not_submitted", "submitted", "indeterminate", "resolved"],
15814        identity_requirement: "none",
15815        resolver_command: None,
15816        cancellation: "per_call_until_submission_then_resolve",
15817    },
15818    CommandOutcomeContract {
15819        command: Command::GetQuiesceStatus,
15820        possible_submission_states: &["not_submitted", "resolved"],
15821        identity_requirement: "none",
15822        resolver_command: None,
15823        cancellation: "per_call",
15824    },
15825    CommandOutcomeContract {
15826        command: Command::GetDecommissionReadiness,
15827        possible_submission_states: &["not_submitted", "resolved"],
15828        identity_requirement: "none",
15829        resolver_command: None,
15830        cancellation: "per_call",
15831    },
15832    CommandOutcomeContract {
15833        command: Command::GetUpgradeReadiness,
15834        possible_submission_states: &["not_submitted", "resolved"],
15835        identity_requirement: "none",
15836        resolver_command: None,
15837        cancellation: "per_call",
15838    },
15839    CommandOutcomeContract {
15840        command: Command::GetMaintenanceStatus,
15841        possible_submission_states: &["not_submitted", "resolved"],
15842        identity_requirement: "none",
15843        resolver_command: None,
15844        cancellation: "per_call",
15845    },
15846    CommandOutcomeContract {
15847        command: Command::WarmVectorIndex,
15848        possible_submission_states: &["not_submitted", "resolved"],
15849        identity_requirement: "exact_root",
15850        resolver_command: None,
15851        cancellation: "per_call",
15852    },
15853    CommandOutcomeContract {
15854        command: Command::EvaluateVectorRecall,
15855        possible_submission_states: &["not_submitted", "submitted", "indeterminate", "resolved"],
15856        identity_requirement: "caller_action_id",
15857        resolver_command: None,
15858        cancellation: "per_call_until_submission_then_resolve",
15859    },
15860    CommandOutcomeContract {
15861        command: Command::CalibrateVectorStrategy,
15862        possible_submission_states: &["not_submitted", "submitted", "indeterminate", "resolved"],
15863        identity_requirement: "caller_action_id",
15864        resolver_command: None,
15865        cancellation: "per_call_until_submission_then_resolve",
15866    },
15867    CommandOutcomeContract {
15868        command: Command::GetVectorDiagnostic,
15869        possible_submission_states: &["not_submitted", "resolved"],
15870        identity_requirement: "request_locator",
15871        resolver_command: None,
15872        cancellation: "per_call",
15873    },
15874    CommandOutcomeContract {
15875        command: Command::CreateDiagnostic,
15876        possible_submission_states: &["not_submitted", "submitted", "indeterminate", "resolved"],
15877        identity_requirement: "none",
15878        resolver_command: None,
15879        cancellation: "per_call_until_submission_then_resolve",
15880    },
15881    CommandOutcomeContract {
15882        command: Command::GetDiagnostic,
15883        possible_submission_states: &["not_submitted", "resolved"],
15884        identity_requirement: "request_locator",
15885        resolver_command: None,
15886        cancellation: "per_call",
15887    },
15888    CommandOutcomeContract {
15889        command: Command::PrepareCollectionExport,
15890        possible_submission_states: &["not_submitted", "resolved"],
15891        identity_requirement: "caller_action_id",
15892        resolver_command: None,
15893        cancellation: "per_call",
15894    },
15895    CommandOutcomeContract {
15896        command: Command::StartCollectionExport,
15897        possible_submission_states: &["not_submitted", "submitted", "indeterminate", "resolved"],
15898        identity_requirement: "caller_action_id",
15899        resolver_command: Some(Command::ResolveCollectionExport),
15900        cancellation: "per_call_until_submission_then_resolve",
15901    },
15902    CommandOutcomeContract {
15903        command: Command::ResolveCollectionExport,
15904        possible_submission_states: &["not_submitted", "resolved", "known_retired"],
15905        identity_requirement: "caller_action_id",
15906        resolver_command: None,
15907        cancellation: "per_call",
15908    },
15909    CommandOutcomeContract {
15910        command: Command::VerifyCollectionExport,
15911        possible_submission_states: &["not_submitted", "resolved"],
15912        identity_requirement: "request_locator",
15913        resolver_command: None,
15914        cancellation: "per_call",
15915    },
15916    CommandOutcomeContract {
15917        command: Command::PrepareCollectionRestore,
15918        possible_submission_states: &["not_submitted", "resolved"],
15919        identity_requirement: "caller_action_id",
15920        resolver_command: None,
15921        cancellation: "per_call",
15922    },
15923    CommandOutcomeContract {
15924        command: Command::StartCollectionRestore,
15925        possible_submission_states: &["not_submitted", "submitted", "indeterminate", "resolved"],
15926        identity_requirement: "caller_action_id",
15927        resolver_command: Some(Command::ResolveCollectionRestore),
15928        cancellation: "per_call_until_submission_then_resolve",
15929    },
15930    CommandOutcomeContract {
15931        command: Command::ResolveCollectionRestore,
15932        possible_submission_states: &["not_submitted", "resolved", "known_retired"],
15933        identity_requirement: "caller_action_id",
15934        resolver_command: None,
15935        cancellation: "per_call",
15936    },
15937    CommandOutcomeContract {
15938        command: Command::PrepareIndexExport,
15939        possible_submission_states: &["not_submitted", "resolved"],
15940        identity_requirement: "caller_action_id",
15941        resolver_command: None,
15942        cancellation: "per_call",
15943    },
15944    CommandOutcomeContract {
15945        command: Command::StartIndexExport,
15946        possible_submission_states: &["not_submitted", "submitted", "indeterminate", "resolved"],
15947        identity_requirement: "caller_action_id",
15948        resolver_command: Some(Command::ResolveIndexExport),
15949        cancellation: "per_call_until_submission_then_resolve",
15950    },
15951    CommandOutcomeContract {
15952        command: Command::ResolveIndexExport,
15953        possible_submission_states: &["not_submitted", "resolved", "known_retired"],
15954        identity_requirement: "caller_action_id",
15955        resolver_command: None,
15956        cancellation: "per_call",
15957    },
15958    CommandOutcomeContract {
15959        command: Command::VerifyIndexExport,
15960        possible_submission_states: &["not_submitted", "resolved"],
15961        identity_requirement: "request_locator",
15962        resolver_command: None,
15963        cancellation: "per_call",
15964    },
15965    CommandOutcomeContract {
15966        command: Command::PrepareIndexImport,
15967        possible_submission_states: &["not_submitted", "resolved"],
15968        identity_requirement: "caller_action_id",
15969        resolver_command: None,
15970        cancellation: "per_call",
15971    },
15972    CommandOutcomeContract {
15973        command: Command::StartIndexImport,
15974        possible_submission_states: &["not_submitted", "submitted", "indeterminate", "resolved"],
15975        identity_requirement: "caller_action_id",
15976        resolver_command: Some(Command::ResolveIndexImport),
15977        cancellation: "per_call_until_submission_then_resolve",
15978    },
15979    CommandOutcomeContract {
15980        command: Command::ResolveIndexImport,
15981        possible_submission_states: &["not_submitted", "resolved", "known_retired"],
15982        identity_requirement: "caller_action_id",
15983        resolver_command: None,
15984        cancellation: "per_call",
15985    },
15986    CommandOutcomeContract {
15987        command: Command::ReadArtifactChunk,
15988        possible_submission_states: &["not_submitted", "resolved"],
15989        identity_requirement: "none",
15990        resolver_command: None,
15991        cancellation: "per_call",
15992    },
15993    CommandOutcomeContract {
15994        command: Command::ExportUsage,
15995        possible_submission_states: &["not_submitted", "resolved"],
15996        identity_requirement: "none",
15997        resolver_command: None,
15998        cancellation: "per_call",
15999    },
16000    CommandOutcomeContract {
16001        command: Command::ExecuteStateRead,
16002        possible_submission_states: &["not_submitted", "resolved"],
16003        identity_requirement: "none",
16004        resolver_command: None,
16005        cancellation: "per_call",
16006    },
16007    CommandOutcomeContract {
16008        command: Command::PrepareStateWrite,
16009        possible_submission_states: &["not_submitted", "resolved"],
16010        identity_requirement: "caller_action_id",
16011        resolver_command: None,
16012        cancellation: "per_call",
16013    },
16014    CommandOutcomeContract {
16015        command: Command::SubmitStateWrite,
16016        possible_submission_states: &[
16017            "not_submitted",
16018            "submitted",
16019            "known_retired",
16020            "indeterminate",
16021            "resolved",
16022        ],
16023        identity_requirement: "request_locator",
16024        resolver_command: Some(Command::ResolveStateWrite),
16025        cancellation: "per_call_until_submission_then_resolve",
16026    },
16027    CommandOutcomeContract {
16028        command: Command::ResolveStateWrite,
16029        possible_submission_states: &["not_submitted", "resolved"],
16030        identity_requirement: "request_locator",
16031        resolver_command: None,
16032        cancellation: "per_call",
16033    },
16034];
16035#[derive(Clone, Copy, Debug, Eq, PartialEq)]
16036pub struct ErrorOutcomeContract {
16037    pub code: ErrorCode,
16038    pub disposition: ErrorDisposition,
16039    pub recovery: RecoveryAction,
16040    pub retry_after_limit_id: Option<&'static str>,
16041    pub recovery_identity: &'static str,
16042}
16043pub const LODESTONE_API_ERROR_OUTCOMES: &[ErrorOutcomeContract] = &[
16044    ErrorOutcomeContract {
16045        code: ErrorCode::Aborted,
16046        disposition: ErrorDisposition::NotSubmitted,
16047        recovery: RecoveryAction::Retry,
16048        retry_after_limit_id: None,
16049        recovery_identity: "request_identity",
16050    },
16051    ErrorOutcomeContract {
16052        code: ErrorCode::Aborted,
16053        disposition: ErrorDisposition::Indeterminate,
16054        recovery: RecoveryAction::Resolve,
16055        retry_after_limit_id: None,
16056        recovery_identity: "request_identity",
16057    },
16058    ErrorOutcomeContract {
16059        code: ErrorCode::DeadlineExceeded,
16060        disposition: ErrorDisposition::NotSubmitted,
16061        recovery: RecoveryAction::Retry,
16062        retry_after_limit_id: None,
16063        recovery_identity: "request_identity",
16064    },
16065    ErrorOutcomeContract {
16066        code: ErrorCode::DeadlineExceeded,
16067        disposition: ErrorDisposition::Indeterminate,
16068        recovery: RecoveryAction::Resolve,
16069        retry_after_limit_id: None,
16070        recovery_identity: "request_identity",
16071    },
16072    ErrorOutcomeContract {
16073        code: ErrorCode::InvalidRequest,
16074        disposition: ErrorDisposition::NotSubmitted,
16075        recovery: RecoveryAction::Stop,
16076        retry_after_limit_id: None,
16077        recovery_identity: "none",
16078    },
16079    ErrorOutcomeContract {
16080        code: ErrorCode::UnsupportedVersion,
16081        disposition: ErrorDisposition::NotSubmitted,
16082        recovery: RecoveryAction::Stop,
16083        retry_after_limit_id: None,
16084        recovery_identity: "none",
16085    },
16086    ErrorOutcomeContract {
16087        code: ErrorCode::Unauthenticated,
16088        disposition: ErrorDisposition::NotSubmitted,
16089        recovery: RecoveryAction::RefreshCredential,
16090        retry_after_limit_id: None,
16091        recovery_identity: "none",
16092    },
16093    ErrorOutcomeContract {
16094        code: ErrorCode::PermissionDenied,
16095        disposition: ErrorDisposition::NotSubmitted,
16096        recovery: RecoveryAction::Stop,
16097        retry_after_limit_id: None,
16098        recovery_identity: "none",
16099    },
16100    ErrorOutcomeContract {
16101        code: ErrorCode::NotFound,
16102        disposition: ErrorDisposition::NotSubmitted,
16103        recovery: RecoveryAction::Stop,
16104        retry_after_limit_id: None,
16105        recovery_identity: "request_identity",
16106    },
16107    ErrorOutcomeContract {
16108        code: ErrorCode::NotFound,
16109        disposition: ErrorDisposition::Resolved,
16110        recovery: RecoveryAction::Stop,
16111        retry_after_limit_id: None,
16112        recovery_identity: "request_identity",
16113    },
16114    ErrorOutcomeContract {
16115        code: ErrorCode::Conflict,
16116        disposition: ErrorDisposition::NotSubmitted,
16117        recovery: RecoveryAction::RefreshPrecondition,
16118        retry_after_limit_id: None,
16119        recovery_identity: "request_identity",
16120    },
16121    ErrorOutcomeContract {
16122        code: ErrorCode::Conflict,
16123        disposition: ErrorDisposition::Resolved,
16124        recovery: RecoveryAction::Stop,
16125        retry_after_limit_id: None,
16126        recovery_identity: "request_identity",
16127    },
16128    ErrorOutcomeContract {
16129        code: ErrorCode::StaleCursor,
16130        disposition: ErrorDisposition::NotSubmitted,
16131        recovery: RecoveryAction::RestartPage,
16132        retry_after_limit_id: None,
16133        recovery_identity: "cursor",
16134    },
16135    ErrorOutcomeContract {
16136        code: ErrorCode::RestartBudgetExhausted,
16137        disposition: ErrorDisposition::NotSubmitted,
16138        recovery: RecoveryAction::Stop,
16139        retry_after_limit_id: None,
16140        recovery_identity: "cursor",
16141    },
16142    ErrorOutcomeContract {
16143        code: ErrorCode::LimitExceeded,
16144        disposition: ErrorDisposition::NotSubmitted,
16145        recovery: RecoveryAction::ReduceRequest,
16146        retry_after_limit_id: None,
16147        recovery_identity: "none",
16148    },
16149    ErrorOutcomeContract {
16150        code: ErrorCode::CapabilityUnavailable,
16151        disposition: ErrorDisposition::NotSubmitted,
16152        recovery: RecoveryAction::Stop,
16153        retry_after_limit_id: None,
16154        recovery_identity: "none",
16155    },
16156    ErrorOutcomeContract {
16157        code: ErrorCode::NotSubmitted,
16158        disposition: ErrorDisposition::NotSubmitted,
16159        recovery: RecoveryAction::RetryAfter,
16160        retry_after_limit_id: Some("retry_after_millis"),
16161        recovery_identity: "request_identity",
16162    },
16163    ErrorOutcomeContract {
16164        code: ErrorCode::SubmittedIndeterminate,
16165        disposition: ErrorDisposition::Indeterminate,
16166        recovery: RecoveryAction::Resolve,
16167        retry_after_limit_id: None,
16168        recovery_identity: "locator_or_caller_action_id",
16169    },
16170    ErrorOutcomeContract {
16171        code: ErrorCode::ExpiredUnknown,
16172        disposition: ErrorDisposition::KnownRetired,
16173        recovery: RecoveryAction::Stop,
16174        retry_after_limit_id: None,
16175        recovery_identity: "locator_or_caller_action_id",
16176    },
16177    ErrorOutcomeContract {
16178        code: ErrorCode::SecretNotEscrowed,
16179        disposition: ErrorDisposition::Resolved,
16180        recovery: RecoveryAction::Resolve,
16181        retry_after_limit_id: None,
16182        recovery_identity: "reservation_action_id",
16183    },
16184    ErrorOutcomeContract {
16185        code: ErrorCode::RetentionGap,
16186        disposition: ErrorDisposition::KnownRetired,
16187        recovery: RecoveryAction::Stop,
16188        retry_after_limit_id: None,
16189        recovery_identity: "cursor_or_locator",
16190    },
16191    ErrorOutcomeContract {
16192        code: ErrorCode::ArtifactRangeInvalid,
16193        disposition: ErrorDisposition::NotSubmitted,
16194        recovery: RecoveryAction::CorrectRange,
16195        retry_after_limit_id: None,
16196        recovery_identity: "artifact_identity",
16197    },
16198    ErrorOutcomeContract {
16199        code: ErrorCode::ChecksumMismatch,
16200        disposition: ErrorDisposition::Resolved,
16201        recovery: RecoveryAction::Stop,
16202        retry_after_limit_id: None,
16203        recovery_identity: "artifact_identity",
16204    },
16205    ErrorOutcomeContract {
16206        code: ErrorCode::TemporarilyUnavailable,
16207        disposition: ErrorDisposition::NotSubmitted,
16208        recovery: RecoveryAction::RetryAfter,
16209        retry_after_limit_id: Some("retry_after_millis"),
16210        recovery_identity: "request_identity",
16211    },
16212    ErrorOutcomeContract {
16213        code: ErrorCode::TemporarilyUnavailable,
16214        disposition: ErrorDisposition::Indeterminate,
16215        recovery: RecoveryAction::Resolve,
16216        retry_after_limit_id: Some("retry_after_millis"),
16217        recovery_identity: "request_identity",
16218    },
16219    ErrorOutcomeContract {
16220        code: ErrorCode::Internal,
16221        disposition: ErrorDisposition::NotSubmitted,
16222        recovery: RecoveryAction::Stop,
16223        retry_after_limit_id: None,
16224        recovery_identity: "request_identity",
16225    },
16226    ErrorOutcomeContract {
16227        code: ErrorCode::Internal,
16228        disposition: ErrorDisposition::Resolved,
16229        recovery: RecoveryAction::Stop,
16230        retry_after_limit_id: None,
16231        recovery_identity: "request_identity",
16232    },
16233    ErrorOutcomeContract {
16234        code: ErrorCode::Internal,
16235        disposition: ErrorDisposition::Indeterminate,
16236        recovery: RecoveryAction::Resolve,
16237        retry_after_limit_id: None,
16238        recovery_identity: "request_identity",
16239    },
16240];
16241#[derive(Clone, Copy, Debug, Eq, PartialEq)]
16242pub struct Limit {
16243    pub id: &'static str,
16244    pub default: u64,
16245    pub maximum: u64,
16246    pub unit: &'static str,
16247}
16248pub const LODESTONE_API_LIMITS: &[Limit] = &[
16249    Limit {
16250        id: "request_bytes",
16251        default: 2097152,
16252        maximum: 2097152,
16253        unit: "bytes",
16254    },
16255    Limit {
16256        id: "response_bytes",
16257        default: 2097152,
16258        maximum: 2097152,
16259        unit: "bytes",
16260    },
16261    Limit {
16262        id: "page_size",
16263        default: 100,
16264        maximum: 1000,
16265        unit: "items",
16266    },
16267    Limit {
16268        id: "catalog_page_size",
16269        default: 100,
16270        maximum: 100,
16271        unit: "items",
16272    },
16273    Limit {
16274        id: "catalog_restart_budget",
16275        default: 8,
16276        maximum: 8,
16277        unit: "restarts",
16278    },
16279    Limit {
16280        id: "query_clauses",
16281        default: 256,
16282        maximum: 1024,
16283        unit: "clauses",
16284    },
16285    Limit {
16286        id: "text_query_bytes",
16287        default: 16384,
16288        maximum: 16384,
16289        unit: "bytes",
16290    },
16291    Limit {
16292        id: "text_query_fields",
16293        default: 64,
16294        maximum: 64,
16295        unit: "fields",
16296    },
16297    Limit {
16298        id: "text_query_slop",
16299        default: 64,
16300        maximum: 64,
16301        unit: "positions",
16302    },
16303    Limit {
16304        id: "text_query_boost",
16305        default: 1024,
16306        maximum: 1024,
16307        unit: "multiplier",
16308    },
16309    Limit {
16310        id: "text_query_fuzzy_expansions",
16311        default: 1024,
16312        maximum: 1024,
16313        unit: "terms",
16314    },
16315    Limit {
16316        id: "text_query_fuzzy_distance",
16317        default: 2,
16318        maximum: 2,
16319        unit: "edits",
16320    },
16321    Limit {
16322        id: "text_query_dictionary_scan_terms",
16323        default: 65536,
16324        maximum: 65536,
16325        unit: "terms",
16326    },
16327    Limit {
16328        id: "text_query_dictionary_scan_bytes",
16329        default: 16777216,
16330        maximum: 16777216,
16331        unit: "bytes",
16332    },
16333    Limit {
16334        id: "text_query_fuzzy_work_units",
16335        default: 2000000,
16336        maximum: 2000000,
16337        unit: "distance_cells",
16338    },
16339    Limit {
16340        id: "aggregation_nodes",
16341        default: 64,
16342        maximum: 256,
16343        unit: "nodes",
16344    },
16345    Limit {
16346        id: "aggregation_buckets",
16347        default: 65536,
16348        maximum: 65536,
16349        unit: "buckets",
16350    },
16351    Limit {
16352        id: "metric_point_bytes",
16353        default: 1048576,
16354        maximum: 1048576,
16355        unit: "bytes",
16356    },
16357    Limit {
16358        id: "metric_attributes",
16359        default: 128,
16360        maximum: 128,
16361        unit: "items",
16362    },
16363    Limit {
16364        id: "metric_attribute_bytes",
16365        default: 65536,
16366        maximum: 65536,
16367        unit: "bytes",
16368    },
16369    Limit {
16370        id: "metric_exemplars",
16371        default: 8,
16372        maximum: 8,
16373        unit: "items",
16374    },
16375    Limit {
16376        id: "metric_histogram_buckets",
16377        default: 4097,
16378        maximum: 4097,
16379        unit: "buckets",
16380    },
16381    Limit {
16382        id: "time_series_grouping_keys",
16383        default: 4,
16384        maximum: 16,
16385        unit: "keys",
16386    },
16387    Limit {
16388        id: "time_series_points",
16389        default: 100000,
16390        maximum: 100000,
16391        unit: "points",
16392    },
16393    Limit {
16394        id: "time_series_series",
16395        default: 10000,
16396        maximum: 10000,
16397        unit: "series",
16398    },
16399    Limit {
16400        id: "time_series_buckets",
16401        default: 65536,
16402        maximum: 65536,
16403        unit: "buckets",
16404    },
16405    Limit {
16406        id: "time_series_results",
16407        default: 65536,
16408        maximum: 65536,
16409        unit: "results",
16410    },
16411    Limit {
16412        id: "time_series_quantiles",
16413        default: 10,
16414        maximum: 100,
16415        unit: "quantiles",
16416    },
16417    Limit {
16418        id: "time_series_state_bytes",
16419        default: 67108864,
16420        maximum: 67108864,
16421        unit: "bytes",
16422    },
16423    Limit {
16424        id: "temporal_inputs",
16425        default: 16,
16426        maximum: 16,
16427        unit: "indexes",
16428    },
16429    Limit {
16430        id: "temporal_pattern_nodes",
16431        default: 64,
16432        maximum: 64,
16433        unit: "nodes",
16434    },
16435    Limit {
16436        id: "temporal_pattern_depth",
16437        default: 16,
16438        maximum: 16,
16439        unit: "levels",
16440    },
16441    Limit {
16442        id: "temporal_pattern_branches",
16443        default: 16,
16444        maximum: 16,
16445        unit: "branches",
16446    },
16447    Limit {
16448        id: "temporal_correlation_keys",
16449        default: 4,
16450        maximum: 4,
16451        unit: "fields",
16452    },
16453    Limit {
16454        id: "temporal_events",
16455        default: 4096,
16456        maximum: 4096,
16457        unit: "events",
16458    },
16459    Limit {
16460        id: "temporal_states",
16461        default: 65536,
16462        maximum: 65536,
16463        unit: "states",
16464    },
16465    Limit {
16466        id: "temporal_captured_events",
16467        default: 256,
16468        maximum: 256,
16469        unit: "events",
16470    },
16471    Limit {
16472        id: "temporal_results",
16473        default: 4096,
16474        maximum: 4096,
16475        unit: "results",
16476    },
16477    Limit {
16478        id: "temporal_state_bytes",
16479        default: 67108864,
16480        maximum: 67108864,
16481        unit: "bytes",
16482    },
16483    Limit {
16484        id: "temporal_interval_nanos",
16485        default: 2678400000000000,
16486        maximum: 2678400000000000,
16487        unit: "nanoseconds",
16488    },
16489    Limit {
16490        id: "relationship_indexes",
16491        default: 4,
16492        maximum: 16,
16493        unit: "indexes",
16494    },
16495    Limit {
16496        id: "relationship_seeds",
16497        default: 16,
16498        maximum: 128,
16499        unit: "entities",
16500    },
16501    Limit {
16502        id: "relationship_filter_values",
16503        default: 16,
16504        maximum: 128,
16505        unit: "values",
16506    },
16507    Limit {
16508        id: "relationship_depth",
16509        default: 4,
16510        maximum: 16,
16511        unit: "levels",
16512    },
16513    Limit {
16514        id: "relationship_fan_out",
16515        default: 256,
16516        maximum: 4096,
16517        unit: "relationships",
16518    },
16519    Limit {
16520        id: "relationship_visited_entities",
16521        default: 10000,
16522        maximum: 65536,
16523        unit: "entities",
16524    },
16525    Limit {
16526        id: "relationship_visited_records",
16527        default: 10000,
16528        maximum: 10000,
16529        unit: "records",
16530    },
16531    Limit {
16532        id: "relationship_returned_records",
16533        default: 10000,
16534        maximum: 10000,
16535        unit: "records",
16536    },
16537    Limit {
16538        id: "relationship_memory_bytes",
16539        default: 67108864,
16540        maximum: 268435456,
16541        unit: "bytes",
16542    },
16543    Limit {
16544        id: "profile_indexes",
16545        default: 4,
16546        maximum: 16,
16547        unit: "indexes",
16548    },
16549    Limit {
16550        id: "profile_filter_values",
16551        default: 16,
16552        maximum: 128,
16553        unit: "values",
16554    },
16555    Limit {
16556        id: "profile_batches",
16557        default: 10000,
16558        maximum: 10000,
16559        unit: "batches",
16560    },
16561    Limit {
16562        id: "profile_samples",
16563        default: 100000,
16564        maximum: 100000,
16565        unit: "samples",
16566    },
16567    Limit {
16568        id: "profile_results",
16569        default: 10000,
16570        maximum: 10000,
16571        unit: "results",
16572    },
16573    Limit {
16574        id: "profile_memory_bytes",
16575        default: 67108864,
16576        maximum: 268435456,
16577        unit: "bytes",
16578    },
16579    Limit {
16580        id: "approximate_cardinality_precision",
16581        default: 12,
16582        maximum: 16,
16583        unit: "index_bits",
16584    },
16585    Limit {
16586        id: "approximate_percentile_precision",
16587        default: 10,
16588        maximum: 12,
16589        unit: "index_bits",
16590    },
16591    Limit {
16592        id: "operation_page_authorities",
16593        default: 7,
16594        maximum: 7,
16595        unit: "authorities",
16596    },
16597    Limit {
16598        id: "artifact_chunk_bytes",
16599        default: 262144,
16600        maximum: 1048576,
16601        unit: "bytes",
16602    },
16603    Limit {
16604        id: "bulk_document_items",
16605        default: 128,
16606        maximum: 1024,
16607        unit: "items",
16608    },
16609    Limit {
16610        id: "bulk_document_bytes",
16611        default: 2097152,
16612        maximum: 2097152,
16613        unit: "bytes",
16614    },
16615    Limit {
16616        id: "state_command_keys",
16617        default: 128,
16618        maximum: 128,
16619        unit: "keys",
16620    },
16621    Limit {
16622        id: "state_command_value_bytes",
16623        default: 1048576,
16624        maximum: 1048576,
16625        unit: "bytes",
16626    },
16627    Limit {
16628        id: "state_write_outcomes",
16629        default: 4096,
16630        maximum: 4096,
16631        unit: "entries",
16632    },
16633    Limit {
16634        id: "exact_decimal_scale",
16635        default: 18,
16636        maximum: 1024,
16637        unit: "decimal_places",
16638    },
16639    Limit {
16640        id: "retry_after_millis",
16641        default: 1000,
16642        maximum: 60000,
16643        unit: "milliseconds",
16644    },
16645    Limit {
16646        id: "mapping_fields",
16647        default: 16384,
16648        maximum: 16384,
16649        unit: "fields",
16650    },
16651    Limit {
16652        id: "search_result_window",
16653        default: 10000,
16654        maximum: 10000,
16655        unit: "items",
16656    },
16657    Limit {
16658        id: "routing_values",
16659        default: 1024,
16660        maximum: 1024,
16661        unit: "items",
16662    },
16663    Limit {
16664        id: "routing_value_bytes",
16665        default: 4096,
16666        maximum: 4096,
16667        unit: "bytes",
16668    },
16669    Limit {
16670        id: "query_recursion_depth",
16671        default: 64,
16672        maximum: 64,
16673        unit: "levels",
16674    },
16675    Limit {
16676        id: "vector_dimensions",
16677        default: 16384,
16678        maximum: 16384,
16679        unit: "dimensions",
16680    },
16681    Limit {
16682        id: "vector_query_bytes",
16683        default: 65536,
16684        maximum: 65536,
16685        unit: "bytes",
16686    },
16687    Limit {
16688        id: "vector_request_bytes",
16689        default: 1048576,
16690        maximum: 1048576,
16691        unit: "bytes",
16692    },
16693    Limit {
16694        id: "vector_candidates",
16695        default: 10000,
16696        maximum: 10000,
16697        unit: "items",
16698    },
16699    Limit {
16700        id: "vector_set_document_vectors",
16701        default: 128,
16702        maximum: 128,
16703        unit: "vectors",
16704    },
16705    Limit {
16706        id: "vector_set_document_bytes",
16707        default: 65536,
16708        maximum: 65536,
16709        unit: "bytes",
16710    },
16711    Limit {
16712        id: "vector_set_query_vectors",
16713        default: 32,
16714        maximum: 32,
16715        unit: "vectors",
16716    },
16717    Limit {
16718        id: "vector_set_query_bytes",
16719        default: 65536,
16720        maximum: 65536,
16721        unit: "bytes",
16722    },
16723    Limit {
16724        id: "retrieval_branches",
16725        default: 16,
16726        maximum: 16,
16727        unit: "branches",
16728    },
16729    Limit {
16730        id: "retrieval_branch_name_bytes",
16731        default: 64,
16732        maximum: 64,
16733        unit: "bytes",
16734    },
16735    Limit {
16736        id: "retrieval_window",
16737        default: 10000,
16738        maximum: 10000,
16739        unit: "items",
16740    },
16741    Limit {
16742        id: "fragment_fields",
16743        default: 4,
16744        maximum: 16,
16745        unit: "fields",
16746    },
16747    Limit {
16748        id: "fragments_per_field",
16749        default: 1,
16750        maximum: 8,
16751        unit: "items",
16752    },
16753    Limit {
16754        id: "fragment_bytes",
16755        default: 150,
16756        maximum: 8192,
16757        unit: "bytes",
16758    },
16759    Limit {
16760        id: "fragment_total_bytes",
16761        default: 65536,
16762        maximum: 65536,
16763        unit: "bytes",
16764    },
16765    Limit {
16766        id: "result_feature_hits",
16767        default: 10,
16768        maximum: 100,
16769        unit: "items",
16770    },
16771    Limit {
16772        id: "result_features",
16773        default: 4,
16774        maximum: 16,
16775        unit: "features",
16776    },
16777    Limit {
16778        id: "diversification_fields",
16779        default: 1,
16780        maximum: 4,
16781        unit: "fields",
16782    },
16783    Limit {
16784        id: "diversification_per_group",
16785        default: 1,
16786        maximum: 64,
16787        unit: "items",
16788    },
16789    Limit {
16790        id: "source_projection_patterns",
16791        default: 128,
16792        maximum: 128,
16793        unit: "patterns",
16794    },
16795    Limit {
16796        id: "source_projection_pattern_bytes",
16797        default: 512,
16798        maximum: 512,
16799        unit: "bytes",
16800    },
16801    Limit {
16802        id: "vector_evaluation_queries",
16803        default: 64,
16804        maximum: 256,
16805        unit: "queries",
16806    },
16807    Limit {
16808        id: "vector_evaluation_k",
16809        default: 10,
16810        maximum: 1000,
16811        unit: "items",
16812    },
16813    Limit {
16814        id: "vector_evaluation_profiles",
16815        default: 3,
16816        maximum: 3,
16817        unit: "profiles",
16818    },
16819    Limit {
16820        id: "vector_evaluation_artifact_bytes",
16821        default: 1048576,
16822        maximum: 1048576,
16823        unit: "bytes",
16824    },
16825    Limit {
16826        id: "vector_warm_components",
16827        default: 2,
16828        maximum: 3,
16829        unit: "components",
16830    },
16831    Limit {
16832        id: "vector_warm_requests",
16833        default: 1024,
16834        maximum: 65536,
16835        unit: "requests",
16836    },
16837    Limit {
16838        id: "vector_warm_bytes",
16839        default: 268435456,
16840        maximum: 1073741824,
16841        unit: "bytes",
16842    },
16843    Limit {
16844        id: "vector_warm_achievements",
16845        default: 1024,
16846        maximum: 10000,
16847        unit: "items",
16848    },
16849    Limit {
16850        id: "vector_warm_ttl_millis",
16851        default: 300000,
16852        maximum: 900000,
16853        unit: "milliseconds",
16854    },
16855    Limit {
16856        id: "operation_page_size",
16857        default: 100,
16858        maximum: 100,
16859        unit: "items",
16860    },
16861    Limit {
16862        id: "operation_wait_attempts",
16863        default: 20,
16864        maximum: 100,
16865        unit: "attempts",
16866    },
16867    Limit {
16868        id: "operation_wait_interval_millis",
16869        default: 100,
16870        maximum: 60000,
16871        unit: "milliseconds",
16872    },
16873    Limit {
16874        id: "resource_initial_shards",
16875        default: 1,
16876        maximum: 4096,
16877        unit: "shards",
16878    },
16879    Limit {
16880        id: "resource_target_shard_bytes",
16881        default: 536870912,
16882        maximum: 1125899906842624,
16883        unit: "bytes",
16884    },
16885    Limit {
16886        id: "resource_admission_weight",
16887        default: 1,
16888        maximum: 1000000,
16889        unit: "weight",
16890    },
16891    Limit {
16892        id: "resource_ram_bytes",
16893        default: 1073741824,
16894        maximum: 1125899906842624,
16895        unit: "bytes",
16896    },
16897    Limit {
16898        id: "resource_nvme_bytes",
16899        default: 2147483648,
16900        maximum: 1125899906842624,
16901        unit: "bytes",
16902    },
16903    Limit {
16904        id: "resource_refresh_millis",
16905        default: 200,
16906        maximum: 604800000,
16907        unit: "milliseconds",
16908    },
16909    Limit {
16910        id: "resource_memtable_bytes",
16911        default: 268435456,
16912        maximum: 1125899906842624,
16913        unit: "bytes",
16914    },
16915    Limit {
16916        id: "resource_parallelism",
16917        default: 1,
16918        maximum: 4096,
16919        unit: "workers",
16920    },
16921    Limit {
16922        id: "collection_export_bytes",
16923        default: 268435456,
16924        maximum: 268435456,
16925        unit: "bytes",
16926    },
16927    Limit {
16928        id: "collection_export_documents",
16929        default: 10000,
16930        maximum: 10000,
16931        unit: "documents",
16932    },
16933    Limit {
16934        id: "index_transfer_bytes",
16935        default: 268435456,
16936        maximum: 268435456,
16937        unit: "bytes",
16938    },
16939    Limit {
16940        id: "index_transfer_records",
16941        default: 10000,
16942        maximum: 10000,
16943        unit: "records",
16944    },
16945    Limit {
16946        id: "index_transfer_pages",
16947        default: 7,
16948        maximum: 7,
16949        unit: "pages",
16950    },
16951    Limit {
16952        id: "portability_prefix_bytes",
16953        default: 512,
16954        maximum: 512,
16955        unit: "bytes",
16956    },
16957];
16958#[derive(Clone, Copy, Debug, Eq, PartialEq)]
16959pub enum JsonError {
16960    DuplicateObjectField,
16961    InvalidScalar,
16962}
16963pub fn validate_semantic_json(value: &JsonValue) -> Result<(), JsonError> {
16964    match value {
16965        JsonValue::I64(item) => item.validate().map_err(|_| JsonError::InvalidScalar),
16966        JsonValue::U64(item) => item.validate().map_err(|_| JsonError::InvalidScalar),
16967        JsonValue::ExactDecimal(item) => item.validate().map_err(|_| JsonError::InvalidScalar),
16968        JsonValue::Approximate(item) => item.validate().map_err(|_| JsonError::InvalidScalar),
16969        JsonValue::Array(items) => items.iter().try_for_each(validate_semantic_json),
16970        JsonValue::Object(fields) => {
16971            let mut names = std::collections::BTreeSet::new();
16972            for field in fields {
16973                if !names.insert(field.name.as_str()) {
16974                    return Err(JsonError::DuplicateObjectField);
16975                }
16976                validate_semantic_json(&field.value)?;
16977            }
16978            Ok(())
16979        }
16980        JsonValue::Null | JsonValue::Bool(_) | JsonValue::String(_) => Ok(()),
16981    }
16982}
16983#[cfg(test)]
16984mod tests {
16985    use super::*;
16986    fn assert_fixture<T>(value: &serde_json::Value) -> Result<(), Box<dyn std::error::Error>>
16987    where
16988        T: serde::de::DeserializeOwned + Serialize,
16989    {
16990        let decoded: T = serde_json::from_value(value.clone())?;
16991        assert_eq!(serde_json::to_value(decoded)?, *value);
16992        Ok(())
16993    }
16994    #[test]
16995    fn every_named_type_has_a_canonical_round_trip_fixture() -> Result<(), Box<dyn std::error::Error>> {
16996        let document: serde_json::Value =
16997            serde_json::from_str(include_str!("../../../tests/native-api/closed-schema.json"))?;
16998        assert_eq!(document["spec_sha256"], LODESTONE_API_SPEC_SHA256);
16999        let fixtures = document["named_types"]
17000            .as_object()
17001            .ok_or("named type fixtures are not an object")?;
17002        assert_eq!(fixtures.len(), LODESTONE_API_TYPE_CONTRACTS.len());
17003        for (name, value) in fixtures {
17004            match name.as_str() {
17005                "cursor" => assert_fixture::<Cursor>(value)?,
17006                "locator" => assert_fixture::<Locator>(value)?,
17007                "resource" => assert_fixture::<Resource>(value)?,
17008                "field_promotion_configuration" => assert_fixture::<FieldPromotionConfiguration>(value)?,
17009                "overload_configuration" => assert_fixture::<OverloadConfiguration>(value)?,
17010                "index_policies" => assert_fixture::<IndexPolicies>(value)?,
17011                "maintenance_budgets" => assert_fixture::<MaintenanceBudgets>(value)?,
17012                "resource_durability_class" => assert_fixture::<ResourceDurabilityClass>(value)?,
17013                "resource_storage_class" => assert_fixture::<ResourceStorageClass>(value)?,
17014                "vector_quality_objective" => assert_fixture::<VectorQualityObjective>(value)?,
17015                "vector_indexing_objective" => assert_fixture::<VectorIndexingObjective>(value)?,
17016                "vector_residency_intent" => assert_fixture::<VectorResidencyIntent>(value)?,
17017                "vector_calibration_binding" => assert_fixture::<VectorCalibrationBinding>(value)?,
17018                "vector_resource_policy" => assert_fixture::<VectorResourcePolicy>(value)?,
17019                "workload_class" => assert_fixture::<WorkloadClass>(value)?,
17020                "index_resource_spec" => assert_fixture::<IndexResourceSpec>(value)?,
17021                "index_summary" => assert_fixture::<IndexSummary>(value)?,
17022                "mapping_mode" => assert_fixture::<MappingMode>(value)?,
17023                "dynamic_mapping_policy" => assert_fixture::<DynamicMappingPolicy>(value)?,
17024                "mapping_analyzer" => assert_fixture::<MappingAnalyzer>(value)?,
17025                "keyword_normalizer" => assert_fixture::<KeywordNormalizer>(value)?,
17026                "vector_metric" => assert_fixture::<VectorMetric>(value)?,
17027                "mapping_scalar" => assert_fixture::<MappingScalar>(value)?,
17028                "sparse_vector_weight_type" => assert_fixture::<SparseVectorWeightType>(value)?,
17029                "mapping_field_type" => assert_fixture::<MappingFieldType>(value)?,
17030                "mapping_field" => assert_fixture::<MappingField>(value)?,
17031                "multi_field_projection" => assert_fixture::<MultiFieldProjection>(value)?,
17032                "analyzer_identity" => assert_fixture::<AnalyzerIdentity>(value)?,
17033                "keyword_limit" => assert_fixture::<KeywordLimit>(value)?,
17034                "profile_privacy_action" => assert_fixture::<ProfilePrivacyAction>(value)?,
17035                "profile_privacy_field" => assert_fixture::<ProfilePrivacyField>(value)?,
17036                "profile_privacy_rule" => assert_fixture::<ProfilePrivacyRule>(value)?,
17037                "profile_privacy_policy" => assert_fixture::<ProfilePrivacyPolicy>(value)?,
17038                "mapping_record_model" => assert_fixture::<MappingRecordModel>(value)?,
17039                "mapping" => assert_fixture::<Mapping>(value)?,
17040                "index_detail" => assert_fixture::<IndexDetail>(value)?,
17041                "source_provider" => assert_fixture::<SourceProvider>(value)?,
17042                "source_decoder" => assert_fixture::<SourceDecoder>(value)?,
17043                "source_replay_guarantees" => assert_fixture::<SourceReplayGuarantees>(value)?,
17044                "source_partition_configuration" => assert_fixture::<SourcePartitionConfiguration>(value)?,
17045                "replayable_source_configuration" => assert_fixture::<ReplayableSourceConfiguration>(value)?,
17046                "source_partition_status" => assert_fixture::<SourcePartitionStatus>(value)?,
17047                "replayable_source_status" => assert_fixture::<ReplayableSourceStatus>(value)?,
17048                "source_control_transition" => assert_fixture::<SourceControlTransition>(value)?,
17049                "history_ledger_precondition" => assert_fixture::<HistoryLedgerPrecondition>(value)?,
17050                "history_retention_policy" => assert_fixture::<HistoryRetentionPolicy>(value)?,
17051                "history_selector" => assert_fixture::<HistorySelector>(value)?,
17052                "history_hold" => assert_fixture::<HistoryHold>(value)?,
17053                "history_status" => assert_fixture::<HistoryStatus>(value)?,
17054                "history_resolution" => assert_fixture::<HistoryResolution>(value)?,
17055                "index_reference" => assert_fixture::<IndexReference>(value)?,
17056                "alias_target" => assert_fixture::<AliasTarget>(value)?,
17057                "alias_summary" => assert_fixture::<AliasSummary>(value)?,
17058                "alias_detail" => assert_fixture::<AliasDetail>(value)?,
17059                "data_stream_summary" => assert_fixture::<DataStreamSummary>(value)?,
17060                "component_template_binding" => assert_fixture::<ComponentTemplateBinding>(value)?,
17061                "index_template_binding" => assert_fixture::<IndexTemplateBinding>(value)?,
17062                "lifecycle_policy_binding" => assert_fixture::<LifecyclePolicyBinding>(value)?,
17063                "data_stream_detail" => assert_fixture::<DataStreamDetail>(value)?,
17064                "component_template_summary" => assert_fixture::<ComponentTemplateSummary>(value)?,
17065                "component_template_detail" => assert_fixture::<ComponentTemplateDetail>(value)?,
17066                "index_template_summary" => assert_fixture::<IndexTemplateSummary>(value)?,
17067                "index_template_detail" => assert_fixture::<IndexTemplateDetail>(value)?,
17068                "ingest_pipeline_summary" => assert_fixture::<IngestPipelineSummary>(value)?,
17069                "ingest_pipeline_detail" => assert_fixture::<IngestPipelineDetail>(value)?,
17070                "ingest_pipeline_selection" => assert_fixture::<IngestPipelineSelection>(value)?,
17071                "lifecycle_policy_summary" => assert_fixture::<LifecyclePolicySummary>(value)?,
17072                "rollover_thresholds" => assert_fixture::<RolloverThresholds>(value)?,
17073                "retention_policy" => assert_fixture::<RetentionPolicy>(value)?,
17074                "lifecycle_policy_detail" => assert_fixture::<LifecyclePolicyDetail>(value)?,
17075                "text_query_operator" => assert_fixture::<TextQueryOperator>(value)?,
17076                "text_query_analyzer" => assert_fixture::<TextQueryAnalyzer>(value)?,
17077                "zero_terms_query" => assert_fixture::<ZeroTermsQuery>(value)?,
17078                "text_query_options" => assert_fixture::<TextQueryOptions>(value)?,
17079                "multi_match_mode" => assert_fixture::<MultiMatchMode>(value)?,
17080                "multi_match_field" => assert_fixture::<MultiMatchField>(value)?,
17081                "multi_match_options" => assert_fixture::<MultiMatchOptions>(value)?,
17082                "sort_order" => assert_fixture::<SortOrder>(value)?,
17083                "sort_mode" => assert_fixture::<SortMode>(value)?,
17084                "missing_order" => assert_fixture::<MissingOrder>(value)?,
17085                "nested_score_mode" => assert_fixture::<NestedScoreMode>(value)?,
17086                "nested_inner_hits" => assert_fixture::<NestedInnerHits>(value)?,
17087                "sort_spec" => assert_fixture::<SortSpec>(value)?,
17088                "query" => assert_fixture::<Query>(value)?,
17089                "dense_retrieval_mode" => assert_fixture::<DenseRetrievalMode>(value)?,
17090                "vector_achieved_mode" => assert_fixture::<VectorAchievedMode>(value)?,
17091                "vector_branch_diagnostics" => assert_fixture::<VectorBranchDiagnostics>(value)?,
17092                "dense_vector_element_type" => assert_fixture::<DenseVectorElementType>(value)?,
17093                "dense_vector_byte_order" => assert_fixture::<DenseVectorByteOrder>(value)?,
17094                "vector_value" => assert_fixture::<VectorValue>(value)?,
17095                "sparse_vector_entry" => assert_fixture::<SparseVectorEntry>(value)?,
17096                "sparse_vector_value" => assert_fixture::<SparseVectorValue>(value)?,
17097                "vector_set_value" => assert_fixture::<VectorSetValue>(value)?,
17098                "vector_evaluation_snapshot" => assert_fixture::<VectorEvaluationSnapshot>(value)?,
17099                "vector_evaluation_query_set" => assert_fixture::<VectorEvaluationQuerySet>(value)?,
17100                "vector_evaluation_budget" => assert_fixture::<VectorEvaluationBudget>(value)?,
17101                "vector_candidate_policy" => assert_fixture::<VectorCandidatePolicy>(value)?,
17102                "vector_calibration_objective" => assert_fixture::<VectorCalibrationObjective>(value)?,
17103                "vector_strategy_profile" => assert_fixture::<VectorStrategyProfile>(value)?,
17104                "vector_evaluation_work" => assert_fixture::<VectorEvaluationWork>(value)?,
17105                "vector_evaluation_error_code" => assert_fixture::<VectorEvaluationErrorCode>(value)?,
17106                "vector_evaluation_error" => assert_fixture::<VectorEvaluationError>(value)?,
17107                "vector_recall_result" => assert_fixture::<VectorRecallResult>(value)?,
17108                "vector_calibration_candidate" => assert_fixture::<VectorCalibrationCandidate>(value)?,
17109                "vector_calibration_result" => assert_fixture::<VectorCalibrationResult>(value)?,
17110                "vector_diagnostic_result" => assert_fixture::<VectorDiagnosticResult>(value)?,
17111                "vector_warm_component" => assert_fixture::<VectorWarmComponent>(value)?,
17112                "vector_warm_state" => assert_fixture::<VectorWarmState>(value)?,
17113                "vector_warm_achievement" => assert_fixture::<VectorWarmAchievement>(value)?,
17114                "vector_warm_result" => assert_fixture::<VectorWarmResult>(value)?,
17115                "dense_retrieval_threshold" => assert_fixture::<DenseRetrievalThreshold>(value)?,
17116                "retrieval_branch" => assert_fixture::<RetrievalBranch>(value)?,
17117                "weighted_rrf_fusion" => assert_fixture::<WeightedRrfFusion>(value)?,
17118                "retrieval_plan" => assert_fixture::<RetrievalPlan>(value)?,
17119                "histogram_bounds" => assert_fixture::<HistogramBounds>(value)?,
17120                "date_histogram_bounds" => assert_fixture::<DateHistogramBounds>(value)?,
17121                "approximation_algorithm" => assert_fixture::<ApproximationAlgorithm>(value)?,
17122                "approximation" => assert_fixture::<Approximation>(value)?,
17123                "percentile_value" => assert_fixture::<PercentileValue>(value)?,
17124                "approximate_percentile_value" => assert_fixture::<ApproximatePercentileValue>(value)?,
17125                "time_series_operator" => assert_fixture::<TimeSeriesOperator>(value)?,
17126                "time_series_missing_data" => assert_fixture::<TimeSeriesMissingData>(value)?,
17127                "time_series_quantile_mode" => assert_fixture::<TimeSeriesQuantileMode>(value)?,
17128                "time_series_bucket_state" => assert_fixture::<TimeSeriesBucketState>(value)?,
17129                "time_series_quantile_value" => assert_fixture::<TimeSeriesQuantileValue>(value)?,
17130                "time_series_value" => assert_fixture::<TimeSeriesValue>(value)?,
17131                "time_series_bucket" => assert_fixture::<TimeSeriesBucket>(value)?,
17132                "relationship_traversal_direction" => assert_fixture::<RelationshipTraversalDirection>(value)?,
17133                "relationship_traversal_filter" => assert_fixture::<RelationshipTraversalFilter>(value)?,
17134                "relationship_traversal_budget" => assert_fixture::<RelationshipTraversalBudget>(value)?,
17135                "traversed_relationship" => assert_fixture::<TraversedRelationship>(value)?,
17136                "profile_query_operation" => assert_fixture::<ProfileQueryOperation>(value)?,
17137                "profile_group_by" => assert_fixture::<ProfileGroupBy>(value)?,
17138                "profile_query_filter" => assert_fixture::<ProfileQueryFilter>(value)?,
17139                "profile_query_budget" => assert_fixture::<ProfileQueryBudget>(value)?,
17140                "profile_query_row" => assert_fixture::<ProfileQueryRow>(value)?,
17141                "temporal_input" => assert_fixture::<TemporalInput>(value)?,
17142                "temporal_pattern" => assert_fixture::<TemporalPattern>(value)?,
17143                "historical_temporal_definition" => assert_fixture::<HistoricalTemporalDefinition>(value)?,
17144                "temporal_evidence_status" => assert_fixture::<TemporalEvidenceStatus>(value)?,
17145                "temporal_source_event" => assert_fixture::<TemporalSourceEvent>(value)?,
17146                "temporal_evidence" => assert_fixture::<TemporalEvidence>(value)?,
17147                "continuous_temporal_start" => assert_fixture::<ContinuousTemporalStart>(value)?,
17148                "continuous_temporal_watermark_policy" => assert_fixture::<ContinuousTemporalWatermarkPolicy>(value)?,
17149                "continuous_temporal_late_data_policy" => assert_fixture::<ContinuousTemporalLateDataPolicy>(value)?,
17150                "continuous_temporal_output" => assert_fixture::<ContinuousTemporalOutput>(value)?,
17151                "continuous_temporal_definition" => assert_fixture::<ContinuousTemporalDefinition>(value)?,
17152                "continuous_temporal_frontier" => assert_fixture::<ContinuousTemporalFrontier>(value)?,
17153                "continuous_temporal_available_frontier" => {
17154                    assert_fixture::<ContinuousTemporalAvailableFrontier>(value)?
17155                }
17156                "continuous_temporal_gap_reason" => assert_fixture::<ContinuousTemporalGapReason>(value)?,
17157                "continuous_temporal_gap" => assert_fixture::<ContinuousTemporalGap>(value)?,
17158                "continuous_temporal_evaluation" => assert_fixture::<ContinuousTemporalEvaluation>(value)?,
17159                "composite_order" => assert_fixture::<CompositeOrder>(value)?,
17160                "composite_source" => assert_fixture::<CompositeSource>(value)?,
17161                "aggregation" => assert_fixture::<Aggregation>(value)?,
17162                "nested_search_hit" => assert_fixture::<NestedSearchHit>(value)?,
17163                "named_nested_inner_hits_result" => assert_fixture::<NamedNestedInnerHitsResult>(value)?,
17164                "fragment_boundary" => assert_fixture::<FragmentBoundary>(value)?,
17165                "fragment_offset_encoding" => assert_fixture::<FragmentOffsetEncoding>(value)?,
17166                "fragment_ranker" => assert_fixture::<FragmentRanker>(value)?,
17167                "fragment_request" => assert_fixture::<FragmentRequest>(value)?,
17168                "search_fragment" => assert_fixture::<SearchFragment>(value)?,
17169                "numeric_feature_transform" => assert_fixture::<NumericFeatureTransform>(value)?,
17170                "numeric_result_feature" => assert_fixture::<NumericResultFeature>(value)?,
17171                "result_feature_request" => assert_fixture::<ResultFeatureRequest>(value)?,
17172                "result_diversification" => assert_fixture::<ResultDiversification>(value)?,
17173                "source_projection" => assert_fixture::<SourceProjection>(value)?,
17174                "branch_score_kind" => assert_fixture::<BranchScoreKind>(value)?,
17175                "result_feature" => assert_fixture::<ResultFeature>(value)?,
17176                "search_hit" => assert_fixture::<SearchHit>(value)?,
17177                "aggregation_bucket" => assert_fixture::<AggregationBucket>(value)?,
17178                "aggregation_result" => assert_fixture::<AggregationResult>(value)?,
17179                "shard_counts" => assert_fixture::<ShardCounts>(value)?,
17180                "total_hits_relation" => assert_fixture::<TotalHitsRelation>(value)?,
17181                "search_total" => assert_fixture::<SearchTotal>(value)?,
17182                "search_execution_freshness" => assert_fixture::<SearchExecutionFreshness>(value)?,
17183                "search_freshness" => assert_fixture::<SearchFreshness>(value)?,
17184                "search_degradation_reason" => assert_fixture::<SearchDegradationReason>(value)?,
17185                "search_achievement" => assert_fixture::<SearchAchievement>(value)?,
17186                "search_failure_stage" => assert_fixture::<SearchFailureStage>(value)?,
17187                "search_failure_reason" => assert_fixture::<SearchFailureReason>(value)?,
17188                "collection_shard" => assert_fixture::<CollectionShard>(value)?,
17189                "search_partial_failure" => assert_fixture::<SearchPartialFailure>(value)?,
17190                "artifact" => assert_fixture::<Artifact>(value)?,
17191                "portability_storage_capability" => assert_fixture::<PortabilityStorageCapability>(value)?,
17192                "collection_export_artifact" => assert_fixture::<CollectionExportArtifact>(value)?,
17193                "index_transfer_page" => assert_fixture::<IndexTransferPage>(value)?,
17194                "index_transfer_artifact" => assert_fixture::<IndexTransferArtifact>(value)?,
17195                "search_validation_bound" => assert_fixture::<SearchValidationBound>(value)?,
17196                "search_validation_estimates" => assert_fixture::<SearchValidationEstimates>(value)?,
17197                "search_validation_limit" => assert_fixture::<SearchValidationLimit>(value)?,
17198                "operation_kind" => assert_fixture::<OperationKind>(value)?,
17199                "operation_authority" => assert_fixture::<OperationAuthority>(value)?,
17200                "operation_target" => assert_fixture::<OperationTarget>(value)?,
17201                "operation_state" => assert_fixture::<OperationState>(value)?,
17202                "operation_pending_state" => assert_fixture::<OperationPendingState>(value)?,
17203                "operation_progress_unit" => assert_fixture::<OperationProgressUnit>(value)?,
17204                "operation_progress" => assert_fixture::<OperationProgress>(value)?,
17205                "operation_result" => assert_fixture::<OperationResult>(value)?,
17206                "operation_failure" => assert_fixture::<OperationFailure>(value)?,
17207                "operation_cancellation" => assert_fixture::<OperationCancellation>(value)?,
17208                "operation_retention_state" => assert_fixture::<OperationRetentionState>(value)?,
17209                "operation_retention" => assert_fixture::<OperationRetention>(value)?,
17210                "operation" => assert_fixture::<Operation>(value)?,
17211                "write_durability_boundary" => assert_fixture::<WriteDurabilityBoundary>(value)?,
17212                "write_visibility_mode" => assert_fixture::<WriteVisibilityMode>(value)?,
17213                "write_response_stage" => assert_fixture::<WriteResponseStage>(value)?,
17214                "write_achievement" => assert_fixture::<WriteAchievement>(value)?,
17215                "mutation_commit_position" => assert_fixture::<MutationCommitPosition>(value)?,
17216                "mutation_commit_receipt" => assert_fixture::<MutationCommitReceipt>(value)?,
17217                "mutation_resolver" => assert_fixture::<MutationResolver>(value)?,
17218                "mutation_outcome" => assert_fixture::<MutationOutcome>(value)?,
17219                "submission_state" => assert_fixture::<SubmissionState>(value)?,
17220                "expected_binding" => assert_fixture::<ExpectedBinding>(value)?,
17221                "administration_alias_action" => assert_fixture::<AdministrationAliasAction>(value)?,
17222                "administration_mutation" => assert_fixture::<AdministrationMutation>(value)?,
17223                "administration_outcome" => assert_fixture::<AdministrationOutcome>(value)?,
17224                "index_change_apply_receipt" => assert_fixture::<IndexChangeApplyReceipt>(value)?,
17225                "bulk_document_item" => assert_fixture::<BulkDocumentItem>(value)?,
17226                "bulk_document_item_outcome" => assert_fixture::<BulkDocumentItemOutcome>(value)?,
17227                "bulk_document_outcome" => assert_fixture::<BulkDocumentOutcome>(value)?,
17228                "metric_attribute_value" => assert_fixture::<MetricAttributeValue>(value)?,
17229                "metric_attribute" => assert_fixture::<MetricAttribute>(value)?,
17230                "metric_number" => assert_fixture::<MetricNumber>(value)?,
17231                "metric_temporality" => assert_fixture::<MetricTemporality>(value)?,
17232                "metric_point_kind" => assert_fixture::<MetricPointKind>(value)?,
17233                "metric_exponential_buckets" => assert_fixture::<MetricExponentialBuckets>(value)?,
17234                "metric_data" => assert_fixture::<MetricData>(value)?,
17235                "metric_instrumentation_scope" => assert_fixture::<MetricInstrumentationScope>(value)?,
17236                "metric_exemplar" => assert_fixture::<MetricExemplar>(value)?,
17237                "metric_point" => assert_fixture::<MetricPoint>(value)?,
17238                "entity_ref" => assert_fixture::<EntityRef>(value)?,
17239                "relationship_evidence_ref" => assert_fixture::<RelationshipEvidenceRef>(value)?,
17240                "relationship_directionality" => assert_fixture::<RelationshipDirectionality>(value)?,
17241                "relationship_record" => assert_fixture::<RelationshipRecord>(value)?,
17242                "profile_label" => assert_fixture::<ProfileLabel>(value)?,
17243                "profile_sample_type" => assert_fixture::<ProfileSampleType>(value)?,
17244                "profile_mapping" => assert_fixture::<ProfileMapping>(value)?,
17245                "profile_function" => assert_fixture::<ProfileFunction>(value)?,
17246                "profile_line" => assert_fixture::<ProfileLine>(value)?,
17247                "profile_location" => assert_fixture::<ProfileLocation>(value)?,
17248                "profile_stack" => assert_fixture::<ProfileStack>(value)?,
17249                "profile_sample" => assert_fixture::<ProfileSample>(value)?,
17250                "profile_instrumentation_scope" => assert_fixture::<ProfileInstrumentationScope>(value)?,
17251                "profile_batch" => assert_fixture::<ProfileBatch>(value)?,
17252                "native_record" => assert_fixture::<NativeRecord>(value)?,
17253                "retained_append_item" => assert_fixture::<RetainedAppendItem>(value)?,
17254                "retained_append_state" => assert_fixture::<RetainedAppendState>(value)?,
17255                "retained_append_retry_safety" => assert_fixture::<RetainedAppendRetrySafety>(value)?,
17256                "retained_append_item_outcome" => assert_fixture::<RetainedAppendItemOutcome>(value)?,
17257                "retained_append_bulk_outcome" => assert_fixture::<RetainedAppendBulkOutcome>(value)?,
17258                "retained_append_observation_state" => assert_fixture::<RetainedAppendObservationState>(value)?,
17259                "retained_append_observation_outcome" => assert_fixture::<RetainedAppendObservationOutcome>(value)?,
17260                "binary_value" => assert_fixture::<BinaryValue>(value)?,
17261                "state_hash_field" => assert_fixture::<StateHashField>(value)?,
17262                "state_set_entry" => assert_fixture::<StateSetEntry>(value)?,
17263                "state_set_condition" => assert_fixture::<StateSetCondition>(value)?,
17264                "state_operation" => assert_fixture::<StateOperation>(value)?,
17265                "state_optional_value" => assert_fixture::<StateOptionalValue>(value)?,
17266                "state_command_result" => assert_fixture::<StateCommandResult>(value)?,
17267                "state_write_resolution" => assert_fixture::<StateWriteResolution>(value)?,
17268                "service_credential_reservation" => assert_fixture::<ServiceCredentialReservation>(value)?,
17269                "subscription_metadata_field" => assert_fixture::<SubscriptionMetadataField>(value)?,
17270                "subscription_field" => assert_fixture::<SubscriptionField>(value)?,
17271                "subscription_filter" => assert_fixture::<SubscriptionFilter>(value)?,
17272                "subscription_cursor_entry" => assert_fixture::<SubscriptionCursorEntry>(value)?,
17273                "subscription_route" => assert_fixture::<SubscriptionRoute>(value)?,
17274                "subscription_start_position" => assert_fixture::<SubscriptionStartPosition>(value)?,
17275                "subscription_start" => assert_fixture::<SubscriptionStart>(value)?,
17276                "subscription_accepted" => assert_fixture::<SubscriptionAccepted>(value)?,
17277                "subscription_writer_fence" => assert_fixture::<SubscriptionWriterFence>(value)?,
17278                "subscription_event" => assert_fixture::<SubscriptionEvent>(value)?,
17279                "subscription_heartbeat" => assert_fixture::<SubscriptionHeartbeat>(value)?,
17280                "subscription_gap" => assert_fixture::<SubscriptionGap>(value)?,
17281                "subscription_terminal_reason" => assert_fixture::<SubscriptionTerminalReason>(value)?,
17282                "subscription_terminal" => assert_fixture::<SubscriptionTerminal>(value)?,
17283                "subscription_frame" => assert_fixture::<SubscriptionFrame>(value)?,
17284                "stream_binding" => assert_fixture::<StreamBinding>(value)?,
17285                "capability_grant" => assert_fixture::<CapabilityGrant>(value)?,
17286                "protocol_limit" => assert_fixture::<ProtocolLimit>(value)?,
17287                "document_mutation_condition" => assert_fixture::<DocumentMutationCondition>(value)?,
17288                "audit_adapter" => assert_fixture::<AuditAdapter>(value)?,
17289                "audit_decision" => assert_fixture::<AuditDecision>(value)?,
17290                "audit_outcome" => assert_fixture::<AuditOutcome>(value)?,
17291                "audit_detail" => assert_fixture::<AuditDetail>(value)?,
17292                "audit_gap_reason" => assert_fixture::<AuditGapReason>(value)?,
17293                "audit_event" => assert_fixture::<AuditEvent>(value)?,
17294                "audit_gap" => assert_fixture::<AuditGap>(value)?,
17295                "audit_stream_state" => assert_fixture::<AuditStreamState>(value)?,
17296                "service_credential_grant" => assert_fixture::<ServiceCredentialGrant>(value)?,
17297                "service_credential_summary" => assert_fixture::<ServiceCredentialSummary>(value)?,
17298                "security_role" => assert_fixture::<SecurityRole>(value)?,
17299                "role_append_scope_change" => assert_fixture::<RoleAppendScopeChange>(value)?,
17300                "role_append_access_preparation" => assert_fixture::<RoleAppendAccessPreparation>(value)?,
17301                "security_action_outcome" => assert_fixture::<SecurityActionOutcome>(value)?,
17302                "maintenance_work_state" => assert_fixture::<MaintenanceWorkState>(value)?,
17303                "maintenance_attempt_state" => assert_fixture::<MaintenanceAttemptState>(value)?,
17304                "maintenance_failure_class" => assert_fixture::<MaintenanceFailureClass>(value)?,
17305                "maintenance_failure_class_count" => assert_fixture::<MaintenanceFailureClassCount>(value)?,
17306                "maintenance_attempt_observation" => assert_fixture::<MaintenanceAttemptObservation>(value)?,
17307                "maintenance_task_scope" => assert_fixture::<MaintenanceTaskScope>(value)?,
17308                "maintenance_task_status" => assert_fixture::<MaintenanceTaskStatus>(value)?,
17309                "maintenance_status_aggregate" => assert_fixture::<MaintenanceStatusAggregate>(value)?,
17310                "runtime_status_detail" => assert_fixture::<RuntimeStatusDetail>(value)?,
17311                "result_cache_status" => assert_fixture::<ResultCacheStatus>(value)?,
17312                "field_promotion_status" => assert_fixture::<FieldPromotionStatus>(value)?,
17313                "overload_shard_status" => assert_fixture::<OverloadShardStatus>(value)?,
17314                "external_key_binding" => assert_fixture::<ExternalKeyBinding>(value)?,
17315                "rollup_measure" => assert_fixture::<RollupMeasure>(value)?,
17316                "aggregate_then_delete_policy" => assert_fixture::<AggregateThenDeletePolicy>(value)?,
17317                "lifecycle_binding_status" => assert_fixture::<LifecycleBindingStatus>(value)?,
17318                "lifecycle_rollup_status" => assert_fixture::<LifecycleRollupStatus>(value)?,
17319                "lifecycle_status" => assert_fixture::<LifecycleStatus>(value)?,
17320                "quota_limit" => assert_fixture::<QuotaLimit>(value)?,
17321                "quota_consumption" => assert_fixture::<QuotaConsumption>(value)?,
17322                "quota_update" => assert_fixture::<QuotaUpdate>(value)?,
17323                "storage_overall_posture" => assert_fixture::<StorageOverallPosture>(value)?,
17324                "storage_profile_role" => assert_fixture::<StorageProfileRole>(value)?,
17325                "storage_provider_posture" => assert_fixture::<StorageProviderPosture>(value)?,
17326                "storage_backend_service_class" => assert_fixture::<StorageBackendServiceClass>(value)?,
17327                "storage_profile_role_binding" => assert_fixture::<StorageProfileRoleBinding>(value)?,
17328                "storage_profile_attestation" => assert_fixture::<StorageProfileAttestation>(value)?,
17329                "storage_profile_expectation" => assert_fixture::<StorageProfileExpectation>(value)?,
17330                "core_binding" => assert_fixture::<CoreBinding>(value)?,
17331                "readiness_observation" => assert_fixture::<ReadinessObservation>(value)?,
17332                "usage_dimension" => assert_fixture::<UsageDimension>(value)?,
17333                "physical_usage_value" => assert_fixture::<PhysicalUsageValue>(value)?,
17334                "core_usage_units" => assert_fixture::<CoreUsageUnits>(value)?,
17335                "core_usage_correction" => assert_fixture::<CoreUsageCorrection>(value)?,
17336                "response_meta" => assert_fixture::<ResponseMeta>(value)?,
17337                "error_disposition" => assert_fixture::<ErrorDisposition>(value)?,
17338                "recovery_action" => assert_fixture::<RecoveryAction>(value)?,
17339                "limit_class" => assert_fixture::<LimitClass>(value)?,
17340                "error_detail" => assert_fixture::<ErrorDetail>(value)?,
17341                "connection_profile" => assert_fixture::<ConnectionProfile>(value)?,
17342                _ => return Err("fixture names an unknown generated type".into()),
17343            }
17344        }
17345        Ok(())
17346    }
17347    #[test]
17348    fn every_aggregation_variant_has_a_canonical_fixture() -> Result<(), Box<dyn std::error::Error>> {
17349        let document: serde_json::Value =
17350            serde_json::from_str(include_str!("../../../tests/native-api/closed-schema.json"))?;
17351        let fixtures = document["aggregation_variants"]
17352            .as_object()
17353            .ok_or("aggregation fixtures are not an object")?;
17354        assert_eq!(fixtures.len(), 17);
17355        for value in fixtures.values() {
17356            assert_fixture::<Aggregation>(value)?;
17357        }
17358        Ok(())
17359    }
17360    #[test]
17361    fn every_versioned_union_variant_has_a_canonical_fixture() -> Result<(), Box<dyn std::error::Error>> {
17362        let document: serde_json::Value =
17363            serde_json::from_str(include_str!("../../../tests/native-api/closed-schema.json"))?;
17364        let fixtures = document["versioned_union_variants"]
17365            .as_object()
17366            .ok_or("versioned union fixtures are not an object")?;
17367        assert_eq!(fixtures.len(), 6);
17368        for (name, value) in fixtures {
17369            match name.as_str() {
17370                "mapping_field_type.vector" => assert_fixture::<MappingFieldType>(value)?,
17371                "mapping_field_type.sparse_vector" => assert_fixture::<MappingFieldType>(value)?,
17372                "mapping_field_type.vector_set" => assert_fixture::<MappingFieldType>(value)?,
17373                "mapping_record_model.metric_v1" => assert_fixture::<MappingRecordModel>(value)?,
17374                "mapping_record_model.relationship_v1" => assert_fixture::<MappingRecordModel>(value)?,
17375                "mapping_record_model.profile_v1" => assert_fixture::<MappingRecordModel>(value)?,
17376                _ => return Err("fixture names an unknown versioned union variant".into()),
17377            }
17378        }
17379        Ok(())
17380    }
17381    #[test]
17382    fn exact_scalar_canonicality_is_closed() {
17383        assert_eq!(
17384            U64 {
17385                value: u64::MAX.to_string()
17386            }
17387            .validate(),
17388            Ok(())
17389        );
17390        assert_eq!(
17391            I64 {
17392                value: i64::MIN.to_string()
17393            }
17394            .validate(),
17395            Ok(())
17396        );
17397        assert_eq!(U64 { value: "01".to_owned() }.validate(), Err(ScalarError::InvalidU64));
17398        assert_eq!(
17399            ExactDecimal {
17400                coefficient: "12345".to_owned(),
17401                scale: 2
17402            }
17403            .validate(),
17404            Ok(())
17405        );
17406        assert_eq!(
17407            ExactDecimal {
17408                coefficient: "123450".to_owned(),
17409                scale: 3
17410            }
17411            .validate(),
17412            Err(ScalarError::InvalidDecimal)
17413        );
17414        assert_eq!(
17415            ExactDecimal {
17416                coefficient: "1".to_owned(),
17417                scale: 1_025
17418            }
17419            .validate(),
17420            Err(ScalarError::InvalidDecimal)
17421        );
17422    }
17423    #[test]
17424    fn scalar_decoders_refuse_numbers_and_noncanonical_strings() {
17425        assert!(serde_json::from_str::<U64>("9007199254740993").is_err());
17426        assert!(serde_json::from_str::<U64>(r#""01""#).is_err());
17427        assert!(serde_json::from_str::<Identity>(r#""0123456789ABCDEF0123456789ABCDEF""#).is_err());
17428        assert!(serde_json::from_str::<Digest>(r#""0123456789abcdef0123456789abcdef""#).is_err());
17429        assert!(serde_json::from_str::<ExactDecimal>(r#"{"coefficient":"123450","scale":3}"#).is_err());
17430        assert!(serde_json::from_str::<ApproximateNumber>(r#""1.0""#).is_err());
17431    }
17432    #[test]
17433    fn semantic_json_rejects_duplicate_fields() {
17434        let value = JsonValue::Object(vec![
17435            JsonField {
17436                name: "x".to_owned(),
17437                value: JsonValue::Null,
17438            },
17439            JsonField {
17440                name: "x".to_owned(),
17441                value: JsonValue::Bool(true),
17442            },
17443        ]);
17444        assert_eq!(validate_semantic_json(&value), Err(JsonError::DuplicateObjectField));
17445    }
17446    #[test]
17447    fn strict_generated_shapes_refuse_malformed_duplicate_unknown_field_and_tag() {
17448        assert!(serde_json::from_str::<DiscoverRequest>(r#"{"unexpected":true}"#).is_err());
17449        assert!(serde_json::from_str::<Cursor>(r#"{"value":"a","value":"b"}"#).is_err());
17450        assert!(serde_json::from_str::<Query>(r#"{"kind":"future_query"}"#).is_err());
17451        assert!(serde_json::from_str::<Cursor>(r#"{"value":1}"#).is_err());
17452    }
17453    fn admitted_error_detail(code: ErrorCode) -> ErrorDetail {
17454        match code {
17455            ErrorCode::Aborted => ErrorDetail::Aborted {
17456                reason: "test".to_owned(),
17457            },
17458            ErrorCode::DeadlineExceeded => ErrorDetail::DeadlineExceeded,
17459            ErrorCode::InvalidRequest => ErrorDetail::InvalidRequest {
17460                field: None,
17461                reason: "test".to_owned(),
17462            },
17463            ErrorCode::UnsupportedVersion => ErrorDetail::UnsupportedVersion {
17464                observed: 1,
17465                maximum_supported: 1,
17466            },
17467            ErrorCode::Unauthenticated => ErrorDetail::Unauthenticated,
17468            ErrorCode::PermissionDenied => ErrorDetail::PermissionDenied {
17469                action: None,
17470                workload_class: None,
17471            },
17472            ErrorCode::NotFound => ErrorDetail::NotFound { resource: None },
17473            ErrorCode::Conflict => ErrorDetail::Conflict {
17474                expected_revision: None,
17475                observed_revision: None,
17476            },
17477            ErrorCode::StaleCursor => ErrorDetail::StaleCursor { restart_count: 0 },
17478            ErrorCode::RestartBudgetExhausted => ErrorDetail::RestartBudgetExhausted { maximum_restarts: 0 },
17479            ErrorCode::LimitExceeded => ErrorDetail::LimitExceeded {
17480                class: LimitClass::RequestBound,
17481                limit_id: "test".to_owned(),
17482                maximum: U64 { value: "0".to_owned() },
17483            },
17484            ErrorCode::CapabilityUnavailable => ErrorDetail::CapabilityUnavailable { capability: None },
17485            ErrorCode::NotSubmitted => ErrorDetail::NotSubmitted {
17486                retry_after_millis: None,
17487            },
17488            ErrorCode::SubmittedIndeterminate => ErrorDetail::SubmittedIndeterminate { locator: None },
17489            ErrorCode::ExpiredUnknown => ErrorDetail::ExpiredUnknown { locator: None },
17490            ErrorCode::SecretNotEscrowed => ErrorDetail::SecretNotEscrowed,
17491            ErrorCode::RetentionGap => ErrorDetail::RetentionGap {
17492                retired_through: U64 { value: "0".to_owned() },
17493            },
17494            ErrorCode::ArtifactRangeInvalid => ErrorDetail::ArtifactRangeInvalid {
17495                maximum_bytes: U64 { value: "0".to_owned() },
17496            },
17497            ErrorCode::ChecksumMismatch => ErrorDetail::ChecksumMismatch {
17498                expected: Digest { value: "0".repeat(64) },
17499                observed: Digest { value: "0".repeat(64) },
17500            },
17501            ErrorCode::TemporarilyUnavailable => ErrorDetail::TemporarilyUnavailable {
17502                retry_after_millis: None,
17503            },
17504            ErrorCode::Internal => ErrorDetail::Internal,
17505        }
17506    }
17507    #[test]
17508    fn every_admitted_error_outcome_is_constructible_and_invalid_combinations_fail_closed() {
17509        let mut codes = std::collections::BTreeSet::new();
17510        for contract in LODESTONE_API_ERROR_OUTCOMES {
17511            codes.insert(format!("{:?}", contract.code));
17512            assert_eq!(
17513                ErrorBody::try_new(
17514                    contract.code,
17515                    "test".to_owned(),
17516                    contract.disposition,
17517                    contract.recovery,
17518                    admitted_error_detail(contract.code)
17519                ),
17520                Ok(ErrorBody {
17521                    code: contract.code,
17522                    message: "test".to_owned(),
17523                    disposition: contract.disposition,
17524                    recovery: contract.recovery,
17525                    details: admitted_error_detail(contract.code)
17526                })
17527            );
17528        }
17529        assert_eq!(codes.len(), 21);
17530        assert_eq!(
17531            ErrorBody::try_new(
17532                ErrorCode::Aborted,
17533                "test".to_owned(),
17534                ErrorDisposition::NotSubmitted,
17535                RecoveryAction::Stop,
17536                admitted_error_detail(ErrorCode::Aborted)
17537            ),
17538            Err(ErrorShapeError::OutcomeMismatch)
17539        );
17540        assert_eq!(
17541            ErrorBody::try_new(
17542                ErrorCode::Aborted,
17543                "test".to_owned(),
17544                ErrorDisposition::NotSubmitted,
17545                RecoveryAction::Retry,
17546                ErrorDetail::Internal
17547            ),
17548            Err(ErrorShapeError::DetailCodeMismatch)
17549        );
17550        assert_eq!(
17551            ErrorBody::try_new(
17552                ErrorCode::TemporarilyUnavailable,
17553                "test".to_owned(),
17554                ErrorDisposition::NotSubmitted,
17555                RecoveryAction::RetryAfter,
17556                ErrorDetail::TemporarilyUnavailable {
17557                    retry_after_millis: Some(U64 {
17558                        value: "60001".to_owned()
17559                    })
17560                }
17561            ),
17562            Err(ErrorShapeError::RetryAfterOutOfRange)
17563        );
17564    }
17565    #[test]
17566    fn registries_match_the_idl() {
17567        assert_eq!(LODESTONE_API_COMMAND_CONTRACTS.len(), 120);
17568        assert_eq!(LODESTONE_API_COMMAND_SEMANTICS.len(), 120);
17569        assert_eq!(LODESTONE_API_COMMAND_OUTCOMES.len(), 120);
17570        assert_eq!(LODESTONE_API_ERROR_CODES.len(), 21);
17571        assert_eq!(LODESTONE_API_ERROR_OUTCOMES.len(), 28);
17572        assert_eq!(LODESTONE_API_TYPE_CONTRACTS.len(), 335);
17573        assert_eq!(LODESTONE_API_STREAM_CONTRACTS.len(), 1);
17574        assert_eq!(LODESTONE_API_LIMITS.len(), 118);
17575        assert_eq!(LODESTONE_API_CLUSTER_CONTROL_ACTIONS.len(), 23);
17576        assert_eq!(LODESTONE_API_CLUSTER_CONTROL_TYPES.len(), 10);
17577    }
17578    #[test]
17579    fn mutation_outcome_metadata_matches_submission_boundaries() {
17580        for (command, outcome) in LODESTONE_API_COMMAND_CONTRACTS
17581            .iter()
17582            .zip(LODESTONE_API_COMMAND_OUTCOMES)
17583        {
17584            assert_eq!(command.command, outcome.command);
17585            let submits = !matches!(command.mutation, "read_only" | "read_only_prepare" | "catalog_prepare");
17586            assert_eq!(outcome.possible_submission_states.contains(&"submitted"), submits);
17587            assert_eq!(outcome.possible_submission_states.contains(&"indeterminate"), submits);
17588            assert_eq!(
17589                outcome.cancellation == "per_call_until_submission_then_resolve",
17590                submits
17591            );
17592        }
17593        for command in [
17594            Command::ReserveServiceCredential,
17595            Command::ReserveServiceCredentialRotation,
17596        ] {
17597            let outcome = LODESTONE_API_COMMAND_OUTCOMES
17598                .iter()
17599                .find(|outcome| outcome.command == command);
17600            assert!(
17601                matches!(outcome, Some(value) if value.identity_requirement == "caller_action_id" && value.resolver_command == Some(Command::ResolveServiceCredentialReservation))
17602            );
17603        }
17604    }
17605}