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 = "fd387adc8a4681f8f46af69a265fcf8841f68a935717474337e99e341ef545a1";
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 = 1;
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    pub source: RawJson,
2832    pub sort: Vec<JsonValue>,
2833}
2834
2835pub const LODESTONE_API_NAMED_NESTED_INNER_HITS_RESULT_FORMAT_VERSION: u16 = 1;
2836#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
2837#[serde(deny_unknown_fields)]
2838pub struct NamedNestedInnerHitsResult {
2839    pub name: String,
2840    pub total: U64,
2841    pub hits: Vec<NestedSearchHit>,
2842}
2843
2844pub const LODESTONE_API_FRAGMENT_BOUNDARY_FORMAT_VERSION: u16 = 1;
2845#[derive(Clone, Copy, Debug, Deserialize, Eq, PartialEq, Serialize)]
2846#[serde(rename_all = "snake_case")]
2847pub enum FragmentBoundary {
2848    Word,
2849    Sentence,
2850    Paragraph,
2851    WholeField,
2852}
2853
2854pub const LODESTONE_API_FRAGMENT_OFFSET_ENCODING_FORMAT_VERSION: u16 = 1;
2855#[derive(Clone, Copy, Debug, Deserialize, Eq, PartialEq, Serialize)]
2856#[serde(rename_all = "snake_case")]
2857pub enum FragmentOffsetEncoding {
2858    Utf8Bytes,
2859    Utf16CodeUnits,
2860    UnicodeCodepoints,
2861}
2862
2863pub const LODESTONE_API_FRAGMENT_RANKER_FORMAT_VERSION: u16 = 1;
2864#[derive(Clone, Copy, Debug, Deserialize, Eq, PartialEq, Serialize)]
2865#[serde(rename_all = "snake_case")]
2866pub enum FragmentRanker {
2867    LexicalMatchCountV1,
2868}
2869
2870pub const LODESTONE_API_FRAGMENT_REQUEST_FORMAT_VERSION: u16 = 1;
2871#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
2872#[serde(deny_unknown_fields)]
2873pub struct FragmentRequest {
2874    pub fields: Vec<String>,
2875    pub max_fragment_bytes: u32,
2876    pub max_fragments: u32,
2877    pub boundary: FragmentBoundary,
2878    pub offset_encoding: FragmentOffsetEncoding,
2879    pub ranker: FragmentRanker,
2880}
2881
2882pub const LODESTONE_API_SEARCH_FRAGMENT_FORMAT_VERSION: u16 = 1;
2883#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
2884#[serde(deny_unknown_fields)]
2885pub struct SearchFragment {
2886    pub field: String,
2887    pub text: String,
2888    pub start: u32,
2889    pub end: u32,
2890    pub offset_encoding: FragmentOffsetEncoding,
2891    pub rank: u32,
2892    pub match_count: u32,
2893    pub truncated: bool,
2894    pub partial: bool,
2895}
2896
2897pub const LODESTONE_API_NUMERIC_FEATURE_TRANSFORM_FORMAT_VERSION: u16 = 1;
2898#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
2899#[serde(tag = "kind", rename_all = "snake_case", deny_unknown_fields)]
2900pub enum NumericFeatureTransform {
2901    Identity,
2902    Log1p,
2903    Clamp {
2904        minimum: ApproximateNumber,
2905        maximum: ApproximateNumber,
2906    },
2907}
2908
2909pub const LODESTONE_API_NUMERIC_RESULT_FEATURE_FORMAT_VERSION: u16 = 1;
2910#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
2911#[serde(deny_unknown_fields)]
2912pub struct NumericResultFeature {
2913    pub name: String,
2914    pub field: String,
2915    pub transform: NumericFeatureTransform,
2916}
2917
2918pub const LODESTONE_API_RESULT_FEATURE_REQUEST_FORMAT_VERSION: u16 = 1;
2919#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
2920#[serde(deny_unknown_fields)]
2921pub struct ResultFeatureRequest {
2922    pub top_n: u32,
2923    pub include_branch_components: bool,
2924    pub numeric: Vec<NumericResultFeature>,
2925}
2926
2927pub const LODESTONE_API_RESULT_DIVERSIFICATION_FORMAT_VERSION: u16 = 1;
2928#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
2929#[serde(deny_unknown_fields)]
2930pub struct ResultDiversification {
2931    pub fields: Vec<String>,
2932    pub max_per_group: u32,
2933}
2934
2935pub const LODESTONE_API_BRANCH_SCORE_KIND_FORMAT_VERSION: u16 = 2;
2936#[derive(Clone, Copy, Debug, Deserialize, Eq, PartialEq, Serialize)]
2937#[serde(rename_all = "snake_case")]
2938pub enum BranchScoreKind {
2939    LexicalScore,
2940    DenseSimilarity,
2941    SparseDotProduct,
2942    LateInteractionMaxsim,
2943}
2944
2945pub const LODESTONE_API_RESULT_FEATURE_FORMAT_VERSION: u16 = 1;
2946#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
2947#[serde(tag = "kind", rename_all = "snake_case", deny_unknown_fields)]
2948pub enum ResultFeature {
2949    Branch {
2950        branch: String,
2951        score_kind: BranchScoreKind,
2952        rank: u32,
2953        score: ApproximateNumber,
2954    },
2955    Numeric {
2956        name: String,
2957        field: String,
2958        value: ApproximateNumber,
2959    },
2960}
2961
2962pub const LODESTONE_API_SEARCH_HIT_FORMAT_VERSION: u16 = 2;
2963#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
2964#[serde(deny_unknown_fields)]
2965pub struct SearchHit {
2966    pub index: Resource,
2967    pub document_id: String,
2968    #[serde(default, skip_serializing_if = "Option::is_none")]
2969    pub score: Option<ApproximateNumber>,
2970    #[serde(default, skip_serializing_if = "Option::is_none")]
2971    pub source: Option<RawJson>,
2972    pub sort: Vec<JsonValue>,
2973    pub fragments: Vec<SearchFragment>,
2974    pub features: Vec<ResultFeature>,
2975    pub group_values: Vec<JsonValue>,
2976    pub inner_hits: Vec<NamedNestedInnerHitsResult>,
2977}
2978
2979pub const LODESTONE_API_AGGREGATION_BUCKET_FORMAT_VERSION: u16 = 1;
2980#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
2981#[serde(deny_unknown_fields)]
2982pub struct AggregationBucket {
2983    pub key: JsonValue,
2984    pub document_count: U64,
2985    pub sub_aggregations: Vec<AggregationResult>,
2986}
2987
2988pub const LODESTONE_API_AGGREGATION_RESULT_FORMAT_VERSION: u16 = 3;
2989#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
2990#[serde(tag = "kind", rename_all = "snake_case", deny_unknown_fields)]
2991pub enum AggregationResult {
2992    Terms {
2993        name: String,
2994        buckets: Vec<AggregationBucket>,
2995        partial: bool,
2996    },
2997    Histogram {
2998        name: String,
2999        buckets: Vec<AggregationBucket>,
3000        partial: bool,
3001    },
3002    DateHistogram {
3003        name: String,
3004        buckets: Vec<AggregationBucket>,
3005        partial: bool,
3006    },
3007    Composite {
3008        name: String,
3009        buckets: Vec<AggregationBucket>,
3010        #[serde(default, skip_serializing_if = "Option::is_none")]
3011        after: Option<Cursor>,
3012        partial: bool,
3013    },
3014    Filter {
3015        name: String,
3016        buckets: Vec<AggregationBucket>,
3017        partial: bool,
3018    },
3019    SingleBucket {
3020        name: String,
3021        document_count: U64,
3022        sub_aggregations: Vec<AggregationResult>,
3023        partial: bool,
3024    },
3025    Cardinality {
3026        name: String,
3027        #[serde(default, skip_serializing_if = "Option::is_none")]
3028        value: Option<ApproximateNumber>,
3029        partial: bool,
3030    },
3031    Percentiles {
3032        name: String,
3033        values: Vec<PercentileValue>,
3034        partial: bool,
3035    },
3036    ApproximateCardinality {
3037        name: String,
3038        value: ApproximateNumber,
3039        approximation: Approximation,
3040        partial: bool,
3041    },
3042    ApproximatePercentiles {
3043        name: String,
3044        values: Vec<ApproximatePercentileValue>,
3045        approximation: Approximation,
3046        partial: bool,
3047    },
3048    Sum {
3049        name: String,
3050        #[serde(default, skip_serializing_if = "Option::is_none")]
3051        value: Option<ApproximateNumber>,
3052        partial: bool,
3053    },
3054    Avg {
3055        name: String,
3056        #[serde(default, skip_serializing_if = "Option::is_none")]
3057        value: Option<ApproximateNumber>,
3058        partial: bool,
3059    },
3060    Min {
3061        name: String,
3062        #[serde(default, skip_serializing_if = "Option::is_none")]
3063        value: Option<ApproximateNumber>,
3064        partial: bool,
3065    },
3066    Max {
3067        name: String,
3068        #[serde(default, skip_serializing_if = "Option::is_none")]
3069        value: Option<ApproximateNumber>,
3070        partial: bool,
3071    },
3072    Stats {
3073        name: String,
3074        count: U64,
3075        #[serde(default, skip_serializing_if = "Option::is_none")]
3076        min: Option<ApproximateNumber>,
3077        #[serde(default, skip_serializing_if = "Option::is_none")]
3078        max: Option<ApproximateNumber>,
3079        #[serde(default, skip_serializing_if = "Option::is_none")]
3080        avg: Option<ApproximateNumber>,
3081        sum: ApproximateNumber,
3082        partial: bool,
3083    },
3084    TimeSeriesV1 {
3085        name: String,
3086        buckets: Vec<TimeSeriesBucket>,
3087        partial: bool,
3088    },
3089}
3090
3091pub const LODESTONE_API_SHARD_COUNTS_FORMAT_VERSION: u16 = 1;
3092#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
3093#[serde(deny_unknown_fields)]
3094pub struct ShardCounts {
3095    pub total: u32,
3096    pub successful: u32,
3097    pub skipped: u32,
3098    pub failed: u32,
3099}
3100
3101pub const LODESTONE_API_TOTAL_HITS_RELATION_FORMAT_VERSION: u16 = 1;
3102#[derive(Clone, Copy, Debug, Deserialize, Eq, PartialEq, Serialize)]
3103#[serde(rename_all = "snake_case")]
3104pub enum TotalHitsRelation {
3105    Exact,
3106    LowerBound,
3107    Incomplete,
3108}
3109
3110pub const LODESTONE_API_SEARCH_TOTAL_FORMAT_VERSION: u16 = 1;
3111#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
3112#[serde(deny_unknown_fields)]
3113pub struct SearchTotal {
3114    pub value: U64,
3115    pub relation: TotalHitsRelation,
3116    pub partial: bool,
3117}
3118
3119pub const LODESTONE_API_SEARCH_EXECUTION_FRESHNESS_FORMAT_VERSION: u16 = 1;
3120#[derive(Clone, Copy, Debug, Deserialize, Eq, PartialEq, Serialize)]
3121#[serde(rename_all = "snake_case")]
3122pub enum SearchExecutionFreshness {
3123    Realtime,
3124    Committed,
3125}
3126
3127pub const LODESTONE_API_SEARCH_FRESHNESS_FORMAT_VERSION: u16 = 1;
3128#[derive(Clone, Copy, Debug, Deserialize, Eq, PartialEq, Serialize)]
3129#[serde(rename_all = "snake_case")]
3130pub enum SearchFreshness {
3131    Auto,
3132    Realtime,
3133    Committed,
3134}
3135
3136pub const LODESTONE_API_SEARCH_DEGRADATION_REASON_FORMAT_VERSION: u16 = 1;
3137#[derive(Clone, Copy, Debug, Deserialize, Eq, PartialEq, Serialize)]
3138#[serde(rename_all = "snake_case")]
3139pub enum SearchDegradationReason {
3140    WriterUnavailable,
3141}
3142
3143pub const LODESTONE_API_SEARCH_ACHIEVEMENT_FORMAT_VERSION: u16 = 1;
3144#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
3145#[serde(deny_unknown_fields)]
3146pub struct SearchAchievement {
3147    pub freshness: SearchExecutionFreshness,
3148    pub degradation_reasons: Vec<SearchDegradationReason>,
3149}
3150
3151pub const LODESTONE_API_SEARCH_FAILURE_STAGE_FORMAT_VERSION: u16 = 1;
3152#[derive(Clone, Copy, Debug, Deserialize, Eq, PartialEq, Serialize)]
3153#[serde(rename_all = "snake_case")]
3154pub enum SearchFailureStage {
3155    Preflight,
3156    Dispatch,
3157}
3158
3159pub const LODESTONE_API_SEARCH_FAILURE_REASON_FORMAT_VERSION: u16 = 1;
3160#[derive(Clone, Copy, Debug, Deserialize, Eq, PartialEq, Serialize)]
3161#[serde(rename_all = "snake_case")]
3162pub enum SearchFailureReason {
3163    Cancelled,
3164    Overloaded,
3165    ResourceLimit,
3166    DeadlineExceeded,
3167    Unavailable,
3168    InvalidResponse,
3169}
3170
3171pub const LODESTONE_API_COLLECTION_SHARD_FORMAT_VERSION: u16 = 1;
3172#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
3173#[serde(deny_unknown_fields)]
3174pub struct CollectionShard {
3175    pub collection_id: Identity,
3176    pub index_id: Identity,
3177    pub shard_id: u32,
3178}
3179
3180pub const LODESTONE_API_SEARCH_PARTIAL_FAILURE_FORMAT_VERSION: u16 = 1;
3181#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
3182#[serde(deny_unknown_fields)]
3183pub struct SearchPartialFailure {
3184    pub shard: CollectionShard,
3185    pub stage: SearchFailureStage,
3186    pub reason: SearchFailureReason,
3187    pub recovery: RecoveryAction,
3188}
3189
3190pub const LODESTONE_API_ARTIFACT_FORMAT_VERSION: u16 = 1;
3191#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
3192#[serde(deny_unknown_fields)]
3193pub struct Artifact {
3194    pub locator: Locator,
3195    pub bytes: U64,
3196    pub sha256: Digest,
3197    pub expires_at: U64,
3198}
3199
3200pub const LODESTONE_API_PORTABILITY_STORAGE_CAPABILITY_FORMAT_VERSION: u16 = 1;
3201#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
3202#[serde(deny_unknown_fields)]
3203pub struct PortabilityStorageCapability {
3204    pub backend_authority: String,
3205    pub object_prefix: String,
3206    pub maximum_bytes: U64,
3207    #[serde(default, skip_serializing_if = "Option::is_none")]
3208    pub key_capability_digest: Option<Digest>,
3209}
3210
3211pub const LODESTONE_API_COLLECTION_EXPORT_ARTIFACT_FORMAT_VERSION: u16 = 1;
3212#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
3213#[serde(deny_unknown_fields)]
3214pub struct CollectionExportArtifact {
3215    pub artifact: Artifact,
3216    pub backend_authority: String,
3217    pub object_key: String,
3218    pub source_collection_id: Identity,
3219    pub source_catalog_revision: U64,
3220}
3221
3222pub const LODESTONE_API_INDEX_TRANSFER_PAGE_FORMAT_VERSION: u16 = 1;
3223#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
3224#[serde(deny_unknown_fields)]
3225pub struct IndexTransferPage {
3226    pub ordinal: u32,
3227    pub object_key: String,
3228    pub bytes: U64,
3229    pub content_digest: Digest,
3230    pub record_count: u32,
3231}
3232
3233pub const LODESTONE_API_INDEX_TRANSFER_ARTIFACT_FORMAT_VERSION: u16 = 1;
3234#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
3235#[serde(deny_unknown_fields)]
3236pub struct IndexTransferArtifact {
3237    pub manifest: Artifact,
3238    pub manifest_object_key: String,
3239    pub transfer_identity: Digest,
3240    pub source_cluster_storage_id: Identity,
3241    pub source_collection_id: Identity,
3242    pub source_index: Resource,
3243    pub source_catalog_revision: U64,
3244    pub source_cut_digest: Digest,
3245    pub pages: Vec<IndexTransferPage>,
3246    pub record_count: u32,
3247}
3248
3249pub const LODESTONE_API_SEARCH_VALIDATION_BOUND_FORMAT_VERSION: u16 = 1;
3250#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
3251#[serde(tag = "kind", rename_all = "snake_case", deny_unknown_fields)]
3252pub enum SearchValidationBound {
3253    Exact { value: U64 },
3254    UpperBound { value: U64 },
3255    Unknown { reason: String },
3256}
3257
3258pub const LODESTONE_API_SEARCH_VALIDATION_ESTIMATES_FORMAT_VERSION: u16 = 1;
3259#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
3260#[serde(deny_unknown_fields)]
3261pub struct SearchValidationEstimates {
3262    pub shard_fanout: SearchValidationBound,
3263    pub candidate_documents: SearchValidationBound,
3264    pub segments: SearchValidationBound,
3265    pub buckets: SearchValidationBound,
3266    pub memory_bytes: SearchValidationBound,
3267    pub object_reads: SearchValidationBound,
3268    pub object_bytes: SearchValidationBound,
3269    pub response_bytes: SearchValidationBound,
3270    pub planning_work: SearchValidationBound,
3271}
3272
3273pub const LODESTONE_API_SEARCH_VALIDATION_LIMIT_FORMAT_VERSION: u16 = 1;
3274#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
3275#[serde(deny_unknown_fields)]
3276pub struct SearchValidationLimit {
3277    pub id: String,
3278    pub applied: U64,
3279    pub unit: String,
3280}
3281
3282pub const LODESTONE_API_OPERATION_KIND_FORMAT_VERSION: u16 = 2;
3283#[derive(Clone, Copy, Debug, Deserialize, Eq, PartialEq, Serialize)]
3284#[serde(rename_all = "snake_case")]
3285pub enum OperationKind {
3286    Catalog,
3287    MaintenanceTask,
3288    Security,
3289    Diagnostic,
3290    CollectionExport,
3291    CollectionRestore,
3292    IndexExport,
3293    IndexImport,
3294    VectorEvaluation,
3295    VectorWarm,
3296    Lifecycle,
3297    Quota,
3298    Admission,
3299}
3300
3301pub const LODESTONE_API_OPERATION_AUTHORITY_FORMAT_VERSION: u16 = 1;
3302#[derive(Clone, Copy, Debug, Deserialize, Eq, PartialEq, Serialize)]
3303#[serde(rename_all = "snake_case")]
3304pub enum OperationAuthority {
3305    Catalog,
3306    Tasks,
3307    Security,
3308    Diagnostics,
3309    Portability,
3310    Lifecycle,
3311    Quota,
3312    Admission,
3313}
3314
3315pub const LODESTONE_API_OPERATION_TARGET_FORMAT_VERSION: u16 = 1;
3316#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
3317#[serde(tag = "kind", rename_all = "snake_case", deny_unknown_fields)]
3318pub enum OperationTarget {
3319    Collection { collection_id: Identity },
3320    Resource { resource: Resource },
3321    Artifact { locator: Locator },
3322    None,
3323}
3324
3325pub const LODESTONE_API_OPERATION_STATE_FORMAT_VERSION: u16 = 1;
3326#[derive(Clone, Copy, Debug, Deserialize, Eq, PartialEq, Serialize)]
3327#[serde(rename_all = "snake_case")]
3328pub enum OperationState {
3329    Pending,
3330    Succeeded,
3331    Failed,
3332    Cancelled,
3333}
3334
3335pub const LODESTONE_API_OPERATION_PENDING_STATE_FORMAT_VERSION: u16 = 1;
3336#[derive(Clone, Copy, Debug, Deserialize, Eq, PartialEq, Serialize)]
3337#[serde(rename_all = "snake_case")]
3338pub enum OperationPendingState {
3339    Queued,
3340    Running,
3341    CancelRequested,
3342}
3343
3344pub const LODESTONE_API_OPERATION_PROGRESS_UNIT_FORMAT_VERSION: u16 = 1;
3345#[derive(Clone, Copy, Debug, Deserialize, Eq, PartialEq, Serialize)]
3346#[serde(rename_all = "snake_case")]
3347pub enum OperationProgressUnit {
3348    BasisPoints,
3349    Items,
3350    Bytes,
3351    WorkUnits,
3352}
3353
3354pub const LODESTONE_API_OPERATION_PROGRESS_FORMAT_VERSION: u16 = 1;
3355#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
3356#[serde(deny_unknown_fields)]
3357pub struct OperationProgress {
3358    pub completed: U64,
3359    pub total: U64,
3360    pub unit: OperationProgressUnit,
3361}
3362
3363pub const LODESTONE_API_OPERATION_RESULT_FORMAT_VERSION: u16 = 1;
3364#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
3365#[serde(tag = "kind", rename_all = "snake_case", deny_unknown_fields)]
3366pub enum OperationResult {
3367    None,
3368    Artifacts { items: Vec<Artifact> },
3369}
3370
3371pub const LODESTONE_API_OPERATION_FAILURE_FORMAT_VERSION: u16 = 1;
3372#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
3373#[serde(deny_unknown_fields)]
3374pub struct OperationFailure {
3375    pub error: ErrorBody,
3376}
3377
3378pub const LODESTONE_API_OPERATION_CANCELLATION_FORMAT_VERSION: u16 = 1;
3379#[derive(Clone, Copy, Debug, Deserialize, Eq, PartialEq, Serialize)]
3380#[serde(rename_all = "snake_case")]
3381pub enum OperationCancellation {
3382    NotCancellable,
3383    Cancellable,
3384    CancelRequested,
3385    Cancelled,
3386}
3387
3388pub const LODESTONE_API_OPERATION_RETENTION_STATE_FORMAT_VERSION: u16 = 1;
3389#[derive(Clone, Copy, Debug, Deserialize, Eq, PartialEq, Serialize)]
3390#[serde(rename_all = "snake_case")]
3391pub enum OperationRetentionState {
3392    Active,
3393    Retired,
3394}
3395
3396pub const LODESTONE_API_OPERATION_RETENTION_FORMAT_VERSION: u16 = 1;
3397#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
3398#[serde(deny_unknown_fields)]
3399pub struct OperationRetention {
3400    pub state: OperationRetentionState,
3401    #[serde(default, skip_serializing_if = "Option::is_none")]
3402    pub retire_after: Option<U64>,
3403}
3404
3405pub const LODESTONE_API_OPERATION_FORMAT_VERSION: u16 = 2;
3406#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
3407#[serde(deny_unknown_fields)]
3408pub struct Operation {
3409    pub locator: Locator,
3410    pub kind: OperationKind,
3411    pub authority: OperationAuthority,
3412    pub target: OperationTarget,
3413    pub authority_revision: U64,
3414    pub current_state: OperationState,
3415    #[serde(default, skip_serializing_if = "Option::is_none")]
3416    pub pending_state: Option<OperationPendingState>,
3417    #[serde(default, skip_serializing_if = "Option::is_none")]
3418    pub progress: Option<OperationProgress>,
3419    #[serde(default, skip_serializing_if = "Option::is_none")]
3420    pub result: Option<OperationResult>,
3421    #[serde(default, skip_serializing_if = "Option::is_none")]
3422    pub failure: Option<OperationFailure>,
3423    pub cancellation: OperationCancellation,
3424    pub retention: OperationRetention,
3425    pub submitted_at: U64,
3426    #[serde(default, skip_serializing_if = "Option::is_none")]
3427    pub terminal_at: Option<U64>,
3428}
3429
3430pub const LODESTONE_API_WRITE_DURABILITY_BOUNDARY_FORMAT_VERSION: u16 = 1;
3431#[derive(Clone, Copy, Debug, Deserialize, Eq, PartialEq, Serialize)]
3432#[serde(rename_all = "snake_case")]
3433pub enum WriteDurabilityBoundary {
3434    Registered,
3435    IncarnationMemory,
3436}
3437
3438pub const LODESTONE_API_WRITE_VISIBILITY_MODE_FORMAT_VERSION: u16 = 1;
3439#[derive(Clone, Copy, Debug, Deserialize, Eq, PartialEq, Serialize)]
3440#[serde(rename_all = "snake_case")]
3441pub enum WriteVisibilityMode {
3442    Applied,
3443    WaitFor,
3444}
3445
3446pub const LODESTONE_API_WRITE_RESPONSE_STAGE_FORMAT_VERSION: u16 = 1;
3447#[derive(Clone, Copy, Debug, Deserialize, Eq, PartialEq, Serialize)]
3448#[serde(rename_all = "snake_case")]
3449pub enum WriteResponseStage {
3450    Validated,
3451    Admitted,
3452    Sequenced,
3453    ObjectPut,
3454    Registered,
3455    AppliedToActiveMemtable,
3456    MicroCommitted,
3457    Sealed,
3458}
3459
3460pub const LODESTONE_API_WRITE_ACHIEVEMENT_FORMAT_VERSION: u16 = 1;
3461#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
3462#[serde(deny_unknown_fields)]
3463pub struct WriteAchievement {
3464    pub durability_class: ResourceDurabilityClass,
3465    pub durability_boundary: WriteDurabilityBoundary,
3466    pub visibility_mode: WriteVisibilityMode,
3467    pub response_stage: WriteResponseStage,
3468}
3469
3470pub const LODESTONE_API_MUTATION_COMMIT_POSITION_FORMAT_VERSION: u16 = 1;
3471#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
3472#[serde(deny_unknown_fields)]
3473pub struct MutationCommitPosition {
3474    pub leader_term: U64,
3475    pub leader_node_id: U64,
3476    pub log_index: U64,
3477}
3478
3479pub const LODESTONE_API_MUTATION_COMMIT_RECEIPT_SHAPE_VERSION: u16 = 1;
3480pub const LODESTONE_API_MUTATION_COMMIT_RECEIPT_FORMAT_VERSION: u16 = 1;
3481#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
3482#[serde(deny_unknown_fields)]
3483pub struct MutationCommitReceipt {
3484    pub format_version: u32,
3485    pub registration_position: MutationCommitPosition,
3486    pub sequence: U64,
3487    pub primary_term: U64,
3488    pub mapping_generation: U64,
3489    pub durability_class: ResourceDurabilityClass,
3490    pub durability_boundary: WriteDurabilityBoundary,
3491    pub committed_at_unix_millis: U64,
3492    pub committed_at_uncertainty_millis: U64,
3493}
3494
3495pub const LODESTONE_API_MUTATION_RESOLVER_FORMAT_VERSION: u16 = 1;
3496#[derive(Clone, Copy, Debug, Deserialize, Eq, PartialEq, Serialize)]
3497#[serde(rename_all = "snake_case")]
3498pub enum MutationResolver {
3499    CloneIndex,
3500    GetHistory,
3501    ResolveAppendBulk,
3502    ResolveCatalogAction,
3503    ResolveDocumentBulk,
3504    ResolveDocumentMutation,
3505    ResolveSecurityAction,
3506    ResolveServiceCredentialReservation,
3507    ResolveStateWrite,
3508}
3509
3510pub const LODESTONE_API_MUTATION_OUTCOME_FORMAT_VERSION: u16 = 1;
3511#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
3512#[serde(tag = "state", rename_all = "snake_case", deny_unknown_fields)]
3513pub enum MutationOutcome {
3514    Terminal,
3515    Pending {
3516        #[serde(default, skip_serializing_if = "Option::is_none")]
3517        resolver: Option<MutationResolver>,
3518    },
3519    Indeterminate {
3520        #[serde(default, skip_serializing_if = "Option::is_none")]
3521        resolver: Option<MutationResolver>,
3522    },
3523    ResolutionRequired {
3524        resolver: MutationResolver,
3525    },
3526}
3527
3528pub const LODESTONE_API_SUBMISSION_STATE_FORMAT_VERSION: u16 = 1;
3529#[derive(Clone, Copy, Debug, Deserialize, Eq, PartialEq, Serialize)]
3530#[serde(rename_all = "snake_case")]
3531pub enum SubmissionState {
3532    NotSubmitted,
3533    Submitted,
3534    Resolved,
3535    KnownRetired,
3536    Indeterminate,
3537}
3538
3539pub const LODESTONE_API_EXPECTED_BINDING_FORMAT_VERSION: u16 = 1;
3540#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
3541#[serde(deny_unknown_fields)]
3542pub struct ExpectedBinding {
3543    pub incarnation: Identity,
3544    pub revision: U64,
3545}
3546
3547pub const LODESTONE_API_ADMINISTRATION_ALIAS_ACTION_FORMAT_VERSION: u16 = 1;
3548#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
3549#[serde(tag = "kind", rename_all = "snake_case", deny_unknown_fields)]
3550pub enum AdministrationAliasAction {
3551    Put {
3552        name: String,
3553        #[serde(default, skip_serializing_if = "Option::is_none")]
3554        expected_revision: Option<U64>,
3555        targets: Vec<AliasTarget>,
3556        #[serde(default, skip_serializing_if = "Option::is_none")]
3557        filter: Option<RawJson>,
3558        #[serde(default, skip_serializing_if = "Option::is_none")]
3559        index_routing: Option<String>,
3560        #[serde(default, skip_serializing_if = "Option::is_none")]
3561        search_routing: Option<String>,
3562    },
3563    Delete {
3564        name: String,
3565        expected_revision: U64,
3566    },
3567}
3568
3569pub const LODESTONE_API_ADMINISTRATION_MUTATION_FORMAT_VERSION: u16 = 1;
3570#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
3571#[serde(tag = "kind", rename_all = "snake_case", deny_unknown_fields)]
3572pub enum AdministrationMutation {
3573    ApplyAliasActions {
3574        actions: Vec<AdministrationAliasAction>,
3575    },
3576    PutComponentTemplate {
3577        name: String,
3578        #[serde(default, skip_serializing_if = "Option::is_none")]
3579        expected: Option<ExpectedBinding>,
3580        mapping: Mapping,
3581        settings: RawJson,
3582        #[serde(default, skip_serializing_if = "Option::is_none")]
3583        resource_spec: Option<IndexResourceSpec>,
3584    },
3585    DeleteComponentTemplate {
3586        name: String,
3587        expected: ExpectedBinding,
3588    },
3589    PutIndexTemplate {
3590        name: String,
3591        #[serde(default, skip_serializing_if = "Option::is_none")]
3592        expected: Option<ExpectedBinding>,
3593        priority: i32,
3594        data_stream: bool,
3595        index_patterns: Vec<String>,
3596        components: Vec<ExpectedBinding>,
3597        mapping: Mapping,
3598        settings: RawJson,
3599        #[serde(default, skip_serializing_if = "Option::is_none")]
3600        resource_spec: Option<IndexResourceSpec>,
3601    },
3602    DeleteIndexTemplate {
3603        name: String,
3604        expected: ExpectedBinding,
3605    },
3606    PutIngestPipeline {
3607        name: String,
3608        #[serde(default, skip_serializing_if = "Option::is_none")]
3609        expected: Option<ExpectedBinding>,
3610        definition: RawJson,
3611    },
3612    DeleteIngestPipeline {
3613        name: String,
3614        expected: ExpectedBinding,
3615    },
3616    PutLifecyclePolicy {
3617        name: String,
3618        #[serde(default, skip_serializing_if = "Option::is_none")]
3619        expected: Option<ExpectedBinding>,
3620        rollover: RolloverThresholds,
3621        retention: RetentionPolicy,
3622        merge_hint: bool,
3623        freeze_hint: bool,
3624        delete_expired: bool,
3625    },
3626    DeleteLifecyclePolicy {
3627        name: String,
3628        expected: ExpectedBinding,
3629    },
3630    CreateDataStream {
3631        name: String,
3632        timestamp_field: String,
3633        index_template: ExpectedBinding,
3634        #[serde(default, skip_serializing_if = "Option::is_none")]
3635        lifecycle_policy: Option<ExpectedBinding>,
3636    },
3637    DeleteDataStream {
3638        name: String,
3639        expected_revision: U64,
3640    },
3641    RolloverDataStream {
3642        name: String,
3643        expected_revision: U64,
3644    },
3645}
3646
3647pub const LODESTONE_API_ADMINISTRATION_OUTCOME_FORMAT_VERSION: u16 = 1;
3648#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
3649#[serde(deny_unknown_fields)]
3650pub struct AdministrationOutcome {
3651    pub action_id: Digest,
3652    pub authority_revision: U64,
3653    pub state: String,
3654    #[serde(default, skip_serializing_if = "Option::is_none")]
3655    pub resource: Option<Resource>,
3656}
3657
3658pub const LODESTONE_API_INDEX_CHANGE_APPLY_RECEIPT_FORMAT_VERSION: u16 = 1;
3659#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
3660#[serde(deny_unknown_fields)]
3661pub struct IndexChangeApplyReceipt {
3662    pub action_id: Digest,
3663    pub semantic_digest: Digest,
3664    pub index: Resource,
3665    pub revision: U64,
3666    pub schema_generation: U64,
3667    pub state: String,
3668}
3669
3670pub const LODESTONE_API_BULK_DOCUMENT_ITEM_FORMAT_VERSION: u16 = 2;
3671#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
3672#[serde(deny_unknown_fields)]
3673pub struct BulkDocumentItem {
3674    pub item_action_id: Digest,
3675    pub document_id: String,
3676    pub operation: String,
3677    #[serde(default, skip_serializing_if = "Option::is_none")]
3678    pub source: Option<RawJson>,
3679    #[serde(default, skip_serializing_if = "Option::is_none")]
3680    pub record: Option<NativeRecord>,
3681    #[serde(default, skip_serializing_if = "Option::is_none")]
3682    pub routing: Option<String>,
3683    #[serde(default, skip_serializing_if = "Option::is_none")]
3684    pub condition: Option<DocumentMutationCondition>,
3685    #[serde(default, skip_serializing_if = "Option::is_none")]
3686    pub pipeline: Option<IngestPipelineSelection>,
3687    pub semantic_digest: Digest,
3688}
3689
3690pub const LODESTONE_API_BULK_DOCUMENT_ITEM_OUTCOME_FORMAT_VERSION: u16 = 1;
3691#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
3692#[serde(deny_unknown_fields)]
3693pub struct BulkDocumentItemOutcome {
3694    pub item_action_id: Digest,
3695    #[serde(default, skip_serializing_if = "Option::is_none")]
3696    pub locator: Option<Locator>,
3697    pub state: SubmissionState,
3698    #[serde(default, skip_serializing_if = "Option::is_none")]
3699    pub sequence: Option<U64>,
3700    #[serde(default, skip_serializing_if = "Option::is_none")]
3701    pub mapping_generation: Option<U64>,
3702    pub mapping_adopted: bool,
3703    pub no_document_effect: bool,
3704    #[serde(default, skip_serializing_if = "Option::is_none")]
3705    pub error: Option<ErrorBody>,
3706}
3707
3708pub const LODESTONE_API_BULK_DOCUMENT_OUTCOME_FORMAT_VERSION: u16 = 1;
3709#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
3710#[serde(deny_unknown_fields)]
3711pub struct BulkDocumentOutcome {
3712    pub batch_id: Digest,
3713    pub index: Resource,
3714    pub items: Vec<BulkDocumentItemOutcome>,
3715    pub complete: bool,
3716    #[serde(default, skip_serializing_if = "Option::is_none")]
3717    pub achievement: Option<WriteAchievement>,
3718}
3719
3720pub const LODESTONE_API_METRIC_ATTRIBUTE_VALUE_FORMAT_VERSION: u16 = 1;
3721#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
3722#[serde(tag = "kind", rename_all = "snake_case", deny_unknown_fields)]
3723pub enum MetricAttributeValue {
3724    String { value: String },
3725    Boolean { value: bool },
3726    I64 { value: I64 },
3727    U64 { value: U64 },
3728    F64Bits { value: U64 },
3729}
3730
3731pub const LODESTONE_API_METRIC_ATTRIBUTE_FORMAT_VERSION: u16 = 1;
3732#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
3733#[serde(deny_unknown_fields)]
3734pub struct MetricAttribute {
3735    pub key: String,
3736    pub value: MetricAttributeValue,
3737}
3738
3739pub const LODESTONE_API_METRIC_NUMBER_FORMAT_VERSION: u16 = 1;
3740#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
3741#[serde(tag = "kind", rename_all = "snake_case", deny_unknown_fields)]
3742pub enum MetricNumber {
3743    I64 { value: I64 },
3744    F64Bits { value: U64 },
3745}
3746
3747pub const LODESTONE_API_METRIC_TEMPORALITY_FORMAT_VERSION: u16 = 1;
3748#[derive(Clone, Copy, Debug, Deserialize, Eq, PartialEq, Serialize)]
3749#[serde(rename_all = "snake_case")]
3750pub enum MetricTemporality {
3751    Cumulative,
3752    Delta,
3753}
3754
3755pub const LODESTONE_API_METRIC_POINT_KIND_FORMAT_VERSION: u16 = 1;
3756#[derive(Clone, Copy, Debug, Deserialize, Eq, PartialEq, Serialize)]
3757#[serde(rename_all = "snake_case")]
3758pub enum MetricPointKind {
3759    Gauge,
3760    Sum,
3761    ExplicitHistogram,
3762    ExponentialHistogram,
3763}
3764
3765pub const LODESTONE_API_METRIC_EXPONENTIAL_BUCKETS_FORMAT_VERSION: u16 = 1;
3766#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
3767#[serde(deny_unknown_fields)]
3768pub struct MetricExponentialBuckets {
3769    pub offset: i32,
3770    pub counts: Vec<U64>,
3771}
3772
3773pub const LODESTONE_API_METRIC_DATA_FORMAT_VERSION: u16 = 1;
3774#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
3775#[serde(tag = "kind", rename_all = "snake_case", deny_unknown_fields)]
3776pub enum MetricData {
3777    Gauge {
3778        value: MetricNumber,
3779    },
3780    Sum {
3781        value: MetricNumber,
3782        temporality: MetricTemporality,
3783        monotonic: bool,
3784    },
3785    ExplicitHistogram {
3786        temporality: MetricTemporality,
3787        count: U64,
3788        #[serde(default, skip_serializing_if = "Option::is_none")]
3789        sum: Option<MetricNumber>,
3790        bounds_f64_bits: Vec<U64>,
3791        bucket_counts: Vec<U64>,
3792    },
3793    ExponentialHistogram {
3794        temporality: MetricTemporality,
3795        count: U64,
3796        #[serde(default, skip_serializing_if = "Option::is_none")]
3797        sum: Option<MetricNumber>,
3798        scale: i32,
3799        zero_count: U64,
3800        positive: MetricExponentialBuckets,
3801        negative: MetricExponentialBuckets,
3802    },
3803}
3804
3805pub const LODESTONE_API_METRIC_INSTRUMENTATION_SCOPE_FORMAT_VERSION: u16 = 1;
3806#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
3807#[serde(deny_unknown_fields)]
3808pub struct MetricInstrumentationScope {
3809    pub name: String,
3810    #[serde(default, skip_serializing_if = "Option::is_none")]
3811    pub version: Option<String>,
3812    #[serde(default, skip_serializing_if = "Option::is_none")]
3813    pub schema_url: Option<String>,
3814    pub attributes: Vec<MetricAttribute>,
3815}
3816
3817pub const LODESTONE_API_METRIC_EXEMPLAR_FORMAT_VERSION: u16 = 1;
3818#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
3819#[serde(deny_unknown_fields)]
3820pub struct MetricExemplar {
3821    pub timestamp_unix_nanos: U64,
3822    pub value: MetricNumber,
3823    #[serde(default, skip_serializing_if = "Option::is_none")]
3824    pub trace_id: Option<String>,
3825    #[serde(default, skip_serializing_if = "Option::is_none")]
3826    pub span_id: Option<String>,
3827    pub filtered_attributes: Vec<MetricAttribute>,
3828}
3829
3830pub const LODESTONE_API_METRIC_POINT_SHAPE_VERSION: u16 = 1;
3831pub const LODESTONE_API_METRIC_POINT_FORMAT_VERSION: u16 = 1;
3832#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
3833#[serde(deny_unknown_fields)]
3834pub struct MetricPoint {
3835    pub format_version: u32,
3836    pub resource_attributes: Vec<MetricAttribute>,
3837    pub instrumentation_scope: MetricInstrumentationScope,
3838    pub metric_name: String,
3839    #[serde(default, skip_serializing_if = "Option::is_none")]
3840    pub description: Option<String>,
3841    pub unit: String,
3842    pub series_attributes: Vec<MetricAttribute>,
3843    pub timestamp_unix_nanos: U64,
3844    #[serde(default, skip_serializing_if = "Option::is_none")]
3845    pub start_timestamp_unix_nanos: Option<U64>,
3846    pub data: MetricData,
3847    pub exemplars: Vec<MetricExemplar>,
3848}
3849
3850pub const LODESTONE_API_ENTITY_REF_FORMAT_VERSION: u16 = 1;
3851#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
3852#[serde(deny_unknown_fields)]
3853pub struct EntityRef {
3854    pub entity_kind: String,
3855    pub entity_id: String,
3856}
3857
3858pub const LODESTONE_API_RELATIONSHIP_EVIDENCE_REF_FORMAT_VERSION: u16 = 1;
3859#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
3860#[serde(deny_unknown_fields)]
3861pub struct RelationshipEvidenceRef {
3862    pub index: Resource,
3863    pub record_id: String,
3864}
3865
3866pub const LODESTONE_API_RELATIONSHIP_DIRECTIONALITY_FORMAT_VERSION: u16 = 1;
3867#[derive(Clone, Copy, Debug, Deserialize, Eq, PartialEq, Serialize)]
3868#[serde(rename_all = "snake_case")]
3869pub enum RelationshipDirectionality {
3870    Directed,
3871    Undirected,
3872}
3873
3874pub const LODESTONE_API_RELATIONSHIP_RECORD_SHAPE_VERSION: u16 = 1;
3875pub const LODESTONE_API_RELATIONSHIP_RECORD_FORMAT_VERSION: u16 = 1;
3876#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
3877#[serde(deny_unknown_fields)]
3878pub struct RelationshipRecord {
3879    pub format_version: u32,
3880    pub relationship_id: String,
3881    pub source: EntityRef,
3882    pub target: EntityRef,
3883    pub relationship_type: String,
3884    pub directionality: RelationshipDirectionality,
3885    #[serde(default, skip_serializing_if = "Option::is_none")]
3886    pub valid_from_unix_nanos: Option<U64>,
3887    #[serde(default, skip_serializing_if = "Option::is_none")]
3888    pub valid_through_unix_nanos: Option<U64>,
3889    pub provenance: Vec<String>,
3890    pub evidence: Vec<RelationshipEvidenceRef>,
3891    pub assertion_class: String,
3892}
3893
3894pub const LODESTONE_API_PROFILE_LABEL_FORMAT_VERSION: u16 = 1;
3895#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
3896#[serde(deny_unknown_fields)]
3897pub struct ProfileLabel {
3898    pub key: String,
3899    pub value: String,
3900}
3901
3902pub const LODESTONE_API_PROFILE_SAMPLE_TYPE_FORMAT_VERSION: u16 = 1;
3903#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
3904#[serde(deny_unknown_fields)]
3905pub struct ProfileSampleType {
3906    pub sample_type: String,
3907    pub unit: String,
3908}
3909
3910pub const LODESTONE_API_PROFILE_MAPPING_FORMAT_VERSION: u16 = 1;
3911#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
3912#[serde(deny_unknown_fields)]
3913pub struct ProfileMapping {
3914    pub mapping_id: String,
3915    pub build_id: String,
3916    pub module_id: String,
3917    #[serde(default, skip_serializing_if = "Option::is_none")]
3918    pub filename: Option<String>,
3919}
3920
3921pub const LODESTONE_API_PROFILE_FUNCTION_FORMAT_VERSION: u16 = 1;
3922#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
3923#[serde(deny_unknown_fields)]
3924pub struct ProfileFunction {
3925    pub function_id: String,
3926    #[serde(default, skip_serializing_if = "Option::is_none")]
3927    pub name: Option<String>,
3928    #[serde(default, skip_serializing_if = "Option::is_none")]
3929    pub system_name: Option<String>,
3930    #[serde(default, skip_serializing_if = "Option::is_none")]
3931    pub filename: Option<String>,
3932    #[serde(default, skip_serializing_if = "Option::is_none")]
3933    pub start_line: Option<U64>,
3934    #[serde(default, skip_serializing_if = "Option::is_none")]
3935    pub symbol_observation_id: Option<String>,
3936}
3937
3938pub const LODESTONE_API_PROFILE_LINE_FORMAT_VERSION: u16 = 1;
3939#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
3940#[serde(deny_unknown_fields)]
3941pub struct ProfileLine {
3942    pub function_id: String,
3943    pub line: U64,
3944}
3945
3946pub const LODESTONE_API_PROFILE_LOCATION_FORMAT_VERSION: u16 = 1;
3947#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
3948#[serde(deny_unknown_fields)]
3949pub struct ProfileLocation {
3950    pub location_id: String,
3951    #[serde(default, skip_serializing_if = "Option::is_none")]
3952    pub mapping_id: Option<String>,
3953    pub address: U64,
3954    pub lines: Vec<ProfileLine>,
3955}
3956
3957pub const LODESTONE_API_PROFILE_STACK_FORMAT_VERSION: u16 = 1;
3958#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
3959#[serde(deny_unknown_fields)]
3960pub struct ProfileStack {
3961    pub stack_id: String,
3962    #[serde(default, skip_serializing_if = "Option::is_none")]
3963    pub parent_stack_id: Option<String>,
3964    pub location_id: String,
3965}
3966
3967pub const LODESTONE_API_PROFILE_SAMPLE_FORMAT_VERSION: u16 = 1;
3968#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
3969#[serde(deny_unknown_fields)]
3970pub struct ProfileSample {
3971    pub sample_id: String,
3972    pub stack_id: String,
3973    pub values: Vec<MetricNumber>,
3974    pub labels: Vec<ProfileLabel>,
3975    #[serde(default, skip_serializing_if = "Option::is_none")]
3976    pub trace_id: Option<String>,
3977    #[serde(default, skip_serializing_if = "Option::is_none")]
3978    pub span_id: Option<String>,
3979}
3980
3981pub const LODESTONE_API_PROFILE_INSTRUMENTATION_SCOPE_FORMAT_VERSION: u16 = 1;
3982#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
3983#[serde(deny_unknown_fields)]
3984pub struct ProfileInstrumentationScope {
3985    pub name: String,
3986    #[serde(default, skip_serializing_if = "Option::is_none")]
3987    pub version: Option<String>,
3988    pub attributes: Vec<ProfileLabel>,
3989}
3990
3991pub const LODESTONE_API_PROFILE_BATCH_SHAPE_VERSION: u16 = 1;
3992pub const LODESTONE_API_PROFILE_BATCH_FORMAT_VERSION: u16 = 1;
3993#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
3994#[serde(deny_unknown_fields)]
3995pub struct ProfileBatch {
3996    pub format_version: u32,
3997    pub profile_id: String,
3998    pub batch_id: String,
3999    pub start_unix_nanos: U64,
4000    pub end_unix_nanos: U64,
4001    pub duration_nanos: U64,
4002    pub period_nanos: U64,
4003    pub sample_types: Vec<ProfileSampleType>,
4004    pub resource_attributes: Vec<ProfileLabel>,
4005    pub instrumentation_scope: ProfileInstrumentationScope,
4006    pub mappings: Vec<ProfileMapping>,
4007    pub functions: Vec<ProfileFunction>,
4008    pub locations: Vec<ProfileLocation>,
4009    pub stacks: Vec<ProfileStack>,
4010    pub samples: Vec<ProfileSample>,
4011}
4012
4013pub const LODESTONE_API_NATIVE_RECORD_FORMAT_VERSION: u16 = 3;
4014#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
4015#[serde(tag = "kind", rename_all = "snake_case", deny_unknown_fields)]
4016pub enum NativeRecord {
4017    Document { source: RawJson },
4018    MetricPoint { point: Box<MetricPoint> },
4019    Relationship { relationship: Box<RelationshipRecord> },
4020    ProfileBatch { batch: Box<ProfileBatch> },
4021}
4022
4023pub const LODESTONE_API_RETAINED_APPEND_ITEM_FORMAT_VERSION: u16 = 4;
4024#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
4025#[serde(deny_unknown_fields)]
4026pub struct RetainedAppendItem {
4027    pub item_action_id: Digest,
4028    pub document_id: String,
4029    pub record: NativeRecord,
4030}
4031
4032pub const LODESTONE_API_RETAINED_APPEND_STATE_FORMAT_VERSION: u16 = 1;
4033#[derive(Clone, Copy, Debug, Deserialize, Eq, PartialEq, Serialize)]
4034#[serde(rename_all = "snake_case")]
4035pub enum RetainedAppendState {
4036    Prepared,
4037    Committed,
4038    Replayed,
4039    Conflict,
4040    NotSubmittedRetryable,
4041    NotSubmittedTerminal,
4042    SubmittedIndeterminate,
4043    Retired,
4044}
4045
4046pub const LODESTONE_API_RETAINED_APPEND_RETRY_SAFETY_FORMAT_VERSION: u16 = 1;
4047#[derive(Clone, Copy, Debug, Deserialize, Eq, PartialEq, Serialize)]
4048#[serde(rename_all = "snake_case")]
4049pub enum RetainedAppendRetrySafety {
4050    Safe,
4051    ResolveOnly,
4052    Terminal,
4053}
4054
4055pub const LODESTONE_API_RETAINED_APPEND_ITEM_OUTCOME_FORMAT_VERSION: u16 = 1;
4056#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
4057#[serde(deny_unknown_fields)]
4058pub struct RetainedAppendItemOutcome {
4059    pub item_action_id: Digest,
4060    #[serde(default, skip_serializing_if = "Option::is_none")]
4061    pub locator: Option<Locator>,
4062    #[serde(default, skip_serializing_if = "Option::is_none")]
4063    pub semantic_digest: Option<Digest>,
4064    pub state: RetainedAppendState,
4065    pub retry_safety: RetainedAppendRetrySafety,
4066    #[serde(default, skip_serializing_if = "Option::is_none")]
4067    pub sequence: Option<U64>,
4068    #[serde(default, skip_serializing_if = "Option::is_none")]
4069    pub primary_term: Option<U64>,
4070    #[serde(default, skip_serializing_if = "Option::is_none")]
4071    pub error: Option<ErrorBody>,
4072}
4073
4074pub const LODESTONE_API_RETAINED_APPEND_BULK_OUTCOME_FORMAT_VERSION: u16 = 1;
4075#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
4076#[serde(deny_unknown_fields)]
4077pub struct RetainedAppendBulkOutcome {
4078    pub batch_id: Digest,
4079    pub index: Resource,
4080    pub items: Vec<RetainedAppendItemOutcome>,
4081    pub complete: bool,
4082    #[serde(default, skip_serializing_if = "Option::is_none")]
4083    pub achievement: Option<WriteAchievement>,
4084}
4085
4086pub const LODESTONE_API_RETAINED_APPEND_OBSERVATION_STATE_FORMAT_VERSION: u16 = 1;
4087#[derive(Clone, Copy, Debug, Deserialize, Eq, PartialEq, Serialize)]
4088#[serde(rename_all = "snake_case")]
4089pub enum RetainedAppendObservationState {
4090    Visible,
4091    Pending,
4092    SubmittedIndeterminate,
4093    Conflict,
4094    Retired,
4095}
4096
4097pub const LODESTONE_API_RETAINED_APPEND_OBSERVATION_OUTCOME_FORMAT_VERSION: u16 = 1;
4098#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
4099#[serde(deny_unknown_fields)]
4100pub struct RetainedAppendObservationOutcome {
4101    pub index: Resource,
4102    pub locator: Locator,
4103    pub state: RetainedAppendObservationState,
4104    #[serde(default, skip_serializing_if = "Option::is_none")]
4105    pub sequence: Option<U64>,
4106    #[serde(default, skip_serializing_if = "Option::is_none")]
4107    pub primary_term: Option<U64>,
4108}
4109
4110pub const LODESTONE_API_BINARY_VALUE_FORMAT_VERSION: u16 = 1;
4111#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
4112#[serde(deny_unknown_fields)]
4113pub struct BinaryValue {
4114    pub bytes_base64: String,
4115}
4116
4117pub const LODESTONE_API_STATE_HASH_FIELD_FORMAT_VERSION: u16 = 1;
4118#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
4119#[serde(deny_unknown_fields)]
4120pub struct StateHashField {
4121    pub field: BinaryValue,
4122    pub value: BinaryValue,
4123}
4124
4125pub const LODESTONE_API_STATE_SET_ENTRY_FORMAT_VERSION: u16 = 1;
4126#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
4127#[serde(deny_unknown_fields)]
4128pub struct StateSetEntry {
4129    pub key: BinaryValue,
4130    pub value: BinaryValue,
4131}
4132
4133pub const LODESTONE_API_STATE_SET_CONDITION_FORMAT_VERSION: u16 = 1;
4134#[derive(Clone, Copy, Debug, Deserialize, Eq, PartialEq, Serialize)]
4135#[serde(rename_all = "snake_case")]
4136pub enum StateSetCondition {
4137    Always,
4138    IfAbsent,
4139    IfPresent,
4140}
4141
4142pub const LODESTONE_API_STATE_OPERATION_FORMAT_VERSION: u16 = 1;
4143#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
4144#[serde(tag = "kind", rename_all = "snake_case", deny_unknown_fields)]
4145pub enum StateOperation {
4146    Get {
4147        key: BinaryValue,
4148    },
4149    Set {
4150        key: BinaryValue,
4151        value: BinaryValue,
4152        condition: StateSetCondition,
4153        #[serde(default, skip_serializing_if = "Option::is_none")]
4154        expires_at_millis: Option<U64>,
4155    },
4156    Delete {
4157        keys: Vec<BinaryValue>,
4158    },
4159    Exists {
4160        keys: Vec<BinaryValue>,
4161    },
4162    ExpireAt {
4163        key: BinaryValue,
4164        absolute_millis: U64,
4165    },
4166    TtlStatus {
4167        key: BinaryValue,
4168    },
4169    Persist {
4170        key: BinaryValue,
4171    },
4172    MultiGet {
4173        keys: Vec<BinaryValue>,
4174    },
4175    MultiSet {
4176        entries: Vec<StateSetEntry>,
4177    },
4178    Increment {
4179        key: BinaryValue,
4180        delta: I64,
4181    },
4182    HashGet {
4183        key: BinaryValue,
4184        field: BinaryValue,
4185    },
4186    HashSet {
4187        key: BinaryValue,
4188        fields: Vec<StateHashField>,
4189    },
4190    HashGetAll {
4191        key: BinaryValue,
4192    },
4193}
4194
4195pub const LODESTONE_API_STATE_OPTIONAL_VALUE_FORMAT_VERSION: u16 = 1;
4196#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
4197#[serde(tag = "state", rename_all = "snake_case", deny_unknown_fields)]
4198pub enum StateOptionalValue {
4199    Missing,
4200    Value { value: BinaryValue },
4201}
4202
4203pub const LODESTONE_API_STATE_COMMAND_RESULT_FORMAT_VERSION: u16 = 1;
4204#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
4205#[serde(tag = "kind", rename_all = "snake_case", deny_unknown_fields)]
4206pub enum StateCommandResult {
4207    Get {
4208        value: StateOptionalValue,
4209    },
4210    Set {
4211        applied: bool,
4212    },
4213    Delete {
4214        removed: u32,
4215    },
4216    Exists {
4217        count: u32,
4218    },
4219    Expire {
4220        changed: bool,
4221    },
4222    TtlStatus {
4223        state: String,
4224        #[serde(default, skip_serializing_if = "Option::is_none")]
4225        remaining_millis: Option<U64>,
4226    },
4227    Persist {
4228        changed: bool,
4229    },
4230    MultiGet {
4231        values: Vec<StateOptionalValue>,
4232    },
4233    MultiSet {
4234        written: u32,
4235    },
4236    Increment {
4237        value: I64,
4238    },
4239    HashGet {
4240        value: StateOptionalValue,
4241    },
4242    HashSet {
4243        fields_added: u32,
4244    },
4245    HashGetAll {
4246        fields: Vec<StateHashField>,
4247    },
4248}
4249
4250pub const LODESTONE_API_STATE_WRITE_RESOLUTION_FORMAT_VERSION: u16 = 1;
4251#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
4252#[serde(tag = "state", rename_all = "snake_case", deny_unknown_fields)]
4253pub enum StateWriteResolution {
4254    NotSubmitted,
4255    Resolved {
4256        result: StateCommandResult,
4257        sequence: U64,
4258    },
4259    KnownRetired {
4260        retired_through: U64,
4261    },
4262    StateReset {
4263        submitted_reset_epoch: U64,
4264        current_reset_epoch: U64,
4265    },
4266    Indeterminate {
4267        #[serde(default, skip_serializing_if = "Option::is_none")]
4268        observed_high_water: Option<U64>,
4269        #[serde(default, skip_serializing_if = "Option::is_none")]
4270        current_high_water: Option<U64>,
4271        #[serde(default, skip_serializing_if = "Option::is_none")]
4272        retired_through: Option<U64>,
4273    },
4274}
4275
4276pub const LODESTONE_API_SERVICE_CREDENTIAL_RESERVATION_FORMAT_VERSION: u16 = 1;
4277#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
4278#[serde(deny_unknown_fields)]
4279pub struct ServiceCredentialReservation {
4280    pub locator: Locator,
4281    pub reservation_action_id: Digest,
4282    pub activation_action_id: Digest,
4283    pub principal_id: Identity,
4284    pub api_key_id: Identity,
4285    pub generation: U64,
4286    pub reservation_expires_at: U64,
4287    pub credential_expires_at: U64,
4288    pub verifier_algorithm: String,
4289    pub verifier_algorithm_version: u32,
4290    pub required_secret_bytes: u32,
4291}
4292
4293pub const LODESTONE_API_SUBSCRIPTION_METADATA_FIELD_FORMAT_VERSION: u16 = 1;
4294#[derive(Clone, Copy, Debug, Deserialize, Eq, PartialEq, Serialize)]
4295#[serde(rename_all = "snake_case")]
4296pub enum SubscriptionMetadataField {
4297    Id,
4298    RoutingHash,
4299    Operation,
4300    Shard,
4301    Sequence,
4302}
4303
4304pub const LODESTONE_API_SUBSCRIPTION_FIELD_FORMAT_VERSION: u16 = 1;
4305#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
4306#[serde(tag = "kind", rename_all = "snake_case", deny_unknown_fields)]
4307pub enum SubscriptionField {
4308    Source { path: String },
4309    Metadata { field: SubscriptionMetadataField },
4310}
4311
4312pub const LODESTONE_API_SUBSCRIPTION_FILTER_FORMAT_VERSION: u16 = 1;
4313#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
4314#[serde(tag = "kind", rename_all = "snake_case", deny_unknown_fields)]
4315pub enum SubscriptionFilter {
4316    All,
4317    Bool {
4318        must: Vec<SubscriptionFilter>,
4319        should: Vec<SubscriptionFilter>,
4320        must_not: Vec<SubscriptionFilter>,
4321        minimum_should_match: u32,
4322    },
4323    Term {
4324        field: SubscriptionField,
4325        value: JsonValue,
4326    },
4327    Terms {
4328        field: SubscriptionField,
4329        values: Vec<JsonValue>,
4330    },
4331    Range {
4332        field: SubscriptionField,
4333        #[serde(default, skip_serializing_if = "Option::is_none")]
4334        gt: Option<JsonValue>,
4335        #[serde(default, skip_serializing_if = "Option::is_none")]
4336        gte: Option<JsonValue>,
4337        #[serde(default, skip_serializing_if = "Option::is_none")]
4338        lt: Option<JsonValue>,
4339        #[serde(default, skip_serializing_if = "Option::is_none")]
4340        lte: Option<JsonValue>,
4341    },
4342    Exists {
4343        field: SubscriptionField,
4344    },
4345    Prefix {
4346        field: SubscriptionField,
4347        value: String,
4348    },
4349}
4350
4351pub const LODESTONE_API_SUBSCRIPTION_CURSOR_ENTRY_FORMAT_VERSION: u16 = 1;
4352#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
4353#[serde(deny_unknown_fields)]
4354pub struct SubscriptionCursorEntry {
4355    pub index: Resource,
4356    pub routing_revision: U64,
4357    pub recovery_era: Identity,
4358    pub shard_id: U64,
4359    pub sequence: U64,
4360}
4361
4362pub const LODESTONE_API_SUBSCRIPTION_ROUTE_FORMAT_VERSION: u16 = 1;
4363#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
4364#[serde(deny_unknown_fields)]
4365pub struct SubscriptionRoute {
4366    pub index: Resource,
4367    pub routing_revision: U64,
4368    pub shard_ids: Vec<U64>,
4369}
4370
4371pub const LODESTONE_API_SUBSCRIPTION_START_POSITION_FORMAT_VERSION: u16 = 1;
4372#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
4373#[serde(tag = "kind", rename_all = "snake_case", deny_unknown_fields)]
4374pub enum SubscriptionStartPosition {
4375    FromNow,
4376    Resume {
4377        routes: Vec<SubscriptionRoute>,
4378        cut: Vec<SubscriptionCursorEntry>,
4379    },
4380}
4381
4382pub const LODESTONE_API_SUBSCRIPTION_START_SHAPE_VERSION: u16 = 1;
4383pub const LODESTONE_API_SUBSCRIPTION_START_FORMAT_VERSION: u16 = 1;
4384#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
4385#[serde(deny_unknown_fields)]
4386pub struct SubscriptionStart {
4387    pub format_version: u32,
4388    pub request_id: String,
4389    pub index: Resource,
4390    #[serde(default, skip_serializing_if = "Option::is_none")]
4391    pub filter: Option<SubscriptionFilter>,
4392    pub include_deletes: bool,
4393    pub source_projection: Vec<String>,
4394    pub reconnect_attempt: u32,
4395    pub start: SubscriptionStartPosition,
4396    pub heartbeat_millis: U64,
4397    pub schema_digest: Digest,
4398}
4399
4400pub const LODESTONE_API_SUBSCRIPTION_ACCEPTED_SHAPE_VERSION: u16 = 1;
4401pub const LODESTONE_API_SUBSCRIPTION_ACCEPTED_FORMAT_VERSION: u16 = 1;
4402#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
4403#[serde(deny_unknown_fields)]
4404pub struct SubscriptionAccepted {
4405    pub format_version: u32,
4406    pub routes: Vec<SubscriptionRoute>,
4407    pub accepted_cut: Vec<SubscriptionCursorEntry>,
4408    pub schema_digest: Digest,
4409}
4410
4411pub const LODESTONE_API_SUBSCRIPTION_WRITER_FENCE_FORMAT_VERSION: u16 = 1;
4412#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
4413#[serde(deny_unknown_fields)]
4414pub struct SubscriptionWriterFence {
4415    pub recovery_era: Identity,
4416    pub epoch: u32,
4417}
4418
4419pub const LODESTONE_API_SUBSCRIPTION_EVENT_SHAPE_VERSION: u16 = 1;
4420pub const LODESTONE_API_SUBSCRIPTION_EVENT_FORMAT_VERSION: u16 = 1;
4421#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
4422#[serde(deny_unknown_fields)]
4423pub struct SubscriptionEvent {
4424    pub format_version: u32,
4425    pub event_id: Digest,
4426    pub index: Resource,
4427    pub shard_id: U64,
4428    pub recovery_era: Identity,
4429    pub writer_fence: SubscriptionWriterFence,
4430    pub routing_revision: U64,
4431    pub sequence: U64,
4432    pub operation: String,
4433    pub document_id: String,
4434    pub routing_hash: u32,
4435    #[serde(default, skip_serializing_if = "Option::is_none")]
4436    pub source: Option<RawJson>,
4437}
4438
4439pub const LODESTONE_API_SUBSCRIPTION_HEARTBEAT_SHAPE_VERSION: u16 = 1;
4440pub const LODESTONE_API_SUBSCRIPTION_HEARTBEAT_FORMAT_VERSION: u16 = 1;
4441#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
4442#[serde(deny_unknown_fields)]
4443pub struct SubscriptionHeartbeat {
4444    pub format_version: u32,
4445    pub confirmed_cut: Vec<SubscriptionCursorEntry>,
4446    pub route_revision: U64,
4447    pub authorization_revision: U64,
4448    pub authorization_valid_until_millis: U64,
4449}
4450
4451pub const LODESTONE_API_SUBSCRIPTION_GAP_SHAPE_VERSION: u16 = 1;
4452pub const LODESTONE_API_SUBSCRIPTION_GAP_FORMAT_VERSION: u16 = 1;
4453#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
4454#[serde(deny_unknown_fields)]
4455pub struct SubscriptionGap {
4456    pub format_version: u32,
4457    pub affected: Vec<SubscriptionCursorEntry>,
4458    pub last_confirmed: Vec<SubscriptionCursorEntry>,
4459    pub earliest_available: Vec<SubscriptionCursorEntry>,
4460    pub reason: String,
4461    pub terminal: bool,
4462}
4463
4464pub const LODESTONE_API_SUBSCRIPTION_TERMINAL_REASON_FORMAT_VERSION: u16 = 1;
4465#[derive(Clone, Copy, Debug, Deserialize, Eq, PartialEq, Serialize)]
4466#[serde(rename_all = "snake_case")]
4467pub enum SubscriptionTerminalReason {
4468    Completed,
4469    Cancelled,
4470    DeadlineExceeded,
4471    StaleCursor,
4472    RetentionGap,
4473    Unavailable,
4474    Internal,
4475}
4476
4477pub const LODESTONE_API_SUBSCRIPTION_TERMINAL_SHAPE_VERSION: u16 = 2;
4478pub const LODESTONE_API_SUBSCRIPTION_TERMINAL_FORMAT_VERSION: u16 = 2;
4479#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
4480#[serde(deny_unknown_fields)]
4481pub struct SubscriptionTerminal {
4482    pub format_version: u32,
4483    pub reason: SubscriptionTerminalReason,
4484    pub recovery: RecoveryAction,
4485}
4486
4487pub const LODESTONE_API_SUBSCRIPTION_FRAME_FORMAT_VERSION: u16 = 1;
4488#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
4489#[serde(tag = "frame", rename_all = "snake_case", deny_unknown_fields)]
4490pub enum SubscriptionFrame {
4491    Accepted { body: SubscriptionAccepted },
4492    Event { body: SubscriptionEvent },
4493    Heartbeat { body: SubscriptionHeartbeat },
4494    Gap { body: SubscriptionGap },
4495    Terminal { body: SubscriptionTerminal },
4496}
4497
4498pub const LODESTONE_API_STREAM_BINDING_FORMAT_VERSION: u16 = 1;
4499#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
4500#[serde(deny_unknown_fields)]
4501pub struct StreamBinding {
4502    pub name: String,
4503    pub transport: String,
4504    pub service: String,
4505    pub method: String,
4506    pub endpoint: String,
4507    pub auth_metadata: String,
4508    pub auth_scheme: String,
4509    pub semantic_format_version: u32,
4510    pub schema_digest: Digest,
4511}
4512
4513pub const LODESTONE_API_CAPABILITY_GRANT_FORMAT_VERSION: u16 = 1;
4514#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
4515#[serde(deny_unknown_fields)]
4516pub struct CapabilityGrant {
4517    pub command: String,
4518    pub action: String,
4519    pub state: String,
4520    pub reason: String,
4521    pub mutation_class: String,
4522    pub cancellable: bool,
4523    pub workload_classes: Vec<WorkloadClass>,
4524    pub possible_submission_states: Vec<String>,
4525    pub capability_family: String,
4526    pub effect_class: String,
4527    pub risk_flags: Vec<String>,
4528    pub admissible_errors: Vec<String>,
4529    pub referenced_limits: Vec<String>,
4530    pub retry_safety: String,
4531    pub identity_requirement: String,
4532    #[serde(default, skip_serializing_if = "Option::is_none")]
4533    pub resolver_command: Option<String>,
4534    pub cancellation: String,
4535    pub side_effects: Vec<String>,
4536    pub recovery: String,
4537    pub index_patterns: Vec<String>,
4538    pub exact_index_incarnations: Vec<Identity>,
4539}
4540
4541pub const LODESTONE_API_PROTOCOL_LIMIT_FORMAT_VERSION: u16 = 1;
4542#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
4543#[serde(deny_unknown_fields)]
4544pub struct ProtocolLimit {
4545    pub id: String,
4546    pub default: U64,
4547    pub maximum: U64,
4548    pub unit: String,
4549}
4550
4551pub const LODESTONE_API_DOCUMENT_MUTATION_CONDITION_FORMAT_VERSION: u16 = 1;
4552#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
4553#[serde(tag = "kind", rename_all = "snake_case", deny_unknown_fields)]
4554pub enum DocumentMutationCondition {
4555    Any,
4556    MustNotExist,
4557    IfSeqNo { seq_no: U64 },
4558    IfSeqNoAndPrimaryTerm { seq_no: U64, primary_term: U64 },
4559}
4560
4561pub const LODESTONE_API_AUDIT_ADAPTER_FORMAT_VERSION: u16 = 1;
4562#[derive(Clone, Copy, Debug, Deserialize, Eq, PartialEq, Serialize)]
4563#[serde(rename_all = "snake_case")]
4564pub enum AuditAdapter {
4565    Native,
4566    Elasticsearch,
4567    Otlp,
4568    Jaeger,
4569    Grpc,
4570    WebSocket,
4571    Resp,
4572    InternalRpc,
4573    ControlPlane,
4574}
4575
4576pub const LODESTONE_API_AUDIT_DECISION_FORMAT_VERSION: u16 = 1;
4577#[derive(Clone, Copy, Debug, Deserialize, Eq, PartialEq, Serialize)]
4578#[serde(rename_all = "snake_case")]
4579pub enum AuditDecision {
4580    Allowed,
4581    DeniedAuthentication,
4582    DeniedAuthorization,
4583    DeniedQuota,
4584    DeniedStalePolicy,
4585}
4586
4587pub const LODESTONE_API_AUDIT_OUTCOME_FORMAT_VERSION: u16 = 1;
4588#[derive(Clone, Copy, Debug, Deserialize, Eq, PartialEq, Serialize)]
4589#[serde(rename_all = "snake_case")]
4590pub enum AuditOutcome {
4591    AdmissionAccepted,
4592    AuthenticationRefused,
4593    AuthorizationRefused,
4594    QuotaRefused,
4595    PolicyUnavailable,
4596    DecodeFailed,
4597    OperationSucceeded,
4598    OperationFailed,
4599    OperationIndeterminate,
4600    FailedRedacted,
4601}
4602
4603pub const LODESTONE_API_AUDIT_DETAIL_FORMAT_VERSION: u16 = 1;
4604#[derive(Clone, Copy, Debug, Deserialize, Eq, PartialEq, Serialize)]
4605#[serde(rename_all = "snake_case")]
4606pub enum AuditDetail {
4607    PolicyMutation,
4608    CredentialRotation,
4609    CredentialRevocation,
4610    QuotaAdmission,
4611    RequestAdmission,
4612    ExplicitCrashGap,
4613    BackupLifecycle,
4614    RetentionLifecycle,
4615    FieldPromotion,
4616}
4617
4618pub const LODESTONE_API_AUDIT_GAP_REASON_FORMAT_VERSION: u16 = 1;
4619#[derive(Clone, Copy, Debug, Deserialize, Eq, PartialEq, Serialize)]
4620#[serde(rename_all = "snake_case")]
4621pub enum AuditGapReason {
4622    ExplicitCrashGap,
4623    Retention,
4624}
4625
4626pub const LODESTONE_API_AUDIT_EVENT_FORMAT_VERSION: u16 = 2;
4627#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
4628#[serde(deny_unknown_fields)]
4629pub struct AuditEvent {
4630    pub event_id: Digest,
4631    pub recovery_era: Identity,
4632    pub sequence: U64,
4633    pub server_time: U64,
4634    #[serde(default, skip_serializing_if = "Option::is_none")]
4635    pub principal_id: Option<Identity>,
4636    #[serde(default, skip_serializing_if = "Option::is_none")]
4637    pub api_key_id: Option<Identity>,
4638    pub policy_revision: U64,
4639    pub adapter: AuditAdapter,
4640    pub action: String,
4641    pub resource_digest: Digest,
4642    pub request_digest: Digest,
4643    #[serde(default, skip_serializing_if = "Option::is_none")]
4644    pub correlation_id: Option<Identity>,
4645    #[serde(default, skip_serializing_if = "Option::is_none")]
4646    pub diagnostic_id: Option<Identity>,
4647    pub decision: AuditDecision,
4648    pub outcome: AuditOutcome,
4649    pub detail: AuditDetail,
4650}
4651
4652pub const LODESTONE_API_AUDIT_GAP_FORMAT_VERSION: u16 = 2;
4653#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
4654#[serde(deny_unknown_fields)]
4655pub struct AuditGap {
4656    pub recovery_era: Identity,
4657    pub first_sequence: U64,
4658    pub last_sequence: U64,
4659    pub reason: AuditGapReason,
4660}
4661
4662pub const LODESTONE_API_AUDIT_STREAM_STATE_FORMAT_VERSION: u16 = 1;
4663#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
4664#[serde(deny_unknown_fields)]
4665pub struct AuditStreamState {
4666    pub recovery_era: Identity,
4667    pub earliest_available_sequence: U64,
4668    pub snapshot_through: U64,
4669}
4670
4671pub const LODESTONE_API_SERVICE_CREDENTIAL_GRANT_FORMAT_VERSION: u16 = 1;
4672#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
4673#[serde(deny_unknown_fields)]
4674pub struct ServiceCredentialGrant {
4675    pub role_name: String,
4676    pub role_version: U64,
4677}
4678
4679pub const LODESTONE_API_SERVICE_CREDENTIAL_SUMMARY_FORMAT_VERSION: u16 = 1;
4680#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
4681#[serde(deny_unknown_fields)]
4682pub struct ServiceCredentialSummary {
4683    pub principal_id: Identity,
4684    pub api_key_id: Identity,
4685    pub generation: U64,
4686    pub state: String,
4687    #[serde(default, skip_serializing_if = "Option::is_none")]
4688    pub expires_at: Option<U64>,
4689    pub grants: Vec<ServiceCredentialGrant>,
4690}
4691
4692pub const LODESTONE_API_SECURITY_ROLE_FORMAT_VERSION: u16 = 1;
4693#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
4694#[serde(deny_unknown_fields)]
4695pub struct SecurityRole {
4696    pub role_name: String,
4697    pub version: U64,
4698    pub permissions: Vec<String>,
4699    pub delegable_permissions: Vec<String>,
4700    pub allowed_workload_classes: Vec<WorkloadClass>,
4701    pub index_patterns: Vec<String>,
4702    pub append_index_incarnations: Vec<Identity>,
4703}
4704
4705pub const LODESTONE_API_ROLE_APPEND_SCOPE_CHANGE_FORMAT_VERSION: u16 = 1;
4706#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
4707#[serde(tag = "kind", rename_all = "snake_case", deny_unknown_fields)]
4708pub enum RoleAppendScopeChange {
4709    Add { index: Resource },
4710    Remove { index_incarnation: Identity },
4711}
4712
4713pub const LODESTONE_API_ROLE_APPEND_ACCESS_PREPARATION_FORMAT_VERSION: u16 = 1;
4714#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
4715#[serde(tag = "state", rename_all = "snake_case", deny_unknown_fields)]
4716pub enum RoleAppendAccessPreparation {
4717    Prepared {
4718        locator: Locator,
4719        semantic_digest: Digest,
4720        expires_at: U64,
4721        predecessor_role_version: U64,
4722        successor_role_version: U64,
4723    },
4724    AlreadySatisfied {
4725        role: SecurityRole,
4726    },
4727}
4728
4729pub const LODESTONE_API_SECURITY_ACTION_OUTCOME_FORMAT_VERSION: u16 = 1;
4730#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
4731#[serde(tag = "kind", rename_all = "snake_case", deny_unknown_fields)]
4732pub enum SecurityActionOutcome {
4733    Reserved {
4734        principal_id: Identity,
4735        api_key_id: Identity,
4736        generation: U64,
4737    },
4738    Activated {
4739        principal_id: Identity,
4740        api_key_id: Identity,
4741        generation: U64,
4742    },
4743    Revoked {
4744        principal_id: Identity,
4745        api_key_id: Identity,
4746        generation: U64,
4747    },
4748    Retired {
4749        principal_id: Identity,
4750        api_key_id: Identity,
4751        generation: U64,
4752    },
4753}
4754
4755pub const LODESTONE_API_MAINTENANCE_WORK_STATE_FORMAT_VERSION: u16 = 1;
4756#[derive(Clone, Copy, Debug, Deserialize, Eq, PartialEq, Serialize)]
4757#[serde(rename_all = "snake_case")]
4758pub enum MaintenanceWorkState {
4759    ParkedOperatorRequired,
4760    RetryWait,
4761    RetryReady,
4762    Leased,
4763    Deferred,
4764    Runnable,
4765}
4766
4767pub const LODESTONE_API_MAINTENANCE_ATTEMPT_STATE_FORMAT_VERSION: u16 = 1;
4768#[derive(Clone, Copy, Debug, Deserialize, Eq, PartialEq, Serialize)]
4769#[serde(rename_all = "snake_case")]
4770pub enum MaintenanceAttemptState {
4771    Running,
4772    DeadlineExceededDraining,
4773    DeadlineExceededReclaimPending,
4774    CancellationDraining,
4775    ClaimRecoveryPending,
4776}
4777
4778pub const LODESTONE_API_MAINTENANCE_FAILURE_CLASS_FORMAT_VERSION: u16 = 1;
4779#[derive(Clone, Copy, Debug, Deserialize, Eq, PartialEq, Serialize)]
4780#[serde(rename_all = "snake_case")]
4781pub enum MaintenanceFailureClass {
4782    Corruption,
4783    AttemptBudget,
4784    StructuralLimit,
4785    Execution,
4786    Other,
4787}
4788
4789pub const LODESTONE_API_MAINTENANCE_FAILURE_CLASS_COUNT_FORMAT_VERSION: u16 = 1;
4790#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
4791#[serde(deny_unknown_fields)]
4792pub struct MaintenanceFailureClassCount {
4793    pub class: MaintenanceFailureClass,
4794    pub count: U64,
4795}
4796
4797pub const LODESTONE_API_MAINTENANCE_ATTEMPT_OBSERVATION_FORMAT_VERSION: u16 = 1;
4798#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
4799#[serde(deny_unknown_fields)]
4800pub struct MaintenanceAttemptObservation {
4801    pub state: MaintenanceAttemptState,
4802    pub lease_epoch: U64,
4803    pub lease_expires_at: U64,
4804    pub observed_at_millis: U64,
4805}
4806
4807pub const LODESTONE_API_MAINTENANCE_TASK_SCOPE_FORMAT_VERSION: u16 = 1;
4808#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
4809#[serde(deny_unknown_fields)]
4810pub struct MaintenanceTaskScope {
4811    pub kind: String,
4812    #[serde(default, skip_serializing_if = "Option::is_none")]
4813    pub index: Option<Resource>,
4814    #[serde(default, skip_serializing_if = "Option::is_none")]
4815    pub shard_id: Option<u32>,
4816}
4817
4818pub const LODESTONE_API_MAINTENANCE_TASK_STATUS_FORMAT_VERSION: u16 = 1;
4819#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
4820#[serde(deny_unknown_fields)]
4821pub struct MaintenanceTaskStatus {
4822    pub task_id: Identity,
4823    pub kind: String,
4824    pub scope: MaintenanceTaskScope,
4825    pub checkpoint_generation: U64,
4826    pub attempt_count: u32,
4827    pub admitted_at: U64,
4828    pub last_transition_at: U64,
4829    pub last_progress_at: U64,
4830    pub work_state: MaintenanceWorkState,
4831    pub state_since: U64,
4832    #[serde(default, skip_serializing_if = "Option::is_none")]
4833    pub defer_reason: Option<String>,
4834    pub cancellation_requested: bool,
4835    #[serde(default, skip_serializing_if = "Option::is_none")]
4836    pub retry_not_before: Option<U64>,
4837    #[serde(default, skip_serializing_if = "Option::is_none")]
4838    pub failure_at: Option<U64>,
4839    #[serde(default, skip_serializing_if = "Option::is_none")]
4840    pub lease_acquired_at: Option<U64>,
4841    #[serde(default, skip_serializing_if = "Option::is_none")]
4842    pub lease_expires_at: Option<U64>,
4843    #[serde(default, skip_serializing_if = "Option::is_none")]
4844    pub failure_class: Option<MaintenanceFailureClass>,
4845    #[serde(default, skip_serializing_if = "Option::is_none")]
4846    pub failure_code: Option<String>,
4847    pub operator_action_required: bool,
4848    #[serde(default, skip_serializing_if = "Option::is_none")]
4849    pub local_attempt: Option<MaintenanceAttemptObservation>,
4850}
4851
4852pub const LODESTONE_API_MAINTENANCE_STATUS_AGGREGATE_SHAPE_VERSION: u16 = 1;
4853pub const LODESTONE_API_MAINTENANCE_STATUS_AGGREGATE_FORMAT_VERSION: u16 = 2;
4854#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
4855#[serde(deny_unknown_fields)]
4856pub struct MaintenanceStatusAggregate {
4857    pub format_version: u32,
4858    pub recovery_era: Identity,
4859    pub source_revision: U64,
4860    pub root_revision: U64,
4861    pub logical_observation_time: U64,
4862    #[serde(default, skip_serializing_if = "Option::is_none")]
4863    pub local_observation_millis: Option<U64>,
4864    pub total_incomplete: U64,
4865    pub parked_operator_required: U64,
4866    pub retry_wait: U64,
4867    pub retry_ready: U64,
4868    pub leased: U64,
4869    pub deferred: U64,
4870    pub runnable: U64,
4871    pub eligible_backlog: U64,
4872    pub cancellation_requested: U64,
4873    #[serde(default, skip_serializing_if = "Option::is_none")]
4874    pub oldest_backlog_age: Option<U64>,
4875    #[serde(default, skip_serializing_if = "Option::is_none")]
4876    pub oldest_runnable_age: Option<U64>,
4877    #[serde(default, skip_serializing_if = "Option::is_none")]
4878    pub oldest_retry_wait_age: Option<U64>,
4879    #[serde(default, skip_serializing_if = "Option::is_none")]
4880    pub oldest_parked_age: Option<U64>,
4881    #[serde(default, skip_serializing_if = "Option::is_none")]
4882    pub oldest_no_progress_age: Option<U64>,
4883    pub current_action_capacity: u32,
4884    pub maximum_action_capacity: u32,
4885    pub active_passes: U64,
4886    pub local_in_flight: U64,
4887    pub deadline_draining: U64,
4888    pub cancellation_draining: U64,
4889    pub claim_recovery_pending: U64,
4890    pub projection_refresh_pending: bool,
4891    #[serde(default, skip_serializing_if = "Option::is_none")]
4892    pub durable_last_progress_at: Option<U64>,
4893    pub tasks_claimed_total: U64,
4894    pub tasks_progressed_total: U64,
4895    pub tasks_completed_total: U64,
4896    pub task_retries_total: U64,
4897    pub task_failures_total: U64,
4898    pub deadline_failures_total: U64,
4899    pub cancellations_total: U64,
4900    pub overlay_capacity_exhaustions_total: U64,
4901    pub failure_classes: Vec<MaintenanceFailureClassCount>,
4902}
4903
4904pub const LODESTONE_API_RUNTIME_STATUS_DETAIL_FORMAT_VERSION: u16 = 1;
4905#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
4906#[serde(deny_unknown_fields)]
4907pub struct RuntimeStatusDetail {
4908    pub metastore_revision: U64,
4909    pub root_revision: U64,
4910    pub logical_time: U64,
4911    pub degraded_dependencies: Vec<String>,
4912}
4913
4914pub const LODESTONE_API_RESULT_CACHE_STATUS_SHAPE_VERSION: u16 = 2;
4915pub const LODESTONE_API_RESULT_CACHE_STATUS_FORMAT_VERSION: u16 = 3;
4916#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
4917#[serde(deny_unknown_fields)]
4918pub struct ResultCacheStatus {
4919    pub format_version: u32,
4920    pub hits: U64,
4921    pub misses: U64,
4922    pub admissions: U64,
4923    pub bypasses: U64,
4924    pub evictions: U64,
4925    pub collection_bytes: U64,
4926    pub collection_entries: u32,
4927}
4928
4929pub const LODESTONE_API_FIELD_PROMOTION_STATUS_SHAPE_VERSION: u16 = 1;
4930pub const LODESTONE_API_FIELD_PROMOTION_STATUS_FORMAT_VERSION: u16 = 3;
4931#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
4932#[serde(deny_unknown_fields)]
4933pub struct FieldPromotionStatus {
4934    pub format_version: u32,
4935    pub index: Resource,
4936    pub mapping_generation: U64,
4937    pub policy_generation: U64,
4938    #[serde(default, skip_serializing_if = "Option::is_none")]
4939    pub last_decision_generation: Option<U64>,
4940    pub heat_records: u32,
4941    pub promoted_fields: u32,
4942    pub extra_bytes: U64,
4943    pub enabled: bool,
4944}
4945
4946pub const LODESTONE_API_OVERLOAD_SHARD_STATUS_SHAPE_VERSION: u16 = 2;
4947pub const LODESTONE_API_OVERLOAD_SHARD_STATUS_FORMAT_VERSION: u16 = 3;
4948#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
4949#[serde(deny_unknown_fields)]
4950pub struct OverloadShardStatus {
4951    pub format_version: u32,
4952    pub shard_id: u32,
4953    pub writer_epoch: U64,
4954    pub configured_mode: String,
4955    pub effective_disposition: String,
4956    pub registered_through: U64,
4957    pub indexed_through: U64,
4958    pub lag_operations: U64,
4959    pub backlog_bytes: U64,
4960    pub oldest_age_millis: U64,
4961    pub collection_share_bytes: U64,
4962    pub recovery_ops_this_pass: u32,
4963    pub pending_overlay_documents: U64,
4964    #[serde(default, skip_serializing_if = "Option::is_none")]
4965    pub shed_reason: Option<String>,
4966}
4967
4968pub const LODESTONE_API_EXTERNAL_KEY_BINDING_FORMAT_VERSION: u16 = 1;
4969#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
4970#[serde(deny_unknown_fields)]
4971pub struct ExternalKeyBinding {
4972    pub content_key_id: Identity,
4973    pub content_key_generation: U64,
4974    pub binding_id: Identity,
4975    pub binding_generation: U64,
4976    pub access_generation: U64,
4977    pub opaque_binding_base64: String,
4978    pub object_context_digest: Digest,
4979}
4980
4981pub const LODESTONE_API_ROLLUP_MEASURE_FORMAT_VERSION: u16 = 1;
4982#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
4983#[serde(tag = "kind", rename_all = "snake_case", deny_unknown_fields)]
4984pub enum RollupMeasure {
4985    Count,
4986    Sum { field_path_digest: Digest },
4987    Min { field_path_digest: Digest },
4988    Max { field_path_digest: Digest },
4989}
4990
4991pub const LODESTONE_API_AGGREGATE_THEN_DELETE_POLICY_FORMAT_VERSION: u16 = 1;
4992#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
4993#[serde(deny_unknown_fields)]
4994pub struct AggregateThenDeletePolicy {
4995    pub policy_id: Identity,
4996    pub policy_generation: U64,
4997    pub detail_retirement_acknowledged: bool,
4998    #[serde(default, skip_serializing_if = "Option::is_none")]
4999    pub expected_policy_generation: Option<U64>,
5000    pub timestamp_field_digest: Digest,
5001    pub bucket_width_millis: U64,
5002    pub bucket_alignment_millis: U64,
5003    pub dimensions: Vec<Digest>,
5004    pub measures: Vec<RollupMeasure>,
5005}
5006
5007pub const LODESTONE_API_LIFECYCLE_BINDING_STATUS_FORMAT_VERSION: u16 = 1;
5008#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
5009#[serde(deny_unknown_fields)]
5010pub struct LifecycleBindingStatus {
5011    pub content_key_id: Identity,
5012    pub content_key_generation: U64,
5013    pub binding_id: Identity,
5014    pub binding_generation: U64,
5015    pub access_generation: U64,
5016}
5017
5018pub const LODESTONE_API_LIFECYCLE_ROLLUP_STATUS_FORMAT_VERSION: u16 = 1;
5019#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
5020#[serde(deny_unknown_fields)]
5021pub struct LifecycleRollupStatus {
5022    pub policy_id: Identity,
5023    pub policy_generation: U64,
5024    pub ledger_revision: U64,
5025    pub coverages: u32,
5026    pub raw_retired_coverages: u32,
5027    pub detail_retirement_acknowledged: bool,
5028    pub query_contract_version: u32,
5029    pub timestamp_field_digest: Digest,
5030    pub bucket_width_millis: U64,
5031    pub bucket_alignment_millis: U64,
5032    pub dimensions: Vec<Digest>,
5033    pub measures: Vec<RollupMeasure>,
5034}
5035
5036pub const LODESTONE_API_LIFECYCLE_STATUS_SHAPE_VERSION: u16 = 2;
5037pub const LODESTONE_API_LIFECYCLE_STATUS_FORMAT_VERSION: u16 = 4;
5038#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
5039#[serde(deny_unknown_fields)]
5040pub struct LifecycleStatus {
5041    pub format_version: u32,
5042    pub index: Resource,
5043    pub authority_revision: U64,
5044    pub active_bindings: Vec<LifecycleBindingStatus>,
5045    #[serde(default, skip_serializing_if = "Option::is_none")]
5046    pub rollup: Option<LifecycleRollupStatus>,
5047}
5048
5049pub const LODESTONE_API_QUOTA_LIMIT_FORMAT_VERSION: u16 = 1;
5050#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
5051#[serde(deny_unknown_fields)]
5052pub struct QuotaLimit {
5053    pub dimension: String,
5054    pub maximum: U64,
5055    pub window_millis: U64,
5056}
5057
5058pub const LODESTONE_API_QUOTA_CONSUMPTION_FORMAT_VERSION: u16 = 1;
5059#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
5060#[serde(deny_unknown_fields)]
5061pub struct QuotaConsumption {
5062    pub dimension: String,
5063    pub consumed: U64,
5064    pub window_millis: U64,
5065}
5066
5067pub const LODESTONE_API_QUOTA_UPDATE_FORMAT_VERSION: u16 = 1;
5068#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
5069#[serde(deny_unknown_fields)]
5070pub struct QuotaUpdate {
5071    pub revision: U64,
5072    pub state: String,
5073}
5074
5075pub const LODESTONE_API_STORAGE_OVERALL_POSTURE_FORMAT_VERSION: u16 = 1;
5076#[derive(Clone, Copy, Debug, Deserialize, Eq, PartialEq, Serialize)]
5077#[serde(rename_all = "snake_case")]
5078pub enum StorageOverallPosture {
5079    FilesystemDevelopment,
5080    ProviderObjectStorage,
5081    S3CompatibleDevelopment,
5082    Mixed,
5083}
5084
5085pub const LODESTONE_API_STORAGE_PROFILE_ROLE_FORMAT_VERSION: u16 = 1;
5086#[derive(Clone, Copy, Debug, Deserialize, Eq, PartialEq, Serialize)]
5087#[serde(rename_all = "snake_case")]
5088pub enum StorageProfileRole {
5089    Control,
5090    DefaultWal,
5091    DefaultData,
5092}
5093
5094pub const LODESTONE_API_STORAGE_PROVIDER_POSTURE_FORMAT_VERSION: u16 = 1;
5095#[derive(Clone, Copy, Debug, Deserialize, Eq, PartialEq, Serialize)]
5096#[serde(rename_all = "snake_case")]
5097pub enum StorageProviderPosture {
5098    Aws,
5099    GoogleCloudStorage,
5100    AzureBlob,
5101    S3CompatibleDevelopment,
5102    FilesystemDevelopment,
5103}
5104
5105pub const LODESTONE_API_STORAGE_BACKEND_SERVICE_CLASS_FORMAT_VERSION: u16 = 1;
5106#[derive(Clone, Copy, Debug, Deserialize, Eq, PartialEq, Serialize)]
5107#[serde(rename_all = "snake_case")]
5108pub enum StorageBackendServiceClass {
5109    RegionalObject,
5110    ZonalLowLatency,
5111}
5112
5113pub const LODESTONE_API_STORAGE_PROFILE_ROLE_BINDING_FORMAT_VERSION: u16 = 1;
5114#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
5115#[serde(deny_unknown_fields)]
5116pub struct StorageProfileRoleBinding {
5117    pub role: StorageProfileRole,
5118    pub authority_group: u32,
5119    pub provider: StorageProviderPosture,
5120    pub service_class: StorageBackendServiceClass,
5121}
5122
5123pub const LODESTONE_API_STORAGE_PROFILE_ATTESTATION_SHAPE_VERSION: u16 = 1;
5124pub const LODESTONE_API_STORAGE_PROFILE_ATTESTATION_FORMAT_VERSION: u16 = 1;
5125#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
5126#[serde(deny_unknown_fields)]
5127pub struct StorageProfileAttestation {
5128    pub format_version: u32,
5129    pub configuration_generation: U64,
5130    pub overall_posture: StorageOverallPosture,
5131    pub roles: Vec<StorageProfileRoleBinding>,
5132    pub default_durability: ResourceDurabilityClass,
5133    pub default_storage: ResourceStorageClass,
5134    pub default_policy_digest: Digest,
5135    pub storage_profile_digest: Digest,
5136    pub attestation_digest: Digest,
5137}
5138
5139pub const LODESTONE_API_STORAGE_PROFILE_EXPECTATION_SHAPE_VERSION: u16 = 1;
5140pub const LODESTONE_API_STORAGE_PROFILE_EXPECTATION_FORMAT_VERSION: u16 = 1;
5141#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
5142#[serde(deny_unknown_fields)]
5143pub struct StorageProfileExpectation {
5144    pub format_version: u32,
5145    #[serde(default, skip_serializing_if = "Option::is_none")]
5146    pub required_posture: Option<StorageOverallPosture>,
5147    #[serde(default, skip_serializing_if = "Option::is_none")]
5148    pub expected_storage_profile_digest: Option<Digest>,
5149}
5150
5151pub const LODESTONE_API_CORE_BINDING_FORMAT_VERSION: u16 = 3;
5152#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
5153#[serde(deny_unknown_fields)]
5154pub struct CoreBinding {
5155    pub cluster_id: Identity,
5156    pub collection_id: Identity,
5157    pub configuration_generation: U64,
5158    pub native_endpoints: Vec<String>,
5159    pub selected_stream_endpoint: String,
5160    pub schema_id: String,
5161    pub schema_digest: Digest,
5162    pub storage_profile: StorageProfileAttestation,
5163}
5164
5165pub const LODESTONE_API_READINESS_OBSERVATION_FORMAT_VERSION: u16 = 1;
5166#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
5167#[serde(deny_unknown_fields)]
5168pub struct ReadinessObservation {
5169    pub subject: String,
5170    pub state: String,
5171    #[serde(default, skip_serializing_if = "Option::is_none")]
5172    pub reason: Option<String>,
5173    pub revision: U64,
5174    pub observed_cut: U64,
5175}
5176
5177pub const LODESTONE_API_USAGE_DIMENSION_FORMAT_VERSION: u16 = 1;
5178#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
5179#[serde(deny_unknown_fields)]
5180pub struct UsageDimension {
5181    pub name: String,
5182    pub value: String,
5183}
5184
5185pub const LODESTONE_API_PHYSICAL_USAGE_VALUE_FORMAT_VERSION: u16 = 2;
5186#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
5187#[serde(deny_unknown_fields)]
5188pub struct PhysicalUsageValue {
5189    pub meter: String,
5190    pub unit: String,
5191    pub value: ExactDecimal,
5192}
5193
5194pub const LODESTONE_API_CORE_USAGE_UNITS_FORMAT_VERSION: u16 = 2;
5195#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
5196#[serde(deny_unknown_fields)]
5197pub struct CoreUsageUnits {
5198    pub sequence: U64,
5199    pub record_identity: Digest,
5200    pub index_id: Identity,
5201    pub workload_class: WorkloadClass,
5202    pub window_start: U64,
5203    pub window_end: U64,
5204    pub meter_set_version: u32,
5205    pub dimensions: Vec<UsageDimension>,
5206    pub values: Vec<PhysicalUsageValue>,
5207    pub authority_revision: U64,
5208    pub source_digest: Digest,
5209}
5210
5211pub const LODESTONE_API_CORE_USAGE_CORRECTION_FORMAT_VERSION: u16 = 2;
5212#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
5213#[serde(deny_unknown_fields)]
5214pub struct CoreUsageCorrection {
5215    pub sequence: U64,
5216    pub correction_sequence: U64,
5217    pub correction_identity: Digest,
5218    pub target_record_identity: Digest,
5219    pub index_id: Identity,
5220    pub workload_class: WorkloadClass,
5221    pub window_start: U64,
5222    pub window_end: U64,
5223    pub meter_set_version: u32,
5224    pub dimensions: Vec<UsageDimension>,
5225    pub values: Vec<PhysicalUsageValue>,
5226    pub reason_digest: Digest,
5227    pub authority_revision: U64,
5228    pub source_digest: Digest,
5229}
5230
5231pub const LODESTONE_API_RESPONSE_META_SHAPE_VERSION: u16 = 1;
5232pub const LODESTONE_API_RESPONSE_META_FORMAT_VERSION: u16 = 1;
5233#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
5234#[serde(deny_unknown_fields)]
5235pub struct ResponseMeta {
5236    pub format_version: u32,
5237    pub request_id: String,
5238    pub correlation_id: Identity,
5239    pub diagnostic_id: Identity,
5240}
5241
5242pub const LODESTONE_API_ERROR_DISPOSITION_FORMAT_VERSION: u16 = 1;
5243#[derive(Clone, Copy, Debug, Deserialize, Eq, PartialEq, Serialize)]
5244#[serde(rename_all = "snake_case")]
5245pub enum ErrorDisposition {
5246    NotSubmitted,
5247    Submitted,
5248    Resolved,
5249    KnownRetired,
5250    Indeterminate,
5251}
5252
5253pub const LODESTONE_API_RECOVERY_ACTION_FORMAT_VERSION: u16 = 1;
5254#[derive(Clone, Copy, Debug, Deserialize, Eq, PartialEq, Serialize)]
5255#[serde(rename_all = "snake_case")]
5256pub enum RecoveryAction {
5257    Retry,
5258    RetryAfter,
5259    RefreshCredential,
5260    RestartPage,
5261    ReduceRequest,
5262    Resolve,
5263    RefreshPrecondition,
5264    CorrectRange,
5265    Stop,
5266}
5267
5268pub const LODESTONE_API_LIMIT_CLASS_FORMAT_VERSION: u16 = 1;
5269#[derive(Clone, Copy, Debug, Deserialize, Eq, PartialEq, Serialize)]
5270#[serde(rename_all = "snake_case")]
5271pub enum LimitClass {
5272    RequestBound,
5273    CollectionQuota,
5274    EngineSafety,
5275}
5276
5277pub const LODESTONE_API_ERROR_DETAIL_FORMAT_VERSION: u16 = 3;
5278#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
5279#[serde(tag = "code", rename_all = "snake_case", deny_unknown_fields)]
5280pub enum ErrorDetail {
5281    Aborted {
5282        reason: String,
5283    },
5284    DeadlineExceeded,
5285    InvalidRequest {
5286        #[serde(default, skip_serializing_if = "Option::is_none")]
5287        field: Option<String>,
5288        reason: String,
5289    },
5290    UnsupportedVersion {
5291        observed: u32,
5292        maximum_supported: u32,
5293    },
5294    Unauthenticated,
5295    PermissionDenied {
5296        #[serde(default, skip_serializing_if = "Option::is_none")]
5297        action: Option<String>,
5298        #[serde(default, skip_serializing_if = "Option::is_none")]
5299        workload_class: Option<WorkloadClass>,
5300    },
5301    NotFound {
5302        #[serde(default, skip_serializing_if = "Option::is_none")]
5303        resource: Option<String>,
5304    },
5305    Conflict {
5306        #[serde(default, skip_serializing_if = "Option::is_none")]
5307        expected_revision: Option<U64>,
5308        #[serde(default, skip_serializing_if = "Option::is_none")]
5309        observed_revision: Option<U64>,
5310    },
5311    StaleCursor {
5312        restart_count: u32,
5313    },
5314    RestartBudgetExhausted {
5315        maximum_restarts: u32,
5316    },
5317    LimitExceeded {
5318        class: LimitClass,
5319        limit_id: String,
5320        maximum: U64,
5321    },
5322    CapabilityUnavailable {
5323        #[serde(default, skip_serializing_if = "Option::is_none")]
5324        capability: Option<String>,
5325    },
5326    NotSubmitted {
5327        #[serde(default, skip_serializing_if = "Option::is_none")]
5328        retry_after_millis: Option<U64>,
5329    },
5330    SubmittedIndeterminate {
5331        #[serde(default, skip_serializing_if = "Option::is_none")]
5332        locator: Option<Locator>,
5333    },
5334    ExpiredUnknown {
5335        #[serde(default, skip_serializing_if = "Option::is_none")]
5336        locator: Option<Locator>,
5337    },
5338    SecretNotEscrowed,
5339    RetentionGap {
5340        retired_through: U64,
5341    },
5342    ArtifactRangeInvalid {
5343        maximum_bytes: U64,
5344    },
5345    ChecksumMismatch {
5346        expected: Digest,
5347        observed: Digest,
5348    },
5349    TemporarilyUnavailable {
5350        #[serde(default, skip_serializing_if = "Option::is_none")]
5351        retry_after_millis: Option<U64>,
5352    },
5353    Internal,
5354}
5355
5356pub const LODESTONE_API_CONNECTION_PROFILE_SHAPE_VERSION: u16 = 4;
5357pub const LODESTONE_API_CONNECTION_PROFILE_FORMAT_VERSION: u16 = 4;
5358#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
5359#[serde(deny_unknown_fields)]
5360pub struct ConnectionProfile {
5361    pub format_version: u32,
5362    pub profile_generation: U64,
5363    pub native_endpoints: Vec<String>,
5364    pub selected_stream_endpoint: String,
5365    pub tls_server_name: String,
5366    pub tls_trust_sha256: Digest,
5367    pub expected_cluster_id: Identity,
5368    pub expected_collection_id: Identity,
5369    pub expected_principal_id: Identity,
5370    pub schema_id: String,
5371    pub schema_digest: Digest,
5372    pub credential_id: Identity,
5373    pub credential_generation: U64,
5374    #[serde(default, skip_serializing_if = "Option::is_none")]
5375    pub credential_expires_at: Option<U64>,
5376    pub secret_reference: String,
5377    #[serde(default, skip_serializing_if = "Option::is_none")]
5378    pub storage_profile_expectation: Option<StorageProfileExpectation>,
5379}
5380
5381#[derive(Clone, Copy, Debug, Eq, PartialEq)]
5382pub enum TypeKind {
5383    Enum,
5384    Struct,
5385    TaggedUnion,
5386}
5387#[derive(Clone, Copy, Debug, Eq, PartialEq)]
5388pub struct TypeContract {
5389    pub name: &'static str,
5390    pub shape_version: u16,
5391    pub instance_format_version: Option<u16>,
5392    pub kind: TypeKind,
5393    pub wire: bool,
5394}
5395pub const LODESTONE_API_TYPE_CONTRACTS: &[TypeContract] = &[
5396    TypeContract {
5397        name: "cursor",
5398        shape_version: 1,
5399        instance_format_version: None,
5400        kind: TypeKind::Struct,
5401        wire: true,
5402    },
5403    TypeContract {
5404        name: "locator",
5405        shape_version: 1,
5406        instance_format_version: None,
5407        kind: TypeKind::Struct,
5408        wire: true,
5409    },
5410    TypeContract {
5411        name: "resource",
5412        shape_version: 1,
5413        instance_format_version: None,
5414        kind: TypeKind::Struct,
5415        wire: true,
5416    },
5417    TypeContract {
5418        name: "field_promotion_configuration",
5419        shape_version: 1,
5420        instance_format_version: Some(3),
5421        kind: TypeKind::Struct,
5422        wire: true,
5423    },
5424    TypeContract {
5425        name: "overload_configuration",
5426        shape_version: 2,
5427        instance_format_version: Some(3),
5428        kind: TypeKind::Struct,
5429        wire: true,
5430    },
5431    TypeContract {
5432        name: "index_policies",
5433        shape_version: 1,
5434        instance_format_version: None,
5435        kind: TypeKind::Struct,
5436        wire: true,
5437    },
5438    TypeContract {
5439        name: "maintenance_budgets",
5440        shape_version: 1,
5441        instance_format_version: None,
5442        kind: TypeKind::Struct,
5443        wire: true,
5444    },
5445    TypeContract {
5446        name: "resource_durability_class",
5447        shape_version: 1,
5448        instance_format_version: None,
5449        kind: TypeKind::Enum,
5450        wire: true,
5451    },
5452    TypeContract {
5453        name: "resource_storage_class",
5454        shape_version: 1,
5455        instance_format_version: None,
5456        kind: TypeKind::Enum,
5457        wire: true,
5458    },
5459    TypeContract {
5460        name: "vector_quality_objective",
5461        shape_version: 1,
5462        instance_format_version: None,
5463        kind: TypeKind::Enum,
5464        wire: true,
5465    },
5466    TypeContract {
5467        name: "vector_indexing_objective",
5468        shape_version: 1,
5469        instance_format_version: None,
5470        kind: TypeKind::Enum,
5471        wire: true,
5472    },
5473    TypeContract {
5474        name: "vector_residency_intent",
5475        shape_version: 1,
5476        instance_format_version: None,
5477        kind: TypeKind::Enum,
5478        wire: true,
5479    },
5480    TypeContract {
5481        name: "vector_calibration_binding",
5482        shape_version: 1,
5483        instance_format_version: None,
5484        kind: TypeKind::Struct,
5485        wire: true,
5486    },
5487    TypeContract {
5488        name: "vector_resource_policy",
5489        shape_version: 2,
5490        instance_format_version: None,
5491        kind: TypeKind::Struct,
5492        wire: true,
5493    },
5494    TypeContract {
5495        name: "workload_class",
5496        shape_version: 1,
5497        instance_format_version: None,
5498        kind: TypeKind::Enum,
5499        wire: true,
5500    },
5501    TypeContract {
5502        name: "index_resource_spec",
5503        shape_version: 3,
5504        instance_format_version: Some(3),
5505        kind: TypeKind::Struct,
5506        wire: true,
5507    },
5508    TypeContract {
5509        name: "index_summary",
5510        shape_version: 1,
5511        instance_format_version: None,
5512        kind: TypeKind::Struct,
5513        wire: true,
5514    },
5515    TypeContract {
5516        name: "mapping_mode",
5517        shape_version: 1,
5518        instance_format_version: None,
5519        kind: TypeKind::Enum,
5520        wire: true,
5521    },
5522    TypeContract {
5523        name: "dynamic_mapping_policy",
5524        shape_version: 1,
5525        instance_format_version: None,
5526        kind: TypeKind::Enum,
5527        wire: true,
5528    },
5529    TypeContract {
5530        name: "mapping_analyzer",
5531        shape_version: 1,
5532        instance_format_version: None,
5533        kind: TypeKind::Enum,
5534        wire: true,
5535    },
5536    TypeContract {
5537        name: "keyword_normalizer",
5538        shape_version: 1,
5539        instance_format_version: None,
5540        kind: TypeKind::Enum,
5541        wire: true,
5542    },
5543    TypeContract {
5544        name: "vector_metric",
5545        shape_version: 1,
5546        instance_format_version: None,
5547        kind: TypeKind::Enum,
5548        wire: true,
5549    },
5550    TypeContract {
5551        name: "mapping_scalar",
5552        shape_version: 1,
5553        instance_format_version: None,
5554        kind: TypeKind::TaggedUnion,
5555        wire: true,
5556    },
5557    TypeContract {
5558        name: "sparse_vector_weight_type",
5559        shape_version: 1,
5560        instance_format_version: None,
5561        kind: TypeKind::Enum,
5562        wire: true,
5563    },
5564    TypeContract {
5565        name: "mapping_field_type",
5566        shape_version: 3,
5567        instance_format_version: None,
5568        kind: TypeKind::TaggedUnion,
5569        wire: true,
5570    },
5571    TypeContract {
5572        name: "mapping_field",
5573        shape_version: 1,
5574        instance_format_version: None,
5575        kind: TypeKind::Struct,
5576        wire: true,
5577    },
5578    TypeContract {
5579        name: "multi_field_projection",
5580        shape_version: 1,
5581        instance_format_version: None,
5582        kind: TypeKind::Struct,
5583        wire: true,
5584    },
5585    TypeContract {
5586        name: "analyzer_identity",
5587        shape_version: 1,
5588        instance_format_version: None,
5589        kind: TypeKind::Struct,
5590        wire: true,
5591    },
5592    TypeContract {
5593        name: "keyword_limit",
5594        shape_version: 1,
5595        instance_format_version: None,
5596        kind: TypeKind::Struct,
5597        wire: true,
5598    },
5599    TypeContract {
5600        name: "profile_privacy_action",
5601        shape_version: 1,
5602        instance_format_version: None,
5603        kind: TypeKind::Enum,
5604        wire: true,
5605    },
5606    TypeContract {
5607        name: "profile_privacy_field",
5608        shape_version: 1,
5609        instance_format_version: None,
5610        kind: TypeKind::TaggedUnion,
5611        wire: true,
5612    },
5613    TypeContract {
5614        name: "profile_privacy_rule",
5615        shape_version: 1,
5616        instance_format_version: None,
5617        kind: TypeKind::Struct,
5618        wire: true,
5619    },
5620    TypeContract {
5621        name: "profile_privacy_policy",
5622        shape_version: 1,
5623        instance_format_version: Some(1),
5624        kind: TypeKind::Struct,
5625        wire: true,
5626    },
5627    TypeContract {
5628        name: "mapping_record_model",
5629        shape_version: 3,
5630        instance_format_version: None,
5631        kind: TypeKind::TaggedUnion,
5632        wire: true,
5633    },
5634    TypeContract {
5635        name: "mapping",
5636        shape_version: 4,
5637        instance_format_version: Some(10),
5638        kind: TypeKind::Struct,
5639        wire: true,
5640    },
5641    TypeContract {
5642        name: "index_detail",
5643        shape_version: 1,
5644        instance_format_version: None,
5645        kind: TypeKind::Struct,
5646        wire: true,
5647    },
5648    TypeContract {
5649        name: "source_provider",
5650        shape_version: 1,
5651        instance_format_version: None,
5652        kind: TypeKind::Enum,
5653        wire: true,
5654    },
5655    TypeContract {
5656        name: "source_decoder",
5657        shape_version: 1,
5658        instance_format_version: None,
5659        kind: TypeKind::Enum,
5660        wire: true,
5661    },
5662    TypeContract {
5663        name: "source_replay_guarantees",
5664        shape_version: 1,
5665        instance_format_version: None,
5666        kind: TypeKind::Struct,
5667        wire: true,
5668    },
5669    TypeContract {
5670        name: "source_partition_configuration",
5671        shape_version: 1,
5672        instance_format_version: None,
5673        kind: TypeKind::Struct,
5674        wire: true,
5675    },
5676    TypeContract {
5677        name: "replayable_source_configuration",
5678        shape_version: 1,
5679        instance_format_version: None,
5680        kind: TypeKind::Struct,
5681        wire: true,
5682    },
5683    TypeContract {
5684        name: "source_partition_status",
5685        shape_version: 1,
5686        instance_format_version: None,
5687        kind: TypeKind::Struct,
5688        wire: true,
5689    },
5690    TypeContract {
5691        name: "replayable_source_status",
5692        shape_version: 1,
5693        instance_format_version: None,
5694        kind: TypeKind::Struct,
5695        wire: true,
5696    },
5697    TypeContract {
5698        name: "source_control_transition",
5699        shape_version: 1,
5700        instance_format_version: None,
5701        kind: TypeKind::Enum,
5702        wire: true,
5703    },
5704    TypeContract {
5705        name: "history_ledger_precondition",
5706        shape_version: 1,
5707        instance_format_version: None,
5708        kind: TypeKind::TaggedUnion,
5709        wire: true,
5710    },
5711    TypeContract {
5712        name: "history_retention_policy",
5713        shape_version: 1,
5714        instance_format_version: None,
5715        kind: TypeKind::Struct,
5716        wire: true,
5717    },
5718    TypeContract {
5719        name: "history_selector",
5720        shape_version: 1,
5721        instance_format_version: None,
5722        kind: TypeKind::TaggedUnion,
5723        wire: true,
5724    },
5725    TypeContract {
5726        name: "history_hold",
5727        shape_version: 1,
5728        instance_format_version: None,
5729        kind: TypeKind::Struct,
5730        wire: true,
5731    },
5732    TypeContract {
5733        name: "history_status",
5734        shape_version: 1,
5735        instance_format_version: None,
5736        kind: TypeKind::Struct,
5737        wire: true,
5738    },
5739    TypeContract {
5740        name: "history_resolution",
5741        shape_version: 1,
5742        instance_format_version: None,
5743        kind: TypeKind::Struct,
5744        wire: true,
5745    },
5746    TypeContract {
5747        name: "index_reference",
5748        shape_version: 1,
5749        instance_format_version: None,
5750        kind: TypeKind::Struct,
5751        wire: true,
5752    },
5753    TypeContract {
5754        name: "alias_target",
5755        shape_version: 1,
5756        instance_format_version: None,
5757        kind: TypeKind::Struct,
5758        wire: true,
5759    },
5760    TypeContract {
5761        name: "alias_summary",
5762        shape_version: 1,
5763        instance_format_version: None,
5764        kind: TypeKind::Struct,
5765        wire: true,
5766    },
5767    TypeContract {
5768        name: "alias_detail",
5769        shape_version: 1,
5770        instance_format_version: None,
5771        kind: TypeKind::Struct,
5772        wire: true,
5773    },
5774    TypeContract {
5775        name: "data_stream_summary",
5776        shape_version: 1,
5777        instance_format_version: None,
5778        kind: TypeKind::Struct,
5779        wire: true,
5780    },
5781    TypeContract {
5782        name: "component_template_binding",
5783        shape_version: 1,
5784        instance_format_version: None,
5785        kind: TypeKind::Struct,
5786        wire: true,
5787    },
5788    TypeContract {
5789        name: "index_template_binding",
5790        shape_version: 1,
5791        instance_format_version: None,
5792        kind: TypeKind::Struct,
5793        wire: true,
5794    },
5795    TypeContract {
5796        name: "lifecycle_policy_binding",
5797        shape_version: 1,
5798        instance_format_version: None,
5799        kind: TypeKind::Struct,
5800        wire: true,
5801    },
5802    TypeContract {
5803        name: "data_stream_detail",
5804        shape_version: 1,
5805        instance_format_version: None,
5806        kind: TypeKind::Struct,
5807        wire: true,
5808    },
5809    TypeContract {
5810        name: "component_template_summary",
5811        shape_version: 1,
5812        instance_format_version: None,
5813        kind: TypeKind::Struct,
5814        wire: true,
5815    },
5816    TypeContract {
5817        name: "component_template_detail",
5818        shape_version: 1,
5819        instance_format_version: None,
5820        kind: TypeKind::Struct,
5821        wire: true,
5822    },
5823    TypeContract {
5824        name: "index_template_summary",
5825        shape_version: 1,
5826        instance_format_version: None,
5827        kind: TypeKind::Struct,
5828        wire: true,
5829    },
5830    TypeContract {
5831        name: "index_template_detail",
5832        shape_version: 1,
5833        instance_format_version: None,
5834        kind: TypeKind::Struct,
5835        wire: true,
5836    },
5837    TypeContract {
5838        name: "ingest_pipeline_summary",
5839        shape_version: 1,
5840        instance_format_version: None,
5841        kind: TypeKind::Struct,
5842        wire: true,
5843    },
5844    TypeContract {
5845        name: "ingest_pipeline_detail",
5846        shape_version: 1,
5847        instance_format_version: None,
5848        kind: TypeKind::Struct,
5849        wire: true,
5850    },
5851    TypeContract {
5852        name: "ingest_pipeline_selection",
5853        shape_version: 1,
5854        instance_format_version: None,
5855        kind: TypeKind::Struct,
5856        wire: true,
5857    },
5858    TypeContract {
5859        name: "lifecycle_policy_summary",
5860        shape_version: 1,
5861        instance_format_version: None,
5862        kind: TypeKind::Struct,
5863        wire: true,
5864    },
5865    TypeContract {
5866        name: "rollover_thresholds",
5867        shape_version: 1,
5868        instance_format_version: None,
5869        kind: TypeKind::Struct,
5870        wire: true,
5871    },
5872    TypeContract {
5873        name: "retention_policy",
5874        shape_version: 1,
5875        instance_format_version: None,
5876        kind: TypeKind::Struct,
5877        wire: true,
5878    },
5879    TypeContract {
5880        name: "lifecycle_policy_detail",
5881        shape_version: 1,
5882        instance_format_version: None,
5883        kind: TypeKind::Struct,
5884        wire: true,
5885    },
5886    TypeContract {
5887        name: "text_query_operator",
5888        shape_version: 1,
5889        instance_format_version: None,
5890        kind: TypeKind::Enum,
5891        wire: true,
5892    },
5893    TypeContract {
5894        name: "text_query_analyzer",
5895        shape_version: 1,
5896        instance_format_version: None,
5897        kind: TypeKind::Enum,
5898        wire: true,
5899    },
5900    TypeContract {
5901        name: "zero_terms_query",
5902        shape_version: 1,
5903        instance_format_version: None,
5904        kind: TypeKind::Enum,
5905        wire: true,
5906    },
5907    TypeContract {
5908        name: "text_query_options",
5909        shape_version: 1,
5910        instance_format_version: None,
5911        kind: TypeKind::Struct,
5912        wire: true,
5913    },
5914    TypeContract {
5915        name: "multi_match_mode",
5916        shape_version: 1,
5917        instance_format_version: None,
5918        kind: TypeKind::Enum,
5919        wire: true,
5920    },
5921    TypeContract {
5922        name: "multi_match_field",
5923        shape_version: 1,
5924        instance_format_version: None,
5925        kind: TypeKind::Struct,
5926        wire: true,
5927    },
5928    TypeContract {
5929        name: "multi_match_options",
5930        shape_version: 1,
5931        instance_format_version: None,
5932        kind: TypeKind::Struct,
5933        wire: true,
5934    },
5935    TypeContract {
5936        name: "sort_order",
5937        shape_version: 1,
5938        instance_format_version: None,
5939        kind: TypeKind::Enum,
5940        wire: true,
5941    },
5942    TypeContract {
5943        name: "sort_mode",
5944        shape_version: 1,
5945        instance_format_version: None,
5946        kind: TypeKind::Enum,
5947        wire: true,
5948    },
5949    TypeContract {
5950        name: "missing_order",
5951        shape_version: 1,
5952        instance_format_version: None,
5953        kind: TypeKind::Enum,
5954        wire: true,
5955    },
5956    TypeContract {
5957        name: "nested_score_mode",
5958        shape_version: 1,
5959        instance_format_version: None,
5960        kind: TypeKind::Enum,
5961        wire: true,
5962    },
5963    TypeContract {
5964        name: "nested_inner_hits",
5965        shape_version: 1,
5966        instance_format_version: None,
5967        kind: TypeKind::Struct,
5968        wire: true,
5969    },
5970    TypeContract {
5971        name: "sort_spec",
5972        shape_version: 1,
5973        instance_format_version: None,
5974        kind: TypeKind::TaggedUnion,
5975        wire: true,
5976    },
5977    TypeContract {
5978        name: "query",
5979        shape_version: 1,
5980        instance_format_version: None,
5981        kind: TypeKind::TaggedUnion,
5982        wire: true,
5983    },
5984    TypeContract {
5985        name: "dense_retrieval_mode",
5986        shape_version: 1,
5987        instance_format_version: None,
5988        kind: TypeKind::Enum,
5989        wire: true,
5990    },
5991    TypeContract {
5992        name: "vector_achieved_mode",
5993        shape_version: 1,
5994        instance_format_version: None,
5995        kind: TypeKind::Enum,
5996        wire: true,
5997    },
5998    TypeContract {
5999        name: "vector_branch_diagnostics",
6000        shape_version: 2,
6001        instance_format_version: None,
6002        kind: TypeKind::Struct,
6003        wire: true,
6004    },
6005    TypeContract {
6006        name: "dense_vector_element_type",
6007        shape_version: 1,
6008        instance_format_version: None,
6009        kind: TypeKind::Enum,
6010        wire: true,
6011    },
6012    TypeContract {
6013        name: "dense_vector_byte_order",
6014        shape_version: 1,
6015        instance_format_version: None,
6016        kind: TypeKind::Enum,
6017        wire: true,
6018    },
6019    TypeContract {
6020        name: "vector_value",
6021        shape_version: 1,
6022        instance_format_version: None,
6023        kind: TypeKind::TaggedUnion,
6024        wire: true,
6025    },
6026    TypeContract {
6027        name: "sparse_vector_entry",
6028        shape_version: 1,
6029        instance_format_version: None,
6030        kind: TypeKind::Struct,
6031        wire: true,
6032    },
6033    TypeContract {
6034        name: "sparse_vector_value",
6035        shape_version: 1,
6036        instance_format_version: None,
6037        kind: TypeKind::Struct,
6038        wire: true,
6039    },
6040    TypeContract {
6041        name: "vector_set_value",
6042        shape_version: 1,
6043        instance_format_version: None,
6044        kind: TypeKind::Struct,
6045        wire: true,
6046    },
6047    TypeContract {
6048        name: "vector_evaluation_snapshot",
6049        shape_version: 1,
6050        instance_format_version: None,
6051        kind: TypeKind::TaggedUnion,
6052        wire: true,
6053    },
6054    TypeContract {
6055        name: "vector_evaluation_query_set",
6056        shape_version: 1,
6057        instance_format_version: None,
6058        kind: TypeKind::TaggedUnion,
6059        wire: true,
6060    },
6061    TypeContract {
6062        name: "vector_evaluation_budget",
6063        shape_version: 1,
6064        instance_format_version: None,
6065        kind: TypeKind::Struct,
6066        wire: true,
6067    },
6068    TypeContract {
6069        name: "vector_candidate_policy",
6070        shape_version: 1,
6071        instance_format_version: None,
6072        kind: TypeKind::Enum,
6073        wire: true,
6074    },
6075    TypeContract {
6076        name: "vector_calibration_objective",
6077        shape_version: 1,
6078        instance_format_version: None,
6079        kind: TypeKind::Enum,
6080        wire: true,
6081    },
6082    TypeContract {
6083        name: "vector_strategy_profile",
6084        shape_version: 1,
6085        instance_format_version: None,
6086        kind: TypeKind::Enum,
6087        wire: true,
6088    },
6089    TypeContract {
6090        name: "vector_evaluation_work",
6091        shape_version: 1,
6092        instance_format_version: None,
6093        kind: TypeKind::Struct,
6094        wire: true,
6095    },
6096    TypeContract {
6097        name: "vector_evaluation_error_code",
6098        shape_version: 1,
6099        instance_format_version: None,
6100        kind: TypeKind::Enum,
6101        wire: true,
6102    },
6103    TypeContract {
6104        name: "vector_evaluation_error",
6105        shape_version: 1,
6106        instance_format_version: None,
6107        kind: TypeKind::Struct,
6108        wire: true,
6109    },
6110    TypeContract {
6111        name: "vector_recall_result",
6112        shape_version: 1,
6113        instance_format_version: Some(1),
6114        kind: TypeKind::Struct,
6115        wire: true,
6116    },
6117    TypeContract {
6118        name: "vector_calibration_candidate",
6119        shape_version: 1,
6120        instance_format_version: None,
6121        kind: TypeKind::Struct,
6122        wire: true,
6123    },
6124    TypeContract {
6125        name: "vector_calibration_result",
6126        shape_version: 1,
6127        instance_format_version: Some(1),
6128        kind: TypeKind::Struct,
6129        wire: true,
6130    },
6131    TypeContract {
6132        name: "vector_diagnostic_result",
6133        shape_version: 1,
6134        instance_format_version: None,
6135        kind: TypeKind::TaggedUnion,
6136        wire: true,
6137    },
6138    TypeContract {
6139        name: "vector_warm_component",
6140        shape_version: 1,
6141        instance_format_version: None,
6142        kind: TypeKind::Enum,
6143        wire: true,
6144    },
6145    TypeContract {
6146        name: "vector_warm_state",
6147        shape_version: 1,
6148        instance_format_version: None,
6149        kind: TypeKind::Enum,
6150        wire: true,
6151    },
6152    TypeContract {
6153        name: "vector_warm_achievement",
6154        shape_version: 1,
6155        instance_format_version: None,
6156        kind: TypeKind::Struct,
6157        wire: true,
6158    },
6159    TypeContract {
6160        name: "vector_warm_result",
6161        shape_version: 1,
6162        instance_format_version: Some(1),
6163        kind: TypeKind::Struct,
6164        wire: true,
6165    },
6166    TypeContract {
6167        name: "dense_retrieval_threshold",
6168        shape_version: 1,
6169        instance_format_version: None,
6170        kind: TypeKind::TaggedUnion,
6171        wire: true,
6172    },
6173    TypeContract {
6174        name: "retrieval_branch",
6175        shape_version: 3,
6176        instance_format_version: None,
6177        kind: TypeKind::TaggedUnion,
6178        wire: true,
6179    },
6180    TypeContract {
6181        name: "weighted_rrf_fusion",
6182        shape_version: 1,
6183        instance_format_version: None,
6184        kind: TypeKind::Struct,
6185        wire: true,
6186    },
6187    TypeContract {
6188        name: "retrieval_plan",
6189        shape_version: 1,
6190        instance_format_version: Some(1),
6191        kind: TypeKind::Struct,
6192        wire: true,
6193    },
6194    TypeContract {
6195        name: "histogram_bounds",
6196        shape_version: 1,
6197        instance_format_version: None,
6198        kind: TypeKind::Struct,
6199        wire: true,
6200    },
6201    TypeContract {
6202        name: "date_histogram_bounds",
6203        shape_version: 1,
6204        instance_format_version: None,
6205        kind: TypeKind::Struct,
6206        wire: true,
6207    },
6208    TypeContract {
6209        name: "approximation_algorithm",
6210        shape_version: 1,
6211        instance_format_version: None,
6212        kind: TypeKind::Enum,
6213        wire: true,
6214    },
6215    TypeContract {
6216        name: "approximation",
6217        shape_version: 1,
6218        instance_format_version: None,
6219        kind: TypeKind::Struct,
6220        wire: true,
6221    },
6222    TypeContract {
6223        name: "percentile_value",
6224        shape_version: 1,
6225        instance_format_version: None,
6226        kind: TypeKind::Struct,
6227        wire: true,
6228    },
6229    TypeContract {
6230        name: "approximate_percentile_value",
6231        shape_version: 1,
6232        instance_format_version: None,
6233        kind: TypeKind::Struct,
6234        wire: true,
6235    },
6236    TypeContract {
6237        name: "time_series_operator",
6238        shape_version: 1,
6239        instance_format_version: None,
6240        kind: TypeKind::Enum,
6241        wire: true,
6242    },
6243    TypeContract {
6244        name: "time_series_missing_data",
6245        shape_version: 1,
6246        instance_format_version: None,
6247        kind: TypeKind::Enum,
6248        wire: true,
6249    },
6250    TypeContract {
6251        name: "time_series_quantile_mode",
6252        shape_version: 1,
6253        instance_format_version: None,
6254        kind: TypeKind::Enum,
6255        wire: true,
6256    },
6257    TypeContract {
6258        name: "time_series_bucket_state",
6259        shape_version: 1,
6260        instance_format_version: None,
6261        kind: TypeKind::Enum,
6262        wire: true,
6263    },
6264    TypeContract {
6265        name: "time_series_quantile_value",
6266        shape_version: 1,
6267        instance_format_version: None,
6268        kind: TypeKind::Struct,
6269        wire: true,
6270    },
6271    TypeContract {
6272        name: "time_series_value",
6273        shape_version: 1,
6274        instance_format_version: None,
6275        kind: TypeKind::TaggedUnion,
6276        wire: true,
6277    },
6278    TypeContract {
6279        name: "time_series_bucket",
6280        shape_version: 1,
6281        instance_format_version: None,
6282        kind: TypeKind::Struct,
6283        wire: true,
6284    },
6285    TypeContract {
6286        name: "relationship_traversal_direction",
6287        shape_version: 1,
6288        instance_format_version: None,
6289        kind: TypeKind::Enum,
6290        wire: true,
6291    },
6292    TypeContract {
6293        name: "relationship_traversal_filter",
6294        shape_version: 1,
6295        instance_format_version: None,
6296        kind: TypeKind::Struct,
6297        wire: true,
6298    },
6299    TypeContract {
6300        name: "relationship_traversal_budget",
6301        shape_version: 1,
6302        instance_format_version: None,
6303        kind: TypeKind::Struct,
6304        wire: true,
6305    },
6306    TypeContract {
6307        name: "traversed_relationship",
6308        shape_version: 1,
6309        instance_format_version: None,
6310        kind: TypeKind::Struct,
6311        wire: true,
6312    },
6313    TypeContract {
6314        name: "profile_query_operation",
6315        shape_version: 1,
6316        instance_format_version: None,
6317        kind: TypeKind::Enum,
6318        wire: true,
6319    },
6320    TypeContract {
6321        name: "profile_group_by",
6322        shape_version: 1,
6323        instance_format_version: None,
6324        kind: TypeKind::TaggedUnion,
6325        wire: true,
6326    },
6327    TypeContract {
6328        name: "profile_query_filter",
6329        shape_version: 1,
6330        instance_format_version: None,
6331        kind: TypeKind::Struct,
6332        wire: true,
6333    },
6334    TypeContract {
6335        name: "profile_query_budget",
6336        shape_version: 1,
6337        instance_format_version: None,
6338        kind: TypeKind::Struct,
6339        wire: true,
6340    },
6341    TypeContract {
6342        name: "profile_query_row",
6343        shape_version: 1,
6344        instance_format_version: None,
6345        kind: TypeKind::Struct,
6346        wire: true,
6347    },
6348    TypeContract {
6349        name: "temporal_input",
6350        shape_version: 1,
6351        instance_format_version: None,
6352        kind: TypeKind::Struct,
6353        wire: true,
6354    },
6355    TypeContract {
6356        name: "temporal_pattern",
6357        shape_version: 1,
6358        instance_format_version: None,
6359        kind: TypeKind::TaggedUnion,
6360        wire: true,
6361    },
6362    TypeContract {
6363        name: "historical_temporal_definition",
6364        shape_version: 1,
6365        instance_format_version: Some(1),
6366        kind: TypeKind::Struct,
6367        wire: true,
6368    },
6369    TypeContract {
6370        name: "temporal_evidence_status",
6371        shape_version: 2,
6372        instance_format_version: None,
6373        kind: TypeKind::Enum,
6374        wire: true,
6375    },
6376    TypeContract {
6377        name: "temporal_source_event",
6378        shape_version: 1,
6379        instance_format_version: None,
6380        kind: TypeKind::Struct,
6381        wire: true,
6382    },
6383    TypeContract {
6384        name: "temporal_evidence",
6385        shape_version: 2,
6386        instance_format_version: None,
6387        kind: TypeKind::Struct,
6388        wire: true,
6389    },
6390    TypeContract {
6391        name: "continuous_temporal_start",
6392        shape_version: 1,
6393        instance_format_version: None,
6394        kind: TypeKind::TaggedUnion,
6395        wire: true,
6396    },
6397    TypeContract {
6398        name: "continuous_temporal_watermark_policy",
6399        shape_version: 1,
6400        instance_format_version: None,
6401        kind: TypeKind::TaggedUnion,
6402        wire: true,
6403    },
6404    TypeContract {
6405        name: "continuous_temporal_late_data_policy",
6406        shape_version: 1,
6407        instance_format_version: None,
6408        kind: TypeKind::TaggedUnion,
6409        wire: true,
6410    },
6411    TypeContract {
6412        name: "continuous_temporal_output",
6413        shape_version: 1,
6414        instance_format_version: None,
6415        kind: TypeKind::TaggedUnion,
6416        wire: true,
6417    },
6418    TypeContract {
6419        name: "continuous_temporal_definition",
6420        shape_version: 1,
6421        instance_format_version: Some(1),
6422        kind: TypeKind::Struct,
6423        wire: true,
6424    },
6425    TypeContract {
6426        name: "continuous_temporal_frontier",
6427        shape_version: 1,
6428        instance_format_version: None,
6429        kind: TypeKind::Struct,
6430        wire: true,
6431    },
6432    TypeContract {
6433        name: "continuous_temporal_available_frontier",
6434        shape_version: 1,
6435        instance_format_version: None,
6436        kind: TypeKind::Struct,
6437        wire: true,
6438    },
6439    TypeContract {
6440        name: "continuous_temporal_gap_reason",
6441        shape_version: 1,
6442        instance_format_version: None,
6443        kind: TypeKind::Enum,
6444        wire: true,
6445    },
6446    TypeContract {
6447        name: "continuous_temporal_gap",
6448        shape_version: 1,
6449        instance_format_version: None,
6450        kind: TypeKind::Struct,
6451        wire: true,
6452    },
6453    TypeContract {
6454        name: "continuous_temporal_evaluation",
6455        shape_version: 1,
6456        instance_format_version: Some(1),
6457        kind: TypeKind::Struct,
6458        wire: true,
6459    },
6460    TypeContract {
6461        name: "composite_order",
6462        shape_version: 1,
6463        instance_format_version: None,
6464        kind: TypeKind::Enum,
6465        wire: true,
6466    },
6467    TypeContract {
6468        name: "composite_source",
6469        shape_version: 1,
6470        instance_format_version: None,
6471        kind: TypeKind::TaggedUnion,
6472        wire: true,
6473    },
6474    TypeContract {
6475        name: "aggregation",
6476        shape_version: 3,
6477        instance_format_version: None,
6478        kind: TypeKind::TaggedUnion,
6479        wire: true,
6480    },
6481    TypeContract {
6482        name: "nested_search_hit",
6483        shape_version: 1,
6484        instance_format_version: None,
6485        kind: TypeKind::Struct,
6486        wire: true,
6487    },
6488    TypeContract {
6489        name: "named_nested_inner_hits_result",
6490        shape_version: 1,
6491        instance_format_version: None,
6492        kind: TypeKind::Struct,
6493        wire: true,
6494    },
6495    TypeContract {
6496        name: "fragment_boundary",
6497        shape_version: 1,
6498        instance_format_version: None,
6499        kind: TypeKind::Enum,
6500        wire: true,
6501    },
6502    TypeContract {
6503        name: "fragment_offset_encoding",
6504        shape_version: 1,
6505        instance_format_version: None,
6506        kind: TypeKind::Enum,
6507        wire: true,
6508    },
6509    TypeContract {
6510        name: "fragment_ranker",
6511        shape_version: 1,
6512        instance_format_version: None,
6513        kind: TypeKind::Enum,
6514        wire: true,
6515    },
6516    TypeContract {
6517        name: "fragment_request",
6518        shape_version: 1,
6519        instance_format_version: None,
6520        kind: TypeKind::Struct,
6521        wire: true,
6522    },
6523    TypeContract {
6524        name: "search_fragment",
6525        shape_version: 1,
6526        instance_format_version: None,
6527        kind: TypeKind::Struct,
6528        wire: true,
6529    },
6530    TypeContract {
6531        name: "numeric_feature_transform",
6532        shape_version: 1,
6533        instance_format_version: None,
6534        kind: TypeKind::TaggedUnion,
6535        wire: true,
6536    },
6537    TypeContract {
6538        name: "numeric_result_feature",
6539        shape_version: 1,
6540        instance_format_version: None,
6541        kind: TypeKind::Struct,
6542        wire: true,
6543    },
6544    TypeContract {
6545        name: "result_feature_request",
6546        shape_version: 1,
6547        instance_format_version: None,
6548        kind: TypeKind::Struct,
6549        wire: true,
6550    },
6551    TypeContract {
6552        name: "result_diversification",
6553        shape_version: 1,
6554        instance_format_version: None,
6555        kind: TypeKind::Struct,
6556        wire: true,
6557    },
6558    TypeContract {
6559        name: "branch_score_kind",
6560        shape_version: 2,
6561        instance_format_version: None,
6562        kind: TypeKind::Enum,
6563        wire: true,
6564    },
6565    TypeContract {
6566        name: "result_feature",
6567        shape_version: 1,
6568        instance_format_version: None,
6569        kind: TypeKind::TaggedUnion,
6570        wire: true,
6571    },
6572    TypeContract {
6573        name: "search_hit",
6574        shape_version: 2,
6575        instance_format_version: None,
6576        kind: TypeKind::Struct,
6577        wire: true,
6578    },
6579    TypeContract {
6580        name: "aggregation_bucket",
6581        shape_version: 1,
6582        instance_format_version: None,
6583        kind: TypeKind::Struct,
6584        wire: true,
6585    },
6586    TypeContract {
6587        name: "aggregation_result",
6588        shape_version: 3,
6589        instance_format_version: None,
6590        kind: TypeKind::TaggedUnion,
6591        wire: true,
6592    },
6593    TypeContract {
6594        name: "shard_counts",
6595        shape_version: 1,
6596        instance_format_version: None,
6597        kind: TypeKind::Struct,
6598        wire: true,
6599    },
6600    TypeContract {
6601        name: "total_hits_relation",
6602        shape_version: 1,
6603        instance_format_version: None,
6604        kind: TypeKind::Enum,
6605        wire: true,
6606    },
6607    TypeContract {
6608        name: "search_total",
6609        shape_version: 1,
6610        instance_format_version: None,
6611        kind: TypeKind::Struct,
6612        wire: true,
6613    },
6614    TypeContract {
6615        name: "search_execution_freshness",
6616        shape_version: 1,
6617        instance_format_version: None,
6618        kind: TypeKind::Enum,
6619        wire: true,
6620    },
6621    TypeContract {
6622        name: "search_freshness",
6623        shape_version: 1,
6624        instance_format_version: None,
6625        kind: TypeKind::Enum,
6626        wire: true,
6627    },
6628    TypeContract {
6629        name: "search_degradation_reason",
6630        shape_version: 1,
6631        instance_format_version: None,
6632        kind: TypeKind::Enum,
6633        wire: true,
6634    },
6635    TypeContract {
6636        name: "search_achievement",
6637        shape_version: 1,
6638        instance_format_version: None,
6639        kind: TypeKind::Struct,
6640        wire: true,
6641    },
6642    TypeContract {
6643        name: "search_failure_stage",
6644        shape_version: 1,
6645        instance_format_version: None,
6646        kind: TypeKind::Enum,
6647        wire: true,
6648    },
6649    TypeContract {
6650        name: "search_failure_reason",
6651        shape_version: 1,
6652        instance_format_version: None,
6653        kind: TypeKind::Enum,
6654        wire: true,
6655    },
6656    TypeContract {
6657        name: "collection_shard",
6658        shape_version: 1,
6659        instance_format_version: None,
6660        kind: TypeKind::Struct,
6661        wire: true,
6662    },
6663    TypeContract {
6664        name: "search_partial_failure",
6665        shape_version: 1,
6666        instance_format_version: None,
6667        kind: TypeKind::Struct,
6668        wire: true,
6669    },
6670    TypeContract {
6671        name: "artifact",
6672        shape_version: 1,
6673        instance_format_version: None,
6674        kind: TypeKind::Struct,
6675        wire: true,
6676    },
6677    TypeContract {
6678        name: "portability_storage_capability",
6679        shape_version: 1,
6680        instance_format_version: None,
6681        kind: TypeKind::Struct,
6682        wire: true,
6683    },
6684    TypeContract {
6685        name: "collection_export_artifact",
6686        shape_version: 1,
6687        instance_format_version: None,
6688        kind: TypeKind::Struct,
6689        wire: true,
6690    },
6691    TypeContract {
6692        name: "index_transfer_page",
6693        shape_version: 1,
6694        instance_format_version: None,
6695        kind: TypeKind::Struct,
6696        wire: true,
6697    },
6698    TypeContract {
6699        name: "index_transfer_artifact",
6700        shape_version: 1,
6701        instance_format_version: None,
6702        kind: TypeKind::Struct,
6703        wire: true,
6704    },
6705    TypeContract {
6706        name: "search_validation_bound",
6707        shape_version: 1,
6708        instance_format_version: None,
6709        kind: TypeKind::TaggedUnion,
6710        wire: true,
6711    },
6712    TypeContract {
6713        name: "search_validation_estimates",
6714        shape_version: 1,
6715        instance_format_version: None,
6716        kind: TypeKind::Struct,
6717        wire: true,
6718    },
6719    TypeContract {
6720        name: "search_validation_limit",
6721        shape_version: 1,
6722        instance_format_version: None,
6723        kind: TypeKind::Struct,
6724        wire: true,
6725    },
6726    TypeContract {
6727        name: "operation_kind",
6728        shape_version: 2,
6729        instance_format_version: None,
6730        kind: TypeKind::Enum,
6731        wire: true,
6732    },
6733    TypeContract {
6734        name: "operation_authority",
6735        shape_version: 1,
6736        instance_format_version: None,
6737        kind: TypeKind::Enum,
6738        wire: true,
6739    },
6740    TypeContract {
6741        name: "operation_target",
6742        shape_version: 1,
6743        instance_format_version: None,
6744        kind: TypeKind::TaggedUnion,
6745        wire: true,
6746    },
6747    TypeContract {
6748        name: "operation_state",
6749        shape_version: 1,
6750        instance_format_version: None,
6751        kind: TypeKind::Enum,
6752        wire: true,
6753    },
6754    TypeContract {
6755        name: "operation_pending_state",
6756        shape_version: 1,
6757        instance_format_version: None,
6758        kind: TypeKind::Enum,
6759        wire: true,
6760    },
6761    TypeContract {
6762        name: "operation_progress_unit",
6763        shape_version: 1,
6764        instance_format_version: None,
6765        kind: TypeKind::Enum,
6766        wire: true,
6767    },
6768    TypeContract {
6769        name: "operation_progress",
6770        shape_version: 1,
6771        instance_format_version: None,
6772        kind: TypeKind::Struct,
6773        wire: true,
6774    },
6775    TypeContract {
6776        name: "operation_result",
6777        shape_version: 1,
6778        instance_format_version: None,
6779        kind: TypeKind::TaggedUnion,
6780        wire: true,
6781    },
6782    TypeContract {
6783        name: "operation_failure",
6784        shape_version: 1,
6785        instance_format_version: None,
6786        kind: TypeKind::Struct,
6787        wire: true,
6788    },
6789    TypeContract {
6790        name: "operation_cancellation",
6791        shape_version: 1,
6792        instance_format_version: None,
6793        kind: TypeKind::Enum,
6794        wire: true,
6795    },
6796    TypeContract {
6797        name: "operation_retention_state",
6798        shape_version: 1,
6799        instance_format_version: None,
6800        kind: TypeKind::Enum,
6801        wire: true,
6802    },
6803    TypeContract {
6804        name: "operation_retention",
6805        shape_version: 1,
6806        instance_format_version: None,
6807        kind: TypeKind::Struct,
6808        wire: true,
6809    },
6810    TypeContract {
6811        name: "operation",
6812        shape_version: 2,
6813        instance_format_version: None,
6814        kind: TypeKind::Struct,
6815        wire: true,
6816    },
6817    TypeContract {
6818        name: "write_durability_boundary",
6819        shape_version: 1,
6820        instance_format_version: None,
6821        kind: TypeKind::Enum,
6822        wire: true,
6823    },
6824    TypeContract {
6825        name: "write_visibility_mode",
6826        shape_version: 1,
6827        instance_format_version: None,
6828        kind: TypeKind::Enum,
6829        wire: true,
6830    },
6831    TypeContract {
6832        name: "write_response_stage",
6833        shape_version: 1,
6834        instance_format_version: None,
6835        kind: TypeKind::Enum,
6836        wire: true,
6837    },
6838    TypeContract {
6839        name: "write_achievement",
6840        shape_version: 1,
6841        instance_format_version: None,
6842        kind: TypeKind::Struct,
6843        wire: true,
6844    },
6845    TypeContract {
6846        name: "mutation_commit_position",
6847        shape_version: 1,
6848        instance_format_version: None,
6849        kind: TypeKind::Struct,
6850        wire: true,
6851    },
6852    TypeContract {
6853        name: "mutation_commit_receipt",
6854        shape_version: 1,
6855        instance_format_version: Some(1),
6856        kind: TypeKind::Struct,
6857        wire: true,
6858    },
6859    TypeContract {
6860        name: "mutation_resolver",
6861        shape_version: 1,
6862        instance_format_version: None,
6863        kind: TypeKind::Enum,
6864        wire: true,
6865    },
6866    TypeContract {
6867        name: "mutation_outcome",
6868        shape_version: 1,
6869        instance_format_version: None,
6870        kind: TypeKind::TaggedUnion,
6871        wire: true,
6872    },
6873    TypeContract {
6874        name: "submission_state",
6875        shape_version: 1,
6876        instance_format_version: None,
6877        kind: TypeKind::Enum,
6878        wire: true,
6879    },
6880    TypeContract {
6881        name: "expected_binding",
6882        shape_version: 1,
6883        instance_format_version: None,
6884        kind: TypeKind::Struct,
6885        wire: true,
6886    },
6887    TypeContract {
6888        name: "administration_alias_action",
6889        shape_version: 1,
6890        instance_format_version: None,
6891        kind: TypeKind::TaggedUnion,
6892        wire: true,
6893    },
6894    TypeContract {
6895        name: "administration_mutation",
6896        shape_version: 1,
6897        instance_format_version: None,
6898        kind: TypeKind::TaggedUnion,
6899        wire: true,
6900    },
6901    TypeContract {
6902        name: "administration_outcome",
6903        shape_version: 1,
6904        instance_format_version: None,
6905        kind: TypeKind::Struct,
6906        wire: true,
6907    },
6908    TypeContract {
6909        name: "index_change_apply_receipt",
6910        shape_version: 1,
6911        instance_format_version: None,
6912        kind: TypeKind::Struct,
6913        wire: true,
6914    },
6915    TypeContract {
6916        name: "bulk_document_item",
6917        shape_version: 2,
6918        instance_format_version: None,
6919        kind: TypeKind::Struct,
6920        wire: true,
6921    },
6922    TypeContract {
6923        name: "bulk_document_item_outcome",
6924        shape_version: 1,
6925        instance_format_version: None,
6926        kind: TypeKind::Struct,
6927        wire: true,
6928    },
6929    TypeContract {
6930        name: "bulk_document_outcome",
6931        shape_version: 1,
6932        instance_format_version: None,
6933        kind: TypeKind::Struct,
6934        wire: true,
6935    },
6936    TypeContract {
6937        name: "metric_attribute_value",
6938        shape_version: 1,
6939        instance_format_version: None,
6940        kind: TypeKind::TaggedUnion,
6941        wire: true,
6942    },
6943    TypeContract {
6944        name: "metric_attribute",
6945        shape_version: 1,
6946        instance_format_version: None,
6947        kind: TypeKind::Struct,
6948        wire: true,
6949    },
6950    TypeContract {
6951        name: "metric_number",
6952        shape_version: 1,
6953        instance_format_version: None,
6954        kind: TypeKind::TaggedUnion,
6955        wire: true,
6956    },
6957    TypeContract {
6958        name: "metric_temporality",
6959        shape_version: 1,
6960        instance_format_version: None,
6961        kind: TypeKind::Enum,
6962        wire: true,
6963    },
6964    TypeContract {
6965        name: "metric_point_kind",
6966        shape_version: 1,
6967        instance_format_version: None,
6968        kind: TypeKind::Enum,
6969        wire: true,
6970    },
6971    TypeContract {
6972        name: "metric_exponential_buckets",
6973        shape_version: 1,
6974        instance_format_version: None,
6975        kind: TypeKind::Struct,
6976        wire: true,
6977    },
6978    TypeContract {
6979        name: "metric_data",
6980        shape_version: 1,
6981        instance_format_version: None,
6982        kind: TypeKind::TaggedUnion,
6983        wire: true,
6984    },
6985    TypeContract {
6986        name: "metric_instrumentation_scope",
6987        shape_version: 1,
6988        instance_format_version: None,
6989        kind: TypeKind::Struct,
6990        wire: true,
6991    },
6992    TypeContract {
6993        name: "metric_exemplar",
6994        shape_version: 1,
6995        instance_format_version: None,
6996        kind: TypeKind::Struct,
6997        wire: true,
6998    },
6999    TypeContract {
7000        name: "metric_point",
7001        shape_version: 1,
7002        instance_format_version: Some(1),
7003        kind: TypeKind::Struct,
7004        wire: true,
7005    },
7006    TypeContract {
7007        name: "entity_ref",
7008        shape_version: 1,
7009        instance_format_version: None,
7010        kind: TypeKind::Struct,
7011        wire: true,
7012    },
7013    TypeContract {
7014        name: "relationship_evidence_ref",
7015        shape_version: 1,
7016        instance_format_version: None,
7017        kind: TypeKind::Struct,
7018        wire: true,
7019    },
7020    TypeContract {
7021        name: "relationship_directionality",
7022        shape_version: 1,
7023        instance_format_version: None,
7024        kind: TypeKind::Enum,
7025        wire: true,
7026    },
7027    TypeContract {
7028        name: "relationship_record",
7029        shape_version: 1,
7030        instance_format_version: Some(1),
7031        kind: TypeKind::Struct,
7032        wire: true,
7033    },
7034    TypeContract {
7035        name: "profile_label",
7036        shape_version: 1,
7037        instance_format_version: None,
7038        kind: TypeKind::Struct,
7039        wire: true,
7040    },
7041    TypeContract {
7042        name: "profile_sample_type",
7043        shape_version: 1,
7044        instance_format_version: None,
7045        kind: TypeKind::Struct,
7046        wire: true,
7047    },
7048    TypeContract {
7049        name: "profile_mapping",
7050        shape_version: 1,
7051        instance_format_version: None,
7052        kind: TypeKind::Struct,
7053        wire: true,
7054    },
7055    TypeContract {
7056        name: "profile_function",
7057        shape_version: 1,
7058        instance_format_version: None,
7059        kind: TypeKind::Struct,
7060        wire: true,
7061    },
7062    TypeContract {
7063        name: "profile_line",
7064        shape_version: 1,
7065        instance_format_version: None,
7066        kind: TypeKind::Struct,
7067        wire: true,
7068    },
7069    TypeContract {
7070        name: "profile_location",
7071        shape_version: 1,
7072        instance_format_version: None,
7073        kind: TypeKind::Struct,
7074        wire: true,
7075    },
7076    TypeContract {
7077        name: "profile_stack",
7078        shape_version: 1,
7079        instance_format_version: None,
7080        kind: TypeKind::Struct,
7081        wire: true,
7082    },
7083    TypeContract {
7084        name: "profile_sample",
7085        shape_version: 1,
7086        instance_format_version: None,
7087        kind: TypeKind::Struct,
7088        wire: true,
7089    },
7090    TypeContract {
7091        name: "profile_instrumentation_scope",
7092        shape_version: 1,
7093        instance_format_version: None,
7094        kind: TypeKind::Struct,
7095        wire: true,
7096    },
7097    TypeContract {
7098        name: "profile_batch",
7099        shape_version: 1,
7100        instance_format_version: Some(1),
7101        kind: TypeKind::Struct,
7102        wire: true,
7103    },
7104    TypeContract {
7105        name: "native_record",
7106        shape_version: 3,
7107        instance_format_version: None,
7108        kind: TypeKind::TaggedUnion,
7109        wire: true,
7110    },
7111    TypeContract {
7112        name: "retained_append_item",
7113        shape_version: 4,
7114        instance_format_version: None,
7115        kind: TypeKind::Struct,
7116        wire: true,
7117    },
7118    TypeContract {
7119        name: "retained_append_state",
7120        shape_version: 1,
7121        instance_format_version: None,
7122        kind: TypeKind::Enum,
7123        wire: true,
7124    },
7125    TypeContract {
7126        name: "retained_append_retry_safety",
7127        shape_version: 1,
7128        instance_format_version: None,
7129        kind: TypeKind::Enum,
7130        wire: true,
7131    },
7132    TypeContract {
7133        name: "retained_append_item_outcome",
7134        shape_version: 1,
7135        instance_format_version: None,
7136        kind: TypeKind::Struct,
7137        wire: true,
7138    },
7139    TypeContract {
7140        name: "retained_append_bulk_outcome",
7141        shape_version: 1,
7142        instance_format_version: None,
7143        kind: TypeKind::Struct,
7144        wire: true,
7145    },
7146    TypeContract {
7147        name: "retained_append_observation_state",
7148        shape_version: 1,
7149        instance_format_version: None,
7150        kind: TypeKind::Enum,
7151        wire: true,
7152    },
7153    TypeContract {
7154        name: "retained_append_observation_outcome",
7155        shape_version: 1,
7156        instance_format_version: None,
7157        kind: TypeKind::Struct,
7158        wire: true,
7159    },
7160    TypeContract {
7161        name: "binary_value",
7162        shape_version: 1,
7163        instance_format_version: None,
7164        kind: TypeKind::Struct,
7165        wire: true,
7166    },
7167    TypeContract {
7168        name: "state_hash_field",
7169        shape_version: 1,
7170        instance_format_version: None,
7171        kind: TypeKind::Struct,
7172        wire: true,
7173    },
7174    TypeContract {
7175        name: "state_set_entry",
7176        shape_version: 1,
7177        instance_format_version: None,
7178        kind: TypeKind::Struct,
7179        wire: true,
7180    },
7181    TypeContract {
7182        name: "state_set_condition",
7183        shape_version: 1,
7184        instance_format_version: None,
7185        kind: TypeKind::Enum,
7186        wire: true,
7187    },
7188    TypeContract {
7189        name: "state_operation",
7190        shape_version: 1,
7191        instance_format_version: None,
7192        kind: TypeKind::TaggedUnion,
7193        wire: true,
7194    },
7195    TypeContract {
7196        name: "state_optional_value",
7197        shape_version: 1,
7198        instance_format_version: None,
7199        kind: TypeKind::TaggedUnion,
7200        wire: true,
7201    },
7202    TypeContract {
7203        name: "state_command_result",
7204        shape_version: 1,
7205        instance_format_version: None,
7206        kind: TypeKind::TaggedUnion,
7207        wire: true,
7208    },
7209    TypeContract {
7210        name: "state_write_resolution",
7211        shape_version: 1,
7212        instance_format_version: None,
7213        kind: TypeKind::TaggedUnion,
7214        wire: true,
7215    },
7216    TypeContract {
7217        name: "service_credential_reservation",
7218        shape_version: 1,
7219        instance_format_version: None,
7220        kind: TypeKind::Struct,
7221        wire: true,
7222    },
7223    TypeContract {
7224        name: "subscription_metadata_field",
7225        shape_version: 1,
7226        instance_format_version: None,
7227        kind: TypeKind::Enum,
7228        wire: true,
7229    },
7230    TypeContract {
7231        name: "subscription_field",
7232        shape_version: 1,
7233        instance_format_version: None,
7234        kind: TypeKind::TaggedUnion,
7235        wire: true,
7236    },
7237    TypeContract {
7238        name: "subscription_filter",
7239        shape_version: 1,
7240        instance_format_version: None,
7241        kind: TypeKind::TaggedUnion,
7242        wire: true,
7243    },
7244    TypeContract {
7245        name: "subscription_cursor_entry",
7246        shape_version: 1,
7247        instance_format_version: None,
7248        kind: TypeKind::Struct,
7249        wire: true,
7250    },
7251    TypeContract {
7252        name: "subscription_route",
7253        shape_version: 1,
7254        instance_format_version: None,
7255        kind: TypeKind::Struct,
7256        wire: true,
7257    },
7258    TypeContract {
7259        name: "subscription_start_position",
7260        shape_version: 1,
7261        instance_format_version: None,
7262        kind: TypeKind::TaggedUnion,
7263        wire: true,
7264    },
7265    TypeContract {
7266        name: "subscription_start",
7267        shape_version: 1,
7268        instance_format_version: Some(1),
7269        kind: TypeKind::Struct,
7270        wire: true,
7271    },
7272    TypeContract {
7273        name: "subscription_accepted",
7274        shape_version: 1,
7275        instance_format_version: Some(1),
7276        kind: TypeKind::Struct,
7277        wire: true,
7278    },
7279    TypeContract {
7280        name: "subscription_writer_fence",
7281        shape_version: 1,
7282        instance_format_version: None,
7283        kind: TypeKind::Struct,
7284        wire: true,
7285    },
7286    TypeContract {
7287        name: "subscription_event",
7288        shape_version: 1,
7289        instance_format_version: Some(1),
7290        kind: TypeKind::Struct,
7291        wire: true,
7292    },
7293    TypeContract {
7294        name: "subscription_heartbeat",
7295        shape_version: 1,
7296        instance_format_version: Some(1),
7297        kind: TypeKind::Struct,
7298        wire: true,
7299    },
7300    TypeContract {
7301        name: "subscription_gap",
7302        shape_version: 1,
7303        instance_format_version: Some(1),
7304        kind: TypeKind::Struct,
7305        wire: true,
7306    },
7307    TypeContract {
7308        name: "subscription_terminal_reason",
7309        shape_version: 1,
7310        instance_format_version: None,
7311        kind: TypeKind::Enum,
7312        wire: true,
7313    },
7314    TypeContract {
7315        name: "subscription_terminal",
7316        shape_version: 2,
7317        instance_format_version: Some(2),
7318        kind: TypeKind::Struct,
7319        wire: true,
7320    },
7321    TypeContract {
7322        name: "subscription_frame",
7323        shape_version: 1,
7324        instance_format_version: None,
7325        kind: TypeKind::TaggedUnion,
7326        wire: true,
7327    },
7328    TypeContract {
7329        name: "stream_binding",
7330        shape_version: 1,
7331        instance_format_version: None,
7332        kind: TypeKind::Struct,
7333        wire: true,
7334    },
7335    TypeContract {
7336        name: "capability_grant",
7337        shape_version: 1,
7338        instance_format_version: None,
7339        kind: TypeKind::Struct,
7340        wire: true,
7341    },
7342    TypeContract {
7343        name: "protocol_limit",
7344        shape_version: 1,
7345        instance_format_version: None,
7346        kind: TypeKind::Struct,
7347        wire: true,
7348    },
7349    TypeContract {
7350        name: "document_mutation_condition",
7351        shape_version: 1,
7352        instance_format_version: None,
7353        kind: TypeKind::TaggedUnion,
7354        wire: true,
7355    },
7356    TypeContract {
7357        name: "audit_adapter",
7358        shape_version: 1,
7359        instance_format_version: None,
7360        kind: TypeKind::Enum,
7361        wire: true,
7362    },
7363    TypeContract {
7364        name: "audit_decision",
7365        shape_version: 1,
7366        instance_format_version: None,
7367        kind: TypeKind::Enum,
7368        wire: true,
7369    },
7370    TypeContract {
7371        name: "audit_outcome",
7372        shape_version: 1,
7373        instance_format_version: None,
7374        kind: TypeKind::Enum,
7375        wire: true,
7376    },
7377    TypeContract {
7378        name: "audit_detail",
7379        shape_version: 1,
7380        instance_format_version: None,
7381        kind: TypeKind::Enum,
7382        wire: true,
7383    },
7384    TypeContract {
7385        name: "audit_gap_reason",
7386        shape_version: 1,
7387        instance_format_version: None,
7388        kind: TypeKind::Enum,
7389        wire: true,
7390    },
7391    TypeContract {
7392        name: "audit_event",
7393        shape_version: 2,
7394        instance_format_version: None,
7395        kind: TypeKind::Struct,
7396        wire: true,
7397    },
7398    TypeContract {
7399        name: "audit_gap",
7400        shape_version: 2,
7401        instance_format_version: None,
7402        kind: TypeKind::Struct,
7403        wire: true,
7404    },
7405    TypeContract {
7406        name: "audit_stream_state",
7407        shape_version: 1,
7408        instance_format_version: None,
7409        kind: TypeKind::Struct,
7410        wire: true,
7411    },
7412    TypeContract {
7413        name: "service_credential_grant",
7414        shape_version: 1,
7415        instance_format_version: None,
7416        kind: TypeKind::Struct,
7417        wire: true,
7418    },
7419    TypeContract {
7420        name: "service_credential_summary",
7421        shape_version: 1,
7422        instance_format_version: None,
7423        kind: TypeKind::Struct,
7424        wire: true,
7425    },
7426    TypeContract {
7427        name: "security_role",
7428        shape_version: 1,
7429        instance_format_version: None,
7430        kind: TypeKind::Struct,
7431        wire: true,
7432    },
7433    TypeContract {
7434        name: "role_append_scope_change",
7435        shape_version: 1,
7436        instance_format_version: None,
7437        kind: TypeKind::TaggedUnion,
7438        wire: true,
7439    },
7440    TypeContract {
7441        name: "role_append_access_preparation",
7442        shape_version: 1,
7443        instance_format_version: None,
7444        kind: TypeKind::TaggedUnion,
7445        wire: true,
7446    },
7447    TypeContract {
7448        name: "security_action_outcome",
7449        shape_version: 1,
7450        instance_format_version: None,
7451        kind: TypeKind::TaggedUnion,
7452        wire: true,
7453    },
7454    TypeContract {
7455        name: "maintenance_work_state",
7456        shape_version: 1,
7457        instance_format_version: None,
7458        kind: TypeKind::Enum,
7459        wire: true,
7460    },
7461    TypeContract {
7462        name: "maintenance_attempt_state",
7463        shape_version: 1,
7464        instance_format_version: None,
7465        kind: TypeKind::Enum,
7466        wire: true,
7467    },
7468    TypeContract {
7469        name: "maintenance_failure_class",
7470        shape_version: 1,
7471        instance_format_version: None,
7472        kind: TypeKind::Enum,
7473        wire: true,
7474    },
7475    TypeContract {
7476        name: "maintenance_failure_class_count",
7477        shape_version: 1,
7478        instance_format_version: None,
7479        kind: TypeKind::Struct,
7480        wire: true,
7481    },
7482    TypeContract {
7483        name: "maintenance_attempt_observation",
7484        shape_version: 1,
7485        instance_format_version: None,
7486        kind: TypeKind::Struct,
7487        wire: true,
7488    },
7489    TypeContract {
7490        name: "maintenance_task_scope",
7491        shape_version: 1,
7492        instance_format_version: None,
7493        kind: TypeKind::Struct,
7494        wire: true,
7495    },
7496    TypeContract {
7497        name: "maintenance_task_status",
7498        shape_version: 1,
7499        instance_format_version: None,
7500        kind: TypeKind::Struct,
7501        wire: true,
7502    },
7503    TypeContract {
7504        name: "maintenance_status_aggregate",
7505        shape_version: 1,
7506        instance_format_version: Some(2),
7507        kind: TypeKind::Struct,
7508        wire: true,
7509    },
7510    TypeContract {
7511        name: "runtime_status_detail",
7512        shape_version: 1,
7513        instance_format_version: None,
7514        kind: TypeKind::Struct,
7515        wire: true,
7516    },
7517    TypeContract {
7518        name: "result_cache_status",
7519        shape_version: 2,
7520        instance_format_version: Some(3),
7521        kind: TypeKind::Struct,
7522        wire: true,
7523    },
7524    TypeContract {
7525        name: "field_promotion_status",
7526        shape_version: 1,
7527        instance_format_version: Some(3),
7528        kind: TypeKind::Struct,
7529        wire: true,
7530    },
7531    TypeContract {
7532        name: "overload_shard_status",
7533        shape_version: 2,
7534        instance_format_version: Some(3),
7535        kind: TypeKind::Struct,
7536        wire: true,
7537    },
7538    TypeContract {
7539        name: "external_key_binding",
7540        shape_version: 1,
7541        instance_format_version: None,
7542        kind: TypeKind::Struct,
7543        wire: true,
7544    },
7545    TypeContract {
7546        name: "rollup_measure",
7547        shape_version: 1,
7548        instance_format_version: None,
7549        kind: TypeKind::TaggedUnion,
7550        wire: true,
7551    },
7552    TypeContract {
7553        name: "aggregate_then_delete_policy",
7554        shape_version: 1,
7555        instance_format_version: None,
7556        kind: TypeKind::Struct,
7557        wire: true,
7558    },
7559    TypeContract {
7560        name: "lifecycle_binding_status",
7561        shape_version: 1,
7562        instance_format_version: None,
7563        kind: TypeKind::Struct,
7564        wire: true,
7565    },
7566    TypeContract {
7567        name: "lifecycle_rollup_status",
7568        shape_version: 1,
7569        instance_format_version: None,
7570        kind: TypeKind::Struct,
7571        wire: true,
7572    },
7573    TypeContract {
7574        name: "lifecycle_status",
7575        shape_version: 2,
7576        instance_format_version: Some(4),
7577        kind: TypeKind::Struct,
7578        wire: true,
7579    },
7580    TypeContract {
7581        name: "quota_limit",
7582        shape_version: 1,
7583        instance_format_version: None,
7584        kind: TypeKind::Struct,
7585        wire: true,
7586    },
7587    TypeContract {
7588        name: "quota_consumption",
7589        shape_version: 1,
7590        instance_format_version: None,
7591        kind: TypeKind::Struct,
7592        wire: true,
7593    },
7594    TypeContract {
7595        name: "quota_update",
7596        shape_version: 1,
7597        instance_format_version: None,
7598        kind: TypeKind::Struct,
7599        wire: true,
7600    },
7601    TypeContract {
7602        name: "storage_overall_posture",
7603        shape_version: 1,
7604        instance_format_version: None,
7605        kind: TypeKind::Enum,
7606        wire: true,
7607    },
7608    TypeContract {
7609        name: "storage_profile_role",
7610        shape_version: 1,
7611        instance_format_version: None,
7612        kind: TypeKind::Enum,
7613        wire: true,
7614    },
7615    TypeContract {
7616        name: "storage_provider_posture",
7617        shape_version: 1,
7618        instance_format_version: None,
7619        kind: TypeKind::Enum,
7620        wire: true,
7621    },
7622    TypeContract {
7623        name: "storage_backend_service_class",
7624        shape_version: 1,
7625        instance_format_version: None,
7626        kind: TypeKind::Enum,
7627        wire: true,
7628    },
7629    TypeContract {
7630        name: "storage_profile_role_binding",
7631        shape_version: 1,
7632        instance_format_version: None,
7633        kind: TypeKind::Struct,
7634        wire: true,
7635    },
7636    TypeContract {
7637        name: "storage_profile_attestation",
7638        shape_version: 1,
7639        instance_format_version: Some(1),
7640        kind: TypeKind::Struct,
7641        wire: true,
7642    },
7643    TypeContract {
7644        name: "storage_profile_expectation",
7645        shape_version: 1,
7646        instance_format_version: Some(1),
7647        kind: TypeKind::Struct,
7648        wire: true,
7649    },
7650    TypeContract {
7651        name: "core_binding",
7652        shape_version: 3,
7653        instance_format_version: None,
7654        kind: TypeKind::Struct,
7655        wire: true,
7656    },
7657    TypeContract {
7658        name: "readiness_observation",
7659        shape_version: 1,
7660        instance_format_version: None,
7661        kind: TypeKind::Struct,
7662        wire: true,
7663    },
7664    TypeContract {
7665        name: "usage_dimension",
7666        shape_version: 1,
7667        instance_format_version: None,
7668        kind: TypeKind::Struct,
7669        wire: true,
7670    },
7671    TypeContract {
7672        name: "physical_usage_value",
7673        shape_version: 2,
7674        instance_format_version: None,
7675        kind: TypeKind::Struct,
7676        wire: true,
7677    },
7678    TypeContract {
7679        name: "core_usage_units",
7680        shape_version: 2,
7681        instance_format_version: None,
7682        kind: TypeKind::Struct,
7683        wire: true,
7684    },
7685    TypeContract {
7686        name: "core_usage_correction",
7687        shape_version: 2,
7688        instance_format_version: None,
7689        kind: TypeKind::Struct,
7690        wire: true,
7691    },
7692    TypeContract {
7693        name: "response_meta",
7694        shape_version: 1,
7695        instance_format_version: Some(1),
7696        kind: TypeKind::Struct,
7697        wire: true,
7698    },
7699    TypeContract {
7700        name: "error_disposition",
7701        shape_version: 1,
7702        instance_format_version: None,
7703        kind: TypeKind::Enum,
7704        wire: true,
7705    },
7706    TypeContract {
7707        name: "recovery_action",
7708        shape_version: 1,
7709        instance_format_version: None,
7710        kind: TypeKind::Enum,
7711        wire: true,
7712    },
7713    TypeContract {
7714        name: "limit_class",
7715        shape_version: 1,
7716        instance_format_version: None,
7717        kind: TypeKind::Enum,
7718        wire: true,
7719    },
7720    TypeContract {
7721        name: "error_detail",
7722        shape_version: 3,
7723        instance_format_version: None,
7724        kind: TypeKind::TaggedUnion,
7725        wire: true,
7726    },
7727    TypeContract {
7728        name: "connection_profile",
7729        shape_version: 4,
7730        instance_format_version: Some(4),
7731        kind: TypeKind::Struct,
7732        wire: false,
7733    },
7734];
7735#[derive(Clone, Copy, Debug, Eq, PartialEq)]
7736pub struct StreamContract {
7737    pub name: &'static str,
7738    pub action: Action,
7739    pub transport: &'static str,
7740    pub service: &'static str,
7741    pub method: &'static str,
7742    pub auth_metadata: &'static str,
7743    pub auth_scheme: &'static str,
7744    pub semantic_format_version: u16,
7745    pub start_type: &'static str,
7746    pub frame_type: &'static str,
7747}
7748pub const LODESTONE_API_STREAM_CONTRACTS: &[StreamContract] = &[StreamContract {
7749    name: "subscription",
7750    action: Action::SubscriptionRead,
7751    transport: "grpc_tls",
7752    service: "lodestone.api.FilterSubscription",
7753    method: "/lodestone.api.FilterSubscription/Subscribe",
7754    auth_metadata: "authorization",
7755    auth_scheme: "ApiKey",
7756    semantic_format_version: 1,
7757    start_type: "subscription_start",
7758    frame_type: "subscription_frame",
7759}];
7760#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
7761#[serde(deny_unknown_fields)]
7762pub struct ErrorBody {
7763    pub code: ErrorCode,
7764    pub message: String,
7765    pub disposition: ErrorDisposition,
7766    pub recovery: RecoveryAction,
7767    pub details: ErrorDetail,
7768}
7769#[derive(Clone, Copy, Debug, Eq, PartialEq)]
7770pub enum ErrorShapeError {
7771    DetailCodeMismatch,
7772    OutcomeMismatch,
7773    RetryAfterOutOfRange,
7774}
7775impl ErrorBody {
7776    pub fn try_new(
7777        code: ErrorCode,
7778        message: String,
7779        disposition: ErrorDisposition,
7780        recovery: RecoveryAction,
7781        details: ErrorDetail,
7782    ) -> Result<Self, ErrorShapeError> {
7783        let body = Self {
7784            code,
7785            message,
7786            disposition,
7787            recovery,
7788            details,
7789        };
7790        validate_error_body(&body)?;
7791        Ok(body)
7792    }
7793    pub fn retry_safe(&self) -> bool {
7794        self.disposition == ErrorDisposition::NotSubmitted
7795            && matches!(
7796                self.recovery,
7797                RecoveryAction::Retry
7798                    | RecoveryAction::RetryAfter
7799                    | RecoveryAction::RefreshCredential
7800                    | RecoveryAction::RestartPage
7801                    | RecoveryAction::ReduceRequest
7802                    | RecoveryAction::RefreshPrecondition
7803                    | RecoveryAction::CorrectRange
7804            )
7805    }
7806    pub fn submitted(&self) -> bool {
7807        self.disposition != ErrorDisposition::NotSubmitted
7808    }
7809}
7810pub fn validate_error_body(body: &ErrorBody) -> Result<(), ErrorShapeError> {
7811    let detail_matches = matches!(
7812        (&body.code, &body.details),
7813        (ErrorCode::Aborted, ErrorDetail::Aborted { .. })
7814            | (ErrorCode::DeadlineExceeded, ErrorDetail::DeadlineExceeded)
7815            | (ErrorCode::InvalidRequest, ErrorDetail::InvalidRequest { .. })
7816            | (ErrorCode::UnsupportedVersion, ErrorDetail::UnsupportedVersion { .. })
7817            | (ErrorCode::Unauthenticated, ErrorDetail::Unauthenticated)
7818            | (ErrorCode::PermissionDenied, ErrorDetail::PermissionDenied { .. })
7819            | (ErrorCode::NotFound, ErrorDetail::NotFound { .. })
7820            | (ErrorCode::Conflict, ErrorDetail::Conflict { .. })
7821            | (ErrorCode::StaleCursor, ErrorDetail::StaleCursor { .. })
7822            | (
7823                ErrorCode::RestartBudgetExhausted,
7824                ErrorDetail::RestartBudgetExhausted { .. }
7825            )
7826            | (ErrorCode::LimitExceeded, ErrorDetail::LimitExceeded { .. })
7827            | (
7828                ErrorCode::CapabilityUnavailable,
7829                ErrorDetail::CapabilityUnavailable { .. }
7830            )
7831            | (ErrorCode::NotSubmitted, ErrorDetail::NotSubmitted { .. })
7832            | (
7833                ErrorCode::SubmittedIndeterminate,
7834                ErrorDetail::SubmittedIndeterminate { .. }
7835            )
7836            | (ErrorCode::ExpiredUnknown, ErrorDetail::ExpiredUnknown { .. })
7837            | (ErrorCode::SecretNotEscrowed, ErrorDetail::SecretNotEscrowed)
7838            | (ErrorCode::RetentionGap, ErrorDetail::RetentionGap { .. })
7839            | (
7840                ErrorCode::ArtifactRangeInvalid,
7841                ErrorDetail::ArtifactRangeInvalid { .. }
7842            )
7843            | (ErrorCode::ChecksumMismatch, ErrorDetail::ChecksumMismatch { .. })
7844            | (
7845                ErrorCode::TemporarilyUnavailable,
7846                ErrorDetail::TemporarilyUnavailable { .. }
7847            )
7848            | (ErrorCode::Internal, ErrorDetail::Internal)
7849    );
7850    if !detail_matches {
7851        return Err(ErrorShapeError::DetailCodeMismatch);
7852    }
7853    if !LODESTONE_API_ERROR_OUTCOMES.iter().any(|contract| {
7854        contract.code == body.code && contract.disposition == body.disposition && contract.recovery == body.recovery
7855    }) {
7856        return Err(ErrorShapeError::OutcomeMismatch);
7857    }
7858    let retry_after = match &body.details {
7859        ErrorDetail::NotSubmitted { retry_after_millis }
7860        | ErrorDetail::TemporarilyUnavailable { retry_after_millis } => retry_after_millis.as_ref(),
7861        _ => None,
7862    };
7863    if retry_after
7864        .and_then(|value| value.value.parse::<u64>().ok())
7865        .is_some_and(|value| value > 60000)
7866    {
7867        return Err(ErrorShapeError::RetryAfterOutOfRange);
7868    }
7869    Ok(())
7870}
7871#[derive(Clone, Debug, Deserialize, Eq, PartialEq, Serialize)]
7872#[serde(deny_unknown_fields)]
7873pub struct RequestMeta {
7874    pub format_version: u16,
7875    pub request_id: String,
7876    pub correlation_id: Identity,
7877    pub absolute_deadline_unix_millis: U64,
7878    pub workload_class: WorkloadClass,
7879}
7880
7881#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
7882#[serde(deny_unknown_fields)]
7883pub struct DiscoverRequest {}
7884
7885#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
7886#[serde(deny_unknown_fields)]
7887pub struct DiscoverResult {
7888    pub principal_id: Identity,
7889    pub collection_id: Identity,
7890    pub policy_revision: U64,
7891    pub artifact_version: String,
7892    pub schema_id: String,
7893    pub schema_digest: Digest,
7894    pub streams: Vec<StreamBinding>,
7895    pub capabilities: Vec<CapabilityGrant>,
7896    pub limits: Vec<ProtocolLimit>,
7897}
7898
7899#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
7900#[serde(deny_unknown_fields)]
7901pub struct ListIndexesRequest {
7902    pub page_size: u32,
7903    #[serde(default, skip_serializing_if = "Option::is_none")]
7904    pub cursor: Option<Cursor>,
7905    #[serde(default, skip_serializing_if = "Option::is_none")]
7906    pub name_prefix: Option<String>,
7907    #[serde(default, skip_serializing_if = "Option::is_none")]
7908    pub mode: Option<String>,
7909    #[serde(default, skip_serializing_if = "Option::is_none")]
7910    pub state: Option<String>,
7911    pub restart_count: u32,
7912}
7913
7914#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
7915#[serde(deny_unknown_fields)]
7916pub struct ListIndexesResult {
7917    pub items: Vec<IndexSummary>,
7918    #[serde(default, skip_serializing_if = "Option::is_none")]
7919    pub next_cursor: Option<Cursor>,
7920    pub restart_count: u32,
7921}
7922
7923#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
7924#[serde(deny_unknown_fields)]
7925pub struct GetIndexRequest {
7926    pub name: String,
7927    #[serde(default, skip_serializing_if = "Option::is_none")]
7928    pub expected_incarnation: Option<Identity>,
7929}
7930
7931#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
7932#[serde(deny_unknown_fields)]
7933pub struct GetIndexResult {
7934    pub resource: IndexDetail,
7935}
7936
7937#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
7938#[serde(deny_unknown_fields)]
7939pub struct ValidateIndexChangeRequest {
7940    pub action_kind: String,
7941    pub name: String,
7942    #[serde(default, skip_serializing_if = "Option::is_none")]
7943    pub expected_incarnation: Option<Identity>,
7944    #[serde(default, skip_serializing_if = "Option::is_none")]
7945    pub expected_revision: Option<U64>,
7946    #[serde(default, skip_serializing_if = "Option::is_none")]
7947    pub mode: Option<String>,
7948    #[serde(default, skip_serializing_if = "Option::is_none")]
7949    pub mapping: Option<Mapping>,
7950    #[serde(default, skip_serializing_if = "Option::is_none")]
7951    pub policies: Option<IndexPolicies>,
7952}
7953
7954#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
7955#[serde(deny_unknown_fields)]
7956pub struct ValidateIndexChangeResult {
7957    pub change_kind: String,
7958    pub fields_added: Vec<String>,
7959    pub policy_axes_changed: Vec<String>,
7960    pub required_capabilities: Vec<String>,
7961    pub catalog_revision: U64,
7962    pub policy_revision: U64,
7963}
7964
7965#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
7966#[serde(deny_unknown_fields)]
7967pub struct ApplyIndexChangeRequest {
7968    pub action_id: Digest,
7969    pub index: Resource,
7970    pub expected_revision: U64,
7971    #[serde(default, skip_serializing_if = "Option::is_none")]
7972    pub mapping: Option<Mapping>,
7973    #[serde(default, skip_serializing_if = "Option::is_none")]
7974    pub policies: Option<IndexPolicies>,
7975}
7976
7977#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
7978#[serde(deny_unknown_fields)]
7979pub struct ApplyIndexChangeResult {
7980    pub receipt: IndexChangeApplyReceipt,
7981}
7982
7983#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
7984#[serde(deny_unknown_fields)]
7985pub struct ApplyAdministrationMutationRequest {
7986    pub action_id: Digest,
7987    pub expected_revision: U64,
7988    pub mutation: AdministrationMutation,
7989}
7990
7991#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
7992#[serde(deny_unknown_fields)]
7993pub struct ApplyAdministrationMutationResult {
7994    pub outcome: AdministrationOutcome,
7995}
7996
7997#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
7998#[serde(deny_unknown_fields)]
7999pub struct ListAliasesRequest {
8000    pub page_size: u32,
8001    #[serde(default, skip_serializing_if = "Option::is_none")]
8002    pub cursor: Option<Cursor>,
8003    #[serde(default, skip_serializing_if = "Option::is_none")]
8004    pub name_prefix: Option<String>,
8005    pub restart_count: u32,
8006}
8007
8008#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
8009#[serde(deny_unknown_fields)]
8010pub struct ListAliasesResult {
8011    pub items: Vec<AliasSummary>,
8012    #[serde(default, skip_serializing_if = "Option::is_none")]
8013    pub next_cursor: Option<Cursor>,
8014    pub restart_count: u32,
8015}
8016
8017#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
8018#[serde(deny_unknown_fields)]
8019pub struct GetAliasRequest {
8020    pub name: String,
8021}
8022
8023#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
8024#[serde(deny_unknown_fields)]
8025pub struct GetAliasResult {
8026    pub resource: AliasDetail,
8027}
8028
8029#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
8030#[serde(deny_unknown_fields)]
8031pub struct ListDataStreamsRequest {
8032    pub page_size: u32,
8033    #[serde(default, skip_serializing_if = "Option::is_none")]
8034    pub cursor: Option<Cursor>,
8035    #[serde(default, skip_serializing_if = "Option::is_none")]
8036    pub name_prefix: Option<String>,
8037    pub restart_count: u32,
8038}
8039
8040#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
8041#[serde(deny_unknown_fields)]
8042pub struct ListDataStreamsResult {
8043    pub items: Vec<DataStreamSummary>,
8044    #[serde(default, skip_serializing_if = "Option::is_none")]
8045    pub next_cursor: Option<Cursor>,
8046    pub restart_count: u32,
8047}
8048
8049#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
8050#[serde(deny_unknown_fields)]
8051pub struct GetDataStreamRequest {
8052    pub name: String,
8053}
8054
8055#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
8056#[serde(deny_unknown_fields)]
8057pub struct GetDataStreamResult {
8058    pub resource: DataStreamDetail,
8059}
8060
8061#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
8062#[serde(deny_unknown_fields)]
8063pub struct ListComponentTemplatesRequest {
8064    pub page_size: u32,
8065    #[serde(default, skip_serializing_if = "Option::is_none")]
8066    pub cursor: Option<Cursor>,
8067    #[serde(default, skip_serializing_if = "Option::is_none")]
8068    pub name_prefix: Option<String>,
8069    pub restart_count: u32,
8070}
8071
8072#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
8073#[serde(deny_unknown_fields)]
8074pub struct ListComponentTemplatesResult {
8075    pub items: Vec<ComponentTemplateSummary>,
8076    #[serde(default, skip_serializing_if = "Option::is_none")]
8077    pub next_cursor: Option<Cursor>,
8078    pub restart_count: u32,
8079}
8080
8081#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
8082#[serde(deny_unknown_fields)]
8083pub struct GetComponentTemplateRequest {
8084    pub name: String,
8085    #[serde(default, skip_serializing_if = "Option::is_none")]
8086    pub expected_incarnation: Option<Identity>,
8087}
8088
8089#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
8090#[serde(deny_unknown_fields)]
8091pub struct GetComponentTemplateResult {
8092    pub resource: ComponentTemplateDetail,
8093}
8094
8095#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
8096#[serde(deny_unknown_fields)]
8097pub struct ListIndexTemplatesRequest {
8098    pub page_size: u32,
8099    #[serde(default, skip_serializing_if = "Option::is_none")]
8100    pub cursor: Option<Cursor>,
8101    #[serde(default, skip_serializing_if = "Option::is_none")]
8102    pub name_prefix: Option<String>,
8103    pub restart_count: u32,
8104}
8105
8106#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
8107#[serde(deny_unknown_fields)]
8108pub struct ListIndexTemplatesResult {
8109    pub items: Vec<IndexTemplateSummary>,
8110    #[serde(default, skip_serializing_if = "Option::is_none")]
8111    pub next_cursor: Option<Cursor>,
8112    pub restart_count: u32,
8113}
8114
8115#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
8116#[serde(deny_unknown_fields)]
8117pub struct GetIndexTemplateRequest {
8118    pub name: String,
8119    #[serde(default, skip_serializing_if = "Option::is_none")]
8120    pub expected_incarnation: Option<Identity>,
8121}
8122
8123#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
8124#[serde(deny_unknown_fields)]
8125pub struct GetIndexTemplateResult {
8126    pub resource: IndexTemplateDetail,
8127}
8128
8129#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
8130#[serde(deny_unknown_fields)]
8131pub struct ListIngestPipelinesRequest {
8132    pub page_size: u32,
8133    #[serde(default, skip_serializing_if = "Option::is_none")]
8134    pub cursor: Option<Cursor>,
8135    #[serde(default, skip_serializing_if = "Option::is_none")]
8136    pub name_prefix: Option<String>,
8137    pub restart_count: u32,
8138}
8139
8140#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
8141#[serde(deny_unknown_fields)]
8142pub struct ListIngestPipelinesResult {
8143    pub items: Vec<IngestPipelineSummary>,
8144    #[serde(default, skip_serializing_if = "Option::is_none")]
8145    pub next_cursor: Option<Cursor>,
8146    pub restart_count: u32,
8147}
8148
8149#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
8150#[serde(deny_unknown_fields)]
8151pub struct GetIngestPipelineRequest {
8152    pub name: String,
8153    #[serde(default, skip_serializing_if = "Option::is_none")]
8154    pub expected_incarnation: Option<Identity>,
8155}
8156
8157#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
8158#[serde(deny_unknown_fields)]
8159pub struct GetIngestPipelineResult {
8160    pub resource: IngestPipelineDetail,
8161}
8162
8163#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
8164#[serde(deny_unknown_fields)]
8165pub struct SimulateIngestPipelineRequest {
8166    #[serde(default, skip_serializing_if = "Option::is_none")]
8167    pub name: Option<String>,
8168    #[serde(default, skip_serializing_if = "Option::is_none")]
8169    pub expected: Option<ExpectedBinding>,
8170    #[serde(default, skip_serializing_if = "Option::is_none")]
8171    pub definition: Option<RawJson>,
8172    pub source: RawJson,
8173}
8174
8175#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
8176#[serde(deny_unknown_fields)]
8177pub struct SimulateIngestPipelineResult {
8178    #[serde(default, skip_serializing_if = "Option::is_none")]
8179    pub source: Option<RawJson>,
8180    pub dropped: bool,
8181    pub changed: bool,
8182}
8183
8184#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
8185#[serde(deny_unknown_fields)]
8186pub struct ReprocessByQueryRequest {
8187    pub action_id: Digest,
8188    pub index: Resource,
8189    pub query: Query,
8190    #[serde(default, skip_serializing_if = "Option::is_none")]
8191    pub pipeline: Option<IngestPipelineSelection>,
8192    pub batch_size: u32,
8193    pub max_docs: U64,
8194    pub proceed_on_conflict: bool,
8195    pub slices: u32,
8196    pub requests_per_second: u32,
8197    pub wait_for_completion: bool,
8198}
8199
8200#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
8201#[serde(deny_unknown_fields)]
8202pub struct ReprocessByQueryResult {
8203    pub task_id: Identity,
8204    pub scanned: U64,
8205    pub updated: U64,
8206    pub noops: U64,
8207    pub version_conflicts: U64,
8208    pub batches: U64,
8209    pub completed: bool,
8210}
8211
8212#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
8213#[serde(deny_unknown_fields)]
8214pub struct ListLifecyclePoliciesRequest {
8215    pub page_size: u32,
8216    #[serde(default, skip_serializing_if = "Option::is_none")]
8217    pub cursor: Option<Cursor>,
8218    #[serde(default, skip_serializing_if = "Option::is_none")]
8219    pub name_prefix: Option<String>,
8220    pub restart_count: u32,
8221}
8222
8223#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
8224#[serde(deny_unknown_fields)]
8225pub struct ListLifecyclePoliciesResult {
8226    pub items: Vec<LifecyclePolicySummary>,
8227    #[serde(default, skip_serializing_if = "Option::is_none")]
8228    pub next_cursor: Option<Cursor>,
8229    pub restart_count: u32,
8230}
8231
8232#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
8233#[serde(deny_unknown_fields)]
8234pub struct GetLifecyclePolicyRequest {
8235    pub name: String,
8236}
8237
8238#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
8239#[serde(deny_unknown_fields)]
8240pub struct GetLifecyclePolicyResult {
8241    pub resource: LifecyclePolicyDetail,
8242}
8243
8244#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
8245#[serde(deny_unknown_fields)]
8246pub struct PrepareCreateIndexRequest {
8247    pub name: String,
8248    pub mapping: Mapping,
8249    #[serde(default, skip_serializing_if = "Option::is_none")]
8250    pub resource_spec: Option<IndexResourceSpec>,
8251    #[serde(default, skip_serializing_if = "Option::is_none")]
8252    pub retained_event_identity: Option<bool>,
8253}
8254
8255#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
8256#[serde(deny_unknown_fields)]
8257pub struct PrepareCreateIndexResult {
8258    pub locator: Locator,
8259    pub expires_at: U64,
8260    pub semantic_digest: Digest,
8261    pub resource_spec: IndexResourceSpec,
8262}
8263
8264#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
8265#[serde(deny_unknown_fields)]
8266pub struct PrepareDeleteIndexRequest {
8267    pub name: String,
8268    pub expected_incarnation: Identity,
8269}
8270
8271#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
8272#[serde(deny_unknown_fields)]
8273pub struct PrepareDeleteIndexResult {
8274    #[serde(default, skip_serializing_if = "Option::is_none")]
8275    pub locator: Option<Locator>,
8276    #[serde(default, skip_serializing_if = "Option::is_none")]
8277    pub expires_at: Option<U64>,
8278    #[serde(default, skip_serializing_if = "Option::is_none")]
8279    pub semantic_digest: Option<Digest>,
8280    pub impact_digest: Digest,
8281    pub blockers: Vec<String>,
8282    pub scheduled_effects: Vec<String>,
8283    #[serde(default, skip_serializing_if = "Option::is_none")]
8284    pub estimated_documents: Option<U64>,
8285    #[serde(default, skip_serializing_if = "Option::is_none")]
8286    pub estimated_logical_bytes: Option<U64>,
8287}
8288
8289#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
8290#[serde(deny_unknown_fields)]
8291pub struct SubmitCatalogActionRequest {
8292    pub locator: Locator,
8293    pub semantic_digest: Digest,
8294    pub action_kind: String,
8295    pub name: String,
8296    #[serde(default, skip_serializing_if = "Option::is_none")]
8297    pub mapping: Option<Mapping>,
8298    #[serde(default, skip_serializing_if = "Option::is_none")]
8299    pub resource_spec: Option<IndexResourceSpec>,
8300    #[serde(default, skip_serializing_if = "Option::is_none")]
8301    pub expected_incarnation: Option<Identity>,
8302}
8303
8304#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
8305#[serde(deny_unknown_fields)]
8306pub struct SubmitCatalogActionResult {
8307    pub locator: Locator,
8308    pub state: String,
8309    pub mutation_outcome: MutationOutcome,
8310}
8311
8312#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
8313#[serde(deny_unknown_fields)]
8314pub struct ResolveCatalogActionRequest {
8315    pub locator: Locator,
8316}
8317
8318#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
8319#[serde(deny_unknown_fields)]
8320pub struct ResolveCatalogActionResult {
8321    pub locator: Locator,
8322    pub state: String,
8323    #[serde(default, skip_serializing_if = "Option::is_none")]
8324    pub resource: Option<Resource>,
8325}
8326
8327#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
8328#[serde(deny_unknown_fields)]
8329pub struct PrepareReplayableSourceIndexRequest {
8330    pub name: String,
8331    pub mapping: Mapping,
8332    #[serde(default, skip_serializing_if = "Option::is_none")]
8333    pub resource_spec: Option<IndexResourceSpec>,
8334    pub source: ReplayableSourceConfiguration,
8335}
8336
8337#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
8338#[serde(deny_unknown_fields)]
8339pub struct PrepareReplayableSourceIndexResult {
8340    pub locator: Locator,
8341    pub expires_at: U64,
8342    pub semantic_digest: Digest,
8343    pub resource_spec: IndexResourceSpec,
8344}
8345
8346#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
8347#[serde(deny_unknown_fields)]
8348pub struct SubmitReplayableSourceIndexRequest {
8349    pub locator: Locator,
8350    pub semantic_digest: Digest,
8351    pub name: String,
8352    pub mapping: Mapping,
8353    pub resource_spec: IndexResourceSpec,
8354    pub source: ReplayableSourceConfiguration,
8355}
8356
8357#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
8358#[serde(deny_unknown_fields)]
8359pub struct SubmitReplayableSourceIndexResult {
8360    pub locator: Locator,
8361    pub state: String,
8362    pub mutation_outcome: MutationOutcome,
8363}
8364
8365#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
8366#[serde(deny_unknown_fields)]
8367pub struct GetReplayableSourceRequest {
8368    pub index: Resource,
8369}
8370
8371#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
8372#[serde(deny_unknown_fields)]
8373pub struct GetReplayableSourceResult {
8374    pub status: ReplayableSourceStatus,
8375}
8376
8377#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
8378#[serde(deny_unknown_fields)]
8379pub struct ControlReplayableSourceRequest {
8380    pub index: Resource,
8381    pub expected_generation: U64,
8382    pub transition: SourceControlTransition,
8383}
8384
8385#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
8386#[serde(deny_unknown_fields)]
8387pub struct ControlReplayableSourceResult {
8388    pub status: ReplayableSourceStatus,
8389    pub mutation_outcome: MutationOutcome,
8390}
8391
8392#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
8393#[serde(deny_unknown_fields)]
8394pub struct CloneIndexRequest {
8395    pub source: Resource,
8396    pub destination_name: String,
8397    pub operation_id: Identity,
8398    pub source_cut_id: Identity,
8399}
8400
8401#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
8402#[serde(deny_unknown_fields)]
8403pub struct CloneIndexResult {
8404    pub destination: Resource,
8405    pub source_cut_id: Identity,
8406    pub mutation_outcome: MutationOutcome,
8407}
8408
8409#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
8410#[serde(deny_unknown_fields)]
8411pub struct ConfigureHistoryRequest {
8412    pub index: Resource,
8413    pub precondition: HistoryLedgerPrecondition,
8414    pub policy: HistoryRetentionPolicy,
8415}
8416
8417#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
8418#[serde(deny_unknown_fields)]
8419pub struct ConfigureHistoryResult {
8420    pub status: HistoryStatus,
8421    pub mutation_outcome: MutationOutcome,
8422}
8423
8424#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
8425#[serde(deny_unknown_fields)]
8426pub struct GetHistoryRequest {
8427    pub index: Resource,
8428}
8429
8430#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
8431#[serde(deny_unknown_fields)]
8432pub struct GetHistoryResult {
8433    pub status: HistoryStatus,
8434}
8435
8436#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
8437#[serde(deny_unknown_fields)]
8438pub struct ResolveHistoryRequest {
8439    pub index: Resource,
8440    pub selector: HistorySelector,
8441}
8442
8443#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
8444#[serde(deny_unknown_fields)]
8445pub struct ResolveHistoryResult {
8446    pub resolution: HistoryResolution,
8447}
8448
8449#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
8450#[serde(deny_unknown_fields)]
8451pub struct PlaceHistoryHoldRequest {
8452    pub index: Resource,
8453    pub expected_ledger_revision: U64,
8454    pub hold: HistoryHold,
8455}
8456
8457#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
8458#[serde(deny_unknown_fields)]
8459pub struct PlaceHistoryHoldResult {
8460    pub status: HistoryStatus,
8461    pub mutation_outcome: MutationOutcome,
8462}
8463
8464#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
8465#[serde(deny_unknown_fields)]
8466pub struct ReleaseHistoryHoldRequest {
8467    pub index: Resource,
8468    pub expected_ledger_revision: U64,
8469    pub hold_id: Identity,
8470}
8471
8472#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
8473#[serde(deny_unknown_fields)]
8474pub struct ReleaseHistoryHoldResult {
8475    pub status: HistoryStatus,
8476    pub mutation_outcome: MutationOutcome,
8477}
8478
8479#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
8480#[serde(deny_unknown_fields)]
8481pub struct PrepareDocumentMutationRequest {
8482    pub index: Resource,
8483    pub document_id: String,
8484    pub operation: String,
8485    #[serde(default, skip_serializing_if = "Option::is_none")]
8486    pub source: Option<RawJson>,
8487    #[serde(default, skip_serializing_if = "Option::is_none")]
8488    pub record: Option<NativeRecord>,
8489    #[serde(default, skip_serializing_if = "Option::is_none")]
8490    pub routing: Option<String>,
8491    #[serde(default, skip_serializing_if = "Option::is_none")]
8492    pub condition: Option<DocumentMutationCondition>,
8493    #[serde(default, skip_serializing_if = "Option::is_none")]
8494    pub pipeline: Option<IngestPipelineSelection>,
8495}
8496
8497#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
8498#[serde(deny_unknown_fields)]
8499pub struct PrepareDocumentMutationResult {
8500    pub locator: Locator,
8501    pub semantic_digest: Digest,
8502    pub retention_max_entries: U64,
8503    pub retention_sequence_window: U64,
8504}
8505
8506#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
8507#[serde(deny_unknown_fields)]
8508pub struct SubmitDocumentMutationRequest {
8509    pub locator: Locator,
8510    pub semantic_digest: Digest,
8511    pub index: Resource,
8512    pub document_id: String,
8513    pub operation: String,
8514    #[serde(default, skip_serializing_if = "Option::is_none")]
8515    pub source: Option<RawJson>,
8516    #[serde(default, skip_serializing_if = "Option::is_none")]
8517    pub record: Option<NativeRecord>,
8518    #[serde(default, skip_serializing_if = "Option::is_none")]
8519    pub routing: Option<String>,
8520    #[serde(default, skip_serializing_if = "Option::is_none")]
8521    pub condition: Option<DocumentMutationCondition>,
8522    #[serde(default, skip_serializing_if = "Option::is_none")]
8523    pub pipeline: Option<IngestPipelineSelection>,
8524}
8525
8526#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
8527#[serde(deny_unknown_fields)]
8528pub struct SubmitDocumentMutationResult {
8529    pub locator: Locator,
8530    pub state: String,
8531    pub mutation_outcome: MutationOutcome,
8532    #[serde(default, skip_serializing_if = "Option::is_none")]
8533    pub achievement: Option<WriteAchievement>,
8534    #[serde(default, skip_serializing_if = "Option::is_none")]
8535    pub sequence: Option<U64>,
8536    #[serde(default, skip_serializing_if = "Option::is_none")]
8537    pub mapping_generation: Option<U64>,
8538    pub mapping_adopted: bool,
8539    #[serde(default, skip_serializing_if = "Option::is_none")]
8540    pub commit_receipt: Option<MutationCommitReceipt>,
8541}
8542
8543#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
8544#[serde(deny_unknown_fields)]
8545pub struct PrepareDocumentBulkRequest {
8546    pub batch_id: Digest,
8547    pub index: Resource,
8548    pub items: Vec<BulkDocumentItem>,
8549}
8550
8551#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
8552#[serde(deny_unknown_fields)]
8553pub struct PrepareDocumentBulkResult {
8554    pub outcome: BulkDocumentOutcome,
8555}
8556
8557#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
8558#[serde(deny_unknown_fields)]
8559pub struct SubmitDocumentBulkRequest {
8560    pub batch_id: Digest,
8561    pub index: Resource,
8562    pub items: Vec<BulkDocumentItem>,
8563    pub preparations: Vec<BulkDocumentItemOutcome>,
8564}
8565
8566#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
8567#[serde(deny_unknown_fields)]
8568pub struct SubmitDocumentBulkResult {
8569    pub outcome: BulkDocumentOutcome,
8570}
8571
8572#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
8573#[serde(deny_unknown_fields)]
8574pub struct ResolveDocumentBulkRequest {
8575    pub batch_id: Digest,
8576    pub index: Resource,
8577    pub items: Vec<BulkDocumentItemOutcome>,
8578}
8579
8580#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
8581#[serde(deny_unknown_fields)]
8582pub struct ResolveDocumentBulkResult {
8583    pub outcome: BulkDocumentOutcome,
8584}
8585
8586#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
8587#[serde(deny_unknown_fields)]
8588pub struct PrepareAppendBulkRequest {
8589    pub batch_id: Digest,
8590    pub index: Resource,
8591    pub items: Vec<RetainedAppendItem>,
8592}
8593
8594#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
8595#[serde(deny_unknown_fields)]
8596pub struct PrepareAppendBulkResult {
8597    pub outcome: RetainedAppendBulkOutcome,
8598}
8599
8600#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
8601#[serde(deny_unknown_fields)]
8602pub struct SubmitAppendBulkRequest {
8603    pub batch_id: Digest,
8604    pub index: Resource,
8605    pub items: Vec<RetainedAppendItem>,
8606    pub preparations: Vec<RetainedAppendItemOutcome>,
8607}
8608
8609#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
8610#[serde(deny_unknown_fields)]
8611pub struct SubmitAppendBulkResult {
8612    pub outcome: RetainedAppendBulkOutcome,
8613}
8614
8615#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
8616#[serde(deny_unknown_fields)]
8617pub struct ResolveAppendBulkRequest {
8618    pub batch_id: Digest,
8619    pub index: Resource,
8620    pub items: Vec<RetainedAppendItemOutcome>,
8621}
8622
8623#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
8624#[serde(deny_unknown_fields)]
8625pub struct ResolveAppendBulkResult {
8626    pub outcome: RetainedAppendBulkOutcome,
8627}
8628
8629#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
8630#[serde(deny_unknown_fields)]
8631pub struct ObserveAppendCommittedRequest {
8632    pub index: Resource,
8633    pub locator: Locator,
8634}
8635
8636#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
8637#[serde(deny_unknown_fields)]
8638pub struct ObserveAppendCommittedResult {
8639    pub outcome: RetainedAppendObservationOutcome,
8640}
8641
8642#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
8643#[serde(deny_unknown_fields)]
8644pub struct ResolveDocumentMutationRequest {
8645    pub locator: Locator,
8646}
8647
8648#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
8649#[serde(deny_unknown_fields)]
8650pub struct ResolveDocumentMutationResult {
8651    pub locator: Locator,
8652    pub state: String,
8653    #[serde(default, skip_serializing_if = "Option::is_none")]
8654    pub sequence: Option<U64>,
8655    #[serde(default, skip_serializing_if = "Option::is_none")]
8656    pub mapping_generation: Option<U64>,
8657    pub mapping_adopted: bool,
8658    #[serde(default, skip_serializing_if = "Option::is_none")]
8659    pub source: Option<RawJson>,
8660    #[serde(default, skip_serializing_if = "Option::is_none")]
8661    pub commit_receipt: Option<MutationCommitReceipt>,
8662}
8663
8664#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
8665#[serde(deny_unknown_fields)]
8666pub struct GetDocumentRequest {
8667    pub index: Resource,
8668    pub document_id: String,
8669    #[serde(default, skip_serializing_if = "Option::is_none")]
8670    pub routing: Option<String>,
8671}
8672
8673#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
8674#[serde(deny_unknown_fields)]
8675pub struct GetDocumentResult {
8676    pub found: bool,
8677    #[serde(default, skip_serializing_if = "Option::is_none")]
8678    pub source: Option<RawJson>,
8679    #[serde(default, skip_serializing_if = "Option::is_none")]
8680    pub sequence: Option<U64>,
8681    #[serde(default, skip_serializing_if = "Option::is_none")]
8682    pub primary_term: Option<U64>,
8683}
8684
8685#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
8686#[serde(deny_unknown_fields)]
8687pub struct SearchRequest {
8688    #[serde(default, skip_serializing_if = "Option::is_none")]
8689    pub indexes: Option<Vec<Resource>>,
8690    #[serde(default, skip_serializing_if = "Option::is_none")]
8691    pub query: Option<Query>,
8692    #[serde(default, skip_serializing_if = "Option::is_none")]
8693    pub retrieval: Option<RetrievalPlan>,
8694    #[serde(default, skip_serializing_if = "Option::is_none")]
8695    pub aggregations: Option<Vec<Aggregation>>,
8696    pub sort: Vec<SortSpec>,
8697    #[serde(default, skip_serializing_if = "Option::is_none")]
8698    pub routing: Option<Vec<String>>,
8699    pub freshness: SearchFreshness,
8700    pub page_size: u32,
8701    #[serde(default, skip_serializing_if = "Option::is_none")]
8702    pub cursor: Option<Cursor>,
8703    #[serde(default, skip_serializing_if = "Option::is_none")]
8704    pub pit: Option<Cursor>,
8705    pub allow_partial: bool,
8706    #[serde(default, skip_serializing_if = "Option::is_none")]
8707    pub total_hits_threshold: Option<U64>,
8708    pub diagnostics: bool,
8709    #[serde(default, skip_serializing_if = "Option::is_none")]
8710    pub fragments: Option<FragmentRequest>,
8711    #[serde(default, skip_serializing_if = "Option::is_none")]
8712    pub features: Option<ResultFeatureRequest>,
8713    #[serde(default, skip_serializing_if = "Option::is_none")]
8714    pub diversification: Option<ResultDiversification>,
8715}
8716
8717#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
8718#[serde(deny_unknown_fields)]
8719pub struct SearchResult {
8720    pub hits: Vec<SearchHit>,
8721    pub aggregations: Vec<AggregationResult>,
8722    #[serde(default, skip_serializing_if = "Option::is_none")]
8723    pub next_cursor: Option<Cursor>,
8724    pub timed_out: bool,
8725    pub partial: bool,
8726    pub achieved: SearchAchievement,
8727    pub shards: ShardCounts,
8728    pub total: SearchTotal,
8729    pub failures: Vec<SearchPartialFailure>,
8730    pub vector_diagnostics: Vec<VectorBranchDiagnostics>,
8731}
8732
8733#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
8734#[serde(deny_unknown_fields)]
8735pub struct TraverseRelationshipsRequest {
8736    pub pit: Cursor,
8737    pub indexes: Vec<Resource>,
8738    pub seeds: Vec<EntityRef>,
8739    pub direction: RelationshipTraversalDirection,
8740    pub filter: RelationshipTraversalFilter,
8741    pub budget: RelationshipTraversalBudget,
8742    pub allow_partial: bool,
8743}
8744
8745#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
8746#[serde(deny_unknown_fields)]
8747pub struct TraverseRelationshipsResult {
8748    pub relationships: Vec<TraversedRelationship>,
8749    pub visited_entities: Vec<EntityRef>,
8750    pub input_cut_digest: Digest,
8751    pub partial: bool,
8752    pub incomplete_frontier: Vec<EntityRef>,
8753    pub failures: Vec<SearchPartialFailure>,
8754}
8755
8756#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
8757#[serde(deny_unknown_fields)]
8758pub struct QueryProfilesRequest {
8759    pub pit: Cursor,
8760    pub indexes: Vec<Resource>,
8761    pub operation: ProfileQueryOperation,
8762    pub start_unix_nanos: U64,
8763    pub end_unix_nanos: U64,
8764    pub sample_type: String,
8765    pub unit: String,
8766    pub filter: ProfileQueryFilter,
8767    #[serde(default, skip_serializing_if = "Option::is_none")]
8768    pub group_by: Option<ProfileGroupBy>,
8769    pub budget: ProfileQueryBudget,
8770    pub allow_partial: bool,
8771}
8772
8773#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
8774#[serde(deny_unknown_fields)]
8775pub struct QueryProfilesResult {
8776    pub rows: Vec<ProfileQueryRow>,
8777    pub evaluated_batches: u32,
8778    pub evaluated_samples: u32,
8779    pub input_cut_digest: Digest,
8780    pub partial: bool,
8781    pub approximate: bool,
8782    pub failures: Vec<SearchPartialFailure>,
8783}
8784
8785#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
8786#[serde(deny_unknown_fields)]
8787pub struct EvaluateTemporalEvidenceRequest {
8788    pub pit: Cursor,
8789    pub definition: HistoricalTemporalDefinition,
8790}
8791
8792#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
8793#[serde(deny_unknown_fields)]
8794pub struct EvaluateTemporalEvidenceResult {
8795    pub evidence: Vec<TemporalEvidence>,
8796    pub input_cut_digest: Digest,
8797    pub pattern_digest: Digest,
8798    pub evaluated_events: u32,
8799}
8800
8801#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
8802#[serde(deny_unknown_fields)]
8803pub struct CreateContinuousTemporalEvaluationRequest {
8804    pub action_id: Digest,
8805    pub definition: ContinuousTemporalDefinition,
8806}
8807
8808#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
8809#[serde(deny_unknown_fields)]
8810pub struct CreateContinuousTemporalEvaluationResult {
8811    pub evaluation: ContinuousTemporalEvaluation,
8812    pub mutation_outcome: MutationOutcome,
8813}
8814
8815#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
8816#[serde(deny_unknown_fields)]
8817pub struct GetContinuousTemporalEvaluationRequest {
8818    pub evaluation_id: Identity,
8819}
8820
8821#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
8822#[serde(deny_unknown_fields)]
8823pub struct GetContinuousTemporalEvaluationResult {
8824    pub evaluation: ContinuousTemporalEvaluation,
8825}
8826
8827#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
8828#[serde(deny_unknown_fields)]
8829pub struct PauseContinuousTemporalEvaluationRequest {
8830    pub action_id: Digest,
8831    pub evaluation_id: Identity,
8832    pub expected_revision: U64,
8833}
8834
8835#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
8836#[serde(deny_unknown_fields)]
8837pub struct PauseContinuousTemporalEvaluationResult {
8838    pub evaluation: ContinuousTemporalEvaluation,
8839    pub mutation_outcome: MutationOutcome,
8840}
8841
8842#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
8843#[serde(deny_unknown_fields)]
8844pub struct ResumeContinuousTemporalEvaluationRequest {
8845    pub action_id: Digest,
8846    pub evaluation_id: Identity,
8847    pub expected_revision: U64,
8848}
8849
8850#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
8851#[serde(deny_unknown_fields)]
8852pub struct ResumeContinuousTemporalEvaluationResult {
8853    pub evaluation: ContinuousTemporalEvaluation,
8854    pub mutation_outcome: MutationOutcome,
8855}
8856
8857#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
8858#[serde(deny_unknown_fields)]
8859pub struct ReplaceContinuousTemporalEvaluationRequest {
8860    pub action_id: Digest,
8861    pub expected_revision: U64,
8862    pub definition: ContinuousTemporalDefinition,
8863}
8864
8865#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
8866#[serde(deny_unknown_fields)]
8867pub struct ReplaceContinuousTemporalEvaluationResult {
8868    pub evaluation: ContinuousTemporalEvaluation,
8869    pub mutation_outcome: MutationOutcome,
8870}
8871
8872#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
8873#[serde(deny_unknown_fields)]
8874pub struct RetireContinuousTemporalEvaluationRequest {
8875    pub action_id: Digest,
8876    pub evaluation_id: Identity,
8877    pub expected_revision: U64,
8878}
8879
8880#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
8881#[serde(deny_unknown_fields)]
8882pub struct RetireContinuousTemporalEvaluationResult {
8883    #[serde(default, skip_serializing_if = "Option::is_none")]
8884    pub evaluation: Option<ContinuousTemporalEvaluation>,
8885    pub mutation_outcome: MutationOutcome,
8886}
8887
8888#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
8889#[serde(deny_unknown_fields)]
8890pub struct ReadContinuousTemporalEvidenceRequest {
8891    pub evaluation_id: Identity,
8892    pub expected_revision: U64,
8893    pub minimum_event_time_unix_nanos: U64,
8894    pub page_size: u32,
8895    #[serde(default, skip_serializing_if = "Option::is_none")]
8896    pub cursor: Option<Cursor>,
8897}
8898
8899#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
8900#[serde(deny_unknown_fields)]
8901pub struct ReadContinuousTemporalEvidenceResult {
8902    pub evidence: Vec<TemporalEvidence>,
8903    #[serde(default, skip_serializing_if = "Option::is_none")]
8904    pub next_cursor: Option<Cursor>,
8905    pub retained_floor_unix_nanos: U64,
8906    pub evaluation_revision: U64,
8907}
8908
8909#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
8910#[serde(deny_unknown_fields)]
8911pub struct ValidateSearchRequest {
8912    pub indexes: Vec<Resource>,
8913    #[serde(default, skip_serializing_if = "Option::is_none")]
8914    pub query: Option<Query>,
8915    #[serde(default, skip_serializing_if = "Option::is_none")]
8916    pub retrieval: Option<RetrievalPlan>,
8917    #[serde(default, skip_serializing_if = "Option::is_none")]
8918    pub aggregations: Option<Vec<Aggregation>>,
8919    pub sort: Vec<SortSpec>,
8920    #[serde(default, skip_serializing_if = "Option::is_none")]
8921    pub routing: Option<Vec<String>>,
8922    pub freshness: SearchFreshness,
8923    pub page_size: u32,
8924    pub allow_partial: bool,
8925    #[serde(default, skip_serializing_if = "Option::is_none")]
8926    pub total_hits_threshold: Option<U64>,
8927    #[serde(default, skip_serializing_if = "Option::is_none")]
8928    pub fragments: Option<FragmentRequest>,
8929    #[serde(default, skip_serializing_if = "Option::is_none")]
8930    pub features: Option<ResultFeatureRequest>,
8931    #[serde(default, skip_serializing_if = "Option::is_none")]
8932    pub diversification: Option<ResultDiversification>,
8933}
8934
8935#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
8936#[serde(deny_unknown_fields)]
8937pub struct ValidateSearchResult {
8938    pub catalog_revision: U64,
8939    pub resolved_indexes: Vec<Resource>,
8940    pub authorized: bool,
8941    pub capabilities: Vec<String>,
8942    pub shape_digest: Digest,
8943    pub warnings: Vec<String>,
8944    pub refusals: Vec<String>,
8945    pub limits: Vec<SearchValidationLimit>,
8946    pub estimates: SearchValidationEstimates,
8947}
8948
8949#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
8950#[serde(deny_unknown_fields)]
8951pub struct OpenPitRequest {
8952    pub indexes: Vec<Resource>,
8953    pub keep_alive_millis: U64,
8954}
8955
8956#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
8957#[serde(deny_unknown_fields)]
8958pub struct OpenPitResult {
8959    pub pit: Cursor,
8960    pub expires_at: U64,
8961    pub shard_count: u32,
8962}
8963
8964#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
8965#[serde(deny_unknown_fields)]
8966pub struct RenewPitRequest {
8967    pub pit: Cursor,
8968    pub keep_alive_millis: U64,
8969}
8970
8971#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
8972#[serde(deny_unknown_fields)]
8973pub struct RenewPitResult {
8974    pub pit: Cursor,
8975    pub expires_at: U64,
8976    pub shard_count: u32,
8977}
8978
8979#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
8980#[serde(deny_unknown_fields)]
8981pub struct ClosePitRequest {
8982    pub pit: Cursor,
8983}
8984
8985#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
8986#[serde(deny_unknown_fields)]
8987pub struct ClosePitResult {
8988    pub removed: bool,
8989}
8990
8991#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
8992#[serde(deny_unknown_fields)]
8993pub struct ListOperationsRequest {
8994    pub page_size: u32,
8995    #[serde(default, skip_serializing_if = "Option::is_none")]
8996    pub cursor: Option<Cursor>,
8997}
8998
8999#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
9000#[serde(deny_unknown_fields)]
9001pub struct ListOperationsResult {
9002    pub items: Vec<Operation>,
9003    #[serde(default, skip_serializing_if = "Option::is_none")]
9004    pub next_cursor: Option<Cursor>,
9005}
9006
9007#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
9008#[serde(deny_unknown_fields)]
9009pub struct GetOperationRequest {
9010    pub locator: Locator,
9011}
9012
9013#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
9014#[serde(deny_unknown_fields)]
9015pub struct GetOperationResult {
9016    pub operation: Operation,
9017}
9018
9019#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
9020#[serde(deny_unknown_fields)]
9021pub struct WaitOperationRequest {
9022    pub locator: Locator,
9023    pub after_authority_revision: U64,
9024    pub maximum_attempts: u32,
9025    pub interval_millis: U64,
9026}
9027
9028#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
9029#[serde(deny_unknown_fields)]
9030pub struct WaitOperationResult {
9031    pub operation: Operation,
9032    pub attempts: u32,
9033}
9034
9035#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
9036#[serde(deny_unknown_fields)]
9037pub struct CancelOperationRequest {
9038    pub locator: Locator,
9039    pub expected_authority_revision: U64,
9040    pub cancel_action: Identity,
9041}
9042
9043#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
9044#[serde(deny_unknown_fields)]
9045pub struct CancelOperationResult {
9046    pub locator: Locator,
9047    pub cancel_generation: U64,
9048    pub mutation_outcome: MutationOutcome,
9049}
9050
9051#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
9052#[serde(deny_unknown_fields)]
9053pub struct ListAuditEventsRequest {
9054    pub start_time: U64,
9055    pub end_time: U64,
9056    pub actions: Vec<String>,
9057    pub page_size: u32,
9058    #[serde(default, skip_serializing_if = "Option::is_none")]
9059    pub cursor: Option<Cursor>,
9060}
9061
9062#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
9063#[serde(deny_unknown_fields)]
9064pub struct ListAuditEventsResult {
9065    pub stream: AuditStreamState,
9066    pub events: Vec<AuditEvent>,
9067    #[serde(default, skip_serializing_if = "Option::is_none")]
9068    pub next_cursor: Option<Cursor>,
9069    pub gaps: Vec<AuditGap>,
9070    pub object_reads: u32,
9071}
9072
9073#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
9074#[serde(deny_unknown_fields)]
9075pub struct ExportAuditEventsRequest {
9076    pub start_time: U64,
9077    pub end_time: U64,
9078    pub actions: Vec<String>,
9079    pub page_size: u32,
9080    #[serde(default, skip_serializing_if = "Option::is_none")]
9081    pub cursor: Option<Cursor>,
9082}
9083
9084#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
9085#[serde(deny_unknown_fields)]
9086pub struct ExportAuditEventsResult {
9087    pub stream: AuditStreamState,
9088    pub events: Vec<AuditEvent>,
9089    #[serde(default, skip_serializing_if = "Option::is_none")]
9090    pub next_cursor: Option<Cursor>,
9091    pub gaps: Vec<AuditGap>,
9092    pub object_reads: u32,
9093}
9094
9095#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
9096#[serde(deny_unknown_fields)]
9097pub struct ReserveServiceCredentialRequest {
9098    pub reservation_action_id: Digest,
9099    pub activation_action_id: Digest,
9100    pub role_grants: Vec<ServiceCredentialGrant>,
9101    pub credential_expires_at: U64,
9102    pub reservation_expires_at: U64,
9103}
9104
9105#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
9106#[serde(deny_unknown_fields)]
9107pub struct ReserveServiceCredentialResult {
9108    pub reservation: ServiceCredentialReservation,
9109}
9110
9111#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
9112#[serde(deny_unknown_fields)]
9113pub struct ReserveServiceCredentialRotationRequest {
9114    pub reservation_action_id: Digest,
9115    pub activation_action_id: Digest,
9116    pub current_api_key_id: Identity,
9117    pub expected_generation: U64,
9118    pub credential_expires_at: U64,
9119    pub overlap_until: U64,
9120    pub reservation_expires_at: U64,
9121}
9122
9123#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
9124#[serde(deny_unknown_fields)]
9125pub struct ReserveServiceCredentialRotationResult {
9126    pub reservation: ServiceCredentialReservation,
9127}
9128
9129#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
9130#[serde(deny_unknown_fields)]
9131pub struct ActivateServiceCredentialRequest {
9132    pub reservation: ServiceCredentialReservation,
9133    pub verifier: Digest,
9134}
9135
9136#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
9137#[serde(deny_unknown_fields)]
9138pub struct ActivateServiceCredentialResult {
9139    pub locator: Locator,
9140    pub outcome: SecurityActionOutcome,
9141    pub secret_escrowed: bool,
9142}
9143
9144#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
9145#[serde(deny_unknown_fields)]
9146pub struct ResolveServiceCredentialReservationRequest {
9147    pub reservation_action_id: Digest,
9148}
9149
9150#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
9151#[serde(deny_unknown_fields)]
9152pub struct ResolveServiceCredentialReservationResult {
9153    pub state: String,
9154    #[serde(default, skip_serializing_if = "Option::is_none")]
9155    pub reservation: Option<ServiceCredentialReservation>,
9156    #[serde(default, skip_serializing_if = "Option::is_none")]
9157    pub outcome: Option<SecurityActionOutcome>,
9158}
9159
9160#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
9161#[serde(deny_unknown_fields)]
9162pub struct PrepareRevokeServiceCredentialRequest {
9163    pub api_key_id: Identity,
9164    pub expected_generation: U64,
9165}
9166
9167#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
9168#[serde(deny_unknown_fields)]
9169pub struct PrepareRevokeServiceCredentialResult {
9170    pub locator: Locator,
9171    pub semantic_digest: Digest,
9172    pub expires_at: U64,
9173}
9174
9175#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
9176#[serde(deny_unknown_fields)]
9177pub struct RevokeServiceCredentialRequest {
9178    pub locator: Locator,
9179    pub api_key_id: Identity,
9180    pub expected_generation: U64,
9181}
9182
9183#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
9184#[serde(deny_unknown_fields)]
9185pub struct RevokeServiceCredentialResult {
9186    pub locator: Locator,
9187    pub principal_id: Identity,
9188    pub api_key_id: Identity,
9189    pub state: String,
9190}
9191
9192#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
9193#[serde(deny_unknown_fields)]
9194pub struct ResolveSecurityActionRequest {
9195    pub locator: Locator,
9196}
9197
9198#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
9199#[serde(deny_unknown_fields)]
9200pub struct ResolveSecurityActionResult {
9201    pub locator: Locator,
9202    pub state: String,
9203    #[serde(default, skip_serializing_if = "Option::is_none")]
9204    pub result: Option<SecurityActionOutcome>,
9205    pub secret_escrowed: bool,
9206}
9207
9208#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
9209#[serde(deny_unknown_fields)]
9210pub struct GetSecurityRoleRequest {
9211    pub role_name: String,
9212}
9213
9214#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
9215#[serde(deny_unknown_fields)]
9216pub struct GetSecurityRoleResult {
9217    pub role: SecurityRole,
9218}
9219
9220#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
9221#[serde(deny_unknown_fields)]
9222pub struct PrepareRoleAppendAccessChangeRequest {
9223    pub role_name: String,
9224    pub expected_role_version: U64,
9225    pub changes: Vec<RoleAppendScopeChange>,
9226}
9227
9228#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
9229#[serde(deny_unknown_fields)]
9230pub struct PrepareRoleAppendAccessChangeResult {
9231    pub preparation: RoleAppendAccessPreparation,
9232}
9233
9234#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
9235#[serde(deny_unknown_fields)]
9236pub struct SubmitRoleAppendAccessChangeRequest {
9237    pub locator: Locator,
9238    pub semantic_digest: Digest,
9239    pub role_name: String,
9240    pub expected_role_version: U64,
9241    pub changes: Vec<RoleAppendScopeChange>,
9242}
9243
9244#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
9245#[serde(deny_unknown_fields)]
9246pub struct SubmitRoleAppendAccessChangeResult {
9247    pub locator: Locator,
9248    pub state: String,
9249    pub target_policy_revision: U64,
9250    pub role: SecurityRole,
9251}
9252
9253#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
9254#[serde(deny_unknown_fields)]
9255pub struct ListServiceCredentialsRequest {
9256    pub page_size: u32,
9257    #[serde(default, skip_serializing_if = "Option::is_none")]
9258    pub cursor: Option<Cursor>,
9259}
9260
9261#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
9262#[serde(deny_unknown_fields)]
9263pub struct ListServiceCredentialsResult {
9264    pub items: Vec<ServiceCredentialSummary>,
9265    #[serde(default, skip_serializing_if = "Option::is_none")]
9266    pub next_cursor: Option<Cursor>,
9267}
9268
9269#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
9270#[serde(deny_unknown_fields)]
9271pub struct GetRuntimeStatusRequest {}
9272
9273#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
9274#[serde(deny_unknown_fields)]
9275pub struct GetRuntimeStatusResult {
9276    pub ready: bool,
9277    pub recovery_era: Identity,
9278    pub catalog_revision: U64,
9279    pub policy_revision: U64,
9280    pub redacted: RuntimeStatusDetail,
9281}
9282
9283#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
9284#[serde(deny_unknown_fields)]
9285pub struct GetResultCacheStatusRequest {}
9286
9287#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
9288#[serde(deny_unknown_fields)]
9289pub struct GetResultCacheStatusResult {
9290    pub status: ResultCacheStatus,
9291}
9292
9293#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
9294#[serde(deny_unknown_fields)]
9295pub struct GetFieldPromotionStatusRequest {
9296    pub index: Resource,
9297}
9298
9299#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
9300#[serde(deny_unknown_fields)]
9301pub struct GetFieldPromotionStatusResult {
9302    pub status: FieldPromotionStatus,
9303}
9304
9305#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
9306#[serde(deny_unknown_fields)]
9307pub struct GetOverloadStatusRequest {
9308    pub index: Resource,
9309}
9310
9311#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
9312#[serde(deny_unknown_fields)]
9313pub struct GetOverloadStatusResult {
9314    pub runtime_observed: bool,
9315    pub shards: Vec<OverloadShardStatus>,
9316}
9317
9318#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
9319#[serde(deny_unknown_fields)]
9320pub struct ConfigureExternalKeyRequest {
9321    pub index: Resource,
9322    pub expected_authority_revision: U64,
9323    pub binding: ExternalKeyBinding,
9324}
9325
9326#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
9327#[serde(deny_unknown_fields)]
9328pub struct ConfigureExternalKeyResult {
9329    pub status: LifecycleStatus,
9330    pub mutation_outcome: MutationOutcome,
9331}
9332
9333#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
9334#[serde(deny_unknown_fields)]
9335pub struct RotateExternalKeyBindingRequest {
9336    pub index: Resource,
9337    pub expected_authority_revision: U64,
9338    pub predecessor_binding_id: Identity,
9339    pub binding: ExternalKeyBinding,
9340}
9341
9342#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
9343#[serde(deny_unknown_fields)]
9344pub struct RotateExternalKeyBindingResult {
9345    pub status: LifecycleStatus,
9346    pub mutation_outcome: MutationOutcome,
9347}
9348
9349#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
9350#[serde(deny_unknown_fields)]
9351pub struct ConfigureAggregateThenDeleteRequest {
9352    pub index: Resource,
9353    pub expected_authority_revision: U64,
9354    pub policy: AggregateThenDeletePolicy,
9355}
9356
9357#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
9358#[serde(deny_unknown_fields)]
9359pub struct ConfigureAggregateThenDeleteResult {
9360    pub status: LifecycleStatus,
9361    pub mutation_outcome: MutationOutcome,
9362}
9363
9364#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
9365#[serde(deny_unknown_fields)]
9366pub struct GetLifecycleStatusRequest {
9367    pub index: Resource,
9368}
9369
9370#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
9371#[serde(deny_unknown_fields)]
9372pub struct GetLifecycleStatusResult {
9373    pub status: LifecycleStatus,
9374}
9375
9376#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
9377#[serde(deny_unknown_fields)]
9378pub struct GetQuotaRequest {}
9379
9380#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
9381#[serde(deny_unknown_fields)]
9382pub struct GetQuotaResult {
9383    pub revision: U64,
9384    pub limits: Vec<QuotaLimit>,
9385    pub usage: Vec<QuotaConsumption>,
9386}
9387
9388#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
9389#[serde(deny_unknown_fields)]
9390pub struct UpdateQuotaRequest {
9391    pub expected_revision: U64,
9392    pub limits: Vec<QuotaLimit>,
9393}
9394
9395#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
9396#[serde(deny_unknown_fields)]
9397pub struct UpdateQuotaResult {
9398    pub update: QuotaUpdate,
9399}
9400
9401#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
9402#[serde(deny_unknown_fields)]
9403pub struct GetBindingRequest {}
9404
9405#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
9406#[serde(deny_unknown_fields)]
9407pub struct GetBindingResult {
9408    pub binding: CoreBinding,
9409    pub derived: bool,
9410    pub revision: U64,
9411}
9412
9413#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
9414#[serde(deny_unknown_fields)]
9415pub struct GetAdmissionStatusRequest {}
9416
9417#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
9418#[serde(deny_unknown_fields)]
9419pub struct GetAdmissionStatusResult {
9420    pub state: String,
9421    pub revision: U64,
9422    pub converged: bool,
9423}
9424
9425#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
9426#[serde(deny_unknown_fields)]
9427pub struct SetAdmissionRequest {
9428    pub expected_revision: U64,
9429    pub state: String,
9430}
9431
9432#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
9433#[serde(deny_unknown_fields)]
9434pub struct SetAdmissionResult {
9435    pub state: String,
9436    pub revision: U64,
9437    pub converged: bool,
9438}
9439
9440#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
9441#[serde(deny_unknown_fields)]
9442pub struct GetQuiesceStatusRequest {}
9443
9444#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
9445#[serde(deny_unknown_fields)]
9446pub struct GetQuiesceStatusResult {
9447    pub ready: bool,
9448    pub blockers: Vec<String>,
9449    pub observations: Vec<ReadinessObservation>,
9450    pub recovery_era: Identity,
9451    pub observed_at: U64,
9452    pub expires_at: U64,
9453}
9454
9455#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
9456#[serde(deny_unknown_fields)]
9457pub struct GetDecommissionReadinessRequest {}
9458
9459#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
9460#[serde(deny_unknown_fields)]
9461pub struct GetDecommissionReadinessResult {
9462    pub ready: bool,
9463    pub blockers: Vec<String>,
9464    pub observations: Vec<ReadinessObservation>,
9465    pub recovery_era: Identity,
9466    pub observed_at: U64,
9467    pub expires_at: U64,
9468}
9469
9470#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
9471#[serde(deny_unknown_fields)]
9472pub struct GetUpgradeReadinessRequest {}
9473
9474#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
9475#[serde(deny_unknown_fields)]
9476pub struct GetUpgradeReadinessResult {
9477    pub ready: bool,
9478    pub blockers: Vec<String>,
9479    pub observations: Vec<ReadinessObservation>,
9480    pub recovery_era: Identity,
9481    pub observed_at: U64,
9482    pub expires_at: U64,
9483}
9484
9485#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
9486#[serde(deny_unknown_fields)]
9487pub struct GetMaintenanceStatusRequest {
9488    pub page_size: u32,
9489    #[serde(default, skip_serializing_if = "Option::is_none")]
9490    pub cursor: Option<Cursor>,
9491    #[serde(default, skip_serializing_if = "Option::is_none")]
9492    pub index: Option<Resource>,
9493}
9494
9495#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
9496#[serde(deny_unknown_fields)]
9497pub struct GetMaintenanceStatusResult {
9498    pub aggregate: MaintenanceStatusAggregate,
9499    pub items: Vec<MaintenanceTaskStatus>,
9500    #[serde(default, skip_serializing_if = "Option::is_none")]
9501    pub next_cursor: Option<Cursor>,
9502}
9503
9504#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
9505#[serde(deny_unknown_fields)]
9506pub struct WarmVectorIndexRequest {
9507    pub index: Resource,
9508    #[serde(default, skip_serializing_if = "Option::is_none")]
9509    pub expected_root_digest: Option<Digest>,
9510    pub components: Vec<VectorWarmComponent>,
9511    pub maximum_requests: u32,
9512    pub maximum_bytes: U64,
9513    pub maximum_achievements: u32,
9514    pub expires_at: U64,
9515}
9516
9517#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
9518#[serde(deny_unknown_fields)]
9519pub struct WarmVectorIndexResult {
9520    pub result: VectorWarmResult,
9521}
9522
9523#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
9524#[serde(deny_unknown_fields)]
9525pub struct EvaluateVectorRecallRequest {
9526    pub action_id: Digest,
9527    pub index: Resource,
9528    pub field: String,
9529    pub mapping_generation: U64,
9530    pub snapshot: VectorEvaluationSnapshot,
9531    pub query_set: VectorEvaluationQuerySet,
9532    #[serde(default, skip_serializing_if = "Option::is_none")]
9533    pub filter: Option<Query>,
9534    pub metric: VectorMetric,
9535    pub k: u32,
9536    pub candidate_policy: VectorCandidatePolicy,
9537    pub budget: VectorEvaluationBudget,
9538    pub maximum_bytes: U64,
9539}
9540
9541#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
9542#[serde(deny_unknown_fields)]
9543pub struct EvaluateVectorRecallResult {
9544    pub operation: Operation,
9545}
9546
9547#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
9548#[serde(deny_unknown_fields)]
9549pub struct CalibrateVectorStrategyRequest {
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 objective: VectorCalibrationObjective,
9561    pub minimum_recall_basis_points: u32,
9562    pub budget: VectorEvaluationBudget,
9563    pub maximum_bytes: U64,
9564}
9565
9566#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
9567#[serde(deny_unknown_fields)]
9568pub struct CalibrateVectorStrategyResult {
9569    pub operation: Operation,
9570}
9571
9572#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
9573#[serde(deny_unknown_fields)]
9574pub struct GetVectorDiagnosticRequest {
9575    pub locator: Locator,
9576}
9577
9578#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
9579#[serde(deny_unknown_fields)]
9580pub struct GetVectorDiagnosticResult {
9581    pub operation: Operation,
9582    pub artifacts: Vec<Artifact>,
9583    #[serde(default, skip_serializing_if = "Option::is_none")]
9584    pub result: Option<VectorDiagnosticResult>,
9585}
9586
9587#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
9588#[serde(deny_unknown_fields)]
9589pub struct CreateDiagnosticRequest {
9590    pub scope: String,
9591    pub maximum_bytes: U64,
9592}
9593
9594#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
9595#[serde(deny_unknown_fields)]
9596pub struct CreateDiagnosticResult {
9597    pub operation: Operation,
9598}
9599
9600#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
9601#[serde(deny_unknown_fields)]
9602pub struct GetDiagnosticRequest {
9603    pub locator: Locator,
9604}
9605
9606#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
9607#[serde(deny_unknown_fields)]
9608pub struct GetDiagnosticResult {
9609    pub operation: Operation,
9610    pub artifacts: Vec<Artifact>,
9611}
9612
9613#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
9614#[serde(deny_unknown_fields)]
9615pub struct PrepareCollectionExportRequest {
9616    pub action_id: Digest,
9617    pub storage: PortabilityStorageCapability,
9618}
9619
9620#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
9621#[serde(deny_unknown_fields)]
9622pub struct PrepareCollectionExportResult {
9623    pub semantic_digest: Digest,
9624    pub maximum_bytes: U64,
9625}
9626
9627#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
9628#[serde(deny_unknown_fields)]
9629pub struct StartCollectionExportRequest {
9630    pub action_id: Digest,
9631    pub semantic_digest: Digest,
9632    pub storage: PortabilityStorageCapability,
9633}
9634
9635#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
9636#[serde(deny_unknown_fields)]
9637pub struct StartCollectionExportResult {
9638    pub operation: Operation,
9639}
9640
9641#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
9642#[serde(deny_unknown_fields)]
9643pub struct ResolveCollectionExportRequest {
9644    pub action_id: Digest,
9645    pub semantic_digest: Digest,
9646    pub storage: PortabilityStorageCapability,
9647}
9648
9649#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
9650#[serde(deny_unknown_fields)]
9651pub struct ResolveCollectionExportResult {
9652    #[serde(default, skip_serializing_if = "Option::is_none")]
9653    pub operation: Option<Operation>,
9654    #[serde(default, skip_serializing_if = "Option::is_none")]
9655    pub artifact: Option<CollectionExportArtifact>,
9656    pub expired_unknown: bool,
9657}
9658
9659#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
9660#[serde(deny_unknown_fields)]
9661pub struct VerifyCollectionExportRequest {
9662    pub artifact: CollectionExportArtifact,
9663    pub storage: PortabilityStorageCapability,
9664}
9665
9666#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
9667#[serde(deny_unknown_fields)]
9668pub struct VerifyCollectionExportResult {
9669    pub verified: bool,
9670    pub source_collection_id: Identity,
9671    pub source_catalog_revision: U64,
9672    pub index_count: u32,
9673    pub document_count: U64,
9674}
9675
9676#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
9677#[serde(deny_unknown_fields)]
9678pub struct PrepareCollectionRestoreRequest {
9679    pub action_id: Digest,
9680    pub artifact: CollectionExportArtifact,
9681    pub storage: PortabilityStorageCapability,
9682}
9683
9684#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
9685#[serde(deny_unknown_fields)]
9686pub struct PrepareCollectionRestoreResult {
9687    pub semantic_digest: Digest,
9688    pub source_collection_id: Identity,
9689    pub maximum_bytes: U64,
9690}
9691
9692#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
9693#[serde(deny_unknown_fields)]
9694pub struct StartCollectionRestoreRequest {
9695    pub action_id: Digest,
9696    pub semantic_digest: Digest,
9697    pub artifact: CollectionExportArtifact,
9698    pub storage: PortabilityStorageCapability,
9699}
9700
9701#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
9702#[serde(deny_unknown_fields)]
9703pub struct StartCollectionRestoreResult {
9704    pub operation: Operation,
9705}
9706
9707#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
9708#[serde(deny_unknown_fields)]
9709pub struct ResolveCollectionRestoreRequest {
9710    pub action_id: Digest,
9711    pub semantic_digest: Digest,
9712    pub artifact: CollectionExportArtifact,
9713    pub storage: PortabilityStorageCapability,
9714}
9715
9716#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
9717#[serde(deny_unknown_fields)]
9718pub struct ResolveCollectionRestoreResult {
9719    #[serde(default, skip_serializing_if = "Option::is_none")]
9720    pub operation: Option<Operation>,
9721    pub expired_unknown: bool,
9722}
9723
9724#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
9725#[serde(deny_unknown_fields)]
9726pub struct PrepareIndexExportRequest {
9727    pub action_id: Digest,
9728    pub index: Resource,
9729    pub storage: PortabilityStorageCapability,
9730    pub maximum_records: u32,
9731    pub maximum_pages: u32,
9732    pub maximum_page_bytes: U64,
9733}
9734
9735#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
9736#[serde(deny_unknown_fields)]
9737pub struct PrepareIndexExportResult {
9738    pub semantic_digest: Digest,
9739    pub maximum_bytes: U64,
9740}
9741
9742#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
9743#[serde(deny_unknown_fields)]
9744pub struct StartIndexExportRequest {
9745    pub action_id: Digest,
9746    pub semantic_digest: Digest,
9747    pub index: Resource,
9748    pub storage: PortabilityStorageCapability,
9749    pub maximum_records: u32,
9750    pub maximum_pages: u32,
9751    pub maximum_page_bytes: U64,
9752}
9753
9754#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
9755#[serde(deny_unknown_fields)]
9756pub struct StartIndexExportResult {
9757    pub operation: Operation,
9758}
9759
9760#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
9761#[serde(deny_unknown_fields)]
9762pub struct ResolveIndexExportRequest {
9763    pub action_id: Digest,
9764    pub semantic_digest: Digest,
9765    pub index: Resource,
9766    pub storage: PortabilityStorageCapability,
9767    pub maximum_records: u32,
9768    pub maximum_pages: u32,
9769    pub maximum_page_bytes: U64,
9770}
9771
9772#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
9773#[serde(deny_unknown_fields)]
9774pub struct ResolveIndexExportResult {
9775    #[serde(default, skip_serializing_if = "Option::is_none")]
9776    pub operation: Option<Operation>,
9777    #[serde(default, skip_serializing_if = "Option::is_none")]
9778    pub artifact: Option<IndexTransferArtifact>,
9779    pub expired_unknown: bool,
9780}
9781
9782#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
9783#[serde(deny_unknown_fields)]
9784pub struct VerifyIndexExportRequest {
9785    pub artifact: IndexTransferArtifact,
9786    pub storage: PortabilityStorageCapability,
9787}
9788
9789#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
9790#[serde(deny_unknown_fields)]
9791pub struct VerifyIndexExportResult {
9792    pub verified: bool,
9793    pub source_cluster_storage_id: Identity,
9794    pub source_collection_id: Identity,
9795    pub source_index: Resource,
9796    pub source_catalog_revision: U64,
9797    pub source_cut_digest: Digest,
9798    pub page_count: u32,
9799    pub record_count: u32,
9800}
9801
9802#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
9803#[serde(deny_unknown_fields)]
9804pub struct PrepareIndexImportRequest {
9805    pub action_id: Digest,
9806    pub artifact: IndexTransferArtifact,
9807    pub storage: PortabilityStorageCapability,
9808    pub destination_name: String,
9809    pub expected_name_absent: bool,
9810    pub destination_policies: IndexPolicies,
9811    pub destination_resource_spec: IndexResourceSpec,
9812}
9813
9814#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
9815#[serde(deny_unknown_fields)]
9816pub struct PrepareIndexImportResult {
9817    pub semantic_digest: Digest,
9818    pub source_cluster_storage_id: Identity,
9819    pub source_collection_id: Identity,
9820    pub source_index: Resource,
9821    pub maximum_bytes: U64,
9822}
9823
9824#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
9825#[serde(deny_unknown_fields)]
9826pub struct StartIndexImportRequest {
9827    pub action_id: Digest,
9828    pub semantic_digest: Digest,
9829    pub artifact: IndexTransferArtifact,
9830    pub storage: PortabilityStorageCapability,
9831    pub destination_name: String,
9832    pub expected_name_absent: bool,
9833    pub destination_policies: IndexPolicies,
9834    pub destination_resource_spec: IndexResourceSpec,
9835}
9836
9837#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
9838#[serde(deny_unknown_fields)]
9839pub struct StartIndexImportResult {
9840    pub operation: Operation,
9841}
9842
9843#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
9844#[serde(deny_unknown_fields)]
9845pub struct ResolveIndexImportRequest {
9846    pub action_id: Digest,
9847    pub semantic_digest: Digest,
9848    pub artifact: IndexTransferArtifact,
9849    pub storage: PortabilityStorageCapability,
9850    pub destination_name: String,
9851    pub expected_name_absent: bool,
9852    pub destination_policies: IndexPolicies,
9853    pub destination_resource_spec: IndexResourceSpec,
9854}
9855
9856#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
9857#[serde(deny_unknown_fields)]
9858pub struct ResolveIndexImportResult {
9859    #[serde(default, skip_serializing_if = "Option::is_none")]
9860    pub operation: Option<Operation>,
9861    #[serde(default, skip_serializing_if = "Option::is_none")]
9862    pub destination: Option<Resource>,
9863    pub expired_unknown: bool,
9864}
9865
9866#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
9867#[serde(deny_unknown_fields)]
9868pub struct ReadArtifactChunkRequest {
9869    pub artifact: Artifact,
9870    pub offset: U64,
9871    pub length: u32,
9872}
9873
9874#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
9875#[serde(deny_unknown_fields)]
9876pub struct ReadArtifactChunkResult {
9877    pub offset: U64,
9878    pub bytes_base64: String,
9879    pub chunk_sha256: String,
9880    pub artifact_sha256: String,
9881    pub complete: bool,
9882}
9883
9884#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
9885#[serde(deny_unknown_fields)]
9886pub struct ExportUsageRequest {
9887    pub window_start: U64,
9888    pub window_end: U64,
9889    pub page_size: u32,
9890    #[serde(default, skip_serializing_if = "Option::is_none")]
9891    pub cursor: Option<Cursor>,
9892}
9893
9894#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
9895#[serde(deny_unknown_fields)]
9896pub struct ExportUsageResult {
9897    pub units: Vec<CoreUsageUnits>,
9898    pub corrections: Vec<CoreUsageCorrection>,
9899    #[serde(default, skip_serializing_if = "Option::is_none")]
9900    pub next_cursor: Option<Cursor>,
9901    pub cumulative_through: U64,
9902}
9903
9904#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
9905#[serde(deny_unknown_fields)]
9906pub struct ExecuteStateReadRequest {
9907    pub index: Resource,
9908    pub operation: StateOperation,
9909}
9910
9911#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
9912#[serde(deny_unknown_fields)]
9913pub struct ExecuteStateReadResult {
9914    pub result: StateCommandResult,
9915}
9916
9917#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
9918#[serde(deny_unknown_fields)]
9919pub struct PrepareStateWriteRequest {
9920    pub index: Resource,
9921    pub action_id: Digest,
9922    pub operation: StateOperation,
9923}
9924
9925#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
9926#[serde(deny_unknown_fields)]
9927pub struct PrepareStateWriteResult {
9928    pub locator: Locator,
9929    pub semantic_digest: Digest,
9930    pub retention_max_entries: U64,
9931    pub retention_sequence_window: U64,
9932}
9933
9934#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
9935#[serde(deny_unknown_fields)]
9936pub struct SubmitStateWriteRequest {
9937    pub index: Resource,
9938    pub action_id: Digest,
9939    pub operation: StateOperation,
9940    pub locator: Locator,
9941    pub semantic_digest: Digest,
9942}
9943
9944#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
9945#[serde(deny_unknown_fields)]
9946pub struct SubmitStateWriteResult {
9947    #[serde(default, skip_serializing_if = "Option::is_none")]
9948    pub result: Option<StateCommandResult>,
9949    #[serde(default, skip_serializing_if = "Option::is_none")]
9950    pub resolution: Option<StateWriteResolution>,
9951    pub mutation_outcome: MutationOutcome,
9952    #[serde(default, skip_serializing_if = "Option::is_none")]
9953    pub achievement: Option<WriteAchievement>,
9954}
9955
9956#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
9957#[serde(deny_unknown_fields)]
9958pub struct ResolveStateWriteRequest {
9959    pub index: Resource,
9960    pub action_id: Digest,
9961    pub operation: StateOperation,
9962    pub locator: Locator,
9963    pub semantic_digest: Digest,
9964}
9965
9966#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
9967#[serde(deny_unknown_fields)]
9968pub struct ResolveStateWriteResult {
9969    pub resolution: StateWriteResolution,
9970}
9971
9972#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
9973#[serde(tag = "command", content = "body", rename_all = "snake_case")]
9974pub enum RequestBody {
9975    Discover(DiscoverRequest),
9976    ListIndexes(ListIndexesRequest),
9977    GetIndex(GetIndexRequest),
9978    ValidateIndexChange(ValidateIndexChangeRequest),
9979    ApplyIndexChange(ApplyIndexChangeRequest),
9980    ApplyAdministrationMutation(ApplyAdministrationMutationRequest),
9981    ListAliases(ListAliasesRequest),
9982    GetAlias(GetAliasRequest),
9983    ListDataStreams(ListDataStreamsRequest),
9984    GetDataStream(GetDataStreamRequest),
9985    ListComponentTemplates(ListComponentTemplatesRequest),
9986    GetComponentTemplate(GetComponentTemplateRequest),
9987    ListIndexTemplates(ListIndexTemplatesRequest),
9988    GetIndexTemplate(GetIndexTemplateRequest),
9989    ListIngestPipelines(ListIngestPipelinesRequest),
9990    GetIngestPipeline(GetIngestPipelineRequest),
9991    SimulateIngestPipeline(SimulateIngestPipelineRequest),
9992    ReprocessByQuery(ReprocessByQueryRequest),
9993    ListLifecyclePolicies(ListLifecyclePoliciesRequest),
9994    GetLifecyclePolicy(GetLifecyclePolicyRequest),
9995    PrepareCreateIndex(PrepareCreateIndexRequest),
9996    PrepareDeleteIndex(PrepareDeleteIndexRequest),
9997    SubmitCatalogAction(SubmitCatalogActionRequest),
9998    ResolveCatalogAction(ResolveCatalogActionRequest),
9999    PrepareReplayableSourceIndex(PrepareReplayableSourceIndexRequest),
10000    SubmitReplayableSourceIndex(SubmitReplayableSourceIndexRequest),
10001    GetReplayableSource(GetReplayableSourceRequest),
10002    ControlReplayableSource(ControlReplayableSourceRequest),
10003    CloneIndex(CloneIndexRequest),
10004    ConfigureHistory(ConfigureHistoryRequest),
10005    GetHistory(GetHistoryRequest),
10006    ResolveHistory(ResolveHistoryRequest),
10007    PlaceHistoryHold(PlaceHistoryHoldRequest),
10008    ReleaseHistoryHold(ReleaseHistoryHoldRequest),
10009    PrepareDocumentMutation(PrepareDocumentMutationRequest),
10010    SubmitDocumentMutation(SubmitDocumentMutationRequest),
10011    PrepareDocumentBulk(PrepareDocumentBulkRequest),
10012    SubmitDocumentBulk(SubmitDocumentBulkRequest),
10013    ResolveDocumentBulk(ResolveDocumentBulkRequest),
10014    PrepareAppendBulk(PrepareAppendBulkRequest),
10015    SubmitAppendBulk(SubmitAppendBulkRequest),
10016    ResolveAppendBulk(ResolveAppendBulkRequest),
10017    ObserveAppendCommitted(ObserveAppendCommittedRequest),
10018    ResolveDocumentMutation(ResolveDocumentMutationRequest),
10019    GetDocument(GetDocumentRequest),
10020    Search(SearchRequest),
10021    TraverseRelationships(TraverseRelationshipsRequest),
10022    QueryProfiles(QueryProfilesRequest),
10023    EvaluateTemporalEvidence(EvaluateTemporalEvidenceRequest),
10024    CreateContinuousTemporalEvaluation(CreateContinuousTemporalEvaluationRequest),
10025    GetContinuousTemporalEvaluation(GetContinuousTemporalEvaluationRequest),
10026    PauseContinuousTemporalEvaluation(PauseContinuousTemporalEvaluationRequest),
10027    ResumeContinuousTemporalEvaluation(ResumeContinuousTemporalEvaluationRequest),
10028    ReplaceContinuousTemporalEvaluation(ReplaceContinuousTemporalEvaluationRequest),
10029    RetireContinuousTemporalEvaluation(RetireContinuousTemporalEvaluationRequest),
10030    ReadContinuousTemporalEvidence(ReadContinuousTemporalEvidenceRequest),
10031    ValidateSearch(ValidateSearchRequest),
10032    OpenPit(OpenPitRequest),
10033    RenewPit(RenewPitRequest),
10034    ClosePit(ClosePitRequest),
10035    ListOperations(ListOperationsRequest),
10036    GetOperation(GetOperationRequest),
10037    WaitOperation(WaitOperationRequest),
10038    CancelOperation(CancelOperationRequest),
10039    ListAuditEvents(ListAuditEventsRequest),
10040    ExportAuditEvents(ExportAuditEventsRequest),
10041    ReserveServiceCredential(ReserveServiceCredentialRequest),
10042    ReserveServiceCredentialRotation(ReserveServiceCredentialRotationRequest),
10043    ActivateServiceCredential(ActivateServiceCredentialRequest),
10044    ResolveServiceCredentialReservation(ResolveServiceCredentialReservationRequest),
10045    PrepareRevokeServiceCredential(PrepareRevokeServiceCredentialRequest),
10046    RevokeServiceCredential(RevokeServiceCredentialRequest),
10047    ResolveSecurityAction(ResolveSecurityActionRequest),
10048    GetSecurityRole(GetSecurityRoleRequest),
10049    PrepareRoleAppendAccessChange(PrepareRoleAppendAccessChangeRequest),
10050    SubmitRoleAppendAccessChange(SubmitRoleAppendAccessChangeRequest),
10051    ListServiceCredentials(ListServiceCredentialsRequest),
10052    GetRuntimeStatus(GetRuntimeStatusRequest),
10053    GetResultCacheStatus(GetResultCacheStatusRequest),
10054    GetFieldPromotionStatus(GetFieldPromotionStatusRequest),
10055    GetOverloadStatus(GetOverloadStatusRequest),
10056    ConfigureExternalKey(ConfigureExternalKeyRequest),
10057    RotateExternalKeyBinding(RotateExternalKeyBindingRequest),
10058    ConfigureAggregateThenDelete(ConfigureAggregateThenDeleteRequest),
10059    GetLifecycleStatus(GetLifecycleStatusRequest),
10060    GetQuota(GetQuotaRequest),
10061    UpdateQuota(UpdateQuotaRequest),
10062    GetBinding(GetBindingRequest),
10063    GetAdmissionStatus(GetAdmissionStatusRequest),
10064    SetAdmission(SetAdmissionRequest),
10065    GetQuiesceStatus(GetQuiesceStatusRequest),
10066    GetDecommissionReadiness(GetDecommissionReadinessRequest),
10067    GetUpgradeReadiness(GetUpgradeReadinessRequest),
10068    GetMaintenanceStatus(GetMaintenanceStatusRequest),
10069    WarmVectorIndex(WarmVectorIndexRequest),
10070    EvaluateVectorRecall(EvaluateVectorRecallRequest),
10071    CalibrateVectorStrategy(CalibrateVectorStrategyRequest),
10072    GetVectorDiagnostic(GetVectorDiagnosticRequest),
10073    CreateDiagnostic(CreateDiagnosticRequest),
10074    GetDiagnostic(GetDiagnosticRequest),
10075    PrepareCollectionExport(PrepareCollectionExportRequest),
10076    StartCollectionExport(StartCollectionExportRequest),
10077    ResolveCollectionExport(ResolveCollectionExportRequest),
10078    VerifyCollectionExport(VerifyCollectionExportRequest),
10079    PrepareCollectionRestore(PrepareCollectionRestoreRequest),
10080    StartCollectionRestore(StartCollectionRestoreRequest),
10081    ResolveCollectionRestore(ResolveCollectionRestoreRequest),
10082    PrepareIndexExport(PrepareIndexExportRequest),
10083    StartIndexExport(StartIndexExportRequest),
10084    ResolveIndexExport(ResolveIndexExportRequest),
10085    VerifyIndexExport(VerifyIndexExportRequest),
10086    PrepareIndexImport(PrepareIndexImportRequest),
10087    StartIndexImport(StartIndexImportRequest),
10088    ResolveIndexImport(ResolveIndexImportRequest),
10089    ReadArtifactChunk(ReadArtifactChunkRequest),
10090    ExportUsage(ExportUsageRequest),
10091    ExecuteStateRead(ExecuteStateReadRequest),
10092    PrepareStateWrite(PrepareStateWriteRequest),
10093    SubmitStateWrite(SubmitStateWriteRequest),
10094    ResolveStateWrite(ResolveStateWriteRequest),
10095}
10096
10097// INVARIANT: the response envelope already boxes this closed wire union; boxing
10098// individual variants would add a second allocation without changing the wire.
10099#[allow(clippy::large_enum_variant)]
10100#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
10101#[serde(tag = "command", content = "body", rename_all = "snake_case")]
10102pub enum ResultBody {
10103    Discover(DiscoverResult),
10104    ListIndexes(ListIndexesResult),
10105    GetIndex(GetIndexResult),
10106    ValidateIndexChange(ValidateIndexChangeResult),
10107    ApplyIndexChange(ApplyIndexChangeResult),
10108    ApplyAdministrationMutation(ApplyAdministrationMutationResult),
10109    ListAliases(ListAliasesResult),
10110    GetAlias(GetAliasResult),
10111    ListDataStreams(ListDataStreamsResult),
10112    GetDataStream(GetDataStreamResult),
10113    ListComponentTemplates(ListComponentTemplatesResult),
10114    GetComponentTemplate(GetComponentTemplateResult),
10115    ListIndexTemplates(ListIndexTemplatesResult),
10116    GetIndexTemplate(GetIndexTemplateResult),
10117    ListIngestPipelines(ListIngestPipelinesResult),
10118    GetIngestPipeline(GetIngestPipelineResult),
10119    SimulateIngestPipeline(SimulateIngestPipelineResult),
10120    ReprocessByQuery(ReprocessByQueryResult),
10121    ListLifecyclePolicies(ListLifecyclePoliciesResult),
10122    GetLifecyclePolicy(GetLifecyclePolicyResult),
10123    PrepareCreateIndex(PrepareCreateIndexResult),
10124    PrepareDeleteIndex(PrepareDeleteIndexResult),
10125    SubmitCatalogAction(SubmitCatalogActionResult),
10126    ResolveCatalogAction(ResolveCatalogActionResult),
10127    PrepareReplayableSourceIndex(PrepareReplayableSourceIndexResult),
10128    SubmitReplayableSourceIndex(SubmitReplayableSourceIndexResult),
10129    GetReplayableSource(GetReplayableSourceResult),
10130    ControlReplayableSource(ControlReplayableSourceResult),
10131    CloneIndex(CloneIndexResult),
10132    ConfigureHistory(ConfigureHistoryResult),
10133    GetHistory(GetHistoryResult),
10134    ResolveHistory(ResolveHistoryResult),
10135    PlaceHistoryHold(PlaceHistoryHoldResult),
10136    ReleaseHistoryHold(ReleaseHistoryHoldResult),
10137    PrepareDocumentMutation(PrepareDocumentMutationResult),
10138    SubmitDocumentMutation(SubmitDocumentMutationResult),
10139    PrepareDocumentBulk(PrepareDocumentBulkResult),
10140    SubmitDocumentBulk(SubmitDocumentBulkResult),
10141    ResolveDocumentBulk(ResolveDocumentBulkResult),
10142    PrepareAppendBulk(PrepareAppendBulkResult),
10143    SubmitAppendBulk(SubmitAppendBulkResult),
10144    ResolveAppendBulk(ResolveAppendBulkResult),
10145    ObserveAppendCommitted(ObserveAppendCommittedResult),
10146    ResolveDocumentMutation(ResolveDocumentMutationResult),
10147    GetDocument(GetDocumentResult),
10148    Search(SearchResult),
10149    TraverseRelationships(TraverseRelationshipsResult),
10150    QueryProfiles(QueryProfilesResult),
10151    EvaluateTemporalEvidence(EvaluateTemporalEvidenceResult),
10152    CreateContinuousTemporalEvaluation(CreateContinuousTemporalEvaluationResult),
10153    GetContinuousTemporalEvaluation(GetContinuousTemporalEvaluationResult),
10154    PauseContinuousTemporalEvaluation(PauseContinuousTemporalEvaluationResult),
10155    ResumeContinuousTemporalEvaluation(ResumeContinuousTemporalEvaluationResult),
10156    ReplaceContinuousTemporalEvaluation(ReplaceContinuousTemporalEvaluationResult),
10157    RetireContinuousTemporalEvaluation(RetireContinuousTemporalEvaluationResult),
10158    ReadContinuousTemporalEvidence(ReadContinuousTemporalEvidenceResult),
10159    ValidateSearch(ValidateSearchResult),
10160    OpenPit(OpenPitResult),
10161    RenewPit(RenewPitResult),
10162    ClosePit(ClosePitResult),
10163    ListOperations(ListOperationsResult),
10164    GetOperation(GetOperationResult),
10165    WaitOperation(WaitOperationResult),
10166    CancelOperation(CancelOperationResult),
10167    ListAuditEvents(ListAuditEventsResult),
10168    ExportAuditEvents(ExportAuditEventsResult),
10169    ReserveServiceCredential(ReserveServiceCredentialResult),
10170    ReserveServiceCredentialRotation(ReserveServiceCredentialRotationResult),
10171    ActivateServiceCredential(ActivateServiceCredentialResult),
10172    ResolveServiceCredentialReservation(ResolveServiceCredentialReservationResult),
10173    PrepareRevokeServiceCredential(PrepareRevokeServiceCredentialResult),
10174    RevokeServiceCredential(RevokeServiceCredentialResult),
10175    ResolveSecurityAction(ResolveSecurityActionResult),
10176    GetSecurityRole(GetSecurityRoleResult),
10177    PrepareRoleAppendAccessChange(PrepareRoleAppendAccessChangeResult),
10178    SubmitRoleAppendAccessChange(SubmitRoleAppendAccessChangeResult),
10179    ListServiceCredentials(ListServiceCredentialsResult),
10180    GetRuntimeStatus(GetRuntimeStatusResult),
10181    GetResultCacheStatus(GetResultCacheStatusResult),
10182    GetFieldPromotionStatus(GetFieldPromotionStatusResult),
10183    GetOverloadStatus(GetOverloadStatusResult),
10184    ConfigureExternalKey(ConfigureExternalKeyResult),
10185    RotateExternalKeyBinding(RotateExternalKeyBindingResult),
10186    ConfigureAggregateThenDelete(ConfigureAggregateThenDeleteResult),
10187    GetLifecycleStatus(GetLifecycleStatusResult),
10188    GetQuota(GetQuotaResult),
10189    UpdateQuota(UpdateQuotaResult),
10190    GetBinding(GetBindingResult),
10191    GetAdmissionStatus(GetAdmissionStatusResult),
10192    SetAdmission(SetAdmissionResult),
10193    GetQuiesceStatus(GetQuiesceStatusResult),
10194    GetDecommissionReadiness(GetDecommissionReadinessResult),
10195    GetUpgradeReadiness(GetUpgradeReadinessResult),
10196    GetMaintenanceStatus(GetMaintenanceStatusResult),
10197    WarmVectorIndex(WarmVectorIndexResult),
10198    EvaluateVectorRecall(EvaluateVectorRecallResult),
10199    CalibrateVectorStrategy(CalibrateVectorStrategyResult),
10200    GetVectorDiagnostic(GetVectorDiagnosticResult),
10201    CreateDiagnostic(CreateDiagnosticResult),
10202    GetDiagnostic(GetDiagnosticResult),
10203    PrepareCollectionExport(PrepareCollectionExportResult),
10204    StartCollectionExport(StartCollectionExportResult),
10205    ResolveCollectionExport(ResolveCollectionExportResult),
10206    VerifyCollectionExport(VerifyCollectionExportResult),
10207    PrepareCollectionRestore(PrepareCollectionRestoreResult),
10208    StartCollectionRestore(StartCollectionRestoreResult),
10209    ResolveCollectionRestore(ResolveCollectionRestoreResult),
10210    PrepareIndexExport(PrepareIndexExportResult),
10211    StartIndexExport(StartIndexExportResult),
10212    ResolveIndexExport(ResolveIndexExportResult),
10213    VerifyIndexExport(VerifyIndexExportResult),
10214    PrepareIndexImport(PrepareIndexImportResult),
10215    StartIndexImport(StartIndexImportResult),
10216    ResolveIndexImport(ResolveIndexImportResult),
10217    ReadArtifactChunk(ReadArtifactChunkResult),
10218    ExportUsage(ExportUsageResult),
10219    ExecuteStateRead(ExecuteStateReadResult),
10220    PrepareStateWrite(PrepareStateWriteResult),
10221    SubmitStateWrite(SubmitStateWriteResult),
10222    ResolveStateWrite(ResolveStateWriteResult),
10223}
10224
10225pub const fn command_for_request(value: &RequestBody) -> Command {
10226    match value {
10227        RequestBody::Discover(_) => Command::Discover,
10228        RequestBody::ListIndexes(_) => Command::ListIndexes,
10229        RequestBody::GetIndex(_) => Command::GetIndex,
10230        RequestBody::ValidateIndexChange(_) => Command::ValidateIndexChange,
10231        RequestBody::ApplyIndexChange(_) => Command::ApplyIndexChange,
10232        RequestBody::ApplyAdministrationMutation(_) => Command::ApplyAdministrationMutation,
10233        RequestBody::ListAliases(_) => Command::ListAliases,
10234        RequestBody::GetAlias(_) => Command::GetAlias,
10235        RequestBody::ListDataStreams(_) => Command::ListDataStreams,
10236        RequestBody::GetDataStream(_) => Command::GetDataStream,
10237        RequestBody::ListComponentTemplates(_) => Command::ListComponentTemplates,
10238        RequestBody::GetComponentTemplate(_) => Command::GetComponentTemplate,
10239        RequestBody::ListIndexTemplates(_) => Command::ListIndexTemplates,
10240        RequestBody::GetIndexTemplate(_) => Command::GetIndexTemplate,
10241        RequestBody::ListIngestPipelines(_) => Command::ListIngestPipelines,
10242        RequestBody::GetIngestPipeline(_) => Command::GetIngestPipeline,
10243        RequestBody::SimulateIngestPipeline(_) => Command::SimulateIngestPipeline,
10244        RequestBody::ReprocessByQuery(_) => Command::ReprocessByQuery,
10245        RequestBody::ListLifecyclePolicies(_) => Command::ListLifecyclePolicies,
10246        RequestBody::GetLifecyclePolicy(_) => Command::GetLifecyclePolicy,
10247        RequestBody::PrepareCreateIndex(_) => Command::PrepareCreateIndex,
10248        RequestBody::PrepareDeleteIndex(_) => Command::PrepareDeleteIndex,
10249        RequestBody::SubmitCatalogAction(_) => Command::SubmitCatalogAction,
10250        RequestBody::ResolveCatalogAction(_) => Command::ResolveCatalogAction,
10251        RequestBody::PrepareReplayableSourceIndex(_) => Command::PrepareReplayableSourceIndex,
10252        RequestBody::SubmitReplayableSourceIndex(_) => Command::SubmitReplayableSourceIndex,
10253        RequestBody::GetReplayableSource(_) => Command::GetReplayableSource,
10254        RequestBody::ControlReplayableSource(_) => Command::ControlReplayableSource,
10255        RequestBody::CloneIndex(_) => Command::CloneIndex,
10256        RequestBody::ConfigureHistory(_) => Command::ConfigureHistory,
10257        RequestBody::GetHistory(_) => Command::GetHistory,
10258        RequestBody::ResolveHistory(_) => Command::ResolveHistory,
10259        RequestBody::PlaceHistoryHold(_) => Command::PlaceHistoryHold,
10260        RequestBody::ReleaseHistoryHold(_) => Command::ReleaseHistoryHold,
10261        RequestBody::PrepareDocumentMutation(_) => Command::PrepareDocumentMutation,
10262        RequestBody::SubmitDocumentMutation(_) => Command::SubmitDocumentMutation,
10263        RequestBody::PrepareDocumentBulk(_) => Command::PrepareDocumentBulk,
10264        RequestBody::SubmitDocumentBulk(_) => Command::SubmitDocumentBulk,
10265        RequestBody::ResolveDocumentBulk(_) => Command::ResolveDocumentBulk,
10266        RequestBody::PrepareAppendBulk(_) => Command::PrepareAppendBulk,
10267        RequestBody::SubmitAppendBulk(_) => Command::SubmitAppendBulk,
10268        RequestBody::ResolveAppendBulk(_) => Command::ResolveAppendBulk,
10269        RequestBody::ObserveAppendCommitted(_) => Command::ObserveAppendCommitted,
10270        RequestBody::ResolveDocumentMutation(_) => Command::ResolveDocumentMutation,
10271        RequestBody::GetDocument(_) => Command::GetDocument,
10272        RequestBody::Search(_) => Command::Search,
10273        RequestBody::TraverseRelationships(_) => Command::TraverseRelationships,
10274        RequestBody::QueryProfiles(_) => Command::QueryProfiles,
10275        RequestBody::EvaluateTemporalEvidence(_) => Command::EvaluateTemporalEvidence,
10276        RequestBody::CreateContinuousTemporalEvaluation(_) => Command::CreateContinuousTemporalEvaluation,
10277        RequestBody::GetContinuousTemporalEvaluation(_) => Command::GetContinuousTemporalEvaluation,
10278        RequestBody::PauseContinuousTemporalEvaluation(_) => Command::PauseContinuousTemporalEvaluation,
10279        RequestBody::ResumeContinuousTemporalEvaluation(_) => Command::ResumeContinuousTemporalEvaluation,
10280        RequestBody::ReplaceContinuousTemporalEvaluation(_) => Command::ReplaceContinuousTemporalEvaluation,
10281        RequestBody::RetireContinuousTemporalEvaluation(_) => Command::RetireContinuousTemporalEvaluation,
10282        RequestBody::ReadContinuousTemporalEvidence(_) => Command::ReadContinuousTemporalEvidence,
10283        RequestBody::ValidateSearch(_) => Command::ValidateSearch,
10284        RequestBody::OpenPit(_) => Command::OpenPit,
10285        RequestBody::RenewPit(_) => Command::RenewPit,
10286        RequestBody::ClosePit(_) => Command::ClosePit,
10287        RequestBody::ListOperations(_) => Command::ListOperations,
10288        RequestBody::GetOperation(_) => Command::GetOperation,
10289        RequestBody::WaitOperation(_) => Command::WaitOperation,
10290        RequestBody::CancelOperation(_) => Command::CancelOperation,
10291        RequestBody::ListAuditEvents(_) => Command::ListAuditEvents,
10292        RequestBody::ExportAuditEvents(_) => Command::ExportAuditEvents,
10293        RequestBody::ReserveServiceCredential(_) => Command::ReserveServiceCredential,
10294        RequestBody::ReserveServiceCredentialRotation(_) => Command::ReserveServiceCredentialRotation,
10295        RequestBody::ActivateServiceCredential(_) => Command::ActivateServiceCredential,
10296        RequestBody::ResolveServiceCredentialReservation(_) => Command::ResolveServiceCredentialReservation,
10297        RequestBody::PrepareRevokeServiceCredential(_) => Command::PrepareRevokeServiceCredential,
10298        RequestBody::RevokeServiceCredential(_) => Command::RevokeServiceCredential,
10299        RequestBody::ResolveSecurityAction(_) => Command::ResolveSecurityAction,
10300        RequestBody::GetSecurityRole(_) => Command::GetSecurityRole,
10301        RequestBody::PrepareRoleAppendAccessChange(_) => Command::PrepareRoleAppendAccessChange,
10302        RequestBody::SubmitRoleAppendAccessChange(_) => Command::SubmitRoleAppendAccessChange,
10303        RequestBody::ListServiceCredentials(_) => Command::ListServiceCredentials,
10304        RequestBody::GetRuntimeStatus(_) => Command::GetRuntimeStatus,
10305        RequestBody::GetResultCacheStatus(_) => Command::GetResultCacheStatus,
10306        RequestBody::GetFieldPromotionStatus(_) => Command::GetFieldPromotionStatus,
10307        RequestBody::GetOverloadStatus(_) => Command::GetOverloadStatus,
10308        RequestBody::ConfigureExternalKey(_) => Command::ConfigureExternalKey,
10309        RequestBody::RotateExternalKeyBinding(_) => Command::RotateExternalKeyBinding,
10310        RequestBody::ConfigureAggregateThenDelete(_) => Command::ConfigureAggregateThenDelete,
10311        RequestBody::GetLifecycleStatus(_) => Command::GetLifecycleStatus,
10312        RequestBody::GetQuota(_) => Command::GetQuota,
10313        RequestBody::UpdateQuota(_) => Command::UpdateQuota,
10314        RequestBody::GetBinding(_) => Command::GetBinding,
10315        RequestBody::GetAdmissionStatus(_) => Command::GetAdmissionStatus,
10316        RequestBody::SetAdmission(_) => Command::SetAdmission,
10317        RequestBody::GetQuiesceStatus(_) => Command::GetQuiesceStatus,
10318        RequestBody::GetDecommissionReadiness(_) => Command::GetDecommissionReadiness,
10319        RequestBody::GetUpgradeReadiness(_) => Command::GetUpgradeReadiness,
10320        RequestBody::GetMaintenanceStatus(_) => Command::GetMaintenanceStatus,
10321        RequestBody::WarmVectorIndex(_) => Command::WarmVectorIndex,
10322        RequestBody::EvaluateVectorRecall(_) => Command::EvaluateVectorRecall,
10323        RequestBody::CalibrateVectorStrategy(_) => Command::CalibrateVectorStrategy,
10324        RequestBody::GetVectorDiagnostic(_) => Command::GetVectorDiagnostic,
10325        RequestBody::CreateDiagnostic(_) => Command::CreateDiagnostic,
10326        RequestBody::GetDiagnostic(_) => Command::GetDiagnostic,
10327        RequestBody::PrepareCollectionExport(_) => Command::PrepareCollectionExport,
10328        RequestBody::StartCollectionExport(_) => Command::StartCollectionExport,
10329        RequestBody::ResolveCollectionExport(_) => Command::ResolveCollectionExport,
10330        RequestBody::VerifyCollectionExport(_) => Command::VerifyCollectionExport,
10331        RequestBody::PrepareCollectionRestore(_) => Command::PrepareCollectionRestore,
10332        RequestBody::StartCollectionRestore(_) => Command::StartCollectionRestore,
10333        RequestBody::ResolveCollectionRestore(_) => Command::ResolveCollectionRestore,
10334        RequestBody::PrepareIndexExport(_) => Command::PrepareIndexExport,
10335        RequestBody::StartIndexExport(_) => Command::StartIndexExport,
10336        RequestBody::ResolveIndexExport(_) => Command::ResolveIndexExport,
10337        RequestBody::VerifyIndexExport(_) => Command::VerifyIndexExport,
10338        RequestBody::PrepareIndexImport(_) => Command::PrepareIndexImport,
10339        RequestBody::StartIndexImport(_) => Command::StartIndexImport,
10340        RequestBody::ResolveIndexImport(_) => Command::ResolveIndexImport,
10341        RequestBody::ReadArtifactChunk(_) => Command::ReadArtifactChunk,
10342        RequestBody::ExportUsage(_) => Command::ExportUsage,
10343        RequestBody::ExecuteStateRead(_) => Command::ExecuteStateRead,
10344        RequestBody::PrepareStateWrite(_) => Command::PrepareStateWrite,
10345        RequestBody::SubmitStateWrite(_) => Command::SubmitStateWrite,
10346        RequestBody::ResolveStateWrite(_) => Command::ResolveStateWrite,
10347    }
10348}
10349
10350pub const fn command_for_result(value: &ResultBody) -> Command {
10351    match value {
10352        ResultBody::Discover(_) => Command::Discover,
10353        ResultBody::ListIndexes(_) => Command::ListIndexes,
10354        ResultBody::GetIndex(_) => Command::GetIndex,
10355        ResultBody::ValidateIndexChange(_) => Command::ValidateIndexChange,
10356        ResultBody::ApplyIndexChange(_) => Command::ApplyIndexChange,
10357        ResultBody::ApplyAdministrationMutation(_) => Command::ApplyAdministrationMutation,
10358        ResultBody::ListAliases(_) => Command::ListAliases,
10359        ResultBody::GetAlias(_) => Command::GetAlias,
10360        ResultBody::ListDataStreams(_) => Command::ListDataStreams,
10361        ResultBody::GetDataStream(_) => Command::GetDataStream,
10362        ResultBody::ListComponentTemplates(_) => Command::ListComponentTemplates,
10363        ResultBody::GetComponentTemplate(_) => Command::GetComponentTemplate,
10364        ResultBody::ListIndexTemplates(_) => Command::ListIndexTemplates,
10365        ResultBody::GetIndexTemplate(_) => Command::GetIndexTemplate,
10366        ResultBody::ListIngestPipelines(_) => Command::ListIngestPipelines,
10367        ResultBody::GetIngestPipeline(_) => Command::GetIngestPipeline,
10368        ResultBody::SimulateIngestPipeline(_) => Command::SimulateIngestPipeline,
10369        ResultBody::ReprocessByQuery(_) => Command::ReprocessByQuery,
10370        ResultBody::ListLifecyclePolicies(_) => Command::ListLifecyclePolicies,
10371        ResultBody::GetLifecyclePolicy(_) => Command::GetLifecyclePolicy,
10372        ResultBody::PrepareCreateIndex(_) => Command::PrepareCreateIndex,
10373        ResultBody::PrepareDeleteIndex(_) => Command::PrepareDeleteIndex,
10374        ResultBody::SubmitCatalogAction(_) => Command::SubmitCatalogAction,
10375        ResultBody::ResolveCatalogAction(_) => Command::ResolveCatalogAction,
10376        ResultBody::PrepareReplayableSourceIndex(_) => Command::PrepareReplayableSourceIndex,
10377        ResultBody::SubmitReplayableSourceIndex(_) => Command::SubmitReplayableSourceIndex,
10378        ResultBody::GetReplayableSource(_) => Command::GetReplayableSource,
10379        ResultBody::ControlReplayableSource(_) => Command::ControlReplayableSource,
10380        ResultBody::CloneIndex(_) => Command::CloneIndex,
10381        ResultBody::ConfigureHistory(_) => Command::ConfigureHistory,
10382        ResultBody::GetHistory(_) => Command::GetHistory,
10383        ResultBody::ResolveHistory(_) => Command::ResolveHistory,
10384        ResultBody::PlaceHistoryHold(_) => Command::PlaceHistoryHold,
10385        ResultBody::ReleaseHistoryHold(_) => Command::ReleaseHistoryHold,
10386        ResultBody::PrepareDocumentMutation(_) => Command::PrepareDocumentMutation,
10387        ResultBody::SubmitDocumentMutation(_) => Command::SubmitDocumentMutation,
10388        ResultBody::PrepareDocumentBulk(_) => Command::PrepareDocumentBulk,
10389        ResultBody::SubmitDocumentBulk(_) => Command::SubmitDocumentBulk,
10390        ResultBody::ResolveDocumentBulk(_) => Command::ResolveDocumentBulk,
10391        ResultBody::PrepareAppendBulk(_) => Command::PrepareAppendBulk,
10392        ResultBody::SubmitAppendBulk(_) => Command::SubmitAppendBulk,
10393        ResultBody::ResolveAppendBulk(_) => Command::ResolveAppendBulk,
10394        ResultBody::ObserveAppendCommitted(_) => Command::ObserveAppendCommitted,
10395        ResultBody::ResolveDocumentMutation(_) => Command::ResolveDocumentMutation,
10396        ResultBody::GetDocument(_) => Command::GetDocument,
10397        ResultBody::Search(_) => Command::Search,
10398        ResultBody::TraverseRelationships(_) => Command::TraverseRelationships,
10399        ResultBody::QueryProfiles(_) => Command::QueryProfiles,
10400        ResultBody::EvaluateTemporalEvidence(_) => Command::EvaluateTemporalEvidence,
10401        ResultBody::CreateContinuousTemporalEvaluation(_) => Command::CreateContinuousTemporalEvaluation,
10402        ResultBody::GetContinuousTemporalEvaluation(_) => Command::GetContinuousTemporalEvaluation,
10403        ResultBody::PauseContinuousTemporalEvaluation(_) => Command::PauseContinuousTemporalEvaluation,
10404        ResultBody::ResumeContinuousTemporalEvaluation(_) => Command::ResumeContinuousTemporalEvaluation,
10405        ResultBody::ReplaceContinuousTemporalEvaluation(_) => Command::ReplaceContinuousTemporalEvaluation,
10406        ResultBody::RetireContinuousTemporalEvaluation(_) => Command::RetireContinuousTemporalEvaluation,
10407        ResultBody::ReadContinuousTemporalEvidence(_) => Command::ReadContinuousTemporalEvidence,
10408        ResultBody::ValidateSearch(_) => Command::ValidateSearch,
10409        ResultBody::OpenPit(_) => Command::OpenPit,
10410        ResultBody::RenewPit(_) => Command::RenewPit,
10411        ResultBody::ClosePit(_) => Command::ClosePit,
10412        ResultBody::ListOperations(_) => Command::ListOperations,
10413        ResultBody::GetOperation(_) => Command::GetOperation,
10414        ResultBody::WaitOperation(_) => Command::WaitOperation,
10415        ResultBody::CancelOperation(_) => Command::CancelOperation,
10416        ResultBody::ListAuditEvents(_) => Command::ListAuditEvents,
10417        ResultBody::ExportAuditEvents(_) => Command::ExportAuditEvents,
10418        ResultBody::ReserveServiceCredential(_) => Command::ReserveServiceCredential,
10419        ResultBody::ReserveServiceCredentialRotation(_) => Command::ReserveServiceCredentialRotation,
10420        ResultBody::ActivateServiceCredential(_) => Command::ActivateServiceCredential,
10421        ResultBody::ResolveServiceCredentialReservation(_) => Command::ResolveServiceCredentialReservation,
10422        ResultBody::PrepareRevokeServiceCredential(_) => Command::PrepareRevokeServiceCredential,
10423        ResultBody::RevokeServiceCredential(_) => Command::RevokeServiceCredential,
10424        ResultBody::ResolveSecurityAction(_) => Command::ResolveSecurityAction,
10425        ResultBody::GetSecurityRole(_) => Command::GetSecurityRole,
10426        ResultBody::PrepareRoleAppendAccessChange(_) => Command::PrepareRoleAppendAccessChange,
10427        ResultBody::SubmitRoleAppendAccessChange(_) => Command::SubmitRoleAppendAccessChange,
10428        ResultBody::ListServiceCredentials(_) => Command::ListServiceCredentials,
10429        ResultBody::GetRuntimeStatus(_) => Command::GetRuntimeStatus,
10430        ResultBody::GetResultCacheStatus(_) => Command::GetResultCacheStatus,
10431        ResultBody::GetFieldPromotionStatus(_) => Command::GetFieldPromotionStatus,
10432        ResultBody::GetOverloadStatus(_) => Command::GetOverloadStatus,
10433        ResultBody::ConfigureExternalKey(_) => Command::ConfigureExternalKey,
10434        ResultBody::RotateExternalKeyBinding(_) => Command::RotateExternalKeyBinding,
10435        ResultBody::ConfigureAggregateThenDelete(_) => Command::ConfigureAggregateThenDelete,
10436        ResultBody::GetLifecycleStatus(_) => Command::GetLifecycleStatus,
10437        ResultBody::GetQuota(_) => Command::GetQuota,
10438        ResultBody::UpdateQuota(_) => Command::UpdateQuota,
10439        ResultBody::GetBinding(_) => Command::GetBinding,
10440        ResultBody::GetAdmissionStatus(_) => Command::GetAdmissionStatus,
10441        ResultBody::SetAdmission(_) => Command::SetAdmission,
10442        ResultBody::GetQuiesceStatus(_) => Command::GetQuiesceStatus,
10443        ResultBody::GetDecommissionReadiness(_) => Command::GetDecommissionReadiness,
10444        ResultBody::GetUpgradeReadiness(_) => Command::GetUpgradeReadiness,
10445        ResultBody::GetMaintenanceStatus(_) => Command::GetMaintenanceStatus,
10446        ResultBody::WarmVectorIndex(_) => Command::WarmVectorIndex,
10447        ResultBody::EvaluateVectorRecall(_) => Command::EvaluateVectorRecall,
10448        ResultBody::CalibrateVectorStrategy(_) => Command::CalibrateVectorStrategy,
10449        ResultBody::GetVectorDiagnostic(_) => Command::GetVectorDiagnostic,
10450        ResultBody::CreateDiagnostic(_) => Command::CreateDiagnostic,
10451        ResultBody::GetDiagnostic(_) => Command::GetDiagnostic,
10452        ResultBody::PrepareCollectionExport(_) => Command::PrepareCollectionExport,
10453        ResultBody::StartCollectionExport(_) => Command::StartCollectionExport,
10454        ResultBody::ResolveCollectionExport(_) => Command::ResolveCollectionExport,
10455        ResultBody::VerifyCollectionExport(_) => Command::VerifyCollectionExport,
10456        ResultBody::PrepareCollectionRestore(_) => Command::PrepareCollectionRestore,
10457        ResultBody::StartCollectionRestore(_) => Command::StartCollectionRestore,
10458        ResultBody::ResolveCollectionRestore(_) => Command::ResolveCollectionRestore,
10459        ResultBody::PrepareIndexExport(_) => Command::PrepareIndexExport,
10460        ResultBody::StartIndexExport(_) => Command::StartIndexExport,
10461        ResultBody::ResolveIndexExport(_) => Command::ResolveIndexExport,
10462        ResultBody::VerifyIndexExport(_) => Command::VerifyIndexExport,
10463        ResultBody::PrepareIndexImport(_) => Command::PrepareIndexImport,
10464        ResultBody::StartIndexImport(_) => Command::StartIndexImport,
10465        ResultBody::ResolveIndexImport(_) => Command::ResolveIndexImport,
10466        ResultBody::ReadArtifactChunk(_) => Command::ReadArtifactChunk,
10467        ResultBody::ExportUsage(_) => Command::ExportUsage,
10468        ResultBody::ExecuteStateRead(_) => Command::ExecuteStateRead,
10469        ResultBody::PrepareStateWrite(_) => Command::PrepareStateWrite,
10470        ResultBody::SubmitStateWrite(_) => Command::SubmitStateWrite,
10471        ResultBody::ResolveStateWrite(_) => Command::ResolveStateWrite,
10472    }
10473}
10474
10475#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
10476#[serde(deny_unknown_fields)]
10477pub struct RequestEnvelope {
10478    pub meta: RequestMeta,
10479    pub request: RequestBody,
10480}
10481#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
10482#[serde(tag = "outcome", rename_all = "snake_case")]
10483pub enum ResponseEnvelope {
10484    Success {
10485        meta: ResponseMeta,
10486        result: Box<ResultBody>,
10487    },
10488    Error {
10489        meta: ResponseMeta,
10490        error: ErrorBody,
10491    },
10492}
10493
10494#[derive(Clone, Copy, Debug, Eq, PartialEq)]
10495pub struct CommandContract {
10496    pub command: Command,
10497    pub action: Action,
10498    pub cancellable: bool,
10499    pub mutation: &'static str,
10500}
10501pub const LODESTONE_API_COMMAND_CONTRACTS: &[CommandContract] = &[
10502    CommandContract {
10503        command: Command::Discover,
10504        action: Action::IdentityDiscovery,
10505        cancellable: true,
10506        mutation: "read_only",
10507    },
10508    CommandContract {
10509        command: Command::ListIndexes,
10510        action: Action::CatalogRead,
10511        cancellable: true,
10512        mutation: "read_only",
10513    },
10514    CommandContract {
10515        command: Command::GetIndex,
10516        action: Action::CatalogRead,
10517        cancellable: true,
10518        mutation: "read_only",
10519    },
10520    CommandContract {
10521        command: Command::ValidateIndexChange,
10522        action: Action::IndexAdmin,
10523        cancellable: true,
10524        mutation: "read_only",
10525    },
10526    CommandContract {
10527        command: Command::ApplyIndexChange,
10528        action: Action::IndexAdmin,
10529        cancellable: true,
10530        mutation: "catalog_submit",
10531    },
10532    CommandContract {
10533        command: Command::ApplyAdministrationMutation,
10534        action: Action::LifecycleAdmin,
10535        cancellable: true,
10536        mutation: "administration_submit",
10537    },
10538    CommandContract {
10539        command: Command::ListAliases,
10540        action: Action::CatalogRead,
10541        cancellable: true,
10542        mutation: "read_only",
10543    },
10544    CommandContract {
10545        command: Command::GetAlias,
10546        action: Action::CatalogRead,
10547        cancellable: true,
10548        mutation: "read_only",
10549    },
10550    CommandContract {
10551        command: Command::ListDataStreams,
10552        action: Action::CatalogRead,
10553        cancellable: true,
10554        mutation: "read_only",
10555    },
10556    CommandContract {
10557        command: Command::GetDataStream,
10558        action: Action::CatalogRead,
10559        cancellable: true,
10560        mutation: "read_only",
10561    },
10562    CommandContract {
10563        command: Command::ListComponentTemplates,
10564        action: Action::CatalogRead,
10565        cancellable: true,
10566        mutation: "read_only",
10567    },
10568    CommandContract {
10569        command: Command::GetComponentTemplate,
10570        action: Action::CatalogRead,
10571        cancellable: true,
10572        mutation: "read_only",
10573    },
10574    CommandContract {
10575        command: Command::ListIndexTemplates,
10576        action: Action::CatalogRead,
10577        cancellable: true,
10578        mutation: "read_only",
10579    },
10580    CommandContract {
10581        command: Command::GetIndexTemplate,
10582        action: Action::CatalogRead,
10583        cancellable: true,
10584        mutation: "read_only",
10585    },
10586    CommandContract {
10587        command: Command::ListIngestPipelines,
10588        action: Action::LifecycleAdmin,
10589        cancellable: true,
10590        mutation: "read_only",
10591    },
10592    CommandContract {
10593        command: Command::GetIngestPipeline,
10594        action: Action::LifecycleAdmin,
10595        cancellable: true,
10596        mutation: "read_only",
10597    },
10598    CommandContract {
10599        command: Command::SimulateIngestPipeline,
10600        action: Action::LifecycleAdmin,
10601        cancellable: true,
10602        mutation: "read_only",
10603    },
10604    CommandContract {
10605        command: Command::ReprocessByQuery,
10606        action: Action::DataWrite,
10607        cancellable: true,
10608        mutation: "authority_submit",
10609    },
10610    CommandContract {
10611        command: Command::ListLifecyclePolicies,
10612        action: Action::CatalogRead,
10613        cancellable: true,
10614        mutation: "read_only",
10615    },
10616    CommandContract {
10617        command: Command::GetLifecyclePolicy,
10618        action: Action::CatalogRead,
10619        cancellable: true,
10620        mutation: "read_only",
10621    },
10622    CommandContract {
10623        command: Command::PrepareCreateIndex,
10624        action: Action::IndexAdmin,
10625        cancellable: true,
10626        mutation: "catalog_prepare",
10627    },
10628    CommandContract {
10629        command: Command::PrepareDeleteIndex,
10630        action: Action::IndexAdmin,
10631        cancellable: true,
10632        mutation: "catalog_prepare",
10633    },
10634    CommandContract {
10635        command: Command::SubmitCatalogAction,
10636        action: Action::IndexAdmin,
10637        cancellable: true,
10638        mutation: "catalog_submit",
10639    },
10640    CommandContract {
10641        command: Command::ResolveCatalogAction,
10642        action: Action::IndexAdmin,
10643        cancellable: true,
10644        mutation: "read_only",
10645    },
10646    CommandContract {
10647        command: Command::PrepareReplayableSourceIndex,
10648        action: Action::IndexAdmin,
10649        cancellable: true,
10650        mutation: "catalog_prepare",
10651    },
10652    CommandContract {
10653        command: Command::SubmitReplayableSourceIndex,
10654        action: Action::IndexAdmin,
10655        cancellable: true,
10656        mutation: "catalog_submit",
10657    },
10658    CommandContract {
10659        command: Command::GetReplayableSource,
10660        action: Action::CatalogRead,
10661        cancellable: true,
10662        mutation: "read_only",
10663    },
10664    CommandContract {
10665        command: Command::ControlReplayableSource,
10666        action: Action::IndexAdmin,
10667        cancellable: true,
10668        mutation: "catalog_submit",
10669    },
10670    CommandContract {
10671        command: Command::CloneIndex,
10672        action: Action::IndexAdmin,
10673        cancellable: true,
10674        mutation: "catalog_submit",
10675    },
10676    CommandContract {
10677        command: Command::ConfigureHistory,
10678        action: Action::IndexAdmin,
10679        cancellable: true,
10680        mutation: "catalog_submit",
10681    },
10682    CommandContract {
10683        command: Command::GetHistory,
10684        action: Action::CatalogRead,
10685        cancellable: true,
10686        mutation: "read_only",
10687    },
10688    CommandContract {
10689        command: Command::ResolveHistory,
10690        action: Action::DataRead,
10691        cancellable: true,
10692        mutation: "read_only",
10693    },
10694    CommandContract {
10695        command: Command::PlaceHistoryHold,
10696        action: Action::IndexAdmin,
10697        cancellable: true,
10698        mutation: "catalog_submit",
10699    },
10700    CommandContract {
10701        command: Command::ReleaseHistoryHold,
10702        action: Action::IndexAdmin,
10703        cancellable: true,
10704        mutation: "catalog_submit",
10705    },
10706    CommandContract {
10707        command: Command::PrepareDocumentMutation,
10708        action: Action::DataWrite,
10709        cancellable: true,
10710        mutation: "read_only_prepare",
10711    },
10712    CommandContract {
10713        command: Command::SubmitDocumentMutation,
10714        action: Action::DataWrite,
10715        cancellable: true,
10716        mutation: "wal_submit",
10717    },
10718    CommandContract {
10719        command: Command::PrepareDocumentBulk,
10720        action: Action::DataWrite,
10721        cancellable: true,
10722        mutation: "read_only_prepare",
10723    },
10724    CommandContract {
10725        command: Command::SubmitDocumentBulk,
10726        action: Action::DataWrite,
10727        cancellable: true,
10728        mutation: "wal_submit",
10729    },
10730    CommandContract {
10731        command: Command::ResolveDocumentBulk,
10732        action: Action::DataRead,
10733        cancellable: true,
10734        mutation: "read_only",
10735    },
10736    CommandContract {
10737        command: Command::PrepareAppendBulk,
10738        action: Action::Append,
10739        cancellable: true,
10740        mutation: "read_only_prepare",
10741    },
10742    CommandContract {
10743        command: Command::SubmitAppendBulk,
10744        action: Action::Append,
10745        cancellable: true,
10746        mutation: "wal_submit",
10747    },
10748    CommandContract {
10749        command: Command::ResolveAppendBulk,
10750        action: Action::ResolveAppend,
10751        cancellable: true,
10752        mutation: "read_only",
10753    },
10754    CommandContract {
10755        command: Command::ObserveAppendCommitted,
10756        action: Action::ResolveAppend,
10757        cancellable: true,
10758        mutation: "read_only",
10759    },
10760    CommandContract {
10761        command: Command::ResolveDocumentMutation,
10762        action: Action::DataRead,
10763        cancellable: true,
10764        mutation: "read_only",
10765    },
10766    CommandContract {
10767        command: Command::GetDocument,
10768        action: Action::DataRead,
10769        cancellable: true,
10770        mutation: "read_only",
10771    },
10772    CommandContract {
10773        command: Command::Search,
10774        action: Action::DataRead,
10775        cancellable: true,
10776        mutation: "read_only",
10777    },
10778    CommandContract {
10779        command: Command::TraverseRelationships,
10780        action: Action::DataRead,
10781        cancellable: true,
10782        mutation: "read_only",
10783    },
10784    CommandContract {
10785        command: Command::QueryProfiles,
10786        action: Action::DataRead,
10787        cancellable: true,
10788        mutation: "read_only",
10789    },
10790    CommandContract {
10791        command: Command::EvaluateTemporalEvidence,
10792        action: Action::DataRead,
10793        cancellable: true,
10794        mutation: "read_only",
10795    },
10796    CommandContract {
10797        command: Command::CreateContinuousTemporalEvaluation,
10798        action: Action::LifecycleAdmin,
10799        cancellable: true,
10800        mutation: "catalog_submit",
10801    },
10802    CommandContract {
10803        command: Command::GetContinuousTemporalEvaluation,
10804        action: Action::CatalogRead,
10805        cancellable: true,
10806        mutation: "read_only",
10807    },
10808    CommandContract {
10809        command: Command::PauseContinuousTemporalEvaluation,
10810        action: Action::LifecycleAdmin,
10811        cancellable: true,
10812        mutation: "catalog_submit",
10813    },
10814    CommandContract {
10815        command: Command::ResumeContinuousTemporalEvaluation,
10816        action: Action::LifecycleAdmin,
10817        cancellable: true,
10818        mutation: "catalog_submit",
10819    },
10820    CommandContract {
10821        command: Command::ReplaceContinuousTemporalEvaluation,
10822        action: Action::LifecycleAdmin,
10823        cancellable: true,
10824        mutation: "catalog_submit",
10825    },
10826    CommandContract {
10827        command: Command::RetireContinuousTemporalEvaluation,
10828        action: Action::LifecycleAdmin,
10829        cancellable: true,
10830        mutation: "catalog_submit",
10831    },
10832    CommandContract {
10833        command: Command::ReadContinuousTemporalEvidence,
10834        action: Action::DataRead,
10835        cancellable: true,
10836        mutation: "read_only",
10837    },
10838    CommandContract {
10839        command: Command::ValidateSearch,
10840        action: Action::DataRead,
10841        cancellable: true,
10842        mutation: "read_only",
10843    },
10844    CommandContract {
10845        command: Command::OpenPit,
10846        action: Action::DataRead,
10847        cancellable: true,
10848        mutation: "authority_submit",
10849    },
10850    CommandContract {
10851        command: Command::RenewPit,
10852        action: Action::DataRead,
10853        cancellable: true,
10854        mutation: "authority_submit",
10855    },
10856    CommandContract {
10857        command: Command::ClosePit,
10858        action: Action::DataRead,
10859        cancellable: true,
10860        mutation: "authority_submit",
10861    },
10862    CommandContract {
10863        command: Command::ListOperations,
10864        action: Action::OperationRead,
10865        cancellable: true,
10866        mutation: "read_only",
10867    },
10868    CommandContract {
10869        command: Command::GetOperation,
10870        action: Action::OperationRead,
10871        cancellable: true,
10872        mutation: "read_only",
10873    },
10874    CommandContract {
10875        command: Command::WaitOperation,
10876        action: Action::OperationRead,
10877        cancellable: true,
10878        mutation: "read_only",
10879    },
10880    CommandContract {
10881        command: Command::CancelOperation,
10882        action: Action::OperationCancel,
10883        cancellable: true,
10884        mutation: "authority_submit",
10885    },
10886    CommandContract {
10887        command: Command::ListAuditEvents,
10888        action: Action::AuditRead,
10889        cancellable: true,
10890        mutation: "read_only",
10891    },
10892    CommandContract {
10893        command: Command::ExportAuditEvents,
10894        action: Action::AuditRead,
10895        cancellable: true,
10896        mutation: "read_only",
10897    },
10898    CommandContract {
10899        command: Command::ReserveServiceCredential,
10900        action: Action::SecurityAdmin,
10901        cancellable: true,
10902        mutation: "security_reserve",
10903    },
10904    CommandContract {
10905        command: Command::ReserveServiceCredentialRotation,
10906        action: Action::SecurityAdmin,
10907        cancellable: true,
10908        mutation: "security_reserve",
10909    },
10910    CommandContract {
10911        command: Command::ActivateServiceCredential,
10912        action: Action::SecurityAdmin,
10913        cancellable: true,
10914        mutation: "security_submit",
10915    },
10916    CommandContract {
10917        command: Command::ResolveServiceCredentialReservation,
10918        action: Action::SecurityRead,
10919        cancellable: true,
10920        mutation: "read_only",
10921    },
10922    CommandContract {
10923        command: Command::PrepareRevokeServiceCredential,
10924        action: Action::SecurityAdmin,
10925        cancellable: true,
10926        mutation: "read_only_prepare",
10927    },
10928    CommandContract {
10929        command: Command::RevokeServiceCredential,
10930        action: Action::SecurityAdmin,
10931        cancellable: true,
10932        mutation: "security_submit",
10933    },
10934    CommandContract {
10935        command: Command::ResolveSecurityAction,
10936        action: Action::SecurityRead,
10937        cancellable: true,
10938        mutation: "read_only",
10939    },
10940    CommandContract {
10941        command: Command::GetSecurityRole,
10942        action: Action::SecurityRead,
10943        cancellable: true,
10944        mutation: "read_only",
10945    },
10946    CommandContract {
10947        command: Command::PrepareRoleAppendAccessChange,
10948        action: Action::SecurityAdmin,
10949        cancellable: true,
10950        mutation: "read_only_prepare",
10951    },
10952    CommandContract {
10953        command: Command::SubmitRoleAppendAccessChange,
10954        action: Action::SecurityAdmin,
10955        cancellable: true,
10956        mutation: "security_submit",
10957    },
10958    CommandContract {
10959        command: Command::ListServiceCredentials,
10960        action: Action::SecurityRead,
10961        cancellable: true,
10962        mutation: "read_only",
10963    },
10964    CommandContract {
10965        command: Command::GetRuntimeStatus,
10966        action: Action::CatalogRead,
10967        cancellable: true,
10968        mutation: "read_only",
10969    },
10970    CommandContract {
10971        command: Command::GetResultCacheStatus,
10972        action: Action::CatalogRead,
10973        cancellable: true,
10974        mutation: "read_only",
10975    },
10976    CommandContract {
10977        command: Command::GetFieldPromotionStatus,
10978        action: Action::CatalogRead,
10979        cancellable: true,
10980        mutation: "read_only",
10981    },
10982    CommandContract {
10983        command: Command::GetOverloadStatus,
10984        action: Action::CatalogRead,
10985        cancellable: true,
10986        mutation: "read_only",
10987    },
10988    CommandContract {
10989        command: Command::ConfigureExternalKey,
10990        action: Action::LifecycleAdmin,
10991        cancellable: true,
10992        mutation: "authority_submit",
10993    },
10994    CommandContract {
10995        command: Command::RotateExternalKeyBinding,
10996        action: Action::LifecycleAdmin,
10997        cancellable: true,
10998        mutation: "authority_submit",
10999    },
11000    CommandContract {
11001        command: Command::ConfigureAggregateThenDelete,
11002        action: Action::LifecycleAdmin,
11003        cancellable: true,
11004        mutation: "authority_submit",
11005    },
11006    CommandContract {
11007        command: Command::GetLifecycleStatus,
11008        action: Action::CatalogRead,
11009        cancellable: true,
11010        mutation: "read_only",
11011    },
11012    CommandContract {
11013        command: Command::GetQuota,
11014        action: Action::QuotaRead,
11015        cancellable: true,
11016        mutation: "read_only",
11017    },
11018    CommandContract {
11019        command: Command::UpdateQuota,
11020        action: Action::QuotaAdmin,
11021        cancellable: true,
11022        mutation: "quota_submit",
11023    },
11024    CommandContract {
11025        command: Command::GetBinding,
11026        action: Action::BindingRead,
11027        cancellable: true,
11028        mutation: "read_only",
11029    },
11030    CommandContract {
11031        command: Command::GetAdmissionStatus,
11032        action: Action::AdmissionRead,
11033        cancellable: true,
11034        mutation: "read_only",
11035    },
11036    CommandContract {
11037        command: Command::SetAdmission,
11038        action: Action::AdmissionAdmin,
11039        cancellable: true,
11040        mutation: "admission_submit",
11041    },
11042    CommandContract {
11043        command: Command::GetQuiesceStatus,
11044        action: Action::AdmissionRead,
11045        cancellable: true,
11046        mutation: "read_only",
11047    },
11048    CommandContract {
11049        command: Command::GetDecommissionReadiness,
11050        action: Action::AdmissionRead,
11051        cancellable: true,
11052        mutation: "read_only",
11053    },
11054    CommandContract {
11055        command: Command::GetUpgradeReadiness,
11056        action: Action::TaskRead,
11057        cancellable: true,
11058        mutation: "read_only",
11059    },
11060    CommandContract {
11061        command: Command::GetMaintenanceStatus,
11062        action: Action::TaskRead,
11063        cancellable: true,
11064        mutation: "read_only",
11065    },
11066    CommandContract {
11067        command: Command::WarmVectorIndex,
11068        action: Action::DataRead,
11069        cancellable: true,
11070        mutation: "read_only",
11071    },
11072    CommandContract {
11073        command: Command::EvaluateVectorRecall,
11074        action: Action::DiagnosticsCreate,
11075        cancellable: true,
11076        mutation: "diagnostic_submit",
11077    },
11078    CommandContract {
11079        command: Command::CalibrateVectorStrategy,
11080        action: Action::DiagnosticsCreate,
11081        cancellable: true,
11082        mutation: "diagnostic_submit",
11083    },
11084    CommandContract {
11085        command: Command::GetVectorDiagnostic,
11086        action: Action::DiagnosticsRead,
11087        cancellable: true,
11088        mutation: "read_only",
11089    },
11090    CommandContract {
11091        command: Command::CreateDiagnostic,
11092        action: Action::DiagnosticsCreate,
11093        cancellable: true,
11094        mutation: "diagnostic_submit",
11095    },
11096    CommandContract {
11097        command: Command::GetDiagnostic,
11098        action: Action::DiagnosticsRead,
11099        cancellable: true,
11100        mutation: "read_only",
11101    },
11102    CommandContract {
11103        command: Command::PrepareCollectionExport,
11104        action: Action::CollectionExport,
11105        cancellable: true,
11106        mutation: "read_only_prepare",
11107    },
11108    CommandContract {
11109        command: Command::StartCollectionExport,
11110        action: Action::CollectionExport,
11111        cancellable: true,
11112        mutation: "portability_submit",
11113    },
11114    CommandContract {
11115        command: Command::ResolveCollectionExport,
11116        action: Action::CollectionExport,
11117        cancellable: true,
11118        mutation: "read_only",
11119    },
11120    CommandContract {
11121        command: Command::VerifyCollectionExport,
11122        action: Action::CollectionExport,
11123        cancellable: true,
11124        mutation: "read_only",
11125    },
11126    CommandContract {
11127        command: Command::PrepareCollectionRestore,
11128        action: Action::CollectionRestore,
11129        cancellable: true,
11130        mutation: "read_only_prepare",
11131    },
11132    CommandContract {
11133        command: Command::StartCollectionRestore,
11134        action: Action::CollectionRestore,
11135        cancellable: true,
11136        mutation: "portability_submit",
11137    },
11138    CommandContract {
11139        command: Command::ResolveCollectionRestore,
11140        action: Action::CollectionRestore,
11141        cancellable: true,
11142        mutation: "read_only",
11143    },
11144    CommandContract {
11145        command: Command::PrepareIndexExport,
11146        action: Action::IndexExport,
11147        cancellable: true,
11148        mutation: "read_only_prepare",
11149    },
11150    CommandContract {
11151        command: Command::StartIndexExport,
11152        action: Action::IndexExport,
11153        cancellable: true,
11154        mutation: "portability_submit",
11155    },
11156    CommandContract {
11157        command: Command::ResolveIndexExport,
11158        action: Action::IndexExport,
11159        cancellable: true,
11160        mutation: "read_only",
11161    },
11162    CommandContract {
11163        command: Command::VerifyIndexExport,
11164        action: Action::IndexExport,
11165        cancellable: true,
11166        mutation: "read_only",
11167    },
11168    CommandContract {
11169        command: Command::PrepareIndexImport,
11170        action: Action::IndexImport,
11171        cancellable: true,
11172        mutation: "read_only_prepare",
11173    },
11174    CommandContract {
11175        command: Command::StartIndexImport,
11176        action: Action::IndexImport,
11177        cancellable: true,
11178        mutation: "portability_submit",
11179    },
11180    CommandContract {
11181        command: Command::ResolveIndexImport,
11182        action: Action::IndexImport,
11183        cancellable: true,
11184        mutation: "read_only",
11185    },
11186    CommandContract {
11187        command: Command::ReadArtifactChunk,
11188        action: Action::OperationRead,
11189        cancellable: true,
11190        mutation: "read_only",
11191    },
11192    CommandContract {
11193        command: Command::ExportUsage,
11194        action: Action::UsageRead,
11195        cancellable: true,
11196        mutation: "read_only",
11197    },
11198    CommandContract {
11199        command: Command::ExecuteStateRead,
11200        action: Action::DataRead,
11201        cancellable: true,
11202        mutation: "read_only",
11203    },
11204    CommandContract {
11205        command: Command::PrepareStateWrite,
11206        action: Action::DataWrite,
11207        cancellable: true,
11208        mutation: "read_only_prepare",
11209    },
11210    CommandContract {
11211        command: Command::SubmitStateWrite,
11212        action: Action::DataWrite,
11213        cancellable: true,
11214        mutation: "state_submit",
11215    },
11216    CommandContract {
11217        command: Command::ResolveStateWrite,
11218        action: Action::DataRead,
11219        cancellable: true,
11220        mutation: "read_only",
11221    },
11222];
11223#[derive(Clone, Copy, Debug, Eq, PartialEq)]
11224pub struct CommandSemanticContract {
11225    pub command: Command,
11226    pub admissible_errors: &'static [ErrorCode],
11227    pub limit_ids: &'static [&'static str],
11228    pub effect_class: &'static str,
11229    pub risk_flags: &'static [&'static str],
11230    pub capability_family: &'static str,
11231    pub retry_safety: &'static str,
11232    pub identity_requirement: &'static str,
11233    pub resolver: Option<Command>,
11234    pub cancellation: &'static str,
11235    pub side_effects: &'static [&'static str],
11236    pub recovery: &'static str,
11237    pub collection_index_ref: &'static str,
11238}
11239pub const LODESTONE_API_COMMAND_SEMANTICS: &[CommandSemanticContract] = &[
11240    CommandSemanticContract {
11241        command: Command::Discover,
11242        admissible_errors: &[
11243            ErrorCode::Aborted,
11244            ErrorCode::DeadlineExceeded,
11245            ErrorCode::InvalidRequest,
11246            ErrorCode::UnsupportedVersion,
11247            ErrorCode::Unauthenticated,
11248            ErrorCode::PermissionDenied,
11249            ErrorCode::NotFound,
11250            ErrorCode::LimitExceeded,
11251            ErrorCode::CapabilityUnavailable,
11252            ErrorCode::TemporarilyUnavailable,
11253            ErrorCode::Internal,
11254        ],
11255        limit_ids: &["request_bytes", "response_bytes"],
11256        effect_class: "read_only",
11257        risk_flags: &[],
11258        capability_family: "discovery",
11259        retry_safety: "safe",
11260        identity_requirement: "none",
11261        resolver: None,
11262        cancellation: "per_call",
11263        side_effects: &[],
11264        recovery: "retry",
11265        collection_index_ref: "none",
11266    },
11267    CommandSemanticContract {
11268        command: Command::ListIndexes,
11269        admissible_errors: &[
11270            ErrorCode::Aborted,
11271            ErrorCode::DeadlineExceeded,
11272            ErrorCode::InvalidRequest,
11273            ErrorCode::UnsupportedVersion,
11274            ErrorCode::Unauthenticated,
11275            ErrorCode::PermissionDenied,
11276            ErrorCode::NotFound,
11277            ErrorCode::StaleCursor,
11278            ErrorCode::RestartBudgetExhausted,
11279            ErrorCode::LimitExceeded,
11280            ErrorCode::CapabilityUnavailable,
11281            ErrorCode::TemporarilyUnavailable,
11282            ErrorCode::Internal,
11283        ],
11284        limit_ids: &[
11285            "request_bytes",
11286            "response_bytes",
11287            "page_size",
11288            "catalog_page_size",
11289            "catalog_restart_budget",
11290        ],
11291        effect_class: "read_only",
11292        risk_flags: &[],
11293        capability_family: "catalog",
11294        retry_safety: "safe",
11295        identity_requirement: "none",
11296        resolver: None,
11297        cancellation: "per_call",
11298        side_effects: &[],
11299        recovery: "retry",
11300        collection_index_ref: "none",
11301    },
11302    CommandSemanticContract {
11303        command: Command::GetIndex,
11304        admissible_errors: &[
11305            ErrorCode::Aborted,
11306            ErrorCode::DeadlineExceeded,
11307            ErrorCode::InvalidRequest,
11308            ErrorCode::UnsupportedVersion,
11309            ErrorCode::Unauthenticated,
11310            ErrorCode::PermissionDenied,
11311            ErrorCode::NotFound,
11312            ErrorCode::LimitExceeded,
11313            ErrorCode::CapabilityUnavailable,
11314            ErrorCode::TemporarilyUnavailable,
11315            ErrorCode::Internal,
11316        ],
11317        limit_ids: &["request_bytes", "response_bytes"],
11318        effect_class: "read_only",
11319        risk_flags: &[],
11320        capability_family: "catalog",
11321        retry_safety: "safe",
11322        identity_requirement: "none",
11323        resolver: None,
11324        cancellation: "per_call",
11325        side_effects: &[],
11326        recovery: "retry",
11327        collection_index_ref: "none",
11328    },
11329    CommandSemanticContract {
11330        command: Command::ValidateIndexChange,
11331        admissible_errors: &[
11332            ErrorCode::Aborted,
11333            ErrorCode::DeadlineExceeded,
11334            ErrorCode::InvalidRequest,
11335            ErrorCode::UnsupportedVersion,
11336            ErrorCode::Unauthenticated,
11337            ErrorCode::PermissionDenied,
11338            ErrorCode::NotFound,
11339            ErrorCode::LimitExceeded,
11340            ErrorCode::CapabilityUnavailable,
11341            ErrorCode::TemporarilyUnavailable,
11342            ErrorCode::Internal,
11343        ],
11344        limit_ids: &["request_bytes", "response_bytes"],
11345        effect_class: "read_only",
11346        risk_flags: &[],
11347        capability_family: "catalog",
11348        retry_safety: "safe",
11349        identity_requirement: "none",
11350        resolver: None,
11351        cancellation: "per_call",
11352        side_effects: &[],
11353        recovery: "retry",
11354        collection_index_ref: "request_name",
11355    },
11356    CommandSemanticContract {
11357        command: Command::ApplyIndexChange,
11358        admissible_errors: &[
11359            ErrorCode::Aborted,
11360            ErrorCode::DeadlineExceeded,
11361            ErrorCode::InvalidRequest,
11362            ErrorCode::UnsupportedVersion,
11363            ErrorCode::Unauthenticated,
11364            ErrorCode::PermissionDenied,
11365            ErrorCode::NotFound,
11366            ErrorCode::Conflict,
11367            ErrorCode::LimitExceeded,
11368            ErrorCode::CapabilityUnavailable,
11369            ErrorCode::NotSubmitted,
11370            ErrorCode::SubmittedIndeterminate,
11371            ErrorCode::ExpiredUnknown,
11372            ErrorCode::TemporarilyUnavailable,
11373            ErrorCode::Internal,
11374        ],
11375        limit_ids: &["request_bytes", "response_bytes"],
11376        effect_class: "durable_submit",
11377        risk_flags: &[],
11378        capability_family: "catalog",
11379        retry_safety: "pre_submit_only",
11380        identity_requirement: "caller_action_id",
11381        resolver: None,
11382        cancellation: "per_call_until_submission_then_resolve",
11383        side_effects: &["commits_authoritative_state"],
11384        recovery: "retry_if_not_submitted",
11385        collection_index_ref: "request_index",
11386    },
11387    CommandSemanticContract {
11388        command: Command::ApplyAdministrationMutation,
11389        admissible_errors: &[
11390            ErrorCode::Aborted,
11391            ErrorCode::DeadlineExceeded,
11392            ErrorCode::InvalidRequest,
11393            ErrorCode::UnsupportedVersion,
11394            ErrorCode::Unauthenticated,
11395            ErrorCode::PermissionDenied,
11396            ErrorCode::NotFound,
11397            ErrorCode::Conflict,
11398            ErrorCode::LimitExceeded,
11399            ErrorCode::CapabilityUnavailable,
11400            ErrorCode::NotSubmitted,
11401            ErrorCode::SubmittedIndeterminate,
11402            ErrorCode::ExpiredUnknown,
11403            ErrorCode::TemporarilyUnavailable,
11404            ErrorCode::Internal,
11405        ],
11406        limit_ids: &["request_bytes", "response_bytes"],
11407        effect_class: "control_write",
11408        risk_flags: &[],
11409        capability_family: "lifecycle",
11410        retry_safety: "pre_submit_only",
11411        identity_requirement: "caller_action_id",
11412        resolver: None,
11413        cancellation: "per_call_until_submission_then_resolve",
11414        side_effects: &["commits_authoritative_state"],
11415        recovery: "retry_if_not_submitted",
11416        collection_index_ref: "none",
11417    },
11418    CommandSemanticContract {
11419        command: Command::ListAliases,
11420        admissible_errors: &[
11421            ErrorCode::Aborted,
11422            ErrorCode::DeadlineExceeded,
11423            ErrorCode::InvalidRequest,
11424            ErrorCode::UnsupportedVersion,
11425            ErrorCode::Unauthenticated,
11426            ErrorCode::PermissionDenied,
11427            ErrorCode::NotFound,
11428            ErrorCode::StaleCursor,
11429            ErrorCode::RestartBudgetExhausted,
11430            ErrorCode::LimitExceeded,
11431            ErrorCode::CapabilityUnavailable,
11432            ErrorCode::TemporarilyUnavailable,
11433            ErrorCode::Internal,
11434        ],
11435        limit_ids: &[
11436            "request_bytes",
11437            "response_bytes",
11438            "page_size",
11439            "catalog_page_size",
11440            "catalog_restart_budget",
11441        ],
11442        effect_class: "read_only",
11443        risk_flags: &[],
11444        capability_family: "catalog",
11445        retry_safety: "safe",
11446        identity_requirement: "none",
11447        resolver: None,
11448        cancellation: "per_call",
11449        side_effects: &[],
11450        recovery: "retry",
11451        collection_index_ref: "none",
11452    },
11453    CommandSemanticContract {
11454        command: Command::GetAlias,
11455        admissible_errors: &[
11456            ErrorCode::Aborted,
11457            ErrorCode::DeadlineExceeded,
11458            ErrorCode::InvalidRequest,
11459            ErrorCode::UnsupportedVersion,
11460            ErrorCode::Unauthenticated,
11461            ErrorCode::PermissionDenied,
11462            ErrorCode::NotFound,
11463            ErrorCode::LimitExceeded,
11464            ErrorCode::CapabilityUnavailable,
11465            ErrorCode::TemporarilyUnavailable,
11466            ErrorCode::Internal,
11467        ],
11468        limit_ids: &["request_bytes", "response_bytes"],
11469        effect_class: "read_only",
11470        risk_flags: &[],
11471        capability_family: "catalog",
11472        retry_safety: "safe",
11473        identity_requirement: "none",
11474        resolver: None,
11475        cancellation: "per_call",
11476        side_effects: &[],
11477        recovery: "retry",
11478        collection_index_ref: "none",
11479    },
11480    CommandSemanticContract {
11481        command: Command::ListDataStreams,
11482        admissible_errors: &[
11483            ErrorCode::Aborted,
11484            ErrorCode::DeadlineExceeded,
11485            ErrorCode::InvalidRequest,
11486            ErrorCode::UnsupportedVersion,
11487            ErrorCode::Unauthenticated,
11488            ErrorCode::PermissionDenied,
11489            ErrorCode::NotFound,
11490            ErrorCode::StaleCursor,
11491            ErrorCode::RestartBudgetExhausted,
11492            ErrorCode::LimitExceeded,
11493            ErrorCode::CapabilityUnavailable,
11494            ErrorCode::TemporarilyUnavailable,
11495            ErrorCode::Internal,
11496        ],
11497        limit_ids: &[
11498            "request_bytes",
11499            "response_bytes",
11500            "page_size",
11501            "catalog_page_size",
11502            "catalog_restart_budget",
11503        ],
11504        effect_class: "read_only",
11505        risk_flags: &[],
11506        capability_family: "catalog",
11507        retry_safety: "safe",
11508        identity_requirement: "none",
11509        resolver: None,
11510        cancellation: "per_call",
11511        side_effects: &[],
11512        recovery: "retry",
11513        collection_index_ref: "none",
11514    },
11515    CommandSemanticContract {
11516        command: Command::GetDataStream,
11517        admissible_errors: &[
11518            ErrorCode::Aborted,
11519            ErrorCode::DeadlineExceeded,
11520            ErrorCode::InvalidRequest,
11521            ErrorCode::UnsupportedVersion,
11522            ErrorCode::Unauthenticated,
11523            ErrorCode::PermissionDenied,
11524            ErrorCode::NotFound,
11525            ErrorCode::LimitExceeded,
11526            ErrorCode::CapabilityUnavailable,
11527            ErrorCode::TemporarilyUnavailable,
11528            ErrorCode::Internal,
11529        ],
11530        limit_ids: &["request_bytes", "response_bytes"],
11531        effect_class: "read_only",
11532        risk_flags: &[],
11533        capability_family: "catalog",
11534        retry_safety: "safe",
11535        identity_requirement: "none",
11536        resolver: None,
11537        cancellation: "per_call",
11538        side_effects: &[],
11539        recovery: "retry",
11540        collection_index_ref: "none",
11541    },
11542    CommandSemanticContract {
11543        command: Command::ListComponentTemplates,
11544        admissible_errors: &[
11545            ErrorCode::Aborted,
11546            ErrorCode::DeadlineExceeded,
11547            ErrorCode::InvalidRequest,
11548            ErrorCode::UnsupportedVersion,
11549            ErrorCode::Unauthenticated,
11550            ErrorCode::PermissionDenied,
11551            ErrorCode::NotFound,
11552            ErrorCode::StaleCursor,
11553            ErrorCode::RestartBudgetExhausted,
11554            ErrorCode::LimitExceeded,
11555            ErrorCode::CapabilityUnavailable,
11556            ErrorCode::TemporarilyUnavailable,
11557            ErrorCode::Internal,
11558        ],
11559        limit_ids: &[
11560            "request_bytes",
11561            "response_bytes",
11562            "page_size",
11563            "catalog_page_size",
11564            "catalog_restart_budget",
11565        ],
11566        effect_class: "read_only",
11567        risk_flags: &[],
11568        capability_family: "catalog",
11569        retry_safety: "safe",
11570        identity_requirement: "none",
11571        resolver: None,
11572        cancellation: "per_call",
11573        side_effects: &[],
11574        recovery: "retry",
11575        collection_index_ref: "none",
11576    },
11577    CommandSemanticContract {
11578        command: Command::GetComponentTemplate,
11579        admissible_errors: &[
11580            ErrorCode::Aborted,
11581            ErrorCode::DeadlineExceeded,
11582            ErrorCode::InvalidRequest,
11583            ErrorCode::UnsupportedVersion,
11584            ErrorCode::Unauthenticated,
11585            ErrorCode::PermissionDenied,
11586            ErrorCode::NotFound,
11587            ErrorCode::LimitExceeded,
11588            ErrorCode::CapabilityUnavailable,
11589            ErrorCode::TemporarilyUnavailable,
11590            ErrorCode::Internal,
11591        ],
11592        limit_ids: &["request_bytes", "response_bytes"],
11593        effect_class: "read_only",
11594        risk_flags: &[],
11595        capability_family: "catalog",
11596        retry_safety: "safe",
11597        identity_requirement: "none",
11598        resolver: None,
11599        cancellation: "per_call",
11600        side_effects: &[],
11601        recovery: "retry",
11602        collection_index_ref: "none",
11603    },
11604    CommandSemanticContract {
11605        command: Command::ListIndexTemplates,
11606        admissible_errors: &[
11607            ErrorCode::Aborted,
11608            ErrorCode::DeadlineExceeded,
11609            ErrorCode::InvalidRequest,
11610            ErrorCode::UnsupportedVersion,
11611            ErrorCode::Unauthenticated,
11612            ErrorCode::PermissionDenied,
11613            ErrorCode::NotFound,
11614            ErrorCode::StaleCursor,
11615            ErrorCode::RestartBudgetExhausted,
11616            ErrorCode::LimitExceeded,
11617            ErrorCode::CapabilityUnavailable,
11618            ErrorCode::TemporarilyUnavailable,
11619            ErrorCode::Internal,
11620        ],
11621        limit_ids: &[
11622            "request_bytes",
11623            "response_bytes",
11624            "page_size",
11625            "catalog_page_size",
11626            "catalog_restart_budget",
11627        ],
11628        effect_class: "read_only",
11629        risk_flags: &[],
11630        capability_family: "catalog",
11631        retry_safety: "safe",
11632        identity_requirement: "none",
11633        resolver: None,
11634        cancellation: "per_call",
11635        side_effects: &[],
11636        recovery: "retry",
11637        collection_index_ref: "none",
11638    },
11639    CommandSemanticContract {
11640        command: Command::GetIndexTemplate,
11641        admissible_errors: &[
11642            ErrorCode::Aborted,
11643            ErrorCode::DeadlineExceeded,
11644            ErrorCode::InvalidRequest,
11645            ErrorCode::UnsupportedVersion,
11646            ErrorCode::Unauthenticated,
11647            ErrorCode::PermissionDenied,
11648            ErrorCode::NotFound,
11649            ErrorCode::LimitExceeded,
11650            ErrorCode::CapabilityUnavailable,
11651            ErrorCode::TemporarilyUnavailable,
11652            ErrorCode::Internal,
11653        ],
11654        limit_ids: &["request_bytes", "response_bytes"],
11655        effect_class: "read_only",
11656        risk_flags: &[],
11657        capability_family: "catalog",
11658        retry_safety: "safe",
11659        identity_requirement: "none",
11660        resolver: None,
11661        cancellation: "per_call",
11662        side_effects: &[],
11663        recovery: "retry",
11664        collection_index_ref: "none",
11665    },
11666    CommandSemanticContract {
11667        command: Command::ListIngestPipelines,
11668        admissible_errors: &[
11669            ErrorCode::Aborted,
11670            ErrorCode::DeadlineExceeded,
11671            ErrorCode::InvalidRequest,
11672            ErrorCode::UnsupportedVersion,
11673            ErrorCode::Unauthenticated,
11674            ErrorCode::PermissionDenied,
11675            ErrorCode::NotFound,
11676            ErrorCode::StaleCursor,
11677            ErrorCode::RestartBudgetExhausted,
11678            ErrorCode::LimitExceeded,
11679            ErrorCode::CapabilityUnavailable,
11680            ErrorCode::TemporarilyUnavailable,
11681            ErrorCode::Internal,
11682        ],
11683        limit_ids: &[
11684            "request_bytes",
11685            "response_bytes",
11686            "page_size",
11687            "catalog_page_size",
11688            "catalog_restart_budget",
11689        ],
11690        effect_class: "read_only",
11691        risk_flags: &[],
11692        capability_family: "lifecycle",
11693        retry_safety: "safe",
11694        identity_requirement: "none",
11695        resolver: None,
11696        cancellation: "per_call",
11697        side_effects: &[],
11698        recovery: "retry",
11699        collection_index_ref: "none",
11700    },
11701    CommandSemanticContract {
11702        command: Command::GetIngestPipeline,
11703        admissible_errors: &[
11704            ErrorCode::Aborted,
11705            ErrorCode::DeadlineExceeded,
11706            ErrorCode::InvalidRequest,
11707            ErrorCode::UnsupportedVersion,
11708            ErrorCode::Unauthenticated,
11709            ErrorCode::PermissionDenied,
11710            ErrorCode::NotFound,
11711            ErrorCode::LimitExceeded,
11712            ErrorCode::CapabilityUnavailable,
11713            ErrorCode::TemporarilyUnavailable,
11714            ErrorCode::Internal,
11715        ],
11716        limit_ids: &["request_bytes", "response_bytes"],
11717        effect_class: "read_only",
11718        risk_flags: &[],
11719        capability_family: "lifecycle",
11720        retry_safety: "safe",
11721        identity_requirement: "none",
11722        resolver: None,
11723        cancellation: "per_call",
11724        side_effects: &[],
11725        recovery: "retry",
11726        collection_index_ref: "none",
11727    },
11728    CommandSemanticContract {
11729        command: Command::SimulateIngestPipeline,
11730        admissible_errors: &[
11731            ErrorCode::Aborted,
11732            ErrorCode::DeadlineExceeded,
11733            ErrorCode::InvalidRequest,
11734            ErrorCode::UnsupportedVersion,
11735            ErrorCode::Unauthenticated,
11736            ErrorCode::PermissionDenied,
11737            ErrorCode::NotFound,
11738            ErrorCode::LimitExceeded,
11739            ErrorCode::CapabilityUnavailable,
11740            ErrorCode::TemporarilyUnavailable,
11741            ErrorCode::Internal,
11742        ],
11743        limit_ids: &["request_bytes", "response_bytes"],
11744        effect_class: "read_only",
11745        risk_flags: &[],
11746        capability_family: "lifecycle",
11747        retry_safety: "safe",
11748        identity_requirement: "none",
11749        resolver: None,
11750        cancellation: "per_call",
11751        side_effects: &[],
11752        recovery: "retry",
11753        collection_index_ref: "none",
11754    },
11755    CommandSemanticContract {
11756        command: Command::ReprocessByQuery,
11757        admissible_errors: &[
11758            ErrorCode::Aborted,
11759            ErrorCode::DeadlineExceeded,
11760            ErrorCode::InvalidRequest,
11761            ErrorCode::UnsupportedVersion,
11762            ErrorCode::Unauthenticated,
11763            ErrorCode::PermissionDenied,
11764            ErrorCode::NotFound,
11765            ErrorCode::Conflict,
11766            ErrorCode::LimitExceeded,
11767            ErrorCode::CapabilityUnavailable,
11768            ErrorCode::NotSubmitted,
11769            ErrorCode::SubmittedIndeterminate,
11770            ErrorCode::ExpiredUnknown,
11771            ErrorCode::TemporarilyUnavailable,
11772            ErrorCode::Internal,
11773        ],
11774        limit_ids: &["request_bytes", "response_bytes"],
11775        effect_class: "durable_submit",
11776        risk_flags: &[],
11777        capability_family: "data",
11778        retry_safety: "safe",
11779        identity_requirement: "caller_action_id",
11780        resolver: None,
11781        cancellation: "per_call_until_submission_then_resolve",
11782        side_effects: &["commits_authoritative_state"],
11783        recovery: "retry",
11784        collection_index_ref: "request_index",
11785    },
11786    CommandSemanticContract {
11787        command: Command::ListLifecyclePolicies,
11788        admissible_errors: &[
11789            ErrorCode::Aborted,
11790            ErrorCode::DeadlineExceeded,
11791            ErrorCode::InvalidRequest,
11792            ErrorCode::UnsupportedVersion,
11793            ErrorCode::Unauthenticated,
11794            ErrorCode::PermissionDenied,
11795            ErrorCode::NotFound,
11796            ErrorCode::StaleCursor,
11797            ErrorCode::RestartBudgetExhausted,
11798            ErrorCode::LimitExceeded,
11799            ErrorCode::CapabilityUnavailable,
11800            ErrorCode::TemporarilyUnavailable,
11801            ErrorCode::Internal,
11802        ],
11803        limit_ids: &[
11804            "request_bytes",
11805            "response_bytes",
11806            "page_size",
11807            "catalog_page_size",
11808            "catalog_restart_budget",
11809        ],
11810        effect_class: "read_only",
11811        risk_flags: &[],
11812        capability_family: "catalog",
11813        retry_safety: "safe",
11814        identity_requirement: "none",
11815        resolver: None,
11816        cancellation: "per_call",
11817        side_effects: &[],
11818        recovery: "retry",
11819        collection_index_ref: "none",
11820    },
11821    CommandSemanticContract {
11822        command: Command::GetLifecyclePolicy,
11823        admissible_errors: &[
11824            ErrorCode::Aborted,
11825            ErrorCode::DeadlineExceeded,
11826            ErrorCode::InvalidRequest,
11827            ErrorCode::UnsupportedVersion,
11828            ErrorCode::Unauthenticated,
11829            ErrorCode::PermissionDenied,
11830            ErrorCode::NotFound,
11831            ErrorCode::LimitExceeded,
11832            ErrorCode::CapabilityUnavailable,
11833            ErrorCode::TemporarilyUnavailable,
11834            ErrorCode::Internal,
11835        ],
11836        limit_ids: &["request_bytes", "response_bytes"],
11837        effect_class: "read_only",
11838        risk_flags: &[],
11839        capability_family: "catalog",
11840        retry_safety: "safe",
11841        identity_requirement: "none",
11842        resolver: None,
11843        cancellation: "per_call",
11844        side_effects: &[],
11845        recovery: "retry",
11846        collection_index_ref: "none",
11847    },
11848    CommandSemanticContract {
11849        command: Command::PrepareCreateIndex,
11850        admissible_errors: &[
11851            ErrorCode::Aborted,
11852            ErrorCode::DeadlineExceeded,
11853            ErrorCode::InvalidRequest,
11854            ErrorCode::UnsupportedVersion,
11855            ErrorCode::Unauthenticated,
11856            ErrorCode::PermissionDenied,
11857            ErrorCode::NotFound,
11858            ErrorCode::LimitExceeded,
11859            ErrorCode::CapabilityUnavailable,
11860            ErrorCode::TemporarilyUnavailable,
11861            ErrorCode::Internal,
11862        ],
11863        limit_ids: &[
11864            "request_bytes",
11865            "response_bytes",
11866            "resource_initial_shards",
11867            "resource_target_shard_bytes",
11868            "resource_admission_weight",
11869            "resource_ram_bytes",
11870            "resource_nvme_bytes",
11871            "resource_refresh_millis",
11872            "resource_memtable_bytes",
11873            "resource_parallelism",
11874        ],
11875        effect_class: "prepare",
11876        risk_flags: &[],
11877        capability_family: "catalog",
11878        retry_safety: "safe",
11879        identity_requirement: "server_locator",
11880        resolver: None,
11881        cancellation: "per_call",
11882        side_effects: &["creates_bounded_preparation"],
11883        recovery: "retry",
11884        collection_index_ref: "request_name",
11885    },
11886    CommandSemanticContract {
11887        command: Command::PrepareDeleteIndex,
11888        admissible_errors: &[
11889            ErrorCode::Aborted,
11890            ErrorCode::DeadlineExceeded,
11891            ErrorCode::InvalidRequest,
11892            ErrorCode::UnsupportedVersion,
11893            ErrorCode::Unauthenticated,
11894            ErrorCode::PermissionDenied,
11895            ErrorCode::NotFound,
11896            ErrorCode::LimitExceeded,
11897            ErrorCode::CapabilityUnavailable,
11898            ErrorCode::TemporarilyUnavailable,
11899            ErrorCode::Internal,
11900        ],
11901        limit_ids: &["request_bytes", "response_bytes"],
11902        effect_class: "prepare",
11903        risk_flags: &["destructive"],
11904        capability_family: "catalog",
11905        retry_safety: "safe",
11906        identity_requirement: "server_locator",
11907        resolver: None,
11908        cancellation: "per_call",
11909        side_effects: &["creates_bounded_preparation"],
11910        recovery: "retry",
11911        collection_index_ref: "request_name",
11912    },
11913    CommandSemanticContract {
11914        command: Command::SubmitCatalogAction,
11915        admissible_errors: &[
11916            ErrorCode::Aborted,
11917            ErrorCode::DeadlineExceeded,
11918            ErrorCode::InvalidRequest,
11919            ErrorCode::UnsupportedVersion,
11920            ErrorCode::Unauthenticated,
11921            ErrorCode::PermissionDenied,
11922            ErrorCode::NotFound,
11923            ErrorCode::Conflict,
11924            ErrorCode::LimitExceeded,
11925            ErrorCode::CapabilityUnavailable,
11926            ErrorCode::NotSubmitted,
11927            ErrorCode::SubmittedIndeterminate,
11928            ErrorCode::ExpiredUnknown,
11929            ErrorCode::TemporarilyUnavailable,
11930            ErrorCode::Internal,
11931        ],
11932        limit_ids: &[
11933            "request_bytes",
11934            "response_bytes",
11935            "resource_initial_shards",
11936            "resource_target_shard_bytes",
11937            "resource_admission_weight",
11938            "resource_ram_bytes",
11939            "resource_nvme_bytes",
11940            "resource_refresh_millis",
11941            "resource_memtable_bytes",
11942            "resource_parallelism",
11943        ],
11944        effect_class: "durable_submit",
11945        risk_flags: &[],
11946        capability_family: "catalog",
11947        retry_safety: "pre_submit_only",
11948        identity_requirement: "request_locator",
11949        resolver: Some(Command::ResolveCatalogAction),
11950        cancellation: "per_call_until_submission_then_resolve",
11951        side_effects: &["commits_authoritative_state"],
11952        recovery: "resolve_with_resolve_catalog_action",
11953        collection_index_ref: "request_name",
11954    },
11955    CommandSemanticContract {
11956        command: Command::ResolveCatalogAction,
11957        admissible_errors: &[
11958            ErrorCode::Aborted,
11959            ErrorCode::DeadlineExceeded,
11960            ErrorCode::InvalidRequest,
11961            ErrorCode::UnsupportedVersion,
11962            ErrorCode::Unauthenticated,
11963            ErrorCode::PermissionDenied,
11964            ErrorCode::NotFound,
11965            ErrorCode::LimitExceeded,
11966            ErrorCode::CapabilityUnavailable,
11967            ErrorCode::TemporarilyUnavailable,
11968            ErrorCode::Internal,
11969        ],
11970        limit_ids: &["request_bytes", "response_bytes"],
11971        effect_class: "read_only",
11972        risk_flags: &[],
11973        capability_family: "catalog",
11974        retry_safety: "safe",
11975        identity_requirement: "request_locator",
11976        resolver: None,
11977        cancellation: "per_call",
11978        side_effects: &[],
11979        recovery: "retry",
11980        collection_index_ref: "caller",
11981    },
11982    CommandSemanticContract {
11983        command: Command::PrepareReplayableSourceIndex,
11984        admissible_errors: &[
11985            ErrorCode::Aborted,
11986            ErrorCode::DeadlineExceeded,
11987            ErrorCode::InvalidRequest,
11988            ErrorCode::UnsupportedVersion,
11989            ErrorCode::Unauthenticated,
11990            ErrorCode::PermissionDenied,
11991            ErrorCode::NotFound,
11992            ErrorCode::LimitExceeded,
11993            ErrorCode::CapabilityUnavailable,
11994            ErrorCode::RetentionGap,
11995            ErrorCode::TemporarilyUnavailable,
11996            ErrorCode::Internal,
11997        ],
11998        limit_ids: &[
11999            "request_bytes",
12000            "response_bytes",
12001            "resource_initial_shards",
12002            "resource_target_shard_bytes",
12003            "resource_admission_weight",
12004            "resource_ram_bytes",
12005            "resource_nvme_bytes",
12006            "resource_refresh_millis",
12007            "resource_memtable_bytes",
12008            "resource_parallelism",
12009        ],
12010        effect_class: "prepare",
12011        risk_flags: &[],
12012        capability_family: "catalog",
12013        retry_safety: "safe",
12014        identity_requirement: "server_locator",
12015        resolver: None,
12016        cancellation: "per_call",
12017        side_effects: &["creates_bounded_preparation"],
12018        recovery: "retry",
12019        collection_index_ref: "request_name",
12020    },
12021    CommandSemanticContract {
12022        command: Command::SubmitReplayableSourceIndex,
12023        admissible_errors: &[
12024            ErrorCode::Aborted,
12025            ErrorCode::DeadlineExceeded,
12026            ErrorCode::InvalidRequest,
12027            ErrorCode::UnsupportedVersion,
12028            ErrorCode::Unauthenticated,
12029            ErrorCode::PermissionDenied,
12030            ErrorCode::NotFound,
12031            ErrorCode::Conflict,
12032            ErrorCode::LimitExceeded,
12033            ErrorCode::CapabilityUnavailable,
12034            ErrorCode::NotSubmitted,
12035            ErrorCode::SubmittedIndeterminate,
12036            ErrorCode::ExpiredUnknown,
12037            ErrorCode::RetentionGap,
12038            ErrorCode::TemporarilyUnavailable,
12039            ErrorCode::Internal,
12040        ],
12041        limit_ids: &[
12042            "request_bytes",
12043            "response_bytes",
12044            "resource_initial_shards",
12045            "resource_target_shard_bytes",
12046            "resource_admission_weight",
12047            "resource_ram_bytes",
12048            "resource_nvme_bytes",
12049            "resource_refresh_millis",
12050            "resource_memtable_bytes",
12051            "resource_parallelism",
12052        ],
12053        effect_class: "durable_submit",
12054        risk_flags: &[],
12055        capability_family: "catalog",
12056        retry_safety: "pre_submit_only",
12057        identity_requirement: "request_locator",
12058        resolver: Some(Command::ResolveCatalogAction),
12059        cancellation: "per_call_until_submission_then_resolve",
12060        side_effects: &["commits_authoritative_state"],
12061        recovery: "resolve_with_resolve_catalog_action",
12062        collection_index_ref: "request_name",
12063    },
12064    CommandSemanticContract {
12065        command: Command::GetReplayableSource,
12066        admissible_errors: &[
12067            ErrorCode::Aborted,
12068            ErrorCode::DeadlineExceeded,
12069            ErrorCode::InvalidRequest,
12070            ErrorCode::UnsupportedVersion,
12071            ErrorCode::Unauthenticated,
12072            ErrorCode::PermissionDenied,
12073            ErrorCode::NotFound,
12074            ErrorCode::LimitExceeded,
12075            ErrorCode::CapabilityUnavailable,
12076            ErrorCode::RetentionGap,
12077            ErrorCode::TemporarilyUnavailable,
12078            ErrorCode::Internal,
12079        ],
12080        limit_ids: &["request_bytes", "response_bytes"],
12081        effect_class: "read_only",
12082        risk_flags: &[],
12083        capability_family: "catalog",
12084        retry_safety: "safe",
12085        identity_requirement: "none",
12086        resolver: None,
12087        cancellation: "per_call",
12088        side_effects: &[],
12089        recovery: "retry",
12090        collection_index_ref: "none",
12091    },
12092    CommandSemanticContract {
12093        command: Command::ControlReplayableSource,
12094        admissible_errors: &[
12095            ErrorCode::Aborted,
12096            ErrorCode::DeadlineExceeded,
12097            ErrorCode::InvalidRequest,
12098            ErrorCode::UnsupportedVersion,
12099            ErrorCode::Unauthenticated,
12100            ErrorCode::PermissionDenied,
12101            ErrorCode::NotFound,
12102            ErrorCode::Conflict,
12103            ErrorCode::LimitExceeded,
12104            ErrorCode::CapabilityUnavailable,
12105            ErrorCode::NotSubmitted,
12106            ErrorCode::SubmittedIndeterminate,
12107            ErrorCode::ExpiredUnknown,
12108            ErrorCode::RetentionGap,
12109            ErrorCode::TemporarilyUnavailable,
12110            ErrorCode::Internal,
12111        ],
12112        limit_ids: &["request_bytes", "response_bytes"],
12113        effect_class: "durable_submit",
12114        risk_flags: &[],
12115        capability_family: "catalog",
12116        retry_safety: "pre_submit_only",
12117        identity_requirement: "none",
12118        resolver: None,
12119        cancellation: "per_call_until_submission_then_resolve",
12120        side_effects: &["commits_authoritative_state"],
12121        recovery: "retry_if_not_submitted",
12122        collection_index_ref: "request_index",
12123    },
12124    CommandSemanticContract {
12125        command: Command::CloneIndex,
12126        admissible_errors: &[
12127            ErrorCode::Aborted,
12128            ErrorCode::DeadlineExceeded,
12129            ErrorCode::InvalidRequest,
12130            ErrorCode::UnsupportedVersion,
12131            ErrorCode::Unauthenticated,
12132            ErrorCode::PermissionDenied,
12133            ErrorCode::NotFound,
12134            ErrorCode::Conflict,
12135            ErrorCode::LimitExceeded,
12136            ErrorCode::CapabilityUnavailable,
12137            ErrorCode::NotSubmitted,
12138            ErrorCode::SubmittedIndeterminate,
12139            ErrorCode::ExpiredUnknown,
12140            ErrorCode::TemporarilyUnavailable,
12141            ErrorCode::Internal,
12142        ],
12143        limit_ids: &["request_bytes", "response_bytes"],
12144        effect_class: "durable_submit",
12145        risk_flags: &[],
12146        capability_family: "catalog",
12147        retry_safety: "pre_submit_only",
12148        identity_requirement: "caller_action_id",
12149        resolver: Some(Command::CloneIndex),
12150        cancellation: "per_call_until_submission_then_resolve",
12151        side_effects: &["commits_authoritative_state"],
12152        recovery: "resolve_with_clone_index",
12153        collection_index_ref: "caller",
12154    },
12155    CommandSemanticContract {
12156        command: Command::ConfigureHistory,
12157        admissible_errors: &[
12158            ErrorCode::Aborted,
12159            ErrorCode::DeadlineExceeded,
12160            ErrorCode::InvalidRequest,
12161            ErrorCode::UnsupportedVersion,
12162            ErrorCode::Unauthenticated,
12163            ErrorCode::PermissionDenied,
12164            ErrorCode::NotFound,
12165            ErrorCode::Conflict,
12166            ErrorCode::LimitExceeded,
12167            ErrorCode::CapabilityUnavailable,
12168            ErrorCode::NotSubmitted,
12169            ErrorCode::SubmittedIndeterminate,
12170            ErrorCode::ExpiredUnknown,
12171            ErrorCode::TemporarilyUnavailable,
12172            ErrorCode::Internal,
12173        ],
12174        limit_ids: &["request_bytes", "response_bytes"],
12175        effect_class: "durable_submit",
12176        risk_flags: &[],
12177        capability_family: "catalog",
12178        retry_safety: "pre_submit_only",
12179        identity_requirement: "none",
12180        resolver: Some(Command::GetHistory),
12181        cancellation: "per_call_until_submission_then_resolve",
12182        side_effects: &["commits_authoritative_state"],
12183        recovery: "resolve_with_get_history",
12184        collection_index_ref: "request_index",
12185    },
12186    CommandSemanticContract {
12187        command: Command::GetHistory,
12188        admissible_errors: &[
12189            ErrorCode::Aborted,
12190            ErrorCode::DeadlineExceeded,
12191            ErrorCode::InvalidRequest,
12192            ErrorCode::UnsupportedVersion,
12193            ErrorCode::Unauthenticated,
12194            ErrorCode::PermissionDenied,
12195            ErrorCode::NotFound,
12196            ErrorCode::LimitExceeded,
12197            ErrorCode::CapabilityUnavailable,
12198            ErrorCode::TemporarilyUnavailable,
12199            ErrorCode::Internal,
12200        ],
12201        limit_ids: &["request_bytes", "response_bytes"],
12202        effect_class: "read_only",
12203        risk_flags: &[],
12204        capability_family: "catalog",
12205        retry_safety: "safe",
12206        identity_requirement: "none",
12207        resolver: None,
12208        cancellation: "per_call",
12209        side_effects: &[],
12210        recovery: "retry",
12211        collection_index_ref: "none",
12212    },
12213    CommandSemanticContract {
12214        command: Command::ResolveHistory,
12215        admissible_errors: &[
12216            ErrorCode::Aborted,
12217            ErrorCode::DeadlineExceeded,
12218            ErrorCode::InvalidRequest,
12219            ErrorCode::UnsupportedVersion,
12220            ErrorCode::Unauthenticated,
12221            ErrorCode::PermissionDenied,
12222            ErrorCode::NotFound,
12223            ErrorCode::LimitExceeded,
12224            ErrorCode::CapabilityUnavailable,
12225            ErrorCode::RetentionGap,
12226            ErrorCode::TemporarilyUnavailable,
12227            ErrorCode::Internal,
12228        ],
12229        limit_ids: &["request_bytes", "response_bytes"],
12230        effect_class: "read_only",
12231        risk_flags: &[],
12232        capability_family: "data",
12233        retry_safety: "safe",
12234        identity_requirement: "none",
12235        resolver: None,
12236        cancellation: "per_call",
12237        side_effects: &[],
12238        recovery: "retry",
12239        collection_index_ref: "request_index",
12240    },
12241    CommandSemanticContract {
12242        command: Command::PlaceHistoryHold,
12243        admissible_errors: &[
12244            ErrorCode::Aborted,
12245            ErrorCode::DeadlineExceeded,
12246            ErrorCode::InvalidRequest,
12247            ErrorCode::UnsupportedVersion,
12248            ErrorCode::Unauthenticated,
12249            ErrorCode::PermissionDenied,
12250            ErrorCode::NotFound,
12251            ErrorCode::Conflict,
12252            ErrorCode::LimitExceeded,
12253            ErrorCode::CapabilityUnavailable,
12254            ErrorCode::NotSubmitted,
12255            ErrorCode::SubmittedIndeterminate,
12256            ErrorCode::ExpiredUnknown,
12257            ErrorCode::TemporarilyUnavailable,
12258            ErrorCode::Internal,
12259        ],
12260        limit_ids: &["request_bytes", "response_bytes"],
12261        effect_class: "durable_submit",
12262        risk_flags: &[],
12263        capability_family: "catalog",
12264        retry_safety: "pre_submit_only",
12265        identity_requirement: "none",
12266        resolver: Some(Command::GetHistory),
12267        cancellation: "per_call_until_submission_then_resolve",
12268        side_effects: &["commits_authoritative_state"],
12269        recovery: "resolve_with_get_history",
12270        collection_index_ref: "request_index",
12271    },
12272    CommandSemanticContract {
12273        command: Command::ReleaseHistoryHold,
12274        admissible_errors: &[
12275            ErrorCode::Aborted,
12276            ErrorCode::DeadlineExceeded,
12277            ErrorCode::InvalidRequest,
12278            ErrorCode::UnsupportedVersion,
12279            ErrorCode::Unauthenticated,
12280            ErrorCode::PermissionDenied,
12281            ErrorCode::NotFound,
12282            ErrorCode::Conflict,
12283            ErrorCode::LimitExceeded,
12284            ErrorCode::CapabilityUnavailable,
12285            ErrorCode::NotSubmitted,
12286            ErrorCode::SubmittedIndeterminate,
12287            ErrorCode::ExpiredUnknown,
12288            ErrorCode::TemporarilyUnavailable,
12289            ErrorCode::Internal,
12290        ],
12291        limit_ids: &["request_bytes", "response_bytes"],
12292        effect_class: "durable_submit",
12293        risk_flags: &[],
12294        capability_family: "catalog",
12295        retry_safety: "pre_submit_only",
12296        identity_requirement: "none",
12297        resolver: Some(Command::GetHistory),
12298        cancellation: "per_call_until_submission_then_resolve",
12299        side_effects: &["commits_authoritative_state"],
12300        recovery: "resolve_with_get_history",
12301        collection_index_ref: "request_index",
12302    },
12303    CommandSemanticContract {
12304        command: Command::PrepareDocumentMutation,
12305        admissible_errors: &[
12306            ErrorCode::Aborted,
12307            ErrorCode::DeadlineExceeded,
12308            ErrorCode::InvalidRequest,
12309            ErrorCode::UnsupportedVersion,
12310            ErrorCode::Unauthenticated,
12311            ErrorCode::PermissionDenied,
12312            ErrorCode::NotFound,
12313            ErrorCode::LimitExceeded,
12314            ErrorCode::CapabilityUnavailable,
12315            ErrorCode::TemporarilyUnavailable,
12316            ErrorCode::Internal,
12317        ],
12318        limit_ids: &["request_bytes", "response_bytes"],
12319        effect_class: "prepare",
12320        risk_flags: &[],
12321        capability_family: "data",
12322        retry_safety: "safe",
12323        identity_requirement: "server_locator",
12324        resolver: None,
12325        cancellation: "per_call",
12326        side_effects: &["creates_bounded_preparation"],
12327        recovery: "retry",
12328        collection_index_ref: "request_index",
12329    },
12330    CommandSemanticContract {
12331        command: Command::SubmitDocumentMutation,
12332        admissible_errors: &[
12333            ErrorCode::Aborted,
12334            ErrorCode::DeadlineExceeded,
12335            ErrorCode::InvalidRequest,
12336            ErrorCode::UnsupportedVersion,
12337            ErrorCode::Unauthenticated,
12338            ErrorCode::PermissionDenied,
12339            ErrorCode::NotFound,
12340            ErrorCode::Conflict,
12341            ErrorCode::LimitExceeded,
12342            ErrorCode::CapabilityUnavailable,
12343            ErrorCode::NotSubmitted,
12344            ErrorCode::SubmittedIndeterminate,
12345            ErrorCode::ExpiredUnknown,
12346            ErrorCode::TemporarilyUnavailable,
12347            ErrorCode::Internal,
12348        ],
12349        limit_ids: &["request_bytes", "response_bytes"],
12350        effect_class: "durable_submit",
12351        risk_flags: &[],
12352        capability_family: "data",
12353        retry_safety: "pre_submit_only",
12354        identity_requirement: "request_locator",
12355        resolver: Some(Command::ResolveDocumentMutation),
12356        cancellation: "per_call_until_submission_then_resolve",
12357        side_effects: &["commits_authoritative_state"],
12358        recovery: "resolve_with_resolve_document_mutation",
12359        collection_index_ref: "request_index",
12360    },
12361    CommandSemanticContract {
12362        command: Command::PrepareDocumentBulk,
12363        admissible_errors: &[
12364            ErrorCode::Aborted,
12365            ErrorCode::DeadlineExceeded,
12366            ErrorCode::InvalidRequest,
12367            ErrorCode::UnsupportedVersion,
12368            ErrorCode::Unauthenticated,
12369            ErrorCode::PermissionDenied,
12370            ErrorCode::NotFound,
12371            ErrorCode::LimitExceeded,
12372            ErrorCode::CapabilityUnavailable,
12373            ErrorCode::TemporarilyUnavailable,
12374            ErrorCode::Internal,
12375        ],
12376        limit_ids: &[
12377            "request_bytes",
12378            "response_bytes",
12379            "bulk_document_items",
12380            "bulk_document_bytes",
12381        ],
12382        effect_class: "prepare",
12383        risk_flags: &[],
12384        capability_family: "data",
12385        retry_safety: "safe",
12386        identity_requirement: "caller_action_id",
12387        resolver: None,
12388        cancellation: "per_call",
12389        side_effects: &["creates_bounded_preparation"],
12390        recovery: "retry",
12391        collection_index_ref: "request_index",
12392    },
12393    CommandSemanticContract {
12394        command: Command::SubmitDocumentBulk,
12395        admissible_errors: &[
12396            ErrorCode::Aborted,
12397            ErrorCode::DeadlineExceeded,
12398            ErrorCode::InvalidRequest,
12399            ErrorCode::UnsupportedVersion,
12400            ErrorCode::Unauthenticated,
12401            ErrorCode::PermissionDenied,
12402            ErrorCode::NotFound,
12403            ErrorCode::Conflict,
12404            ErrorCode::LimitExceeded,
12405            ErrorCode::CapabilityUnavailable,
12406            ErrorCode::NotSubmitted,
12407            ErrorCode::SubmittedIndeterminate,
12408            ErrorCode::ExpiredUnknown,
12409            ErrorCode::TemporarilyUnavailable,
12410            ErrorCode::Internal,
12411        ],
12412        limit_ids: &[
12413            "request_bytes",
12414            "response_bytes",
12415            "bulk_document_items",
12416            "bulk_document_bytes",
12417        ],
12418        effect_class: "durable_submit",
12419        risk_flags: &[],
12420        capability_family: "data",
12421        retry_safety: "pre_submit_only",
12422        identity_requirement: "caller_action_id",
12423        resolver: Some(Command::ResolveDocumentBulk),
12424        cancellation: "per_call_until_submission_then_resolve",
12425        side_effects: &["commits_authoritative_state"],
12426        recovery: "resolve_with_resolve_document_bulk",
12427        collection_index_ref: "request_index",
12428    },
12429    CommandSemanticContract {
12430        command: Command::ResolveDocumentBulk,
12431        admissible_errors: &[
12432            ErrorCode::Aborted,
12433            ErrorCode::DeadlineExceeded,
12434            ErrorCode::InvalidRequest,
12435            ErrorCode::UnsupportedVersion,
12436            ErrorCode::Unauthenticated,
12437            ErrorCode::PermissionDenied,
12438            ErrorCode::NotFound,
12439            ErrorCode::LimitExceeded,
12440            ErrorCode::CapabilityUnavailable,
12441            ErrorCode::TemporarilyUnavailable,
12442            ErrorCode::Internal,
12443        ],
12444        limit_ids: &[
12445            "request_bytes",
12446            "response_bytes",
12447            "bulk_document_items",
12448            "bulk_document_bytes",
12449        ],
12450        effect_class: "read_only",
12451        risk_flags: &[],
12452        capability_family: "data",
12453        retry_safety: "safe",
12454        identity_requirement: "caller_action_id",
12455        resolver: None,
12456        cancellation: "per_call",
12457        side_effects: &[],
12458        recovery: "retry",
12459        collection_index_ref: "request_index",
12460    },
12461    CommandSemanticContract {
12462        command: Command::PrepareAppendBulk,
12463        admissible_errors: &[
12464            ErrorCode::Aborted,
12465            ErrorCode::DeadlineExceeded,
12466            ErrorCode::InvalidRequest,
12467            ErrorCode::UnsupportedVersion,
12468            ErrorCode::Unauthenticated,
12469            ErrorCode::PermissionDenied,
12470            ErrorCode::NotFound,
12471            ErrorCode::LimitExceeded,
12472            ErrorCode::CapabilityUnavailable,
12473            ErrorCode::TemporarilyUnavailable,
12474            ErrorCode::Internal,
12475        ],
12476        limit_ids: &[
12477            "request_bytes",
12478            "response_bytes",
12479            "bulk_document_items",
12480            "bulk_document_bytes",
12481        ],
12482        effect_class: "prepare",
12483        risk_flags: &[],
12484        capability_family: "data",
12485        retry_safety: "safe",
12486        identity_requirement: "caller_action_id",
12487        resolver: None,
12488        cancellation: "per_call",
12489        side_effects: &[],
12490        recovery: "retry",
12491        collection_index_ref: "request_index",
12492    },
12493    CommandSemanticContract {
12494        command: Command::SubmitAppendBulk,
12495        admissible_errors: &[
12496            ErrorCode::Aborted,
12497            ErrorCode::DeadlineExceeded,
12498            ErrorCode::InvalidRequest,
12499            ErrorCode::UnsupportedVersion,
12500            ErrorCode::Unauthenticated,
12501            ErrorCode::PermissionDenied,
12502            ErrorCode::NotFound,
12503            ErrorCode::Conflict,
12504            ErrorCode::LimitExceeded,
12505            ErrorCode::CapabilityUnavailable,
12506            ErrorCode::NotSubmitted,
12507            ErrorCode::SubmittedIndeterminate,
12508            ErrorCode::TemporarilyUnavailable,
12509            ErrorCode::Internal,
12510        ],
12511        limit_ids: &[
12512            "request_bytes",
12513            "response_bytes",
12514            "bulk_document_items",
12515            "bulk_document_bytes",
12516        ],
12517        effect_class: "durable_submit",
12518        risk_flags: &[],
12519        capability_family: "data",
12520        retry_safety: "pre_submit_only",
12521        identity_requirement: "request_locator",
12522        resolver: Some(Command::ResolveAppendBulk),
12523        cancellation: "per_call_until_submission_then_resolve",
12524        side_effects: &["commits_authoritative_state"],
12525        recovery: "resolve_with_resolve_append_bulk",
12526        collection_index_ref: "request_index",
12527    },
12528    CommandSemanticContract {
12529        command: Command::ResolveAppendBulk,
12530        admissible_errors: &[
12531            ErrorCode::Aborted,
12532            ErrorCode::DeadlineExceeded,
12533            ErrorCode::InvalidRequest,
12534            ErrorCode::UnsupportedVersion,
12535            ErrorCode::Unauthenticated,
12536            ErrorCode::PermissionDenied,
12537            ErrorCode::NotFound,
12538            ErrorCode::Conflict,
12539            ErrorCode::LimitExceeded,
12540            ErrorCode::CapabilityUnavailable,
12541            ErrorCode::TemporarilyUnavailable,
12542            ErrorCode::Internal,
12543        ],
12544        limit_ids: &[
12545            "request_bytes",
12546            "response_bytes",
12547            "bulk_document_items",
12548            "bulk_document_bytes",
12549        ],
12550        effect_class: "read_only",
12551        risk_flags: &[],
12552        capability_family: "data",
12553        retry_safety: "safe",
12554        identity_requirement: "request_locator",
12555        resolver: None,
12556        cancellation: "per_call",
12557        side_effects: &[],
12558        recovery: "retry",
12559        collection_index_ref: "request_index",
12560    },
12561    CommandSemanticContract {
12562        command: Command::ObserveAppendCommitted,
12563        admissible_errors: &[
12564            ErrorCode::Aborted,
12565            ErrorCode::DeadlineExceeded,
12566            ErrorCode::InvalidRequest,
12567            ErrorCode::UnsupportedVersion,
12568            ErrorCode::Unauthenticated,
12569            ErrorCode::PermissionDenied,
12570            ErrorCode::NotFound,
12571            ErrorCode::Conflict,
12572            ErrorCode::LimitExceeded,
12573            ErrorCode::CapabilityUnavailable,
12574            ErrorCode::TemporarilyUnavailable,
12575            ErrorCode::Internal,
12576        ],
12577        limit_ids: &["request_bytes", "response_bytes"],
12578        effect_class: "read_only",
12579        risk_flags: &[],
12580        capability_family: "data",
12581        retry_safety: "safe",
12582        identity_requirement: "request_locator",
12583        resolver: None,
12584        cancellation: "per_call",
12585        side_effects: &[],
12586        recovery: "retry",
12587        collection_index_ref: "request_index",
12588    },
12589    CommandSemanticContract {
12590        command: Command::ResolveDocumentMutation,
12591        admissible_errors: &[
12592            ErrorCode::Aborted,
12593            ErrorCode::DeadlineExceeded,
12594            ErrorCode::InvalidRequest,
12595            ErrorCode::UnsupportedVersion,
12596            ErrorCode::Unauthenticated,
12597            ErrorCode::PermissionDenied,
12598            ErrorCode::NotFound,
12599            ErrorCode::LimitExceeded,
12600            ErrorCode::CapabilityUnavailable,
12601            ErrorCode::TemporarilyUnavailable,
12602            ErrorCode::Internal,
12603        ],
12604        limit_ids: &["request_bytes", "response_bytes"],
12605        effect_class: "read_only",
12606        risk_flags: &[],
12607        capability_family: "data",
12608        retry_safety: "safe",
12609        identity_requirement: "request_locator",
12610        resolver: None,
12611        cancellation: "per_call",
12612        side_effects: &[],
12613        recovery: "retry",
12614        collection_index_ref: "caller",
12615    },
12616    CommandSemanticContract {
12617        command: Command::GetDocument,
12618        admissible_errors: &[
12619            ErrorCode::Aborted,
12620            ErrorCode::DeadlineExceeded,
12621            ErrorCode::InvalidRequest,
12622            ErrorCode::UnsupportedVersion,
12623            ErrorCode::Unauthenticated,
12624            ErrorCode::PermissionDenied,
12625            ErrorCode::NotFound,
12626            ErrorCode::LimitExceeded,
12627            ErrorCode::CapabilityUnavailable,
12628            ErrorCode::TemporarilyUnavailable,
12629            ErrorCode::Internal,
12630        ],
12631        limit_ids: &["request_bytes", "response_bytes"],
12632        effect_class: "read_only",
12633        risk_flags: &[],
12634        capability_family: "data",
12635        retry_safety: "safe",
12636        identity_requirement: "none",
12637        resolver: None,
12638        cancellation: "per_call",
12639        side_effects: &[],
12640        recovery: "retry",
12641        collection_index_ref: "request_index",
12642    },
12643    CommandSemanticContract {
12644        command: Command::Search,
12645        admissible_errors: &[
12646            ErrorCode::Aborted,
12647            ErrorCode::DeadlineExceeded,
12648            ErrorCode::InvalidRequest,
12649            ErrorCode::UnsupportedVersion,
12650            ErrorCode::Unauthenticated,
12651            ErrorCode::PermissionDenied,
12652            ErrorCode::NotFound,
12653            ErrorCode::StaleCursor,
12654            ErrorCode::RestartBudgetExhausted,
12655            ErrorCode::LimitExceeded,
12656            ErrorCode::CapabilityUnavailable,
12657            ErrorCode::TemporarilyUnavailable,
12658            ErrorCode::Internal,
12659        ],
12660        limit_ids: &[
12661            "request_bytes",
12662            "response_bytes",
12663            "page_size",
12664            "query_clauses",
12665            "aggregation_nodes",
12666            "aggregation_buckets",
12667            "routing_values",
12668            "routing_value_bytes",
12669            "query_recursion_depth",
12670            "text_query_bytes",
12671            "text_query_fields",
12672            "text_query_slop",
12673            "text_query_boost",
12674            "text_query_fuzzy_expansions",
12675            "text_query_fuzzy_distance",
12676            "text_query_dictionary_scan_terms",
12677            "text_query_dictionary_scan_bytes",
12678            "text_query_fuzzy_work_units",
12679            "vector_dimensions",
12680            "vector_query_bytes",
12681            "vector_request_bytes",
12682            "vector_candidates",
12683            "vector_set_query_vectors",
12684            "vector_set_query_bytes",
12685            "retrieval_branches",
12686            "retrieval_branch_name_bytes",
12687            "retrieval_window",
12688            "fragment_fields",
12689            "fragments_per_field",
12690            "fragment_bytes",
12691            "fragment_total_bytes",
12692            "result_feature_hits",
12693            "result_features",
12694            "diversification_fields",
12695            "diversification_per_group",
12696            "search_result_window",
12697        ],
12698        effect_class: "read_only",
12699        risk_flags: &[],
12700        capability_family: "data",
12701        retry_safety: "safe",
12702        identity_requirement: "none",
12703        resolver: None,
12704        cancellation: "per_call",
12705        side_effects: &[],
12706        recovery: "retry",
12707        collection_index_ref: "request_indexes_or_pit_authority",
12708    },
12709    CommandSemanticContract {
12710        command: Command::TraverseRelationships,
12711        admissible_errors: &[
12712            ErrorCode::Aborted,
12713            ErrorCode::DeadlineExceeded,
12714            ErrorCode::InvalidRequest,
12715            ErrorCode::UnsupportedVersion,
12716            ErrorCode::Unauthenticated,
12717            ErrorCode::PermissionDenied,
12718            ErrorCode::NotFound,
12719            ErrorCode::LimitExceeded,
12720            ErrorCode::CapabilityUnavailable,
12721            ErrorCode::TemporarilyUnavailable,
12722            ErrorCode::Internal,
12723        ],
12724        limit_ids: &[
12725            "request_bytes",
12726            "response_bytes",
12727            "relationship_indexes",
12728            "relationship_seeds",
12729            "relationship_filter_values",
12730            "relationship_depth",
12731            "relationship_fan_out",
12732            "relationship_visited_entities",
12733            "relationship_visited_records",
12734            "relationship_returned_records",
12735            "relationship_memory_bytes",
12736            "search_result_window",
12737        ],
12738        effect_class: "read_only",
12739        risk_flags: &[],
12740        capability_family: "data",
12741        retry_safety: "safe",
12742        identity_requirement: "none",
12743        resolver: None,
12744        cancellation: "per_call",
12745        side_effects: &[],
12746        recovery: "retry",
12747        collection_index_ref: "pit_authority",
12748    },
12749    CommandSemanticContract {
12750        command: Command::QueryProfiles,
12751        admissible_errors: &[
12752            ErrorCode::Aborted,
12753            ErrorCode::DeadlineExceeded,
12754            ErrorCode::InvalidRequest,
12755            ErrorCode::UnsupportedVersion,
12756            ErrorCode::Unauthenticated,
12757            ErrorCode::PermissionDenied,
12758            ErrorCode::NotFound,
12759            ErrorCode::LimitExceeded,
12760            ErrorCode::CapabilityUnavailable,
12761            ErrorCode::TemporarilyUnavailable,
12762            ErrorCode::Internal,
12763        ],
12764        limit_ids: &[
12765            "request_bytes",
12766            "response_bytes",
12767            "profile_indexes",
12768            "profile_filter_values",
12769            "profile_batches",
12770            "profile_samples",
12771            "profile_results",
12772            "profile_memory_bytes",
12773            "search_result_window",
12774        ],
12775        effect_class: "read_only",
12776        risk_flags: &[],
12777        capability_family: "data",
12778        retry_safety: "safe",
12779        identity_requirement: "none",
12780        resolver: None,
12781        cancellation: "per_call",
12782        side_effects: &[],
12783        recovery: "retry",
12784        collection_index_ref: "pit_authority",
12785    },
12786    CommandSemanticContract {
12787        command: Command::EvaluateTemporalEvidence,
12788        admissible_errors: &[
12789            ErrorCode::Aborted,
12790            ErrorCode::DeadlineExceeded,
12791            ErrorCode::InvalidRequest,
12792            ErrorCode::UnsupportedVersion,
12793            ErrorCode::Unauthenticated,
12794            ErrorCode::PermissionDenied,
12795            ErrorCode::NotFound,
12796            ErrorCode::LimitExceeded,
12797            ErrorCode::CapabilityUnavailable,
12798            ErrorCode::TemporarilyUnavailable,
12799            ErrorCode::Internal,
12800        ],
12801        limit_ids: &[
12802            "request_bytes",
12803            "response_bytes",
12804            "query_clauses",
12805            "query_recursion_depth",
12806            "search_result_window",
12807            "temporal_inputs",
12808            "temporal_pattern_nodes",
12809            "temporal_pattern_depth",
12810            "temporal_pattern_branches",
12811            "temporal_correlation_keys",
12812            "temporal_events",
12813            "temporal_states",
12814            "temporal_captured_events",
12815            "temporal_results",
12816            "temporal_state_bytes",
12817            "temporal_interval_nanos",
12818        ],
12819        effect_class: "read_only",
12820        risk_flags: &[],
12821        capability_family: "data",
12822        retry_safety: "safe",
12823        identity_requirement: "none",
12824        resolver: None,
12825        cancellation: "per_call",
12826        side_effects: &[],
12827        recovery: "retry",
12828        collection_index_ref: "pit_authority",
12829    },
12830    CommandSemanticContract {
12831        command: Command::CreateContinuousTemporalEvaluation,
12832        admissible_errors: &[
12833            ErrorCode::Aborted,
12834            ErrorCode::DeadlineExceeded,
12835            ErrorCode::InvalidRequest,
12836            ErrorCode::UnsupportedVersion,
12837            ErrorCode::Unauthenticated,
12838            ErrorCode::PermissionDenied,
12839            ErrorCode::NotFound,
12840            ErrorCode::Conflict,
12841            ErrorCode::LimitExceeded,
12842            ErrorCode::CapabilityUnavailable,
12843            ErrorCode::NotSubmitted,
12844            ErrorCode::SubmittedIndeterminate,
12845            ErrorCode::TemporarilyUnavailable,
12846            ErrorCode::Internal,
12847        ],
12848        limit_ids: &[
12849            "request_bytes",
12850            "response_bytes",
12851            "temporal_inputs",
12852            "temporal_pattern_nodes",
12853            "temporal_pattern_depth",
12854            "temporal_pattern_branches",
12855            "temporal_correlation_keys",
12856            "temporal_events",
12857            "temporal_states",
12858            "temporal_captured_events",
12859            "temporal_results",
12860            "temporal_state_bytes",
12861            "temporal_interval_nanos",
12862        ],
12863        effect_class: "durable_submit",
12864        risk_flags: &[],
12865        capability_family: "lifecycle",
12866        retry_safety: "pre_submit_only",
12867        identity_requirement: "caller_action_id",
12868        resolver: Some(Command::GetContinuousTemporalEvaluation),
12869        cancellation: "per_call_until_submission_then_resolve",
12870        side_effects: &["commits_authoritative_state"],
12871        recovery: "resolve_with_get_continuous_temporal_evaluation",
12872        collection_index_ref: "request_temporal_inputs",
12873    },
12874    CommandSemanticContract {
12875        command: Command::GetContinuousTemporalEvaluation,
12876        admissible_errors: &[
12877            ErrorCode::Aborted,
12878            ErrorCode::DeadlineExceeded,
12879            ErrorCode::InvalidRequest,
12880            ErrorCode::UnsupportedVersion,
12881            ErrorCode::Unauthenticated,
12882            ErrorCode::PermissionDenied,
12883            ErrorCode::NotFound,
12884            ErrorCode::LimitExceeded,
12885            ErrorCode::CapabilityUnavailable,
12886            ErrorCode::TemporarilyUnavailable,
12887            ErrorCode::Internal,
12888        ],
12889        limit_ids: &["request_bytes", "response_bytes"],
12890        effect_class: "read_only",
12891        risk_flags: &[],
12892        capability_family: "lifecycle",
12893        retry_safety: "safe",
12894        identity_requirement: "none",
12895        resolver: None,
12896        cancellation: "per_call",
12897        side_effects: &[],
12898        recovery: "retry",
12899        collection_index_ref: "request_evaluation",
12900    },
12901    CommandSemanticContract {
12902        command: Command::PauseContinuousTemporalEvaluation,
12903        admissible_errors: &[
12904            ErrorCode::Aborted,
12905            ErrorCode::DeadlineExceeded,
12906            ErrorCode::InvalidRequest,
12907            ErrorCode::UnsupportedVersion,
12908            ErrorCode::Unauthenticated,
12909            ErrorCode::PermissionDenied,
12910            ErrorCode::NotFound,
12911            ErrorCode::Conflict,
12912            ErrorCode::LimitExceeded,
12913            ErrorCode::CapabilityUnavailable,
12914            ErrorCode::NotSubmitted,
12915            ErrorCode::SubmittedIndeterminate,
12916            ErrorCode::TemporarilyUnavailable,
12917            ErrorCode::Internal,
12918        ],
12919        limit_ids: &["request_bytes", "response_bytes"],
12920        effect_class: "durable_submit",
12921        risk_flags: &[],
12922        capability_family: "lifecycle",
12923        retry_safety: "pre_submit_only",
12924        identity_requirement: "caller_action_id",
12925        resolver: Some(Command::GetContinuousTemporalEvaluation),
12926        cancellation: "per_call_until_submission_then_resolve",
12927        side_effects: &["commits_authoritative_state"],
12928        recovery: "resolve_with_get_continuous_temporal_evaluation",
12929        collection_index_ref: "request_evaluation",
12930    },
12931    CommandSemanticContract {
12932        command: Command::ResumeContinuousTemporalEvaluation,
12933        admissible_errors: &[
12934            ErrorCode::Aborted,
12935            ErrorCode::DeadlineExceeded,
12936            ErrorCode::InvalidRequest,
12937            ErrorCode::UnsupportedVersion,
12938            ErrorCode::Unauthenticated,
12939            ErrorCode::PermissionDenied,
12940            ErrorCode::NotFound,
12941            ErrorCode::Conflict,
12942            ErrorCode::LimitExceeded,
12943            ErrorCode::CapabilityUnavailable,
12944            ErrorCode::NotSubmitted,
12945            ErrorCode::SubmittedIndeterminate,
12946            ErrorCode::TemporarilyUnavailable,
12947            ErrorCode::Internal,
12948        ],
12949        limit_ids: &["request_bytes", "response_bytes"],
12950        effect_class: "durable_submit",
12951        risk_flags: &[],
12952        capability_family: "lifecycle",
12953        retry_safety: "pre_submit_only",
12954        identity_requirement: "caller_action_id",
12955        resolver: Some(Command::GetContinuousTemporalEvaluation),
12956        cancellation: "per_call_until_submission_then_resolve",
12957        side_effects: &["commits_authoritative_state"],
12958        recovery: "resolve_with_get_continuous_temporal_evaluation",
12959        collection_index_ref: "request_evaluation",
12960    },
12961    CommandSemanticContract {
12962        command: Command::ReplaceContinuousTemporalEvaluation,
12963        admissible_errors: &[
12964            ErrorCode::Aborted,
12965            ErrorCode::DeadlineExceeded,
12966            ErrorCode::InvalidRequest,
12967            ErrorCode::UnsupportedVersion,
12968            ErrorCode::Unauthenticated,
12969            ErrorCode::PermissionDenied,
12970            ErrorCode::NotFound,
12971            ErrorCode::Conflict,
12972            ErrorCode::LimitExceeded,
12973            ErrorCode::CapabilityUnavailable,
12974            ErrorCode::NotSubmitted,
12975            ErrorCode::SubmittedIndeterminate,
12976            ErrorCode::TemporarilyUnavailable,
12977            ErrorCode::Internal,
12978        ],
12979        limit_ids: &[
12980            "request_bytes",
12981            "response_bytes",
12982            "temporal_inputs",
12983            "temporal_pattern_nodes",
12984            "temporal_pattern_depth",
12985            "temporal_pattern_branches",
12986            "temporal_correlation_keys",
12987            "temporal_events",
12988            "temporal_states",
12989            "temporal_captured_events",
12990            "temporal_results",
12991            "temporal_state_bytes",
12992            "temporal_interval_nanos",
12993        ],
12994        effect_class: "durable_submit",
12995        risk_flags: &[],
12996        capability_family: "lifecycle",
12997        retry_safety: "pre_submit_only",
12998        identity_requirement: "caller_action_id",
12999        resolver: Some(Command::GetContinuousTemporalEvaluation),
13000        cancellation: "per_call_until_submission_then_resolve",
13001        side_effects: &["commits_authoritative_state"],
13002        recovery: "resolve_with_get_continuous_temporal_evaluation",
13003        collection_index_ref: "request_temporal_inputs",
13004    },
13005    CommandSemanticContract {
13006        command: Command::RetireContinuousTemporalEvaluation,
13007        admissible_errors: &[
13008            ErrorCode::Aborted,
13009            ErrorCode::DeadlineExceeded,
13010            ErrorCode::InvalidRequest,
13011            ErrorCode::UnsupportedVersion,
13012            ErrorCode::Unauthenticated,
13013            ErrorCode::PermissionDenied,
13014            ErrorCode::NotFound,
13015            ErrorCode::Conflict,
13016            ErrorCode::LimitExceeded,
13017            ErrorCode::CapabilityUnavailable,
13018            ErrorCode::NotSubmitted,
13019            ErrorCode::SubmittedIndeterminate,
13020            ErrorCode::TemporarilyUnavailable,
13021            ErrorCode::Internal,
13022        ],
13023        limit_ids: &["request_bytes", "response_bytes"],
13024        effect_class: "durable_submit",
13025        risk_flags: &["destructive"],
13026        capability_family: "lifecycle",
13027        retry_safety: "pre_submit_only",
13028        identity_requirement: "caller_action_id",
13029        resolver: Some(Command::GetContinuousTemporalEvaluation),
13030        cancellation: "per_call_until_submission_then_resolve",
13031        side_effects: &["commits_authoritative_state"],
13032        recovery: "resolve_with_get_continuous_temporal_evaluation",
13033        collection_index_ref: "request_evaluation",
13034    },
13035    CommandSemanticContract {
13036        command: Command::ReadContinuousTemporalEvidence,
13037        admissible_errors: &[
13038            ErrorCode::Aborted,
13039            ErrorCode::DeadlineExceeded,
13040            ErrorCode::InvalidRequest,
13041            ErrorCode::UnsupportedVersion,
13042            ErrorCode::Unauthenticated,
13043            ErrorCode::PermissionDenied,
13044            ErrorCode::NotFound,
13045            ErrorCode::Conflict,
13046            ErrorCode::RetentionGap,
13047            ErrorCode::LimitExceeded,
13048            ErrorCode::CapabilityUnavailable,
13049            ErrorCode::TemporarilyUnavailable,
13050            ErrorCode::Internal,
13051        ],
13052        limit_ids: &["request_bytes", "response_bytes", "page_size", "temporal_results"],
13053        effect_class: "read_only",
13054        risk_flags: &[],
13055        capability_family: "data",
13056        retry_safety: "safe",
13057        identity_requirement: "none",
13058        resolver: None,
13059        cancellation: "per_call",
13060        side_effects: &[],
13061        recovery: "retry",
13062        collection_index_ref: "request_evaluation",
13063    },
13064    CommandSemanticContract {
13065        command: Command::ValidateSearch,
13066        admissible_errors: &[
13067            ErrorCode::Aborted,
13068            ErrorCode::DeadlineExceeded,
13069            ErrorCode::InvalidRequest,
13070            ErrorCode::UnsupportedVersion,
13071            ErrorCode::Unauthenticated,
13072            ErrorCode::PermissionDenied,
13073            ErrorCode::NotFound,
13074            ErrorCode::LimitExceeded,
13075            ErrorCode::CapabilityUnavailable,
13076            ErrorCode::TemporarilyUnavailable,
13077            ErrorCode::Internal,
13078        ],
13079        limit_ids: &[
13080            "request_bytes",
13081            "response_bytes",
13082            "page_size",
13083            "query_clauses",
13084            "aggregation_nodes",
13085            "aggregation_buckets",
13086            "routing_values",
13087            "routing_value_bytes",
13088            "query_recursion_depth",
13089            "search_result_window",
13090        ],
13091        effect_class: "read_only",
13092        risk_flags: &[],
13093        capability_family: "data",
13094        retry_safety: "safe",
13095        identity_requirement: "none",
13096        resolver: None,
13097        cancellation: "per_call",
13098        side_effects: &[],
13099        recovery: "retry",
13100        collection_index_ref: "request_indexes_uniform",
13101    },
13102    CommandSemanticContract {
13103        command: Command::OpenPit,
13104        admissible_errors: &[
13105            ErrorCode::Aborted,
13106            ErrorCode::DeadlineExceeded,
13107            ErrorCode::InvalidRequest,
13108            ErrorCode::UnsupportedVersion,
13109            ErrorCode::Unauthenticated,
13110            ErrorCode::PermissionDenied,
13111            ErrorCode::NotFound,
13112            ErrorCode::Conflict,
13113            ErrorCode::LimitExceeded,
13114            ErrorCode::CapabilityUnavailable,
13115            ErrorCode::NotSubmitted,
13116            ErrorCode::SubmittedIndeterminate,
13117            ErrorCode::ExpiredUnknown,
13118            ErrorCode::TemporarilyUnavailable,
13119            ErrorCode::Internal,
13120        ],
13121        limit_ids: &["request_bytes", "response_bytes"],
13122        effect_class: "lease_renewing_read",
13123        risk_flags: &[],
13124        capability_family: "data",
13125        retry_safety: "pre_submit_only",
13126        identity_requirement: "none",
13127        resolver: None,
13128        cancellation: "per_call_until_submission_then_resolve",
13129        side_effects: &["renews_or_closes_existing_lease"],
13130        recovery: "retry_if_not_submitted",
13131        collection_index_ref: "request_indexes_uniform",
13132    },
13133    CommandSemanticContract {
13134        command: Command::RenewPit,
13135        admissible_errors: &[
13136            ErrorCode::Aborted,
13137            ErrorCode::DeadlineExceeded,
13138            ErrorCode::InvalidRequest,
13139            ErrorCode::UnsupportedVersion,
13140            ErrorCode::Unauthenticated,
13141            ErrorCode::PermissionDenied,
13142            ErrorCode::NotFound,
13143            ErrorCode::Conflict,
13144            ErrorCode::LimitExceeded,
13145            ErrorCode::CapabilityUnavailable,
13146            ErrorCode::NotSubmitted,
13147            ErrorCode::SubmittedIndeterminate,
13148            ErrorCode::ExpiredUnknown,
13149            ErrorCode::TemporarilyUnavailable,
13150            ErrorCode::Internal,
13151        ],
13152        limit_ids: &["request_bytes", "response_bytes"],
13153        effect_class: "lease_renewing_read",
13154        risk_flags: &[],
13155        capability_family: "data",
13156        retry_safety: "pre_submit_only",
13157        identity_requirement: "none",
13158        resolver: None,
13159        cancellation: "per_call_until_submission_then_resolve",
13160        side_effects: &["renews_or_closes_existing_lease"],
13161        recovery: "retry_if_not_submitted",
13162        collection_index_ref: "pit_authority",
13163    },
13164    CommandSemanticContract {
13165        command: Command::ClosePit,
13166        admissible_errors: &[
13167            ErrorCode::Aborted,
13168            ErrorCode::DeadlineExceeded,
13169            ErrorCode::InvalidRequest,
13170            ErrorCode::UnsupportedVersion,
13171            ErrorCode::Unauthenticated,
13172            ErrorCode::PermissionDenied,
13173            ErrorCode::NotFound,
13174            ErrorCode::Conflict,
13175            ErrorCode::LimitExceeded,
13176            ErrorCode::CapabilityUnavailable,
13177            ErrorCode::NotSubmitted,
13178            ErrorCode::SubmittedIndeterminate,
13179            ErrorCode::ExpiredUnknown,
13180            ErrorCode::TemporarilyUnavailable,
13181            ErrorCode::Internal,
13182        ],
13183        limit_ids: &["request_bytes", "response_bytes"],
13184        effect_class: "lease_renewing_read",
13185        risk_flags: &[],
13186        capability_family: "data",
13187        retry_safety: "pre_submit_only",
13188        identity_requirement: "none",
13189        resolver: None,
13190        cancellation: "per_call_until_submission_then_resolve",
13191        side_effects: &["renews_or_closes_existing_lease"],
13192        recovery: "retry_if_not_submitted",
13193        collection_index_ref: "pit_authority",
13194    },
13195    CommandSemanticContract {
13196        command: Command::ListOperations,
13197        admissible_errors: &[
13198            ErrorCode::Aborted,
13199            ErrorCode::DeadlineExceeded,
13200            ErrorCode::InvalidRequest,
13201            ErrorCode::UnsupportedVersion,
13202            ErrorCode::Unauthenticated,
13203            ErrorCode::PermissionDenied,
13204            ErrorCode::NotFound,
13205            ErrorCode::StaleCursor,
13206            ErrorCode::RestartBudgetExhausted,
13207            ErrorCode::LimitExceeded,
13208            ErrorCode::CapabilityUnavailable,
13209            ErrorCode::TemporarilyUnavailable,
13210            ErrorCode::Internal,
13211        ],
13212        limit_ids: &["request_bytes", "response_bytes", "page_size", "operation_page_size"],
13213        effect_class: "read_only",
13214        risk_flags: &[],
13215        capability_family: "operations",
13216        retry_safety: "safe",
13217        identity_requirement: "none",
13218        resolver: None,
13219        cancellation: "per_call",
13220        side_effects: &[],
13221        recovery: "retry",
13222        collection_index_ref: "none",
13223    },
13224    CommandSemanticContract {
13225        command: Command::GetOperation,
13226        admissible_errors: &[
13227            ErrorCode::Aborted,
13228            ErrorCode::DeadlineExceeded,
13229            ErrorCode::InvalidRequest,
13230            ErrorCode::UnsupportedVersion,
13231            ErrorCode::Unauthenticated,
13232            ErrorCode::PermissionDenied,
13233            ErrorCode::NotFound,
13234            ErrorCode::LimitExceeded,
13235            ErrorCode::CapabilityUnavailable,
13236            ErrorCode::TemporarilyUnavailable,
13237            ErrorCode::Internal,
13238        ],
13239        limit_ids: &["request_bytes", "response_bytes"],
13240        effect_class: "read_only",
13241        risk_flags: &[],
13242        capability_family: "operations",
13243        retry_safety: "safe",
13244        identity_requirement: "request_locator",
13245        resolver: None,
13246        cancellation: "per_call",
13247        side_effects: &[],
13248        recovery: "retry",
13249        collection_index_ref: "none",
13250    },
13251    CommandSemanticContract {
13252        command: Command::WaitOperation,
13253        admissible_errors: &[
13254            ErrorCode::Aborted,
13255            ErrorCode::DeadlineExceeded,
13256            ErrorCode::InvalidRequest,
13257            ErrorCode::UnsupportedVersion,
13258            ErrorCode::Unauthenticated,
13259            ErrorCode::PermissionDenied,
13260            ErrorCode::NotFound,
13261            ErrorCode::Conflict,
13262            ErrorCode::LimitExceeded,
13263            ErrorCode::CapabilityUnavailable,
13264            ErrorCode::TemporarilyUnavailable,
13265            ErrorCode::Internal,
13266        ],
13267        limit_ids: &[
13268            "request_bytes",
13269            "response_bytes",
13270            "operation_wait_attempts",
13271            "operation_wait_interval_millis",
13272        ],
13273        effect_class: "read_only",
13274        risk_flags: &[],
13275        capability_family: "operations",
13276        retry_safety: "safe",
13277        identity_requirement: "request_locator",
13278        resolver: None,
13279        cancellation: "per_call",
13280        side_effects: &[],
13281        recovery: "retry",
13282        collection_index_ref: "none",
13283    },
13284    CommandSemanticContract {
13285        command: Command::CancelOperation,
13286        admissible_errors: &[
13287            ErrorCode::Aborted,
13288            ErrorCode::DeadlineExceeded,
13289            ErrorCode::InvalidRequest,
13290            ErrorCode::UnsupportedVersion,
13291            ErrorCode::Unauthenticated,
13292            ErrorCode::PermissionDenied,
13293            ErrorCode::NotFound,
13294            ErrorCode::Conflict,
13295            ErrorCode::LimitExceeded,
13296            ErrorCode::CapabilityUnavailable,
13297            ErrorCode::NotSubmitted,
13298            ErrorCode::SubmittedIndeterminate,
13299            ErrorCode::ExpiredUnknown,
13300            ErrorCode::TemporarilyUnavailable,
13301            ErrorCode::Internal,
13302        ],
13303        limit_ids: &["request_bytes", "response_bytes"],
13304        effect_class: "control_write",
13305        risk_flags: &[],
13306        capability_family: "operations",
13307        retry_safety: "pre_submit_only",
13308        identity_requirement: "request_locator",
13309        resolver: None,
13310        cancellation: "per_call_until_submission_then_resolve",
13311        side_effects: &["commits_authoritative_state"],
13312        recovery: "retry_if_not_submitted",
13313        collection_index_ref: "none",
13314    },
13315    CommandSemanticContract {
13316        command: Command::ListAuditEvents,
13317        admissible_errors: &[
13318            ErrorCode::Aborted,
13319            ErrorCode::DeadlineExceeded,
13320            ErrorCode::InvalidRequest,
13321            ErrorCode::UnsupportedVersion,
13322            ErrorCode::Unauthenticated,
13323            ErrorCode::PermissionDenied,
13324            ErrorCode::NotFound,
13325            ErrorCode::StaleCursor,
13326            ErrorCode::RestartBudgetExhausted,
13327            ErrorCode::LimitExceeded,
13328            ErrorCode::CapabilityUnavailable,
13329            ErrorCode::TemporarilyUnavailable,
13330            ErrorCode::Internal,
13331        ],
13332        limit_ids: &["request_bytes", "response_bytes", "page_size"],
13333        effect_class: "read_only",
13334        risk_flags: &[],
13335        capability_family: "audit",
13336        retry_safety: "safe",
13337        identity_requirement: "none",
13338        resolver: None,
13339        cancellation: "per_call",
13340        side_effects: &[],
13341        recovery: "retry",
13342        collection_index_ref: "none",
13343    },
13344    CommandSemanticContract {
13345        command: Command::ExportAuditEvents,
13346        admissible_errors: &[
13347            ErrorCode::Aborted,
13348            ErrorCode::DeadlineExceeded,
13349            ErrorCode::InvalidRequest,
13350            ErrorCode::UnsupportedVersion,
13351            ErrorCode::Unauthenticated,
13352            ErrorCode::PermissionDenied,
13353            ErrorCode::NotFound,
13354            ErrorCode::StaleCursor,
13355            ErrorCode::RestartBudgetExhausted,
13356            ErrorCode::LimitExceeded,
13357            ErrorCode::CapabilityUnavailable,
13358            ErrorCode::TemporarilyUnavailable,
13359            ErrorCode::Internal,
13360        ],
13361        limit_ids: &["request_bytes", "response_bytes", "page_size"],
13362        effect_class: "read_only",
13363        risk_flags: &[],
13364        capability_family: "audit",
13365        retry_safety: "safe",
13366        identity_requirement: "none",
13367        resolver: None,
13368        cancellation: "per_call",
13369        side_effects: &[],
13370        recovery: "retry",
13371        collection_index_ref: "none",
13372    },
13373    CommandSemanticContract {
13374        command: Command::ReserveServiceCredential,
13375        admissible_errors: &[
13376            ErrorCode::Aborted,
13377            ErrorCode::DeadlineExceeded,
13378            ErrorCode::InvalidRequest,
13379            ErrorCode::UnsupportedVersion,
13380            ErrorCode::Unauthenticated,
13381            ErrorCode::PermissionDenied,
13382            ErrorCode::NotFound,
13383            ErrorCode::Conflict,
13384            ErrorCode::LimitExceeded,
13385            ErrorCode::CapabilityUnavailable,
13386            ErrorCode::NotSubmitted,
13387            ErrorCode::SubmittedIndeterminate,
13388            ErrorCode::ExpiredUnknown,
13389            ErrorCode::SecretNotEscrowed,
13390            ErrorCode::TemporarilyUnavailable,
13391            ErrorCode::Internal,
13392        ],
13393        limit_ids: &["request_bytes", "response_bytes"],
13394        effect_class: "durable_submit",
13395        risk_flags: &["credential_sensitive"],
13396        capability_family: "security",
13397        retry_safety: "pre_submit_only",
13398        identity_requirement: "caller_action_id",
13399        resolver: Some(Command::ResolveServiceCredentialReservation),
13400        cancellation: "per_call_until_submission_then_resolve",
13401        side_effects: &["commits_authoritative_state"],
13402        recovery: "resolve_with_resolve_service_credential_reservation",
13403        collection_index_ref: "none",
13404    },
13405    CommandSemanticContract {
13406        command: Command::ReserveServiceCredentialRotation,
13407        admissible_errors: &[
13408            ErrorCode::Aborted,
13409            ErrorCode::DeadlineExceeded,
13410            ErrorCode::InvalidRequest,
13411            ErrorCode::UnsupportedVersion,
13412            ErrorCode::Unauthenticated,
13413            ErrorCode::PermissionDenied,
13414            ErrorCode::NotFound,
13415            ErrorCode::Conflict,
13416            ErrorCode::LimitExceeded,
13417            ErrorCode::CapabilityUnavailable,
13418            ErrorCode::NotSubmitted,
13419            ErrorCode::SubmittedIndeterminate,
13420            ErrorCode::ExpiredUnknown,
13421            ErrorCode::SecretNotEscrowed,
13422            ErrorCode::TemporarilyUnavailable,
13423            ErrorCode::Internal,
13424        ],
13425        limit_ids: &["request_bytes", "response_bytes"],
13426        effect_class: "durable_submit",
13427        risk_flags: &["credential_sensitive"],
13428        capability_family: "security",
13429        retry_safety: "pre_submit_only",
13430        identity_requirement: "caller_action_id",
13431        resolver: Some(Command::ResolveServiceCredentialReservation),
13432        cancellation: "per_call_until_submission_then_resolve",
13433        side_effects: &["commits_authoritative_state"],
13434        recovery: "resolve_with_resolve_service_credential_reservation",
13435        collection_index_ref: "none",
13436    },
13437    CommandSemanticContract {
13438        command: Command::ActivateServiceCredential,
13439        admissible_errors: &[
13440            ErrorCode::Aborted,
13441            ErrorCode::DeadlineExceeded,
13442            ErrorCode::InvalidRequest,
13443            ErrorCode::UnsupportedVersion,
13444            ErrorCode::Unauthenticated,
13445            ErrorCode::PermissionDenied,
13446            ErrorCode::NotFound,
13447            ErrorCode::Conflict,
13448            ErrorCode::LimitExceeded,
13449            ErrorCode::CapabilityUnavailable,
13450            ErrorCode::NotSubmitted,
13451            ErrorCode::SubmittedIndeterminate,
13452            ErrorCode::ExpiredUnknown,
13453            ErrorCode::SecretNotEscrowed,
13454            ErrorCode::TemporarilyUnavailable,
13455            ErrorCode::Internal,
13456        ],
13457        limit_ids: &["request_bytes", "response_bytes"],
13458        effect_class: "durable_submit",
13459        risk_flags: &["credential_sensitive"],
13460        capability_family: "security",
13461        retry_safety: "pre_submit_only",
13462        identity_requirement: "server_locator",
13463        resolver: Some(Command::ResolveServiceCredentialReservation),
13464        cancellation: "per_call_until_submission_then_resolve",
13465        side_effects: &["commits_authoritative_state"],
13466        recovery: "resolve_with_resolve_service_credential_reservation",
13467        collection_index_ref: "none",
13468    },
13469    CommandSemanticContract {
13470        command: Command::ResolveServiceCredentialReservation,
13471        admissible_errors: &[
13472            ErrorCode::Aborted,
13473            ErrorCode::DeadlineExceeded,
13474            ErrorCode::InvalidRequest,
13475            ErrorCode::UnsupportedVersion,
13476            ErrorCode::Unauthenticated,
13477            ErrorCode::PermissionDenied,
13478            ErrorCode::NotFound,
13479            ErrorCode::LimitExceeded,
13480            ErrorCode::CapabilityUnavailable,
13481            ErrorCode::SecretNotEscrowed,
13482            ErrorCode::TemporarilyUnavailable,
13483            ErrorCode::Internal,
13484        ],
13485        limit_ids: &["request_bytes", "response_bytes"],
13486        effect_class: "read_only",
13487        risk_flags: &["credential_sensitive"],
13488        capability_family: "security",
13489        retry_safety: "safe",
13490        identity_requirement: "caller_action_id",
13491        resolver: None,
13492        cancellation: "per_call",
13493        side_effects: &[],
13494        recovery: "retry",
13495        collection_index_ref: "none",
13496    },
13497    CommandSemanticContract {
13498        command: Command::PrepareRevokeServiceCredential,
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: "prepare",
13515        risk_flags: &["destructive", "credential_sensitive"],
13516        capability_family: "security",
13517        retry_safety: "safe",
13518        identity_requirement: "server_locator",
13519        resolver: None,
13520        cancellation: "per_call",
13521        side_effects: &["creates_bounded_preparation"],
13522        recovery: "retry",
13523        collection_index_ref: "none",
13524    },
13525    CommandSemanticContract {
13526        command: Command::RevokeServiceCredential,
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::Conflict,
13536            ErrorCode::LimitExceeded,
13537            ErrorCode::CapabilityUnavailable,
13538            ErrorCode::NotSubmitted,
13539            ErrorCode::SubmittedIndeterminate,
13540            ErrorCode::ExpiredUnknown,
13541            ErrorCode::SecretNotEscrowed,
13542            ErrorCode::TemporarilyUnavailable,
13543            ErrorCode::Internal,
13544        ],
13545        limit_ids: &["request_bytes", "response_bytes"],
13546        effect_class: "durable_submit",
13547        risk_flags: &["destructive", "credential_sensitive"],
13548        capability_family: "security",
13549        retry_safety: "pre_submit_only",
13550        identity_requirement: "request_locator",
13551        resolver: Some(Command::ResolveSecurityAction),
13552        cancellation: "per_call_until_submission_then_resolve",
13553        side_effects: &["commits_authoritative_state"],
13554        recovery: "resolve_with_resolve_security_action",
13555        collection_index_ref: "none",
13556    },
13557    CommandSemanticContract {
13558        command: Command::ResolveSecurityAction,
13559        admissible_errors: &[
13560            ErrorCode::Aborted,
13561            ErrorCode::DeadlineExceeded,
13562            ErrorCode::InvalidRequest,
13563            ErrorCode::UnsupportedVersion,
13564            ErrorCode::Unauthenticated,
13565            ErrorCode::PermissionDenied,
13566            ErrorCode::NotFound,
13567            ErrorCode::LimitExceeded,
13568            ErrorCode::CapabilityUnavailable,
13569            ErrorCode::SecretNotEscrowed,
13570            ErrorCode::TemporarilyUnavailable,
13571            ErrorCode::Internal,
13572        ],
13573        limit_ids: &["request_bytes", "response_bytes"],
13574        effect_class: "read_only",
13575        risk_flags: &[],
13576        capability_family: "security",
13577        retry_safety: "safe",
13578        identity_requirement: "request_locator",
13579        resolver: None,
13580        cancellation: "per_call",
13581        side_effects: &[],
13582        recovery: "retry",
13583        collection_index_ref: "none",
13584    },
13585    CommandSemanticContract {
13586        command: Command::GetSecurityRole,
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::TemporarilyUnavailable,
13598            ErrorCode::Internal,
13599        ],
13600        limit_ids: &["request_bytes", "response_bytes"],
13601        effect_class: "read_only",
13602        risk_flags: &[],
13603        capability_family: "security",
13604        retry_safety: "safe",
13605        identity_requirement: "none",
13606        resolver: None,
13607        cancellation: "per_call",
13608        side_effects: &[],
13609        recovery: "retry",
13610        collection_index_ref: "none",
13611    },
13612    CommandSemanticContract {
13613        command: Command::PrepareRoleAppendAccessChange,
13614        admissible_errors: &[
13615            ErrorCode::Aborted,
13616            ErrorCode::DeadlineExceeded,
13617            ErrorCode::InvalidRequest,
13618            ErrorCode::UnsupportedVersion,
13619            ErrorCode::Unauthenticated,
13620            ErrorCode::PermissionDenied,
13621            ErrorCode::NotFound,
13622            ErrorCode::Conflict,
13623            ErrorCode::LimitExceeded,
13624            ErrorCode::CapabilityUnavailable,
13625            ErrorCode::TemporarilyUnavailable,
13626            ErrorCode::Internal,
13627        ],
13628        limit_ids: &["request_bytes", "response_bytes"],
13629        effect_class: "prepare",
13630        risk_flags: &["destructive"],
13631        capability_family: "security",
13632        retry_safety: "safe",
13633        identity_requirement: "server_locator",
13634        resolver: None,
13635        cancellation: "per_call",
13636        side_effects: &["creates_bounded_preparation"],
13637        recovery: "retry",
13638        collection_index_ref: "none",
13639    },
13640    CommandSemanticContract {
13641        command: Command::SubmitRoleAppendAccessChange,
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::NotSubmitted,
13654            ErrorCode::SubmittedIndeterminate,
13655            ErrorCode::ExpiredUnknown,
13656            ErrorCode::TemporarilyUnavailable,
13657            ErrorCode::Internal,
13658        ],
13659        limit_ids: &["request_bytes", "response_bytes"],
13660        effect_class: "durable_submit",
13661        risk_flags: &["destructive"],
13662        capability_family: "security",
13663        retry_safety: "pre_submit_only",
13664        identity_requirement: "request_locator",
13665        resolver: Some(Command::ResolveSecurityAction),
13666        cancellation: "per_call_until_submission_then_resolve",
13667        side_effects: &["commits_authoritative_state"],
13668        recovery: "resolve_with_resolve_security_action",
13669        collection_index_ref: "none",
13670    },
13671    CommandSemanticContract {
13672        command: Command::ListServiceCredentials,
13673        admissible_errors: &[
13674            ErrorCode::Aborted,
13675            ErrorCode::DeadlineExceeded,
13676            ErrorCode::InvalidRequest,
13677            ErrorCode::UnsupportedVersion,
13678            ErrorCode::Unauthenticated,
13679            ErrorCode::PermissionDenied,
13680            ErrorCode::NotFound,
13681            ErrorCode::StaleCursor,
13682            ErrorCode::RestartBudgetExhausted,
13683            ErrorCode::LimitExceeded,
13684            ErrorCode::CapabilityUnavailable,
13685            ErrorCode::SecretNotEscrowed,
13686            ErrorCode::TemporarilyUnavailable,
13687            ErrorCode::Internal,
13688        ],
13689        limit_ids: &["request_bytes", "response_bytes", "page_size"],
13690        effect_class: "read_only",
13691        risk_flags: &["credential_sensitive"],
13692        capability_family: "security",
13693        retry_safety: "safe",
13694        identity_requirement: "none",
13695        resolver: None,
13696        cancellation: "per_call",
13697        side_effects: &[],
13698        recovery: "retry",
13699        collection_index_ref: "none",
13700    },
13701    CommandSemanticContract {
13702        command: Command::GetRuntimeStatus,
13703        admissible_errors: &[
13704            ErrorCode::Aborted,
13705            ErrorCode::DeadlineExceeded,
13706            ErrorCode::InvalidRequest,
13707            ErrorCode::UnsupportedVersion,
13708            ErrorCode::Unauthenticated,
13709            ErrorCode::PermissionDenied,
13710            ErrorCode::NotFound,
13711            ErrorCode::LimitExceeded,
13712            ErrorCode::CapabilityUnavailable,
13713            ErrorCode::TemporarilyUnavailable,
13714            ErrorCode::Internal,
13715        ],
13716        limit_ids: &["request_bytes", "response_bytes"],
13717        effect_class: "read_only",
13718        risk_flags: &[],
13719        capability_family: "catalog",
13720        retry_safety: "safe",
13721        identity_requirement: "none",
13722        resolver: None,
13723        cancellation: "per_call",
13724        side_effects: &[],
13725        recovery: "retry",
13726        collection_index_ref: "none",
13727    },
13728    CommandSemanticContract {
13729        command: Command::GetResultCacheStatus,
13730        admissible_errors: &[
13731            ErrorCode::Aborted,
13732            ErrorCode::DeadlineExceeded,
13733            ErrorCode::InvalidRequest,
13734            ErrorCode::UnsupportedVersion,
13735            ErrorCode::Unauthenticated,
13736            ErrorCode::PermissionDenied,
13737            ErrorCode::NotFound,
13738            ErrorCode::LimitExceeded,
13739            ErrorCode::CapabilityUnavailable,
13740            ErrorCode::TemporarilyUnavailable,
13741            ErrorCode::Internal,
13742        ],
13743        limit_ids: &["request_bytes", "response_bytes"],
13744        effect_class: "read_only",
13745        risk_flags: &[],
13746        capability_family: "catalog",
13747        retry_safety: "safe",
13748        identity_requirement: "none",
13749        resolver: None,
13750        cancellation: "per_call",
13751        side_effects: &[],
13752        recovery: "retry",
13753        collection_index_ref: "none",
13754    },
13755    CommandSemanticContract {
13756        command: Command::GetFieldPromotionStatus,
13757        admissible_errors: &[
13758            ErrorCode::Aborted,
13759            ErrorCode::DeadlineExceeded,
13760            ErrorCode::InvalidRequest,
13761            ErrorCode::UnsupportedVersion,
13762            ErrorCode::Unauthenticated,
13763            ErrorCode::PermissionDenied,
13764            ErrorCode::NotFound,
13765            ErrorCode::LimitExceeded,
13766            ErrorCode::CapabilityUnavailable,
13767            ErrorCode::TemporarilyUnavailable,
13768            ErrorCode::Internal,
13769        ],
13770        limit_ids: &["request_bytes", "response_bytes"],
13771        effect_class: "read_only",
13772        risk_flags: &[],
13773        capability_family: "catalog",
13774        retry_safety: "safe",
13775        identity_requirement: "none",
13776        resolver: None,
13777        cancellation: "per_call",
13778        side_effects: &[],
13779        recovery: "retry",
13780        collection_index_ref: "none",
13781    },
13782    CommandSemanticContract {
13783        command: Command::GetOverloadStatus,
13784        admissible_errors: &[
13785            ErrorCode::Aborted,
13786            ErrorCode::DeadlineExceeded,
13787            ErrorCode::InvalidRequest,
13788            ErrorCode::UnsupportedVersion,
13789            ErrorCode::Unauthenticated,
13790            ErrorCode::PermissionDenied,
13791            ErrorCode::NotFound,
13792            ErrorCode::LimitExceeded,
13793            ErrorCode::CapabilityUnavailable,
13794            ErrorCode::TemporarilyUnavailable,
13795            ErrorCode::Internal,
13796        ],
13797        limit_ids: &["request_bytes", "response_bytes"],
13798        effect_class: "read_only",
13799        risk_flags: &[],
13800        capability_family: "catalog",
13801        retry_safety: "safe",
13802        identity_requirement: "none",
13803        resolver: None,
13804        cancellation: "per_call",
13805        side_effects: &[],
13806        recovery: "retry",
13807        collection_index_ref: "none",
13808    },
13809    CommandSemanticContract {
13810        command: Command::ConfigureExternalKey,
13811        admissible_errors: &[
13812            ErrorCode::Aborted,
13813            ErrorCode::DeadlineExceeded,
13814            ErrorCode::InvalidRequest,
13815            ErrorCode::UnsupportedVersion,
13816            ErrorCode::Unauthenticated,
13817            ErrorCode::PermissionDenied,
13818            ErrorCode::NotFound,
13819            ErrorCode::Conflict,
13820            ErrorCode::LimitExceeded,
13821            ErrorCode::CapabilityUnavailable,
13822            ErrorCode::NotSubmitted,
13823            ErrorCode::SubmittedIndeterminate,
13824            ErrorCode::ExpiredUnknown,
13825            ErrorCode::TemporarilyUnavailable,
13826            ErrorCode::Internal,
13827        ],
13828        limit_ids: &["request_bytes", "response_bytes"],
13829        effect_class: "control_write",
13830        risk_flags: &[],
13831        capability_family: "lifecycle",
13832        retry_safety: "pre_submit_only",
13833        identity_requirement: "none",
13834        resolver: None,
13835        cancellation: "per_call_until_submission_then_resolve",
13836        side_effects: &["commits_authoritative_state"],
13837        recovery: "retry_if_not_submitted",
13838        collection_index_ref: "request_index",
13839    },
13840    CommandSemanticContract {
13841        command: Command::RotateExternalKeyBinding,
13842        admissible_errors: &[
13843            ErrorCode::Aborted,
13844            ErrorCode::DeadlineExceeded,
13845            ErrorCode::InvalidRequest,
13846            ErrorCode::UnsupportedVersion,
13847            ErrorCode::Unauthenticated,
13848            ErrorCode::PermissionDenied,
13849            ErrorCode::NotFound,
13850            ErrorCode::Conflict,
13851            ErrorCode::LimitExceeded,
13852            ErrorCode::CapabilityUnavailable,
13853            ErrorCode::NotSubmitted,
13854            ErrorCode::SubmittedIndeterminate,
13855            ErrorCode::ExpiredUnknown,
13856            ErrorCode::TemporarilyUnavailable,
13857            ErrorCode::Internal,
13858        ],
13859        limit_ids: &["request_bytes", "response_bytes"],
13860        effect_class: "control_write",
13861        risk_flags: &[],
13862        capability_family: "lifecycle",
13863        retry_safety: "pre_submit_only",
13864        identity_requirement: "none",
13865        resolver: None,
13866        cancellation: "per_call_until_submission_then_resolve",
13867        side_effects: &["commits_authoritative_state"],
13868        recovery: "retry_if_not_submitted",
13869        collection_index_ref: "request_index",
13870    },
13871    CommandSemanticContract {
13872        command: Command::ConfigureAggregateThenDelete,
13873        admissible_errors: &[
13874            ErrorCode::Aborted,
13875            ErrorCode::DeadlineExceeded,
13876            ErrorCode::InvalidRequest,
13877            ErrorCode::UnsupportedVersion,
13878            ErrorCode::Unauthenticated,
13879            ErrorCode::PermissionDenied,
13880            ErrorCode::NotFound,
13881            ErrorCode::Conflict,
13882            ErrorCode::LimitExceeded,
13883            ErrorCode::CapabilityUnavailable,
13884            ErrorCode::NotSubmitted,
13885            ErrorCode::SubmittedIndeterminate,
13886            ErrorCode::ExpiredUnknown,
13887            ErrorCode::TemporarilyUnavailable,
13888            ErrorCode::Internal,
13889        ],
13890        limit_ids: &["request_bytes", "response_bytes"],
13891        effect_class: "control_write",
13892        risk_flags: &["destructive"],
13893        capability_family: "lifecycle",
13894        retry_safety: "pre_submit_only",
13895        identity_requirement: "none",
13896        resolver: None,
13897        cancellation: "per_call_until_submission_then_resolve",
13898        side_effects: &["commits_authoritative_state"],
13899        recovery: "retry_if_not_submitted",
13900        collection_index_ref: "request_index",
13901    },
13902    CommandSemanticContract {
13903        command: Command::GetLifecycleStatus,
13904        admissible_errors: &[
13905            ErrorCode::Aborted,
13906            ErrorCode::DeadlineExceeded,
13907            ErrorCode::InvalidRequest,
13908            ErrorCode::UnsupportedVersion,
13909            ErrorCode::Unauthenticated,
13910            ErrorCode::PermissionDenied,
13911            ErrorCode::NotFound,
13912            ErrorCode::LimitExceeded,
13913            ErrorCode::CapabilityUnavailable,
13914            ErrorCode::TemporarilyUnavailable,
13915            ErrorCode::Internal,
13916        ],
13917        limit_ids: &["request_bytes", "response_bytes"],
13918        effect_class: "read_only",
13919        risk_flags: &[],
13920        capability_family: "catalog",
13921        retry_safety: "safe",
13922        identity_requirement: "none",
13923        resolver: None,
13924        cancellation: "per_call",
13925        side_effects: &[],
13926        recovery: "retry",
13927        collection_index_ref: "none",
13928    },
13929    CommandSemanticContract {
13930        command: Command::GetQuota,
13931        admissible_errors: &[
13932            ErrorCode::Aborted,
13933            ErrorCode::DeadlineExceeded,
13934            ErrorCode::InvalidRequest,
13935            ErrorCode::UnsupportedVersion,
13936            ErrorCode::Unauthenticated,
13937            ErrorCode::PermissionDenied,
13938            ErrorCode::NotFound,
13939            ErrorCode::LimitExceeded,
13940            ErrorCode::CapabilityUnavailable,
13941            ErrorCode::TemporarilyUnavailable,
13942            ErrorCode::Internal,
13943        ],
13944        limit_ids: &["request_bytes", "response_bytes"],
13945        effect_class: "read_only",
13946        risk_flags: &[],
13947        capability_family: "quota",
13948        retry_safety: "safe",
13949        identity_requirement: "none",
13950        resolver: None,
13951        cancellation: "per_call",
13952        side_effects: &[],
13953        recovery: "retry",
13954        collection_index_ref: "none",
13955    },
13956    CommandSemanticContract {
13957        command: Command::UpdateQuota,
13958        admissible_errors: &[
13959            ErrorCode::Aborted,
13960            ErrorCode::DeadlineExceeded,
13961            ErrorCode::InvalidRequest,
13962            ErrorCode::UnsupportedVersion,
13963            ErrorCode::Unauthenticated,
13964            ErrorCode::PermissionDenied,
13965            ErrorCode::NotFound,
13966            ErrorCode::Conflict,
13967            ErrorCode::LimitExceeded,
13968            ErrorCode::CapabilityUnavailable,
13969            ErrorCode::NotSubmitted,
13970            ErrorCode::SubmittedIndeterminate,
13971            ErrorCode::ExpiredUnknown,
13972            ErrorCode::TemporarilyUnavailable,
13973            ErrorCode::Internal,
13974        ],
13975        limit_ids: &["request_bytes", "response_bytes"],
13976        effect_class: "control_write",
13977        risk_flags: &[],
13978        capability_family: "quota",
13979        retry_safety: "pre_submit_only",
13980        identity_requirement: "none",
13981        resolver: None,
13982        cancellation: "per_call_until_submission_then_resolve",
13983        side_effects: &["commits_authoritative_state"],
13984        recovery: "retry_if_not_submitted",
13985        collection_index_ref: "none",
13986    },
13987    CommandSemanticContract {
13988        command: Command::GetBinding,
13989        admissible_errors: &[
13990            ErrorCode::Aborted,
13991            ErrorCode::DeadlineExceeded,
13992            ErrorCode::InvalidRequest,
13993            ErrorCode::UnsupportedVersion,
13994            ErrorCode::Unauthenticated,
13995            ErrorCode::PermissionDenied,
13996            ErrorCode::NotFound,
13997            ErrorCode::LimitExceeded,
13998            ErrorCode::CapabilityUnavailable,
13999            ErrorCode::TemporarilyUnavailable,
14000            ErrorCode::Internal,
14001        ],
14002        limit_ids: &["request_bytes", "response_bytes"],
14003        effect_class: "read_only",
14004        risk_flags: &[],
14005        capability_family: "runtime_control",
14006        retry_safety: "safe",
14007        identity_requirement: "none",
14008        resolver: None,
14009        cancellation: "per_call",
14010        side_effects: &[],
14011        recovery: "retry",
14012        collection_index_ref: "none",
14013    },
14014    CommandSemanticContract {
14015        command: Command::GetAdmissionStatus,
14016        admissible_errors: &[
14017            ErrorCode::Aborted,
14018            ErrorCode::DeadlineExceeded,
14019            ErrorCode::InvalidRequest,
14020            ErrorCode::UnsupportedVersion,
14021            ErrorCode::Unauthenticated,
14022            ErrorCode::PermissionDenied,
14023            ErrorCode::NotFound,
14024            ErrorCode::LimitExceeded,
14025            ErrorCode::CapabilityUnavailable,
14026            ErrorCode::TemporarilyUnavailable,
14027            ErrorCode::Internal,
14028        ],
14029        limit_ids: &["request_bytes", "response_bytes"],
14030        effect_class: "read_only",
14031        risk_flags: &[],
14032        capability_family: "runtime_control",
14033        retry_safety: "safe",
14034        identity_requirement: "none",
14035        resolver: None,
14036        cancellation: "per_call",
14037        side_effects: &[],
14038        recovery: "retry",
14039        collection_index_ref: "none",
14040    },
14041    CommandSemanticContract {
14042        command: Command::SetAdmission,
14043        admissible_errors: &[
14044            ErrorCode::Aborted,
14045            ErrorCode::DeadlineExceeded,
14046            ErrorCode::InvalidRequest,
14047            ErrorCode::UnsupportedVersion,
14048            ErrorCode::Unauthenticated,
14049            ErrorCode::PermissionDenied,
14050            ErrorCode::NotFound,
14051            ErrorCode::Conflict,
14052            ErrorCode::LimitExceeded,
14053            ErrorCode::CapabilityUnavailable,
14054            ErrorCode::NotSubmitted,
14055            ErrorCode::SubmittedIndeterminate,
14056            ErrorCode::ExpiredUnknown,
14057            ErrorCode::TemporarilyUnavailable,
14058            ErrorCode::Internal,
14059        ],
14060        limit_ids: &["request_bytes", "response_bytes"],
14061        effect_class: "control_write",
14062        risk_flags: &[],
14063        capability_family: "runtime_control",
14064        retry_safety: "pre_submit_only",
14065        identity_requirement: "none",
14066        resolver: None,
14067        cancellation: "per_call_until_submission_then_resolve",
14068        side_effects: &["commits_authoritative_state"],
14069        recovery: "retry_if_not_submitted",
14070        collection_index_ref: "none",
14071    },
14072    CommandSemanticContract {
14073        command: Command::GetQuiesceStatus,
14074        admissible_errors: &[
14075            ErrorCode::Aborted,
14076            ErrorCode::DeadlineExceeded,
14077            ErrorCode::InvalidRequest,
14078            ErrorCode::UnsupportedVersion,
14079            ErrorCode::Unauthenticated,
14080            ErrorCode::PermissionDenied,
14081            ErrorCode::NotFound,
14082            ErrorCode::LimitExceeded,
14083            ErrorCode::CapabilityUnavailable,
14084            ErrorCode::TemporarilyUnavailable,
14085            ErrorCode::Internal,
14086        ],
14087        limit_ids: &["request_bytes", "response_bytes"],
14088        effect_class: "read_only",
14089        risk_flags: &[],
14090        capability_family: "runtime_control",
14091        retry_safety: "safe",
14092        identity_requirement: "none",
14093        resolver: None,
14094        cancellation: "per_call",
14095        side_effects: &[],
14096        recovery: "retry",
14097        collection_index_ref: "none",
14098    },
14099    CommandSemanticContract {
14100        command: Command::GetDecommissionReadiness,
14101        admissible_errors: &[
14102            ErrorCode::Aborted,
14103            ErrorCode::DeadlineExceeded,
14104            ErrorCode::InvalidRequest,
14105            ErrorCode::UnsupportedVersion,
14106            ErrorCode::Unauthenticated,
14107            ErrorCode::PermissionDenied,
14108            ErrorCode::NotFound,
14109            ErrorCode::LimitExceeded,
14110            ErrorCode::CapabilityUnavailable,
14111            ErrorCode::TemporarilyUnavailable,
14112            ErrorCode::Internal,
14113        ],
14114        limit_ids: &["request_bytes", "response_bytes"],
14115        effect_class: "read_only",
14116        risk_flags: &[],
14117        capability_family: "runtime_control",
14118        retry_safety: "safe",
14119        identity_requirement: "none",
14120        resolver: None,
14121        cancellation: "per_call",
14122        side_effects: &[],
14123        recovery: "retry",
14124        collection_index_ref: "none",
14125    },
14126    CommandSemanticContract {
14127        command: Command::GetUpgradeReadiness,
14128        admissible_errors: &[
14129            ErrorCode::Aborted,
14130            ErrorCode::DeadlineExceeded,
14131            ErrorCode::InvalidRequest,
14132            ErrorCode::UnsupportedVersion,
14133            ErrorCode::Unauthenticated,
14134            ErrorCode::PermissionDenied,
14135            ErrorCode::NotFound,
14136            ErrorCode::LimitExceeded,
14137            ErrorCode::CapabilityUnavailable,
14138            ErrorCode::TemporarilyUnavailable,
14139            ErrorCode::Internal,
14140        ],
14141        limit_ids: &["request_bytes", "response_bytes"],
14142        effect_class: "read_only",
14143        risk_flags: &[],
14144        capability_family: "operations",
14145        retry_safety: "safe",
14146        identity_requirement: "none",
14147        resolver: None,
14148        cancellation: "per_call",
14149        side_effects: &[],
14150        recovery: "retry",
14151        collection_index_ref: "none",
14152    },
14153    CommandSemanticContract {
14154        command: Command::GetMaintenanceStatus,
14155        admissible_errors: &[
14156            ErrorCode::Aborted,
14157            ErrorCode::DeadlineExceeded,
14158            ErrorCode::InvalidRequest,
14159            ErrorCode::UnsupportedVersion,
14160            ErrorCode::Unauthenticated,
14161            ErrorCode::PermissionDenied,
14162            ErrorCode::NotFound,
14163            ErrorCode::StaleCursor,
14164            ErrorCode::LimitExceeded,
14165            ErrorCode::CapabilityUnavailable,
14166            ErrorCode::TemporarilyUnavailable,
14167            ErrorCode::Internal,
14168        ],
14169        limit_ids: &["request_bytes", "response_bytes", "page_size", "operation_page_size"],
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: "optional_request_index",
14180    },
14181    CommandSemanticContract {
14182        command: Command::WarmVectorIndex,
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::Conflict,
14192            ErrorCode::LimitExceeded,
14193            ErrorCode::CapabilityUnavailable,
14194            ErrorCode::TemporarilyUnavailable,
14195            ErrorCode::Internal,
14196        ],
14197        limit_ids: &[
14198            "request_bytes",
14199            "response_bytes",
14200            "vector_warm_components",
14201            "vector_warm_requests",
14202            "vector_warm_bytes",
14203            "vector_warm_achievements",
14204            "vector_warm_ttl_millis",
14205        ],
14206        effect_class: "read_only",
14207        risk_flags: &[],
14208        capability_family: "data",
14209        retry_safety: "safe",
14210        identity_requirement: "exact_root",
14211        resolver: None,
14212        cancellation: "per_call",
14213        side_effects: &["populates_reconstructible_cache"],
14214        recovery: "retry",
14215        collection_index_ref: "request_index",
14216    },
14217    CommandSemanticContract {
14218        command: Command::EvaluateVectorRecall,
14219        admissible_errors: &[
14220            ErrorCode::Aborted,
14221            ErrorCode::DeadlineExceeded,
14222            ErrorCode::InvalidRequest,
14223            ErrorCode::UnsupportedVersion,
14224            ErrorCode::Unauthenticated,
14225            ErrorCode::PermissionDenied,
14226            ErrorCode::NotFound,
14227            ErrorCode::Conflict,
14228            ErrorCode::LimitExceeded,
14229            ErrorCode::CapabilityUnavailable,
14230            ErrorCode::NotSubmitted,
14231            ErrorCode::SubmittedIndeterminate,
14232            ErrorCode::ExpiredUnknown,
14233            ErrorCode::TemporarilyUnavailable,
14234            ErrorCode::Internal,
14235        ],
14236        limit_ids: &[
14237            "request_bytes",
14238            "response_bytes",
14239            "vector_dimensions",
14240            "vector_query_bytes",
14241            "vector_request_bytes",
14242            "vector_candidates",
14243            "vector_evaluation_queries",
14244            "vector_evaluation_k",
14245            "vector_evaluation_artifact_bytes",
14246        ],
14247        effect_class: "durable_submit",
14248        risk_flags: &[],
14249        capability_family: "diagnostics",
14250        retry_safety: "pre_submit_only",
14251        identity_requirement: "caller_action_id",
14252        resolver: None,
14253        cancellation: "per_call_until_submission_then_resolve",
14254        side_effects: &["commits_authoritative_state"],
14255        recovery: "retry_if_not_submitted",
14256        collection_index_ref: "request_index",
14257    },
14258    CommandSemanticContract {
14259        command: Command::CalibrateVectorStrategy,
14260        admissible_errors: &[
14261            ErrorCode::Aborted,
14262            ErrorCode::DeadlineExceeded,
14263            ErrorCode::InvalidRequest,
14264            ErrorCode::UnsupportedVersion,
14265            ErrorCode::Unauthenticated,
14266            ErrorCode::PermissionDenied,
14267            ErrorCode::NotFound,
14268            ErrorCode::Conflict,
14269            ErrorCode::LimitExceeded,
14270            ErrorCode::CapabilityUnavailable,
14271            ErrorCode::NotSubmitted,
14272            ErrorCode::SubmittedIndeterminate,
14273            ErrorCode::ExpiredUnknown,
14274            ErrorCode::TemporarilyUnavailable,
14275            ErrorCode::Internal,
14276        ],
14277        limit_ids: &[
14278            "request_bytes",
14279            "response_bytes",
14280            "vector_dimensions",
14281            "vector_query_bytes",
14282            "vector_request_bytes",
14283            "vector_candidates",
14284            "vector_evaluation_queries",
14285            "vector_evaluation_k",
14286            "vector_evaluation_profiles",
14287            "vector_evaluation_artifact_bytes",
14288        ],
14289        effect_class: "durable_submit",
14290        risk_flags: &[],
14291        capability_family: "diagnostics",
14292        retry_safety: "pre_submit_only",
14293        identity_requirement: "caller_action_id",
14294        resolver: None,
14295        cancellation: "per_call_until_submission_then_resolve",
14296        side_effects: &["commits_authoritative_state"],
14297        recovery: "retry_if_not_submitted",
14298        collection_index_ref: "request_index",
14299    },
14300    CommandSemanticContract {
14301        command: Command::GetVectorDiagnostic,
14302        admissible_errors: &[
14303            ErrorCode::Aborted,
14304            ErrorCode::DeadlineExceeded,
14305            ErrorCode::InvalidRequest,
14306            ErrorCode::UnsupportedVersion,
14307            ErrorCode::Unauthenticated,
14308            ErrorCode::PermissionDenied,
14309            ErrorCode::NotFound,
14310            ErrorCode::LimitExceeded,
14311            ErrorCode::CapabilityUnavailable,
14312            ErrorCode::TemporarilyUnavailable,
14313            ErrorCode::Internal,
14314        ],
14315        limit_ids: &["request_bytes", "response_bytes"],
14316        effect_class: "read_only",
14317        risk_flags: &[],
14318        capability_family: "diagnostics",
14319        retry_safety: "safe",
14320        identity_requirement: "request_locator",
14321        resolver: None,
14322        cancellation: "per_call",
14323        side_effects: &[],
14324        recovery: "retry",
14325        collection_index_ref: "none",
14326    },
14327    CommandSemanticContract {
14328        command: Command::CreateDiagnostic,
14329        admissible_errors: &[
14330            ErrorCode::Aborted,
14331            ErrorCode::DeadlineExceeded,
14332            ErrorCode::InvalidRequest,
14333            ErrorCode::UnsupportedVersion,
14334            ErrorCode::Unauthenticated,
14335            ErrorCode::PermissionDenied,
14336            ErrorCode::NotFound,
14337            ErrorCode::Conflict,
14338            ErrorCode::LimitExceeded,
14339            ErrorCode::CapabilityUnavailable,
14340            ErrorCode::NotSubmitted,
14341            ErrorCode::SubmittedIndeterminate,
14342            ErrorCode::ExpiredUnknown,
14343            ErrorCode::TemporarilyUnavailable,
14344            ErrorCode::Internal,
14345        ],
14346        limit_ids: &["request_bytes", "response_bytes"],
14347        effect_class: "durable_submit",
14348        risk_flags: &[],
14349        capability_family: "diagnostics",
14350        retry_safety: "pre_submit_only",
14351        identity_requirement: "none",
14352        resolver: None,
14353        cancellation: "per_call_until_submission_then_resolve",
14354        side_effects: &["commits_authoritative_state"],
14355        recovery: "retry_if_not_submitted",
14356        collection_index_ref: "none",
14357    },
14358    CommandSemanticContract {
14359        command: Command::GetDiagnostic,
14360        admissible_errors: &[
14361            ErrorCode::Aborted,
14362            ErrorCode::DeadlineExceeded,
14363            ErrorCode::InvalidRequest,
14364            ErrorCode::UnsupportedVersion,
14365            ErrorCode::Unauthenticated,
14366            ErrorCode::PermissionDenied,
14367            ErrorCode::NotFound,
14368            ErrorCode::LimitExceeded,
14369            ErrorCode::CapabilityUnavailable,
14370            ErrorCode::TemporarilyUnavailable,
14371            ErrorCode::Internal,
14372        ],
14373        limit_ids: &["request_bytes", "response_bytes"],
14374        effect_class: "read_only",
14375        risk_flags: &[],
14376        capability_family: "diagnostics",
14377        retry_safety: "safe",
14378        identity_requirement: "request_locator",
14379        resolver: None,
14380        cancellation: "per_call",
14381        side_effects: &[],
14382        recovery: "retry",
14383        collection_index_ref: "none",
14384    },
14385    CommandSemanticContract {
14386        command: Command::PrepareCollectionExport,
14387        admissible_errors: &[
14388            ErrorCode::Aborted,
14389            ErrorCode::DeadlineExceeded,
14390            ErrorCode::InvalidRequest,
14391            ErrorCode::UnsupportedVersion,
14392            ErrorCode::Unauthenticated,
14393            ErrorCode::PermissionDenied,
14394            ErrorCode::NotFound,
14395            ErrorCode::LimitExceeded,
14396            ErrorCode::CapabilityUnavailable,
14397            ErrorCode::TemporarilyUnavailable,
14398            ErrorCode::Internal,
14399        ],
14400        limit_ids: &[
14401            "request_bytes",
14402            "response_bytes",
14403            "collection_export_bytes",
14404            "portability_prefix_bytes",
14405        ],
14406        effect_class: "prepare",
14407        risk_flags: &[],
14408        capability_family: "portability",
14409        retry_safety: "safe",
14410        identity_requirement: "caller_action_id",
14411        resolver: None,
14412        cancellation: "per_call",
14413        side_effects: &[],
14414        recovery: "retry",
14415        collection_index_ref: "none",
14416    },
14417    CommandSemanticContract {
14418        command: Command::StartCollectionExport,
14419        admissible_errors: &[
14420            ErrorCode::Aborted,
14421            ErrorCode::DeadlineExceeded,
14422            ErrorCode::InvalidRequest,
14423            ErrorCode::UnsupportedVersion,
14424            ErrorCode::Unauthenticated,
14425            ErrorCode::PermissionDenied,
14426            ErrorCode::NotFound,
14427            ErrorCode::Conflict,
14428            ErrorCode::LimitExceeded,
14429            ErrorCode::CapabilityUnavailable,
14430            ErrorCode::NotSubmitted,
14431            ErrorCode::SubmittedIndeterminate,
14432            ErrorCode::ExpiredUnknown,
14433            ErrorCode::TemporarilyUnavailable,
14434            ErrorCode::Internal,
14435        ],
14436        limit_ids: &[
14437            "request_bytes",
14438            "response_bytes",
14439            "collection_export_bytes",
14440            "collection_export_documents",
14441            "portability_prefix_bytes",
14442        ],
14443        effect_class: "durable_submit",
14444        risk_flags: &[],
14445        capability_family: "portability",
14446        retry_safety: "pre_submit_only",
14447        identity_requirement: "caller_action_id",
14448        resolver: Some(Command::ResolveCollectionExport),
14449        cancellation: "per_call_until_submission_then_resolve",
14450        side_effects: &["commits_authoritative_state", "writes_external_artifact"],
14451        recovery: "resolve_with_resolve_collection_export",
14452        collection_index_ref: "none",
14453    },
14454    CommandSemanticContract {
14455        command: Command::ResolveCollectionExport,
14456        admissible_errors: &[
14457            ErrorCode::Aborted,
14458            ErrorCode::DeadlineExceeded,
14459            ErrorCode::InvalidRequest,
14460            ErrorCode::UnsupportedVersion,
14461            ErrorCode::Unauthenticated,
14462            ErrorCode::PermissionDenied,
14463            ErrorCode::NotFound,
14464            ErrorCode::LimitExceeded,
14465            ErrorCode::CapabilityUnavailable,
14466            ErrorCode::TemporarilyUnavailable,
14467            ErrorCode::Internal,
14468        ],
14469        limit_ids: &["request_bytes", "response_bytes", "portability_prefix_bytes"],
14470        effect_class: "read_only",
14471        risk_flags: &[],
14472        capability_family: "portability",
14473        retry_safety: "safe",
14474        identity_requirement: "caller_action_id",
14475        resolver: None,
14476        cancellation: "per_call",
14477        side_effects: &[],
14478        recovery: "retry",
14479        collection_index_ref: "none",
14480    },
14481    CommandSemanticContract {
14482        command: Command::VerifyCollectionExport,
14483        admissible_errors: &[
14484            ErrorCode::Aborted,
14485            ErrorCode::DeadlineExceeded,
14486            ErrorCode::InvalidRequest,
14487            ErrorCode::UnsupportedVersion,
14488            ErrorCode::Unauthenticated,
14489            ErrorCode::PermissionDenied,
14490            ErrorCode::NotFound,
14491            ErrorCode::LimitExceeded,
14492            ErrorCode::CapabilityUnavailable,
14493            ErrorCode::ChecksumMismatch,
14494            ErrorCode::TemporarilyUnavailable,
14495            ErrorCode::Internal,
14496        ],
14497        limit_ids: &[
14498            "request_bytes",
14499            "response_bytes",
14500            "collection_export_bytes",
14501            "portability_prefix_bytes",
14502        ],
14503        effect_class: "read_only",
14504        risk_flags: &[],
14505        capability_family: "portability",
14506        retry_safety: "safe",
14507        identity_requirement: "request_locator",
14508        resolver: None,
14509        cancellation: "per_call",
14510        side_effects: &[],
14511        recovery: "retry",
14512        collection_index_ref: "none",
14513    },
14514    CommandSemanticContract {
14515        command: Command::PrepareCollectionRestore,
14516        admissible_errors: &[
14517            ErrorCode::Aborted,
14518            ErrorCode::DeadlineExceeded,
14519            ErrorCode::InvalidRequest,
14520            ErrorCode::UnsupportedVersion,
14521            ErrorCode::Unauthenticated,
14522            ErrorCode::PermissionDenied,
14523            ErrorCode::NotFound,
14524            ErrorCode::Conflict,
14525            ErrorCode::LimitExceeded,
14526            ErrorCode::CapabilityUnavailable,
14527            ErrorCode::ChecksumMismatch,
14528            ErrorCode::TemporarilyUnavailable,
14529            ErrorCode::Internal,
14530        ],
14531        limit_ids: &[
14532            "request_bytes",
14533            "response_bytes",
14534            "collection_export_bytes",
14535            "portability_prefix_bytes",
14536        ],
14537        effect_class: "prepare",
14538        risk_flags: &[],
14539        capability_family: "portability",
14540        retry_safety: "safe",
14541        identity_requirement: "caller_action_id",
14542        resolver: None,
14543        cancellation: "per_call",
14544        side_effects: &[],
14545        recovery: "retry",
14546        collection_index_ref: "none",
14547    },
14548    CommandSemanticContract {
14549        command: Command::StartCollectionRestore,
14550        admissible_errors: &[
14551            ErrorCode::Aborted,
14552            ErrorCode::DeadlineExceeded,
14553            ErrorCode::InvalidRequest,
14554            ErrorCode::UnsupportedVersion,
14555            ErrorCode::Unauthenticated,
14556            ErrorCode::PermissionDenied,
14557            ErrorCode::NotFound,
14558            ErrorCode::Conflict,
14559            ErrorCode::LimitExceeded,
14560            ErrorCode::CapabilityUnavailable,
14561            ErrorCode::NotSubmitted,
14562            ErrorCode::SubmittedIndeterminate,
14563            ErrorCode::ExpiredUnknown,
14564            ErrorCode::ChecksumMismatch,
14565            ErrorCode::TemporarilyUnavailable,
14566            ErrorCode::Internal,
14567        ],
14568        limit_ids: &[
14569            "request_bytes",
14570            "response_bytes",
14571            "collection_export_bytes",
14572            "collection_export_documents",
14573            "portability_prefix_bytes",
14574        ],
14575        effect_class: "durable_submit",
14576        risk_flags: &[],
14577        capability_family: "portability",
14578        retry_safety: "pre_submit_only",
14579        identity_requirement: "caller_action_id",
14580        resolver: Some(Command::ResolveCollectionRestore),
14581        cancellation: "per_call_until_submission_then_resolve",
14582        side_effects: &["commits_authoritative_state", "creates_destination_owned_data"],
14583        recovery: "resolve_with_resolve_collection_restore",
14584        collection_index_ref: "none",
14585    },
14586    CommandSemanticContract {
14587        command: Command::ResolveCollectionRestore,
14588        admissible_errors: &[
14589            ErrorCode::Aborted,
14590            ErrorCode::DeadlineExceeded,
14591            ErrorCode::InvalidRequest,
14592            ErrorCode::UnsupportedVersion,
14593            ErrorCode::Unauthenticated,
14594            ErrorCode::PermissionDenied,
14595            ErrorCode::NotFound,
14596            ErrorCode::LimitExceeded,
14597            ErrorCode::CapabilityUnavailable,
14598            ErrorCode::TemporarilyUnavailable,
14599            ErrorCode::Internal,
14600        ],
14601        limit_ids: &["request_bytes", "response_bytes", "portability_prefix_bytes"],
14602        effect_class: "read_only",
14603        risk_flags: &[],
14604        capability_family: "portability",
14605        retry_safety: "safe",
14606        identity_requirement: "caller_action_id",
14607        resolver: None,
14608        cancellation: "per_call",
14609        side_effects: &[],
14610        recovery: "retry",
14611        collection_index_ref: "none",
14612    },
14613    CommandSemanticContract {
14614        command: Command::PrepareIndexExport,
14615        admissible_errors: &[
14616            ErrorCode::Aborted,
14617            ErrorCode::DeadlineExceeded,
14618            ErrorCode::InvalidRequest,
14619            ErrorCode::UnsupportedVersion,
14620            ErrorCode::Unauthenticated,
14621            ErrorCode::PermissionDenied,
14622            ErrorCode::NotFound,
14623            ErrorCode::LimitExceeded,
14624            ErrorCode::CapabilityUnavailable,
14625            ErrorCode::TemporarilyUnavailable,
14626            ErrorCode::Internal,
14627        ],
14628        limit_ids: &[
14629            "request_bytes",
14630            "response_bytes",
14631            "index_transfer_bytes",
14632            "index_transfer_records",
14633            "index_transfer_pages",
14634            "portability_prefix_bytes",
14635        ],
14636        effect_class: "prepare",
14637        risk_flags: &[],
14638        capability_family: "portability",
14639        retry_safety: "safe",
14640        identity_requirement: "caller_action_id",
14641        resolver: None,
14642        cancellation: "per_call",
14643        side_effects: &[],
14644        recovery: "retry",
14645        collection_index_ref: "request_index",
14646    },
14647    CommandSemanticContract {
14648        command: Command::StartIndexExport,
14649        admissible_errors: &[
14650            ErrorCode::Aborted,
14651            ErrorCode::DeadlineExceeded,
14652            ErrorCode::InvalidRequest,
14653            ErrorCode::UnsupportedVersion,
14654            ErrorCode::Unauthenticated,
14655            ErrorCode::PermissionDenied,
14656            ErrorCode::NotFound,
14657            ErrorCode::Conflict,
14658            ErrorCode::LimitExceeded,
14659            ErrorCode::CapabilityUnavailable,
14660            ErrorCode::NotSubmitted,
14661            ErrorCode::SubmittedIndeterminate,
14662            ErrorCode::ExpiredUnknown,
14663            ErrorCode::TemporarilyUnavailable,
14664            ErrorCode::Internal,
14665        ],
14666        limit_ids: &[
14667            "request_bytes",
14668            "response_bytes",
14669            "index_transfer_bytes",
14670            "index_transfer_records",
14671            "index_transfer_pages",
14672            "portability_prefix_bytes",
14673        ],
14674        effect_class: "durable_submit",
14675        risk_flags: &[],
14676        capability_family: "portability",
14677        retry_safety: "pre_submit_only",
14678        identity_requirement: "caller_action_id",
14679        resolver: Some(Command::ResolveIndexExport),
14680        cancellation: "per_call_until_submission_then_resolve",
14681        side_effects: &["commits_authoritative_state", "writes_external_artifact"],
14682        recovery: "resolve_with_resolve_index_export",
14683        collection_index_ref: "request_index",
14684    },
14685    CommandSemanticContract {
14686        command: Command::ResolveIndexExport,
14687        admissible_errors: &[
14688            ErrorCode::Aborted,
14689            ErrorCode::DeadlineExceeded,
14690            ErrorCode::InvalidRequest,
14691            ErrorCode::UnsupportedVersion,
14692            ErrorCode::Unauthenticated,
14693            ErrorCode::PermissionDenied,
14694            ErrorCode::NotFound,
14695            ErrorCode::LimitExceeded,
14696            ErrorCode::CapabilityUnavailable,
14697            ErrorCode::ChecksumMismatch,
14698            ErrorCode::TemporarilyUnavailable,
14699            ErrorCode::Internal,
14700        ],
14701        limit_ids: &[
14702            "request_bytes",
14703            "response_bytes",
14704            "index_transfer_bytes",
14705            "index_transfer_pages",
14706            "portability_prefix_bytes",
14707        ],
14708        effect_class: "read_only",
14709        risk_flags: &[],
14710        capability_family: "portability",
14711        retry_safety: "safe",
14712        identity_requirement: "caller_action_id",
14713        resolver: None,
14714        cancellation: "per_call",
14715        side_effects: &[],
14716        recovery: "retry",
14717        collection_index_ref: "request_index",
14718    },
14719    CommandSemanticContract {
14720        command: Command::VerifyIndexExport,
14721        admissible_errors: &[
14722            ErrorCode::Aborted,
14723            ErrorCode::DeadlineExceeded,
14724            ErrorCode::InvalidRequest,
14725            ErrorCode::UnsupportedVersion,
14726            ErrorCode::Unauthenticated,
14727            ErrorCode::PermissionDenied,
14728            ErrorCode::NotFound,
14729            ErrorCode::LimitExceeded,
14730            ErrorCode::CapabilityUnavailable,
14731            ErrorCode::ChecksumMismatch,
14732            ErrorCode::TemporarilyUnavailable,
14733            ErrorCode::Internal,
14734        ],
14735        limit_ids: &[
14736            "request_bytes",
14737            "response_bytes",
14738            "index_transfer_bytes",
14739            "index_transfer_pages",
14740            "portability_prefix_bytes",
14741        ],
14742        effect_class: "read_only",
14743        risk_flags: &[],
14744        capability_family: "portability",
14745        retry_safety: "safe",
14746        identity_requirement: "request_locator",
14747        resolver: None,
14748        cancellation: "per_call",
14749        side_effects: &[],
14750        recovery: "retry",
14751        collection_index_ref: "request_artifact_source_index",
14752    },
14753    CommandSemanticContract {
14754        command: Command::PrepareIndexImport,
14755        admissible_errors: &[
14756            ErrorCode::Aborted,
14757            ErrorCode::DeadlineExceeded,
14758            ErrorCode::InvalidRequest,
14759            ErrorCode::UnsupportedVersion,
14760            ErrorCode::Unauthenticated,
14761            ErrorCode::PermissionDenied,
14762            ErrorCode::NotFound,
14763            ErrorCode::Conflict,
14764            ErrorCode::LimitExceeded,
14765            ErrorCode::CapabilityUnavailable,
14766            ErrorCode::ChecksumMismatch,
14767            ErrorCode::TemporarilyUnavailable,
14768            ErrorCode::Internal,
14769        ],
14770        limit_ids: &[
14771            "request_bytes",
14772            "response_bytes",
14773            "index_transfer_bytes",
14774            "index_transfer_pages",
14775            "portability_prefix_bytes",
14776            "resource_initial_shards",
14777            "resource_target_shard_bytes",
14778            "resource_admission_weight",
14779            "resource_ram_bytes",
14780            "resource_nvme_bytes",
14781            "resource_refresh_millis",
14782            "resource_memtable_bytes",
14783            "resource_parallelism",
14784        ],
14785        effect_class: "prepare",
14786        risk_flags: &[],
14787        capability_family: "portability",
14788        retry_safety: "safe",
14789        identity_requirement: "caller_action_id",
14790        resolver: None,
14791        cancellation: "per_call",
14792        side_effects: &[],
14793        recovery: "retry",
14794        collection_index_ref: "request_destination_name",
14795    },
14796    CommandSemanticContract {
14797        command: Command::StartIndexImport,
14798        admissible_errors: &[
14799            ErrorCode::Aborted,
14800            ErrorCode::DeadlineExceeded,
14801            ErrorCode::InvalidRequest,
14802            ErrorCode::UnsupportedVersion,
14803            ErrorCode::Unauthenticated,
14804            ErrorCode::PermissionDenied,
14805            ErrorCode::NotFound,
14806            ErrorCode::Conflict,
14807            ErrorCode::LimitExceeded,
14808            ErrorCode::CapabilityUnavailable,
14809            ErrorCode::NotSubmitted,
14810            ErrorCode::SubmittedIndeterminate,
14811            ErrorCode::ExpiredUnknown,
14812            ErrorCode::ChecksumMismatch,
14813            ErrorCode::TemporarilyUnavailable,
14814            ErrorCode::Internal,
14815        ],
14816        limit_ids: &[
14817            "request_bytes",
14818            "response_bytes",
14819            "index_transfer_bytes",
14820            "index_transfer_pages",
14821            "portability_prefix_bytes",
14822            "resource_initial_shards",
14823            "resource_target_shard_bytes",
14824            "resource_admission_weight",
14825            "resource_ram_bytes",
14826            "resource_nvme_bytes",
14827            "resource_refresh_millis",
14828            "resource_memtable_bytes",
14829            "resource_parallelism",
14830        ],
14831        effect_class: "durable_submit",
14832        risk_flags: &[],
14833        capability_family: "portability",
14834        retry_safety: "pre_submit_only",
14835        identity_requirement: "caller_action_id",
14836        resolver: Some(Command::ResolveIndexImport),
14837        cancellation: "per_call_until_submission_then_resolve",
14838        side_effects: &["commits_authoritative_state", "creates_destination_owned_data"],
14839        recovery: "resolve_with_resolve_index_import",
14840        collection_index_ref: "request_destination_name",
14841    },
14842    CommandSemanticContract {
14843        command: Command::ResolveIndexImport,
14844        admissible_errors: &[
14845            ErrorCode::Aborted,
14846            ErrorCode::DeadlineExceeded,
14847            ErrorCode::InvalidRequest,
14848            ErrorCode::UnsupportedVersion,
14849            ErrorCode::Unauthenticated,
14850            ErrorCode::PermissionDenied,
14851            ErrorCode::NotFound,
14852            ErrorCode::LimitExceeded,
14853            ErrorCode::CapabilityUnavailable,
14854            ErrorCode::ChecksumMismatch,
14855            ErrorCode::TemporarilyUnavailable,
14856            ErrorCode::Internal,
14857        ],
14858        limit_ids: &[
14859            "request_bytes",
14860            "response_bytes",
14861            "index_transfer_bytes",
14862            "index_transfer_pages",
14863            "portability_prefix_bytes",
14864        ],
14865        effect_class: "read_only",
14866        risk_flags: &[],
14867        capability_family: "portability",
14868        retry_safety: "safe",
14869        identity_requirement: "caller_action_id",
14870        resolver: None,
14871        cancellation: "per_call",
14872        side_effects: &[],
14873        recovery: "retry",
14874        collection_index_ref: "request_destination_name",
14875    },
14876    CommandSemanticContract {
14877        command: Command::ReadArtifactChunk,
14878        admissible_errors: &[
14879            ErrorCode::Aborted,
14880            ErrorCode::DeadlineExceeded,
14881            ErrorCode::InvalidRequest,
14882            ErrorCode::UnsupportedVersion,
14883            ErrorCode::Unauthenticated,
14884            ErrorCode::PermissionDenied,
14885            ErrorCode::NotFound,
14886            ErrorCode::LimitExceeded,
14887            ErrorCode::CapabilityUnavailable,
14888            ErrorCode::ArtifactRangeInvalid,
14889            ErrorCode::ChecksumMismatch,
14890            ErrorCode::TemporarilyUnavailable,
14891            ErrorCode::Internal,
14892        ],
14893        limit_ids: &["request_bytes", "response_bytes", "artifact_chunk_bytes"],
14894        effect_class: "read_only",
14895        risk_flags: &[],
14896        capability_family: "operations",
14897        retry_safety: "safe",
14898        identity_requirement: "none",
14899        resolver: None,
14900        cancellation: "per_call",
14901        side_effects: &[],
14902        recovery: "retry",
14903        collection_index_ref: "none",
14904    },
14905    CommandSemanticContract {
14906        command: Command::ExportUsage,
14907        admissible_errors: &[
14908            ErrorCode::Aborted,
14909            ErrorCode::DeadlineExceeded,
14910            ErrorCode::InvalidRequest,
14911            ErrorCode::UnsupportedVersion,
14912            ErrorCode::Unauthenticated,
14913            ErrorCode::PermissionDenied,
14914            ErrorCode::NotFound,
14915            ErrorCode::StaleCursor,
14916            ErrorCode::RestartBudgetExhausted,
14917            ErrorCode::LimitExceeded,
14918            ErrorCode::CapabilityUnavailable,
14919            ErrorCode::TemporarilyUnavailable,
14920            ErrorCode::Internal,
14921        ],
14922        limit_ids: &["request_bytes", "response_bytes", "page_size"],
14923        effect_class: "read_only",
14924        risk_flags: &[],
14925        capability_family: "usage",
14926        retry_safety: "safe",
14927        identity_requirement: "none",
14928        resolver: None,
14929        cancellation: "per_call",
14930        side_effects: &[],
14931        recovery: "retry",
14932        collection_index_ref: "none",
14933    },
14934    CommandSemanticContract {
14935        command: Command::ExecuteStateRead,
14936        admissible_errors: &[
14937            ErrorCode::Aborted,
14938            ErrorCode::DeadlineExceeded,
14939            ErrorCode::InvalidRequest,
14940            ErrorCode::UnsupportedVersion,
14941            ErrorCode::Unauthenticated,
14942            ErrorCode::PermissionDenied,
14943            ErrorCode::NotFound,
14944            ErrorCode::LimitExceeded,
14945            ErrorCode::CapabilityUnavailable,
14946            ErrorCode::TemporarilyUnavailable,
14947            ErrorCode::Internal,
14948        ],
14949        limit_ids: &[
14950            "request_bytes",
14951            "response_bytes",
14952            "state_command_keys",
14953            "state_command_value_bytes",
14954        ],
14955        effect_class: "read_only",
14956        risk_flags: &[],
14957        capability_family: "data",
14958        retry_safety: "safe",
14959        identity_requirement: "none",
14960        resolver: None,
14961        cancellation: "per_call",
14962        side_effects: &[],
14963        recovery: "retry",
14964        collection_index_ref: "request_index",
14965    },
14966    CommandSemanticContract {
14967        command: Command::PrepareStateWrite,
14968        admissible_errors: &[
14969            ErrorCode::Aborted,
14970            ErrorCode::DeadlineExceeded,
14971            ErrorCode::InvalidRequest,
14972            ErrorCode::UnsupportedVersion,
14973            ErrorCode::Unauthenticated,
14974            ErrorCode::PermissionDenied,
14975            ErrorCode::NotFound,
14976            ErrorCode::LimitExceeded,
14977            ErrorCode::CapabilityUnavailable,
14978            ErrorCode::TemporarilyUnavailable,
14979            ErrorCode::Internal,
14980        ],
14981        limit_ids: &[
14982            "request_bytes",
14983            "response_bytes",
14984            "state_command_keys",
14985            "state_command_value_bytes",
14986        ],
14987        effect_class: "prepare",
14988        risk_flags: &[],
14989        capability_family: "data",
14990        retry_safety: "safe",
14991        identity_requirement: "caller_action_id",
14992        resolver: None,
14993        cancellation: "per_call",
14994        side_effects: &["creates_bounded_preparation"],
14995        recovery: "retry",
14996        collection_index_ref: "request_index",
14997    },
14998    CommandSemanticContract {
14999        command: Command::SubmitStateWrite,
15000        admissible_errors: &[
15001            ErrorCode::Aborted,
15002            ErrorCode::DeadlineExceeded,
15003            ErrorCode::InvalidRequest,
15004            ErrorCode::UnsupportedVersion,
15005            ErrorCode::Unauthenticated,
15006            ErrorCode::PermissionDenied,
15007            ErrorCode::NotFound,
15008            ErrorCode::Conflict,
15009            ErrorCode::LimitExceeded,
15010            ErrorCode::CapabilityUnavailable,
15011            ErrorCode::NotSubmitted,
15012            ErrorCode::SubmittedIndeterminate,
15013            ErrorCode::ExpiredUnknown,
15014            ErrorCode::TemporarilyUnavailable,
15015            ErrorCode::Internal,
15016        ],
15017        limit_ids: &[
15018            "request_bytes",
15019            "response_bytes",
15020            "state_command_keys",
15021            "state_command_value_bytes",
15022        ],
15023        effect_class: "durable_submit",
15024        risk_flags: &[],
15025        capability_family: "data",
15026        retry_safety: "pre_submit_only",
15027        identity_requirement: "request_locator",
15028        resolver: Some(Command::ResolveStateWrite),
15029        cancellation: "per_call_until_submission_then_resolve",
15030        side_effects: &["commits_authoritative_state"],
15031        recovery: "resolve_with_resolve_state_write",
15032        collection_index_ref: "request_index",
15033    },
15034    CommandSemanticContract {
15035        command: Command::ResolveStateWrite,
15036        admissible_errors: &[
15037            ErrorCode::Aborted,
15038            ErrorCode::DeadlineExceeded,
15039            ErrorCode::InvalidRequest,
15040            ErrorCode::UnsupportedVersion,
15041            ErrorCode::Unauthenticated,
15042            ErrorCode::PermissionDenied,
15043            ErrorCode::NotFound,
15044            ErrorCode::LimitExceeded,
15045            ErrorCode::CapabilityUnavailable,
15046            ErrorCode::TemporarilyUnavailable,
15047            ErrorCode::Internal,
15048        ],
15049        limit_ids: &[
15050            "request_bytes",
15051            "response_bytes",
15052            "state_command_keys",
15053            "state_command_value_bytes",
15054        ],
15055        effect_class: "read_only",
15056        risk_flags: &[],
15057        capability_family: "data",
15058        retry_safety: "safe",
15059        identity_requirement: "request_locator",
15060        resolver: None,
15061        cancellation: "per_call",
15062        side_effects: &[],
15063        recovery: "retry",
15064        collection_index_ref: "request_index",
15065    },
15066];
15067#[derive(Clone, Copy, Debug, Eq, PartialEq)]
15068pub struct CommandOutcomeContract {
15069    pub command: Command,
15070    pub possible_submission_states: &'static [&'static str],
15071    pub identity_requirement: &'static str,
15072    pub resolver_command: Option<Command>,
15073    pub cancellation: &'static str,
15074}
15075pub const LODESTONE_API_COMMAND_OUTCOMES: &[CommandOutcomeContract] = &[
15076    CommandOutcomeContract {
15077        command: Command::Discover,
15078        possible_submission_states: &["not_submitted", "resolved"],
15079        identity_requirement: "none",
15080        resolver_command: None,
15081        cancellation: "per_call",
15082    },
15083    CommandOutcomeContract {
15084        command: Command::ListIndexes,
15085        possible_submission_states: &["not_submitted", "resolved"],
15086        identity_requirement: "none",
15087        resolver_command: None,
15088        cancellation: "per_call",
15089    },
15090    CommandOutcomeContract {
15091        command: Command::GetIndex,
15092        possible_submission_states: &["not_submitted", "resolved"],
15093        identity_requirement: "none",
15094        resolver_command: None,
15095        cancellation: "per_call",
15096    },
15097    CommandOutcomeContract {
15098        command: Command::ValidateIndexChange,
15099        possible_submission_states: &["not_submitted", "resolved"],
15100        identity_requirement: "none",
15101        resolver_command: None,
15102        cancellation: "per_call",
15103    },
15104    CommandOutcomeContract {
15105        command: Command::ApplyIndexChange,
15106        possible_submission_states: &["not_submitted", "submitted", "indeterminate", "resolved"],
15107        identity_requirement: "caller_action_id",
15108        resolver_command: None,
15109        cancellation: "per_call_until_submission_then_resolve",
15110    },
15111    CommandOutcomeContract {
15112        command: Command::ApplyAdministrationMutation,
15113        possible_submission_states: &["not_submitted", "submitted", "indeterminate", "resolved"],
15114        identity_requirement: "caller_action_id",
15115        resolver_command: None,
15116        cancellation: "per_call_until_submission_then_resolve",
15117    },
15118    CommandOutcomeContract {
15119        command: Command::ListAliases,
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::GetAlias,
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::ListDataStreams,
15134        possible_submission_states: &["not_submitted", "resolved"],
15135        identity_requirement: "none",
15136        resolver_command: None,
15137        cancellation: "per_call",
15138    },
15139    CommandOutcomeContract {
15140        command: Command::GetDataStream,
15141        possible_submission_states: &["not_submitted", "resolved"],
15142        identity_requirement: "none",
15143        resolver_command: None,
15144        cancellation: "per_call",
15145    },
15146    CommandOutcomeContract {
15147        command: Command::ListComponentTemplates,
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::GetComponentTemplate,
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::ListIndexTemplates,
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::GetIndexTemplate,
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::ListIngestPipelines,
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::GetIngestPipeline,
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::SimulateIngestPipeline,
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::ReprocessByQuery,
15197        possible_submission_states: &[
15198            "not_submitted",
15199            "submitted",
15200            "known_retired",
15201            "indeterminate",
15202            "resolved",
15203        ],
15204        identity_requirement: "caller_action_id",
15205        resolver_command: None,
15206        cancellation: "per_call_until_submission_then_resolve",
15207    },
15208    CommandOutcomeContract {
15209        command: Command::ListLifecyclePolicies,
15210        possible_submission_states: &["not_submitted", "resolved"],
15211        identity_requirement: "none",
15212        resolver_command: None,
15213        cancellation: "per_call",
15214    },
15215    CommandOutcomeContract {
15216        command: Command::GetLifecyclePolicy,
15217        possible_submission_states: &["not_submitted", "resolved"],
15218        identity_requirement: "none",
15219        resolver_command: None,
15220        cancellation: "per_call",
15221    },
15222    CommandOutcomeContract {
15223        command: Command::PrepareCreateIndex,
15224        possible_submission_states: &["not_submitted", "resolved"],
15225        identity_requirement: "server_locator",
15226        resolver_command: None,
15227        cancellation: "per_call",
15228    },
15229    CommandOutcomeContract {
15230        command: Command::PrepareDeleteIndex,
15231        possible_submission_states: &["not_submitted", "resolved"],
15232        identity_requirement: "server_locator",
15233        resolver_command: None,
15234        cancellation: "per_call",
15235    },
15236    CommandOutcomeContract {
15237        command: Command::SubmitCatalogAction,
15238        possible_submission_states: &[
15239            "not_submitted",
15240            "submitted",
15241            "known_retired",
15242            "indeterminate",
15243            "resolved",
15244        ],
15245        identity_requirement: "request_locator",
15246        resolver_command: Some(Command::ResolveCatalogAction),
15247        cancellation: "per_call_until_submission_then_resolve",
15248    },
15249    CommandOutcomeContract {
15250        command: Command::ResolveCatalogAction,
15251        possible_submission_states: &["not_submitted", "resolved"],
15252        identity_requirement: "request_locator",
15253        resolver_command: None,
15254        cancellation: "per_call",
15255    },
15256    CommandOutcomeContract {
15257        command: Command::PrepareReplayableSourceIndex,
15258        possible_submission_states: &["not_submitted", "resolved"],
15259        identity_requirement: "server_locator",
15260        resolver_command: None,
15261        cancellation: "per_call",
15262    },
15263    CommandOutcomeContract {
15264        command: Command::SubmitReplayableSourceIndex,
15265        possible_submission_states: &[
15266            "not_submitted",
15267            "submitted",
15268            "known_retired",
15269            "indeterminate",
15270            "resolved",
15271        ],
15272        identity_requirement: "request_locator",
15273        resolver_command: Some(Command::ResolveCatalogAction),
15274        cancellation: "per_call_until_submission_then_resolve",
15275    },
15276    CommandOutcomeContract {
15277        command: Command::GetReplayableSource,
15278        possible_submission_states: &["not_submitted", "resolved"],
15279        identity_requirement: "none",
15280        resolver_command: None,
15281        cancellation: "per_call",
15282    },
15283    CommandOutcomeContract {
15284        command: Command::ControlReplayableSource,
15285        possible_submission_states: &["not_submitted", "submitted", "indeterminate", "resolved"],
15286        identity_requirement: "none",
15287        resolver_command: None,
15288        cancellation: "per_call_until_submission_then_resolve",
15289    },
15290    CommandOutcomeContract {
15291        command: Command::CloneIndex,
15292        possible_submission_states: &[
15293            "not_submitted",
15294            "submitted",
15295            "known_retired",
15296            "indeterminate",
15297            "resolved",
15298        ],
15299        identity_requirement: "caller_action_id",
15300        resolver_command: Some(Command::CloneIndex),
15301        cancellation: "per_call_until_submission_then_resolve",
15302    },
15303    CommandOutcomeContract {
15304        command: Command::ConfigureHistory,
15305        possible_submission_states: &[
15306            "not_submitted",
15307            "submitted",
15308            "known_retired",
15309            "indeterminate",
15310            "resolved",
15311        ],
15312        identity_requirement: "none",
15313        resolver_command: Some(Command::GetHistory),
15314        cancellation: "per_call_until_submission_then_resolve",
15315    },
15316    CommandOutcomeContract {
15317        command: Command::GetHistory,
15318        possible_submission_states: &["not_submitted", "resolved"],
15319        identity_requirement: "none",
15320        resolver_command: None,
15321        cancellation: "per_call",
15322    },
15323    CommandOutcomeContract {
15324        command: Command::ResolveHistory,
15325        possible_submission_states: &["not_submitted", "resolved"],
15326        identity_requirement: "none",
15327        resolver_command: None,
15328        cancellation: "per_call",
15329    },
15330    CommandOutcomeContract {
15331        command: Command::PlaceHistoryHold,
15332        possible_submission_states: &[
15333            "not_submitted",
15334            "submitted",
15335            "known_retired",
15336            "indeterminate",
15337            "resolved",
15338        ],
15339        identity_requirement: "none",
15340        resolver_command: Some(Command::GetHistory),
15341        cancellation: "per_call_until_submission_then_resolve",
15342    },
15343    CommandOutcomeContract {
15344        command: Command::ReleaseHistoryHold,
15345        possible_submission_states: &[
15346            "not_submitted",
15347            "submitted",
15348            "known_retired",
15349            "indeterminate",
15350            "resolved",
15351        ],
15352        identity_requirement: "none",
15353        resolver_command: Some(Command::GetHistory),
15354        cancellation: "per_call_until_submission_then_resolve",
15355    },
15356    CommandOutcomeContract {
15357        command: Command::PrepareDocumentMutation,
15358        possible_submission_states: &["not_submitted", "resolved"],
15359        identity_requirement: "server_locator",
15360        resolver_command: None,
15361        cancellation: "per_call",
15362    },
15363    CommandOutcomeContract {
15364        command: Command::SubmitDocumentMutation,
15365        possible_submission_states: &[
15366            "not_submitted",
15367            "submitted",
15368            "known_retired",
15369            "indeterminate",
15370            "resolved",
15371        ],
15372        identity_requirement: "request_locator",
15373        resolver_command: Some(Command::ResolveDocumentMutation),
15374        cancellation: "per_call_until_submission_then_resolve",
15375    },
15376    CommandOutcomeContract {
15377        command: Command::PrepareDocumentBulk,
15378        possible_submission_states: &["not_submitted", "resolved"],
15379        identity_requirement: "caller_action_id",
15380        resolver_command: None,
15381        cancellation: "per_call",
15382    },
15383    CommandOutcomeContract {
15384        command: Command::SubmitDocumentBulk,
15385        possible_submission_states: &[
15386            "not_submitted",
15387            "submitted",
15388            "known_retired",
15389            "indeterminate",
15390            "resolved",
15391        ],
15392        identity_requirement: "caller_action_id",
15393        resolver_command: Some(Command::ResolveDocumentBulk),
15394        cancellation: "per_call_until_submission_then_resolve",
15395    },
15396    CommandOutcomeContract {
15397        command: Command::ResolveDocumentBulk,
15398        possible_submission_states: &["not_submitted", "resolved"],
15399        identity_requirement: "caller_action_id",
15400        resolver_command: None,
15401        cancellation: "per_call",
15402    },
15403    CommandOutcomeContract {
15404        command: Command::PrepareAppendBulk,
15405        possible_submission_states: &["not_submitted", "resolved"],
15406        identity_requirement: "caller_action_id",
15407        resolver_command: None,
15408        cancellation: "per_call",
15409    },
15410    CommandOutcomeContract {
15411        command: Command::SubmitAppendBulk,
15412        possible_submission_states: &["not_submitted", "submitted", "indeterminate", "resolved"],
15413        identity_requirement: "request_locator",
15414        resolver_command: Some(Command::ResolveAppendBulk),
15415        cancellation: "per_call_until_submission_then_resolve",
15416    },
15417    CommandOutcomeContract {
15418        command: Command::ResolveAppendBulk,
15419        possible_submission_states: &["not_submitted", "resolved"],
15420        identity_requirement: "request_locator",
15421        resolver_command: None,
15422        cancellation: "per_call",
15423    },
15424    CommandOutcomeContract {
15425        command: Command::ObserveAppendCommitted,
15426        possible_submission_states: &["not_submitted", "resolved"],
15427        identity_requirement: "request_locator",
15428        resolver_command: None,
15429        cancellation: "per_call",
15430    },
15431    CommandOutcomeContract {
15432        command: Command::ResolveDocumentMutation,
15433        possible_submission_states: &["not_submitted", "resolved"],
15434        identity_requirement: "request_locator",
15435        resolver_command: None,
15436        cancellation: "per_call",
15437    },
15438    CommandOutcomeContract {
15439        command: Command::GetDocument,
15440        possible_submission_states: &["not_submitted", "resolved"],
15441        identity_requirement: "none",
15442        resolver_command: None,
15443        cancellation: "per_call",
15444    },
15445    CommandOutcomeContract {
15446        command: Command::Search,
15447        possible_submission_states: &["not_submitted", "resolved"],
15448        identity_requirement: "none",
15449        resolver_command: None,
15450        cancellation: "per_call",
15451    },
15452    CommandOutcomeContract {
15453        command: Command::TraverseRelationships,
15454        possible_submission_states: &["not_submitted", "resolved"],
15455        identity_requirement: "none",
15456        resolver_command: None,
15457        cancellation: "per_call",
15458    },
15459    CommandOutcomeContract {
15460        command: Command::QueryProfiles,
15461        possible_submission_states: &["not_submitted", "resolved"],
15462        identity_requirement: "none",
15463        resolver_command: None,
15464        cancellation: "per_call",
15465    },
15466    CommandOutcomeContract {
15467        command: Command::EvaluateTemporalEvidence,
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::CreateContinuousTemporalEvaluation,
15475        possible_submission_states: &["not_submitted", "submitted", "indeterminate", "resolved"],
15476        identity_requirement: "caller_action_id",
15477        resolver_command: Some(Command::GetContinuousTemporalEvaluation),
15478        cancellation: "per_call_until_submission_then_resolve",
15479    },
15480    CommandOutcomeContract {
15481        command: Command::GetContinuousTemporalEvaluation,
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::PauseContinuousTemporalEvaluation,
15489        possible_submission_states: &["not_submitted", "submitted", "indeterminate", "resolved"],
15490        identity_requirement: "caller_action_id",
15491        resolver_command: Some(Command::GetContinuousTemporalEvaluation),
15492        cancellation: "per_call_until_submission_then_resolve",
15493    },
15494    CommandOutcomeContract {
15495        command: Command::ResumeContinuousTemporalEvaluation,
15496        possible_submission_states: &["not_submitted", "submitted", "indeterminate", "resolved"],
15497        identity_requirement: "caller_action_id",
15498        resolver_command: Some(Command::GetContinuousTemporalEvaluation),
15499        cancellation: "per_call_until_submission_then_resolve",
15500    },
15501    CommandOutcomeContract {
15502        command: Command::ReplaceContinuousTemporalEvaluation,
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::RetireContinuousTemporalEvaluation,
15510        possible_submission_states: &["not_submitted", "submitted", "indeterminate", "resolved"],
15511        identity_requirement: "caller_action_id",
15512        resolver_command: Some(Command::GetContinuousTemporalEvaluation),
15513        cancellation: "per_call_until_submission_then_resolve",
15514    },
15515    CommandOutcomeContract {
15516        command: Command::ReadContinuousTemporalEvidence,
15517        possible_submission_states: &["not_submitted", "resolved"],
15518        identity_requirement: "none",
15519        resolver_command: None,
15520        cancellation: "per_call",
15521    },
15522    CommandOutcomeContract {
15523        command: Command::ValidateSearch,
15524        possible_submission_states: &["not_submitted", "resolved"],
15525        identity_requirement: "none",
15526        resolver_command: None,
15527        cancellation: "per_call",
15528    },
15529    CommandOutcomeContract {
15530        command: Command::OpenPit,
15531        possible_submission_states: &["not_submitted", "submitted", "indeterminate", "resolved"],
15532        identity_requirement: "none",
15533        resolver_command: None,
15534        cancellation: "per_call_until_submission_then_resolve",
15535    },
15536    CommandOutcomeContract {
15537        command: Command::RenewPit,
15538        possible_submission_states: &["not_submitted", "submitted", "indeterminate", "resolved"],
15539        identity_requirement: "none",
15540        resolver_command: None,
15541        cancellation: "per_call_until_submission_then_resolve",
15542    },
15543    CommandOutcomeContract {
15544        command: Command::ClosePit,
15545        possible_submission_states: &["not_submitted", "submitted", "indeterminate", "resolved"],
15546        identity_requirement: "none",
15547        resolver_command: None,
15548        cancellation: "per_call_until_submission_then_resolve",
15549    },
15550    CommandOutcomeContract {
15551        command: Command::ListOperations,
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::GetOperation,
15559        possible_submission_states: &["not_submitted", "resolved"],
15560        identity_requirement: "request_locator",
15561        resolver_command: None,
15562        cancellation: "per_call",
15563    },
15564    CommandOutcomeContract {
15565        command: Command::WaitOperation,
15566        possible_submission_states: &["not_submitted", "resolved"],
15567        identity_requirement: "request_locator",
15568        resolver_command: None,
15569        cancellation: "per_call",
15570    },
15571    CommandOutcomeContract {
15572        command: Command::CancelOperation,
15573        possible_submission_states: &["not_submitted", "submitted", "indeterminate", "resolved"],
15574        identity_requirement: "request_locator",
15575        resolver_command: None,
15576        cancellation: "per_call_until_submission_then_resolve",
15577    },
15578    CommandOutcomeContract {
15579        command: Command::ListAuditEvents,
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::ExportAuditEvents,
15587        possible_submission_states: &["not_submitted", "resolved"],
15588        identity_requirement: "none",
15589        resolver_command: None,
15590        cancellation: "per_call",
15591    },
15592    CommandOutcomeContract {
15593        command: Command::ReserveServiceCredential,
15594        possible_submission_states: &[
15595            "not_submitted",
15596            "submitted",
15597            "known_retired",
15598            "indeterminate",
15599            "resolved",
15600        ],
15601        identity_requirement: "caller_action_id",
15602        resolver_command: Some(Command::ResolveServiceCredentialReservation),
15603        cancellation: "per_call_until_submission_then_resolve",
15604    },
15605    CommandOutcomeContract {
15606        command: Command::ReserveServiceCredentialRotation,
15607        possible_submission_states: &[
15608            "not_submitted",
15609            "submitted",
15610            "known_retired",
15611            "indeterminate",
15612            "resolved",
15613        ],
15614        identity_requirement: "caller_action_id",
15615        resolver_command: Some(Command::ResolveServiceCredentialReservation),
15616        cancellation: "per_call_until_submission_then_resolve",
15617    },
15618    CommandOutcomeContract {
15619        command: Command::ActivateServiceCredential,
15620        possible_submission_states: &[
15621            "not_submitted",
15622            "submitted",
15623            "known_retired",
15624            "indeterminate",
15625            "resolved",
15626        ],
15627        identity_requirement: "server_locator",
15628        resolver_command: Some(Command::ResolveServiceCredentialReservation),
15629        cancellation: "per_call_until_submission_then_resolve",
15630    },
15631    CommandOutcomeContract {
15632        command: Command::ResolveServiceCredentialReservation,
15633        possible_submission_states: &["not_submitted", "resolved"],
15634        identity_requirement: "caller_action_id",
15635        resolver_command: None,
15636        cancellation: "per_call",
15637    },
15638    CommandOutcomeContract {
15639        command: Command::PrepareRevokeServiceCredential,
15640        possible_submission_states: &["not_submitted", "resolved"],
15641        identity_requirement: "server_locator",
15642        resolver_command: None,
15643        cancellation: "per_call",
15644    },
15645    CommandOutcomeContract {
15646        command: Command::RevokeServiceCredential,
15647        possible_submission_states: &[
15648            "not_submitted",
15649            "submitted",
15650            "known_retired",
15651            "indeterminate",
15652            "resolved",
15653        ],
15654        identity_requirement: "request_locator",
15655        resolver_command: Some(Command::ResolveSecurityAction),
15656        cancellation: "per_call_until_submission_then_resolve",
15657    },
15658    CommandOutcomeContract {
15659        command: Command::ResolveSecurityAction,
15660        possible_submission_states: &["not_submitted", "resolved"],
15661        identity_requirement: "request_locator",
15662        resolver_command: None,
15663        cancellation: "per_call",
15664    },
15665    CommandOutcomeContract {
15666        command: Command::GetSecurityRole,
15667        possible_submission_states: &["not_submitted", "resolved"],
15668        identity_requirement: "none",
15669        resolver_command: None,
15670        cancellation: "per_call",
15671    },
15672    CommandOutcomeContract {
15673        command: Command::PrepareRoleAppendAccessChange,
15674        possible_submission_states: &["not_submitted", "resolved"],
15675        identity_requirement: "server_locator",
15676        resolver_command: None,
15677        cancellation: "per_call",
15678    },
15679    CommandOutcomeContract {
15680        command: Command::SubmitRoleAppendAccessChange,
15681        possible_submission_states: &[
15682            "not_submitted",
15683            "submitted",
15684            "known_retired",
15685            "indeterminate",
15686            "resolved",
15687        ],
15688        identity_requirement: "request_locator",
15689        resolver_command: Some(Command::ResolveSecurityAction),
15690        cancellation: "per_call_until_submission_then_resolve",
15691    },
15692    CommandOutcomeContract {
15693        command: Command::ListServiceCredentials,
15694        possible_submission_states: &["not_submitted", "resolved"],
15695        identity_requirement: "none",
15696        resolver_command: None,
15697        cancellation: "per_call",
15698    },
15699    CommandOutcomeContract {
15700        command: Command::GetRuntimeStatus,
15701        possible_submission_states: &["not_submitted", "resolved"],
15702        identity_requirement: "none",
15703        resolver_command: None,
15704        cancellation: "per_call",
15705    },
15706    CommandOutcomeContract {
15707        command: Command::GetResultCacheStatus,
15708        possible_submission_states: &["not_submitted", "resolved"],
15709        identity_requirement: "none",
15710        resolver_command: None,
15711        cancellation: "per_call",
15712    },
15713    CommandOutcomeContract {
15714        command: Command::GetFieldPromotionStatus,
15715        possible_submission_states: &["not_submitted", "resolved"],
15716        identity_requirement: "none",
15717        resolver_command: None,
15718        cancellation: "per_call",
15719    },
15720    CommandOutcomeContract {
15721        command: Command::GetOverloadStatus,
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::ConfigureExternalKey,
15729        possible_submission_states: &["not_submitted", "submitted", "indeterminate", "resolved"],
15730        identity_requirement: "none",
15731        resolver_command: None,
15732        cancellation: "per_call_until_submission_then_resolve",
15733    },
15734    CommandOutcomeContract {
15735        command: Command::RotateExternalKeyBinding,
15736        possible_submission_states: &["not_submitted", "submitted", "indeterminate", "resolved"],
15737        identity_requirement: "none",
15738        resolver_command: None,
15739        cancellation: "per_call_until_submission_then_resolve",
15740    },
15741    CommandOutcomeContract {
15742        command: Command::ConfigureAggregateThenDelete,
15743        possible_submission_states: &["not_submitted", "submitted", "indeterminate", "resolved"],
15744        identity_requirement: "none",
15745        resolver_command: None,
15746        cancellation: "per_call_until_submission_then_resolve",
15747    },
15748    CommandOutcomeContract {
15749        command: Command::GetLifecycleStatus,
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::GetQuota,
15757        possible_submission_states: &["not_submitted", "resolved"],
15758        identity_requirement: "none",
15759        resolver_command: None,
15760        cancellation: "per_call",
15761    },
15762    CommandOutcomeContract {
15763        command: Command::UpdateQuota,
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::GetBinding,
15771        possible_submission_states: &["not_submitted", "resolved"],
15772        identity_requirement: "none",
15773        resolver_command: None,
15774        cancellation: "per_call",
15775    },
15776    CommandOutcomeContract {
15777        command: Command::GetAdmissionStatus,
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::SetAdmission,
15785        possible_submission_states: &["not_submitted", "submitted", "indeterminate", "resolved"],
15786        identity_requirement: "none",
15787        resolver_command: None,
15788        cancellation: "per_call_until_submission_then_resolve",
15789    },
15790    CommandOutcomeContract {
15791        command: Command::GetQuiesceStatus,
15792        possible_submission_states: &["not_submitted", "resolved"],
15793        identity_requirement: "none",
15794        resolver_command: None,
15795        cancellation: "per_call",
15796    },
15797    CommandOutcomeContract {
15798        command: Command::GetDecommissionReadiness,
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::GetUpgradeReadiness,
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::GetMaintenanceStatus,
15813        possible_submission_states: &["not_submitted", "resolved"],
15814        identity_requirement: "none",
15815        resolver_command: None,
15816        cancellation: "per_call",
15817    },
15818    CommandOutcomeContract {
15819        command: Command::WarmVectorIndex,
15820        possible_submission_states: &["not_submitted", "resolved"],
15821        identity_requirement: "exact_root",
15822        resolver_command: None,
15823        cancellation: "per_call",
15824    },
15825    CommandOutcomeContract {
15826        command: Command::EvaluateVectorRecall,
15827        possible_submission_states: &["not_submitted", "submitted", "indeterminate", "resolved"],
15828        identity_requirement: "caller_action_id",
15829        resolver_command: None,
15830        cancellation: "per_call_until_submission_then_resolve",
15831    },
15832    CommandOutcomeContract {
15833        command: Command::CalibrateVectorStrategy,
15834        possible_submission_states: &["not_submitted", "submitted", "indeterminate", "resolved"],
15835        identity_requirement: "caller_action_id",
15836        resolver_command: None,
15837        cancellation: "per_call_until_submission_then_resolve",
15838    },
15839    CommandOutcomeContract {
15840        command: Command::GetVectorDiagnostic,
15841        possible_submission_states: &["not_submitted", "resolved"],
15842        identity_requirement: "request_locator",
15843        resolver_command: None,
15844        cancellation: "per_call",
15845    },
15846    CommandOutcomeContract {
15847        command: Command::CreateDiagnostic,
15848        possible_submission_states: &["not_submitted", "submitted", "indeterminate", "resolved"],
15849        identity_requirement: "none",
15850        resolver_command: None,
15851        cancellation: "per_call_until_submission_then_resolve",
15852    },
15853    CommandOutcomeContract {
15854        command: Command::GetDiagnostic,
15855        possible_submission_states: &["not_submitted", "resolved"],
15856        identity_requirement: "request_locator",
15857        resolver_command: None,
15858        cancellation: "per_call",
15859    },
15860    CommandOutcomeContract {
15861        command: Command::PrepareCollectionExport,
15862        possible_submission_states: &["not_submitted", "resolved"],
15863        identity_requirement: "caller_action_id",
15864        resolver_command: None,
15865        cancellation: "per_call",
15866    },
15867    CommandOutcomeContract {
15868        command: Command::StartCollectionExport,
15869        possible_submission_states: &["not_submitted", "submitted", "indeterminate", "resolved"],
15870        identity_requirement: "caller_action_id",
15871        resolver_command: Some(Command::ResolveCollectionExport),
15872        cancellation: "per_call_until_submission_then_resolve",
15873    },
15874    CommandOutcomeContract {
15875        command: Command::ResolveCollectionExport,
15876        possible_submission_states: &["not_submitted", "resolved", "known_retired"],
15877        identity_requirement: "caller_action_id",
15878        resolver_command: None,
15879        cancellation: "per_call",
15880    },
15881    CommandOutcomeContract {
15882        command: Command::VerifyCollectionExport,
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::PrepareCollectionRestore,
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::StartCollectionRestore,
15897        possible_submission_states: &["not_submitted", "submitted", "indeterminate", "resolved"],
15898        identity_requirement: "caller_action_id",
15899        resolver_command: Some(Command::ResolveCollectionRestore),
15900        cancellation: "per_call_until_submission_then_resolve",
15901    },
15902    CommandOutcomeContract {
15903        command: Command::ResolveCollectionRestore,
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::PrepareIndexExport,
15911        possible_submission_states: &["not_submitted", "resolved"],
15912        identity_requirement: "caller_action_id",
15913        resolver_command: None,
15914        cancellation: "per_call",
15915    },
15916    CommandOutcomeContract {
15917        command: Command::StartIndexExport,
15918        possible_submission_states: &["not_submitted", "submitted", "indeterminate", "resolved"],
15919        identity_requirement: "caller_action_id",
15920        resolver_command: Some(Command::ResolveIndexExport),
15921        cancellation: "per_call_until_submission_then_resolve",
15922    },
15923    CommandOutcomeContract {
15924        command: Command::ResolveIndexExport,
15925        possible_submission_states: &["not_submitted", "resolved", "known_retired"],
15926        identity_requirement: "caller_action_id",
15927        resolver_command: None,
15928        cancellation: "per_call",
15929    },
15930    CommandOutcomeContract {
15931        command: Command::VerifyIndexExport,
15932        possible_submission_states: &["not_submitted", "resolved"],
15933        identity_requirement: "request_locator",
15934        resolver_command: None,
15935        cancellation: "per_call",
15936    },
15937    CommandOutcomeContract {
15938        command: Command::PrepareIndexImport,
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::StartIndexImport,
15946        possible_submission_states: &["not_submitted", "submitted", "indeterminate", "resolved"],
15947        identity_requirement: "caller_action_id",
15948        resolver_command: Some(Command::ResolveIndexImport),
15949        cancellation: "per_call_until_submission_then_resolve",
15950    },
15951    CommandOutcomeContract {
15952        command: Command::ResolveIndexImport,
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::ReadArtifactChunk,
15960        possible_submission_states: &["not_submitted", "resolved"],
15961        identity_requirement: "none",
15962        resolver_command: None,
15963        cancellation: "per_call",
15964    },
15965    CommandOutcomeContract {
15966        command: Command::ExportUsage,
15967        possible_submission_states: &["not_submitted", "resolved"],
15968        identity_requirement: "none",
15969        resolver_command: None,
15970        cancellation: "per_call",
15971    },
15972    CommandOutcomeContract {
15973        command: Command::ExecuteStateRead,
15974        possible_submission_states: &["not_submitted", "resolved"],
15975        identity_requirement: "none",
15976        resolver_command: None,
15977        cancellation: "per_call",
15978    },
15979    CommandOutcomeContract {
15980        command: Command::PrepareStateWrite,
15981        possible_submission_states: &["not_submitted", "resolved"],
15982        identity_requirement: "caller_action_id",
15983        resolver_command: None,
15984        cancellation: "per_call",
15985    },
15986    CommandOutcomeContract {
15987        command: Command::SubmitStateWrite,
15988        possible_submission_states: &[
15989            "not_submitted",
15990            "submitted",
15991            "known_retired",
15992            "indeterminate",
15993            "resolved",
15994        ],
15995        identity_requirement: "request_locator",
15996        resolver_command: Some(Command::ResolveStateWrite),
15997        cancellation: "per_call_until_submission_then_resolve",
15998    },
15999    CommandOutcomeContract {
16000        command: Command::ResolveStateWrite,
16001        possible_submission_states: &["not_submitted", "resolved"],
16002        identity_requirement: "request_locator",
16003        resolver_command: None,
16004        cancellation: "per_call",
16005    },
16006];
16007#[derive(Clone, Copy, Debug, Eq, PartialEq)]
16008pub struct ErrorOutcomeContract {
16009    pub code: ErrorCode,
16010    pub disposition: ErrorDisposition,
16011    pub recovery: RecoveryAction,
16012    pub retry_after_limit_id: Option<&'static str>,
16013    pub recovery_identity: &'static str,
16014}
16015pub const LODESTONE_API_ERROR_OUTCOMES: &[ErrorOutcomeContract] = &[
16016    ErrorOutcomeContract {
16017        code: ErrorCode::Aborted,
16018        disposition: ErrorDisposition::NotSubmitted,
16019        recovery: RecoveryAction::Retry,
16020        retry_after_limit_id: None,
16021        recovery_identity: "request_identity",
16022    },
16023    ErrorOutcomeContract {
16024        code: ErrorCode::Aborted,
16025        disposition: ErrorDisposition::Indeterminate,
16026        recovery: RecoveryAction::Resolve,
16027        retry_after_limit_id: None,
16028        recovery_identity: "request_identity",
16029    },
16030    ErrorOutcomeContract {
16031        code: ErrorCode::DeadlineExceeded,
16032        disposition: ErrorDisposition::NotSubmitted,
16033        recovery: RecoveryAction::Retry,
16034        retry_after_limit_id: None,
16035        recovery_identity: "request_identity",
16036    },
16037    ErrorOutcomeContract {
16038        code: ErrorCode::DeadlineExceeded,
16039        disposition: ErrorDisposition::Indeterminate,
16040        recovery: RecoveryAction::Resolve,
16041        retry_after_limit_id: None,
16042        recovery_identity: "request_identity",
16043    },
16044    ErrorOutcomeContract {
16045        code: ErrorCode::InvalidRequest,
16046        disposition: ErrorDisposition::NotSubmitted,
16047        recovery: RecoveryAction::Stop,
16048        retry_after_limit_id: None,
16049        recovery_identity: "none",
16050    },
16051    ErrorOutcomeContract {
16052        code: ErrorCode::UnsupportedVersion,
16053        disposition: ErrorDisposition::NotSubmitted,
16054        recovery: RecoveryAction::Stop,
16055        retry_after_limit_id: None,
16056        recovery_identity: "none",
16057    },
16058    ErrorOutcomeContract {
16059        code: ErrorCode::Unauthenticated,
16060        disposition: ErrorDisposition::NotSubmitted,
16061        recovery: RecoveryAction::RefreshCredential,
16062        retry_after_limit_id: None,
16063        recovery_identity: "none",
16064    },
16065    ErrorOutcomeContract {
16066        code: ErrorCode::PermissionDenied,
16067        disposition: ErrorDisposition::NotSubmitted,
16068        recovery: RecoveryAction::Stop,
16069        retry_after_limit_id: None,
16070        recovery_identity: "none",
16071    },
16072    ErrorOutcomeContract {
16073        code: ErrorCode::NotFound,
16074        disposition: ErrorDisposition::NotSubmitted,
16075        recovery: RecoveryAction::Stop,
16076        retry_after_limit_id: None,
16077        recovery_identity: "request_identity",
16078    },
16079    ErrorOutcomeContract {
16080        code: ErrorCode::NotFound,
16081        disposition: ErrorDisposition::Resolved,
16082        recovery: RecoveryAction::Stop,
16083        retry_after_limit_id: None,
16084        recovery_identity: "request_identity",
16085    },
16086    ErrorOutcomeContract {
16087        code: ErrorCode::Conflict,
16088        disposition: ErrorDisposition::NotSubmitted,
16089        recovery: RecoveryAction::RefreshPrecondition,
16090        retry_after_limit_id: None,
16091        recovery_identity: "request_identity",
16092    },
16093    ErrorOutcomeContract {
16094        code: ErrorCode::Conflict,
16095        disposition: ErrorDisposition::Resolved,
16096        recovery: RecoveryAction::Stop,
16097        retry_after_limit_id: None,
16098        recovery_identity: "request_identity",
16099    },
16100    ErrorOutcomeContract {
16101        code: ErrorCode::StaleCursor,
16102        disposition: ErrorDisposition::NotSubmitted,
16103        recovery: RecoveryAction::RestartPage,
16104        retry_after_limit_id: None,
16105        recovery_identity: "cursor",
16106    },
16107    ErrorOutcomeContract {
16108        code: ErrorCode::RestartBudgetExhausted,
16109        disposition: ErrorDisposition::NotSubmitted,
16110        recovery: RecoveryAction::Stop,
16111        retry_after_limit_id: None,
16112        recovery_identity: "cursor",
16113    },
16114    ErrorOutcomeContract {
16115        code: ErrorCode::LimitExceeded,
16116        disposition: ErrorDisposition::NotSubmitted,
16117        recovery: RecoveryAction::ReduceRequest,
16118        retry_after_limit_id: None,
16119        recovery_identity: "none",
16120    },
16121    ErrorOutcomeContract {
16122        code: ErrorCode::CapabilityUnavailable,
16123        disposition: ErrorDisposition::NotSubmitted,
16124        recovery: RecoveryAction::Stop,
16125        retry_after_limit_id: None,
16126        recovery_identity: "none",
16127    },
16128    ErrorOutcomeContract {
16129        code: ErrorCode::NotSubmitted,
16130        disposition: ErrorDisposition::NotSubmitted,
16131        recovery: RecoveryAction::RetryAfter,
16132        retry_after_limit_id: Some("retry_after_millis"),
16133        recovery_identity: "request_identity",
16134    },
16135    ErrorOutcomeContract {
16136        code: ErrorCode::SubmittedIndeterminate,
16137        disposition: ErrorDisposition::Indeterminate,
16138        recovery: RecoveryAction::Resolve,
16139        retry_after_limit_id: None,
16140        recovery_identity: "locator_or_caller_action_id",
16141    },
16142    ErrorOutcomeContract {
16143        code: ErrorCode::ExpiredUnknown,
16144        disposition: ErrorDisposition::KnownRetired,
16145        recovery: RecoveryAction::Stop,
16146        retry_after_limit_id: None,
16147        recovery_identity: "locator_or_caller_action_id",
16148    },
16149    ErrorOutcomeContract {
16150        code: ErrorCode::SecretNotEscrowed,
16151        disposition: ErrorDisposition::Resolved,
16152        recovery: RecoveryAction::Resolve,
16153        retry_after_limit_id: None,
16154        recovery_identity: "reservation_action_id",
16155    },
16156    ErrorOutcomeContract {
16157        code: ErrorCode::RetentionGap,
16158        disposition: ErrorDisposition::KnownRetired,
16159        recovery: RecoveryAction::Stop,
16160        retry_after_limit_id: None,
16161        recovery_identity: "cursor_or_locator",
16162    },
16163    ErrorOutcomeContract {
16164        code: ErrorCode::ArtifactRangeInvalid,
16165        disposition: ErrorDisposition::NotSubmitted,
16166        recovery: RecoveryAction::CorrectRange,
16167        retry_after_limit_id: None,
16168        recovery_identity: "artifact_identity",
16169    },
16170    ErrorOutcomeContract {
16171        code: ErrorCode::ChecksumMismatch,
16172        disposition: ErrorDisposition::Resolved,
16173        recovery: RecoveryAction::Stop,
16174        retry_after_limit_id: None,
16175        recovery_identity: "artifact_identity",
16176    },
16177    ErrorOutcomeContract {
16178        code: ErrorCode::TemporarilyUnavailable,
16179        disposition: ErrorDisposition::NotSubmitted,
16180        recovery: RecoveryAction::RetryAfter,
16181        retry_after_limit_id: Some("retry_after_millis"),
16182        recovery_identity: "request_identity",
16183    },
16184    ErrorOutcomeContract {
16185        code: ErrorCode::TemporarilyUnavailable,
16186        disposition: ErrorDisposition::Indeterminate,
16187        recovery: RecoveryAction::Resolve,
16188        retry_after_limit_id: Some("retry_after_millis"),
16189        recovery_identity: "request_identity",
16190    },
16191    ErrorOutcomeContract {
16192        code: ErrorCode::Internal,
16193        disposition: ErrorDisposition::NotSubmitted,
16194        recovery: RecoveryAction::Stop,
16195        retry_after_limit_id: None,
16196        recovery_identity: "request_identity",
16197    },
16198    ErrorOutcomeContract {
16199        code: ErrorCode::Internal,
16200        disposition: ErrorDisposition::Resolved,
16201        recovery: RecoveryAction::Stop,
16202        retry_after_limit_id: None,
16203        recovery_identity: "request_identity",
16204    },
16205    ErrorOutcomeContract {
16206        code: ErrorCode::Internal,
16207        disposition: ErrorDisposition::Indeterminate,
16208        recovery: RecoveryAction::Resolve,
16209        retry_after_limit_id: None,
16210        recovery_identity: "request_identity",
16211    },
16212];
16213#[derive(Clone, Copy, Debug, Eq, PartialEq)]
16214pub struct Limit {
16215    pub id: &'static str,
16216    pub default: u64,
16217    pub maximum: u64,
16218    pub unit: &'static str,
16219}
16220pub const LODESTONE_API_LIMITS: &[Limit] = &[
16221    Limit {
16222        id: "request_bytes",
16223        default: 2097152,
16224        maximum: 2097152,
16225        unit: "bytes",
16226    },
16227    Limit {
16228        id: "response_bytes",
16229        default: 2097152,
16230        maximum: 2097152,
16231        unit: "bytes",
16232    },
16233    Limit {
16234        id: "page_size",
16235        default: 100,
16236        maximum: 1000,
16237        unit: "items",
16238    },
16239    Limit {
16240        id: "catalog_page_size",
16241        default: 100,
16242        maximum: 100,
16243        unit: "items",
16244    },
16245    Limit {
16246        id: "catalog_restart_budget",
16247        default: 8,
16248        maximum: 8,
16249        unit: "restarts",
16250    },
16251    Limit {
16252        id: "query_clauses",
16253        default: 256,
16254        maximum: 1024,
16255        unit: "clauses",
16256    },
16257    Limit {
16258        id: "text_query_bytes",
16259        default: 16384,
16260        maximum: 16384,
16261        unit: "bytes",
16262    },
16263    Limit {
16264        id: "text_query_fields",
16265        default: 64,
16266        maximum: 64,
16267        unit: "fields",
16268    },
16269    Limit {
16270        id: "text_query_slop",
16271        default: 64,
16272        maximum: 64,
16273        unit: "positions",
16274    },
16275    Limit {
16276        id: "text_query_boost",
16277        default: 1024,
16278        maximum: 1024,
16279        unit: "multiplier",
16280    },
16281    Limit {
16282        id: "text_query_fuzzy_expansions",
16283        default: 1024,
16284        maximum: 1024,
16285        unit: "terms",
16286    },
16287    Limit {
16288        id: "text_query_fuzzy_distance",
16289        default: 2,
16290        maximum: 2,
16291        unit: "edits",
16292    },
16293    Limit {
16294        id: "text_query_dictionary_scan_terms",
16295        default: 65536,
16296        maximum: 65536,
16297        unit: "terms",
16298    },
16299    Limit {
16300        id: "text_query_dictionary_scan_bytes",
16301        default: 16777216,
16302        maximum: 16777216,
16303        unit: "bytes",
16304    },
16305    Limit {
16306        id: "text_query_fuzzy_work_units",
16307        default: 2000000,
16308        maximum: 2000000,
16309        unit: "distance_cells",
16310    },
16311    Limit {
16312        id: "aggregation_nodes",
16313        default: 64,
16314        maximum: 256,
16315        unit: "nodes",
16316    },
16317    Limit {
16318        id: "aggregation_buckets",
16319        default: 65536,
16320        maximum: 65536,
16321        unit: "buckets",
16322    },
16323    Limit {
16324        id: "metric_point_bytes",
16325        default: 1048576,
16326        maximum: 1048576,
16327        unit: "bytes",
16328    },
16329    Limit {
16330        id: "metric_attributes",
16331        default: 128,
16332        maximum: 128,
16333        unit: "items",
16334    },
16335    Limit {
16336        id: "metric_attribute_bytes",
16337        default: 65536,
16338        maximum: 65536,
16339        unit: "bytes",
16340    },
16341    Limit {
16342        id: "metric_exemplars",
16343        default: 8,
16344        maximum: 8,
16345        unit: "items",
16346    },
16347    Limit {
16348        id: "metric_histogram_buckets",
16349        default: 4097,
16350        maximum: 4097,
16351        unit: "buckets",
16352    },
16353    Limit {
16354        id: "time_series_grouping_keys",
16355        default: 4,
16356        maximum: 16,
16357        unit: "keys",
16358    },
16359    Limit {
16360        id: "time_series_points",
16361        default: 100000,
16362        maximum: 100000,
16363        unit: "points",
16364    },
16365    Limit {
16366        id: "time_series_series",
16367        default: 10000,
16368        maximum: 10000,
16369        unit: "series",
16370    },
16371    Limit {
16372        id: "time_series_buckets",
16373        default: 65536,
16374        maximum: 65536,
16375        unit: "buckets",
16376    },
16377    Limit {
16378        id: "time_series_results",
16379        default: 65536,
16380        maximum: 65536,
16381        unit: "results",
16382    },
16383    Limit {
16384        id: "time_series_quantiles",
16385        default: 10,
16386        maximum: 100,
16387        unit: "quantiles",
16388    },
16389    Limit {
16390        id: "time_series_state_bytes",
16391        default: 67108864,
16392        maximum: 67108864,
16393        unit: "bytes",
16394    },
16395    Limit {
16396        id: "temporal_inputs",
16397        default: 16,
16398        maximum: 16,
16399        unit: "indexes",
16400    },
16401    Limit {
16402        id: "temporal_pattern_nodes",
16403        default: 64,
16404        maximum: 64,
16405        unit: "nodes",
16406    },
16407    Limit {
16408        id: "temporal_pattern_depth",
16409        default: 16,
16410        maximum: 16,
16411        unit: "levels",
16412    },
16413    Limit {
16414        id: "temporal_pattern_branches",
16415        default: 16,
16416        maximum: 16,
16417        unit: "branches",
16418    },
16419    Limit {
16420        id: "temporal_correlation_keys",
16421        default: 4,
16422        maximum: 4,
16423        unit: "fields",
16424    },
16425    Limit {
16426        id: "temporal_events",
16427        default: 4096,
16428        maximum: 4096,
16429        unit: "events",
16430    },
16431    Limit {
16432        id: "temporal_states",
16433        default: 65536,
16434        maximum: 65536,
16435        unit: "states",
16436    },
16437    Limit {
16438        id: "temporal_captured_events",
16439        default: 256,
16440        maximum: 256,
16441        unit: "events",
16442    },
16443    Limit {
16444        id: "temporal_results",
16445        default: 4096,
16446        maximum: 4096,
16447        unit: "results",
16448    },
16449    Limit {
16450        id: "temporal_state_bytes",
16451        default: 67108864,
16452        maximum: 67108864,
16453        unit: "bytes",
16454    },
16455    Limit {
16456        id: "temporal_interval_nanos",
16457        default: 2678400000000000,
16458        maximum: 2678400000000000,
16459        unit: "nanoseconds",
16460    },
16461    Limit {
16462        id: "relationship_indexes",
16463        default: 4,
16464        maximum: 16,
16465        unit: "indexes",
16466    },
16467    Limit {
16468        id: "relationship_seeds",
16469        default: 16,
16470        maximum: 128,
16471        unit: "entities",
16472    },
16473    Limit {
16474        id: "relationship_filter_values",
16475        default: 16,
16476        maximum: 128,
16477        unit: "values",
16478    },
16479    Limit {
16480        id: "relationship_depth",
16481        default: 4,
16482        maximum: 16,
16483        unit: "levels",
16484    },
16485    Limit {
16486        id: "relationship_fan_out",
16487        default: 256,
16488        maximum: 4096,
16489        unit: "relationships",
16490    },
16491    Limit {
16492        id: "relationship_visited_entities",
16493        default: 10000,
16494        maximum: 65536,
16495        unit: "entities",
16496    },
16497    Limit {
16498        id: "relationship_visited_records",
16499        default: 10000,
16500        maximum: 10000,
16501        unit: "records",
16502    },
16503    Limit {
16504        id: "relationship_returned_records",
16505        default: 10000,
16506        maximum: 10000,
16507        unit: "records",
16508    },
16509    Limit {
16510        id: "relationship_memory_bytes",
16511        default: 67108864,
16512        maximum: 268435456,
16513        unit: "bytes",
16514    },
16515    Limit {
16516        id: "profile_indexes",
16517        default: 4,
16518        maximum: 16,
16519        unit: "indexes",
16520    },
16521    Limit {
16522        id: "profile_filter_values",
16523        default: 16,
16524        maximum: 128,
16525        unit: "values",
16526    },
16527    Limit {
16528        id: "profile_batches",
16529        default: 10000,
16530        maximum: 10000,
16531        unit: "batches",
16532    },
16533    Limit {
16534        id: "profile_samples",
16535        default: 100000,
16536        maximum: 100000,
16537        unit: "samples",
16538    },
16539    Limit {
16540        id: "profile_results",
16541        default: 10000,
16542        maximum: 10000,
16543        unit: "results",
16544    },
16545    Limit {
16546        id: "profile_memory_bytes",
16547        default: 67108864,
16548        maximum: 268435456,
16549        unit: "bytes",
16550    },
16551    Limit {
16552        id: "approximate_cardinality_precision",
16553        default: 12,
16554        maximum: 16,
16555        unit: "index_bits",
16556    },
16557    Limit {
16558        id: "approximate_percentile_precision",
16559        default: 10,
16560        maximum: 12,
16561        unit: "index_bits",
16562    },
16563    Limit {
16564        id: "operation_page_authorities",
16565        default: 7,
16566        maximum: 7,
16567        unit: "authorities",
16568    },
16569    Limit {
16570        id: "artifact_chunk_bytes",
16571        default: 262144,
16572        maximum: 1048576,
16573        unit: "bytes",
16574    },
16575    Limit {
16576        id: "bulk_document_items",
16577        default: 128,
16578        maximum: 1024,
16579        unit: "items",
16580    },
16581    Limit {
16582        id: "bulk_document_bytes",
16583        default: 2097152,
16584        maximum: 2097152,
16585        unit: "bytes",
16586    },
16587    Limit {
16588        id: "state_command_keys",
16589        default: 128,
16590        maximum: 128,
16591        unit: "keys",
16592    },
16593    Limit {
16594        id: "state_command_value_bytes",
16595        default: 1048576,
16596        maximum: 1048576,
16597        unit: "bytes",
16598    },
16599    Limit {
16600        id: "state_write_outcomes",
16601        default: 4096,
16602        maximum: 4096,
16603        unit: "entries",
16604    },
16605    Limit {
16606        id: "exact_decimal_scale",
16607        default: 18,
16608        maximum: 1024,
16609        unit: "decimal_places",
16610    },
16611    Limit {
16612        id: "retry_after_millis",
16613        default: 1000,
16614        maximum: 60000,
16615        unit: "milliseconds",
16616    },
16617    Limit {
16618        id: "mapping_fields",
16619        default: 16384,
16620        maximum: 16384,
16621        unit: "fields",
16622    },
16623    Limit {
16624        id: "search_result_window",
16625        default: 10000,
16626        maximum: 10000,
16627        unit: "items",
16628    },
16629    Limit {
16630        id: "routing_values",
16631        default: 1024,
16632        maximum: 1024,
16633        unit: "items",
16634    },
16635    Limit {
16636        id: "routing_value_bytes",
16637        default: 4096,
16638        maximum: 4096,
16639        unit: "bytes",
16640    },
16641    Limit {
16642        id: "query_recursion_depth",
16643        default: 64,
16644        maximum: 64,
16645        unit: "levels",
16646    },
16647    Limit {
16648        id: "vector_dimensions",
16649        default: 16384,
16650        maximum: 16384,
16651        unit: "dimensions",
16652    },
16653    Limit {
16654        id: "vector_query_bytes",
16655        default: 65536,
16656        maximum: 65536,
16657        unit: "bytes",
16658    },
16659    Limit {
16660        id: "vector_request_bytes",
16661        default: 1048576,
16662        maximum: 1048576,
16663        unit: "bytes",
16664    },
16665    Limit {
16666        id: "vector_candidates",
16667        default: 10000,
16668        maximum: 10000,
16669        unit: "items",
16670    },
16671    Limit {
16672        id: "vector_set_document_vectors",
16673        default: 128,
16674        maximum: 128,
16675        unit: "vectors",
16676    },
16677    Limit {
16678        id: "vector_set_document_bytes",
16679        default: 65536,
16680        maximum: 65536,
16681        unit: "bytes",
16682    },
16683    Limit {
16684        id: "vector_set_query_vectors",
16685        default: 32,
16686        maximum: 32,
16687        unit: "vectors",
16688    },
16689    Limit {
16690        id: "vector_set_query_bytes",
16691        default: 65536,
16692        maximum: 65536,
16693        unit: "bytes",
16694    },
16695    Limit {
16696        id: "retrieval_branches",
16697        default: 16,
16698        maximum: 16,
16699        unit: "branches",
16700    },
16701    Limit {
16702        id: "retrieval_branch_name_bytes",
16703        default: 64,
16704        maximum: 64,
16705        unit: "bytes",
16706    },
16707    Limit {
16708        id: "retrieval_window",
16709        default: 10000,
16710        maximum: 10000,
16711        unit: "items",
16712    },
16713    Limit {
16714        id: "fragment_fields",
16715        default: 4,
16716        maximum: 16,
16717        unit: "fields",
16718    },
16719    Limit {
16720        id: "fragments_per_field",
16721        default: 1,
16722        maximum: 8,
16723        unit: "items",
16724    },
16725    Limit {
16726        id: "fragment_bytes",
16727        default: 150,
16728        maximum: 8192,
16729        unit: "bytes",
16730    },
16731    Limit {
16732        id: "fragment_total_bytes",
16733        default: 65536,
16734        maximum: 65536,
16735        unit: "bytes",
16736    },
16737    Limit {
16738        id: "result_feature_hits",
16739        default: 10,
16740        maximum: 100,
16741        unit: "items",
16742    },
16743    Limit {
16744        id: "result_features",
16745        default: 4,
16746        maximum: 16,
16747        unit: "features",
16748    },
16749    Limit {
16750        id: "diversification_fields",
16751        default: 1,
16752        maximum: 4,
16753        unit: "fields",
16754    },
16755    Limit {
16756        id: "diversification_per_group",
16757        default: 1,
16758        maximum: 64,
16759        unit: "items",
16760    },
16761    Limit {
16762        id: "vector_evaluation_queries",
16763        default: 64,
16764        maximum: 256,
16765        unit: "queries",
16766    },
16767    Limit {
16768        id: "vector_evaluation_k",
16769        default: 10,
16770        maximum: 1000,
16771        unit: "items",
16772    },
16773    Limit {
16774        id: "vector_evaluation_profiles",
16775        default: 3,
16776        maximum: 3,
16777        unit: "profiles",
16778    },
16779    Limit {
16780        id: "vector_evaluation_artifact_bytes",
16781        default: 1048576,
16782        maximum: 1048576,
16783        unit: "bytes",
16784    },
16785    Limit {
16786        id: "vector_warm_components",
16787        default: 2,
16788        maximum: 3,
16789        unit: "components",
16790    },
16791    Limit {
16792        id: "vector_warm_requests",
16793        default: 1024,
16794        maximum: 65536,
16795        unit: "requests",
16796    },
16797    Limit {
16798        id: "vector_warm_bytes",
16799        default: 268435456,
16800        maximum: 1073741824,
16801        unit: "bytes",
16802    },
16803    Limit {
16804        id: "vector_warm_achievements",
16805        default: 1024,
16806        maximum: 10000,
16807        unit: "items",
16808    },
16809    Limit {
16810        id: "vector_warm_ttl_millis",
16811        default: 300000,
16812        maximum: 900000,
16813        unit: "milliseconds",
16814    },
16815    Limit {
16816        id: "operation_page_size",
16817        default: 100,
16818        maximum: 100,
16819        unit: "items",
16820    },
16821    Limit {
16822        id: "operation_wait_attempts",
16823        default: 20,
16824        maximum: 100,
16825        unit: "attempts",
16826    },
16827    Limit {
16828        id: "operation_wait_interval_millis",
16829        default: 100,
16830        maximum: 60000,
16831        unit: "milliseconds",
16832    },
16833    Limit {
16834        id: "resource_initial_shards",
16835        default: 1,
16836        maximum: 4096,
16837        unit: "shards",
16838    },
16839    Limit {
16840        id: "resource_target_shard_bytes",
16841        default: 536870912,
16842        maximum: 1125899906842624,
16843        unit: "bytes",
16844    },
16845    Limit {
16846        id: "resource_admission_weight",
16847        default: 1,
16848        maximum: 1000000,
16849        unit: "weight",
16850    },
16851    Limit {
16852        id: "resource_ram_bytes",
16853        default: 1073741824,
16854        maximum: 1125899906842624,
16855        unit: "bytes",
16856    },
16857    Limit {
16858        id: "resource_nvme_bytes",
16859        default: 2147483648,
16860        maximum: 1125899906842624,
16861        unit: "bytes",
16862    },
16863    Limit {
16864        id: "resource_refresh_millis",
16865        default: 200,
16866        maximum: 604800000,
16867        unit: "milliseconds",
16868    },
16869    Limit {
16870        id: "resource_memtable_bytes",
16871        default: 268435456,
16872        maximum: 1125899906842624,
16873        unit: "bytes",
16874    },
16875    Limit {
16876        id: "resource_parallelism",
16877        default: 1,
16878        maximum: 4096,
16879        unit: "workers",
16880    },
16881    Limit {
16882        id: "collection_export_bytes",
16883        default: 268435456,
16884        maximum: 268435456,
16885        unit: "bytes",
16886    },
16887    Limit {
16888        id: "collection_export_documents",
16889        default: 10000,
16890        maximum: 10000,
16891        unit: "documents",
16892    },
16893    Limit {
16894        id: "index_transfer_bytes",
16895        default: 268435456,
16896        maximum: 268435456,
16897        unit: "bytes",
16898    },
16899    Limit {
16900        id: "index_transfer_records",
16901        default: 10000,
16902        maximum: 10000,
16903        unit: "records",
16904    },
16905    Limit {
16906        id: "index_transfer_pages",
16907        default: 7,
16908        maximum: 7,
16909        unit: "pages",
16910    },
16911    Limit {
16912        id: "portability_prefix_bytes",
16913        default: 512,
16914        maximum: 512,
16915        unit: "bytes",
16916    },
16917];
16918#[derive(Clone, Copy, Debug, Eq, PartialEq)]
16919pub enum JsonError {
16920    DuplicateObjectField,
16921    InvalidScalar,
16922}
16923pub fn validate_semantic_json(value: &JsonValue) -> Result<(), JsonError> {
16924    match value {
16925        JsonValue::I64(item) => item.validate().map_err(|_| JsonError::InvalidScalar),
16926        JsonValue::U64(item) => item.validate().map_err(|_| JsonError::InvalidScalar),
16927        JsonValue::ExactDecimal(item) => item.validate().map_err(|_| JsonError::InvalidScalar),
16928        JsonValue::Approximate(item) => item.validate().map_err(|_| JsonError::InvalidScalar),
16929        JsonValue::Array(items) => items.iter().try_for_each(validate_semantic_json),
16930        JsonValue::Object(fields) => {
16931            let mut names = std::collections::BTreeSet::new();
16932            for field in fields {
16933                if !names.insert(field.name.as_str()) {
16934                    return Err(JsonError::DuplicateObjectField);
16935                }
16936                validate_semantic_json(&field.value)?;
16937            }
16938            Ok(())
16939        }
16940        JsonValue::Null | JsonValue::Bool(_) | JsonValue::String(_) => Ok(()),
16941    }
16942}
16943#[cfg(test)]
16944mod tests {
16945    use super::*;
16946    fn assert_fixture<T>(value: &serde_json::Value) -> Result<(), Box<dyn std::error::Error>>
16947    where
16948        T: serde::de::DeserializeOwned + Serialize,
16949    {
16950        let decoded: T = serde_json::from_value(value.clone())?;
16951        assert_eq!(serde_json::to_value(decoded)?, *value);
16952        Ok(())
16953    }
16954    #[test]
16955    fn every_named_type_has_a_canonical_round_trip_fixture() -> Result<(), Box<dyn std::error::Error>> {
16956        let document: serde_json::Value =
16957            serde_json::from_str(include_str!("../../../tests/native-api/closed-schema.json"))?;
16958        assert_eq!(document["spec_sha256"], LODESTONE_API_SPEC_SHA256);
16959        let fixtures = document["named_types"]
16960            .as_object()
16961            .ok_or("named type fixtures are not an object")?;
16962        assert_eq!(fixtures.len(), LODESTONE_API_TYPE_CONTRACTS.len());
16963        for (name, value) in fixtures {
16964            match name.as_str() {
16965                "cursor" => assert_fixture::<Cursor>(value)?,
16966                "locator" => assert_fixture::<Locator>(value)?,
16967                "resource" => assert_fixture::<Resource>(value)?,
16968                "field_promotion_configuration" => assert_fixture::<FieldPromotionConfiguration>(value)?,
16969                "overload_configuration" => assert_fixture::<OverloadConfiguration>(value)?,
16970                "index_policies" => assert_fixture::<IndexPolicies>(value)?,
16971                "maintenance_budgets" => assert_fixture::<MaintenanceBudgets>(value)?,
16972                "resource_durability_class" => assert_fixture::<ResourceDurabilityClass>(value)?,
16973                "resource_storage_class" => assert_fixture::<ResourceStorageClass>(value)?,
16974                "vector_quality_objective" => assert_fixture::<VectorQualityObjective>(value)?,
16975                "vector_indexing_objective" => assert_fixture::<VectorIndexingObjective>(value)?,
16976                "vector_residency_intent" => assert_fixture::<VectorResidencyIntent>(value)?,
16977                "vector_calibration_binding" => assert_fixture::<VectorCalibrationBinding>(value)?,
16978                "vector_resource_policy" => assert_fixture::<VectorResourcePolicy>(value)?,
16979                "workload_class" => assert_fixture::<WorkloadClass>(value)?,
16980                "index_resource_spec" => assert_fixture::<IndexResourceSpec>(value)?,
16981                "index_summary" => assert_fixture::<IndexSummary>(value)?,
16982                "mapping_mode" => assert_fixture::<MappingMode>(value)?,
16983                "dynamic_mapping_policy" => assert_fixture::<DynamicMappingPolicy>(value)?,
16984                "mapping_analyzer" => assert_fixture::<MappingAnalyzer>(value)?,
16985                "keyword_normalizer" => assert_fixture::<KeywordNormalizer>(value)?,
16986                "vector_metric" => assert_fixture::<VectorMetric>(value)?,
16987                "mapping_scalar" => assert_fixture::<MappingScalar>(value)?,
16988                "sparse_vector_weight_type" => assert_fixture::<SparseVectorWeightType>(value)?,
16989                "mapping_field_type" => assert_fixture::<MappingFieldType>(value)?,
16990                "mapping_field" => assert_fixture::<MappingField>(value)?,
16991                "multi_field_projection" => assert_fixture::<MultiFieldProjection>(value)?,
16992                "analyzer_identity" => assert_fixture::<AnalyzerIdentity>(value)?,
16993                "keyword_limit" => assert_fixture::<KeywordLimit>(value)?,
16994                "profile_privacy_action" => assert_fixture::<ProfilePrivacyAction>(value)?,
16995                "profile_privacy_field" => assert_fixture::<ProfilePrivacyField>(value)?,
16996                "profile_privacy_rule" => assert_fixture::<ProfilePrivacyRule>(value)?,
16997                "profile_privacy_policy" => assert_fixture::<ProfilePrivacyPolicy>(value)?,
16998                "mapping_record_model" => assert_fixture::<MappingRecordModel>(value)?,
16999                "mapping" => assert_fixture::<Mapping>(value)?,
17000                "index_detail" => assert_fixture::<IndexDetail>(value)?,
17001                "source_provider" => assert_fixture::<SourceProvider>(value)?,
17002                "source_decoder" => assert_fixture::<SourceDecoder>(value)?,
17003                "source_replay_guarantees" => assert_fixture::<SourceReplayGuarantees>(value)?,
17004                "source_partition_configuration" => assert_fixture::<SourcePartitionConfiguration>(value)?,
17005                "replayable_source_configuration" => assert_fixture::<ReplayableSourceConfiguration>(value)?,
17006                "source_partition_status" => assert_fixture::<SourcePartitionStatus>(value)?,
17007                "replayable_source_status" => assert_fixture::<ReplayableSourceStatus>(value)?,
17008                "source_control_transition" => assert_fixture::<SourceControlTransition>(value)?,
17009                "history_ledger_precondition" => assert_fixture::<HistoryLedgerPrecondition>(value)?,
17010                "history_retention_policy" => assert_fixture::<HistoryRetentionPolicy>(value)?,
17011                "history_selector" => assert_fixture::<HistorySelector>(value)?,
17012                "history_hold" => assert_fixture::<HistoryHold>(value)?,
17013                "history_status" => assert_fixture::<HistoryStatus>(value)?,
17014                "history_resolution" => assert_fixture::<HistoryResolution>(value)?,
17015                "index_reference" => assert_fixture::<IndexReference>(value)?,
17016                "alias_target" => assert_fixture::<AliasTarget>(value)?,
17017                "alias_summary" => assert_fixture::<AliasSummary>(value)?,
17018                "alias_detail" => assert_fixture::<AliasDetail>(value)?,
17019                "data_stream_summary" => assert_fixture::<DataStreamSummary>(value)?,
17020                "component_template_binding" => assert_fixture::<ComponentTemplateBinding>(value)?,
17021                "index_template_binding" => assert_fixture::<IndexTemplateBinding>(value)?,
17022                "lifecycle_policy_binding" => assert_fixture::<LifecyclePolicyBinding>(value)?,
17023                "data_stream_detail" => assert_fixture::<DataStreamDetail>(value)?,
17024                "component_template_summary" => assert_fixture::<ComponentTemplateSummary>(value)?,
17025                "component_template_detail" => assert_fixture::<ComponentTemplateDetail>(value)?,
17026                "index_template_summary" => assert_fixture::<IndexTemplateSummary>(value)?,
17027                "index_template_detail" => assert_fixture::<IndexTemplateDetail>(value)?,
17028                "ingest_pipeline_summary" => assert_fixture::<IngestPipelineSummary>(value)?,
17029                "ingest_pipeline_detail" => assert_fixture::<IngestPipelineDetail>(value)?,
17030                "ingest_pipeline_selection" => assert_fixture::<IngestPipelineSelection>(value)?,
17031                "lifecycle_policy_summary" => assert_fixture::<LifecyclePolicySummary>(value)?,
17032                "rollover_thresholds" => assert_fixture::<RolloverThresholds>(value)?,
17033                "retention_policy" => assert_fixture::<RetentionPolicy>(value)?,
17034                "lifecycle_policy_detail" => assert_fixture::<LifecyclePolicyDetail>(value)?,
17035                "text_query_operator" => assert_fixture::<TextQueryOperator>(value)?,
17036                "text_query_analyzer" => assert_fixture::<TextQueryAnalyzer>(value)?,
17037                "zero_terms_query" => assert_fixture::<ZeroTermsQuery>(value)?,
17038                "text_query_options" => assert_fixture::<TextQueryOptions>(value)?,
17039                "multi_match_mode" => assert_fixture::<MultiMatchMode>(value)?,
17040                "multi_match_field" => assert_fixture::<MultiMatchField>(value)?,
17041                "multi_match_options" => assert_fixture::<MultiMatchOptions>(value)?,
17042                "sort_order" => assert_fixture::<SortOrder>(value)?,
17043                "sort_mode" => assert_fixture::<SortMode>(value)?,
17044                "missing_order" => assert_fixture::<MissingOrder>(value)?,
17045                "nested_score_mode" => assert_fixture::<NestedScoreMode>(value)?,
17046                "nested_inner_hits" => assert_fixture::<NestedInnerHits>(value)?,
17047                "sort_spec" => assert_fixture::<SortSpec>(value)?,
17048                "query" => assert_fixture::<Query>(value)?,
17049                "dense_retrieval_mode" => assert_fixture::<DenseRetrievalMode>(value)?,
17050                "vector_achieved_mode" => assert_fixture::<VectorAchievedMode>(value)?,
17051                "vector_branch_diagnostics" => assert_fixture::<VectorBranchDiagnostics>(value)?,
17052                "dense_vector_element_type" => assert_fixture::<DenseVectorElementType>(value)?,
17053                "dense_vector_byte_order" => assert_fixture::<DenseVectorByteOrder>(value)?,
17054                "vector_value" => assert_fixture::<VectorValue>(value)?,
17055                "sparse_vector_entry" => assert_fixture::<SparseVectorEntry>(value)?,
17056                "sparse_vector_value" => assert_fixture::<SparseVectorValue>(value)?,
17057                "vector_set_value" => assert_fixture::<VectorSetValue>(value)?,
17058                "vector_evaluation_snapshot" => assert_fixture::<VectorEvaluationSnapshot>(value)?,
17059                "vector_evaluation_query_set" => assert_fixture::<VectorEvaluationQuerySet>(value)?,
17060                "vector_evaluation_budget" => assert_fixture::<VectorEvaluationBudget>(value)?,
17061                "vector_candidate_policy" => assert_fixture::<VectorCandidatePolicy>(value)?,
17062                "vector_calibration_objective" => assert_fixture::<VectorCalibrationObjective>(value)?,
17063                "vector_strategy_profile" => assert_fixture::<VectorStrategyProfile>(value)?,
17064                "vector_evaluation_work" => assert_fixture::<VectorEvaluationWork>(value)?,
17065                "vector_evaluation_error_code" => assert_fixture::<VectorEvaluationErrorCode>(value)?,
17066                "vector_evaluation_error" => assert_fixture::<VectorEvaluationError>(value)?,
17067                "vector_recall_result" => assert_fixture::<VectorRecallResult>(value)?,
17068                "vector_calibration_candidate" => assert_fixture::<VectorCalibrationCandidate>(value)?,
17069                "vector_calibration_result" => assert_fixture::<VectorCalibrationResult>(value)?,
17070                "vector_diagnostic_result" => assert_fixture::<VectorDiagnosticResult>(value)?,
17071                "vector_warm_component" => assert_fixture::<VectorWarmComponent>(value)?,
17072                "vector_warm_state" => assert_fixture::<VectorWarmState>(value)?,
17073                "vector_warm_achievement" => assert_fixture::<VectorWarmAchievement>(value)?,
17074                "vector_warm_result" => assert_fixture::<VectorWarmResult>(value)?,
17075                "dense_retrieval_threshold" => assert_fixture::<DenseRetrievalThreshold>(value)?,
17076                "retrieval_branch" => assert_fixture::<RetrievalBranch>(value)?,
17077                "weighted_rrf_fusion" => assert_fixture::<WeightedRrfFusion>(value)?,
17078                "retrieval_plan" => assert_fixture::<RetrievalPlan>(value)?,
17079                "histogram_bounds" => assert_fixture::<HistogramBounds>(value)?,
17080                "date_histogram_bounds" => assert_fixture::<DateHistogramBounds>(value)?,
17081                "approximation_algorithm" => assert_fixture::<ApproximationAlgorithm>(value)?,
17082                "approximation" => assert_fixture::<Approximation>(value)?,
17083                "percentile_value" => assert_fixture::<PercentileValue>(value)?,
17084                "approximate_percentile_value" => assert_fixture::<ApproximatePercentileValue>(value)?,
17085                "time_series_operator" => assert_fixture::<TimeSeriesOperator>(value)?,
17086                "time_series_missing_data" => assert_fixture::<TimeSeriesMissingData>(value)?,
17087                "time_series_quantile_mode" => assert_fixture::<TimeSeriesQuantileMode>(value)?,
17088                "time_series_bucket_state" => assert_fixture::<TimeSeriesBucketState>(value)?,
17089                "time_series_quantile_value" => assert_fixture::<TimeSeriesQuantileValue>(value)?,
17090                "time_series_value" => assert_fixture::<TimeSeriesValue>(value)?,
17091                "time_series_bucket" => assert_fixture::<TimeSeriesBucket>(value)?,
17092                "relationship_traversal_direction" => assert_fixture::<RelationshipTraversalDirection>(value)?,
17093                "relationship_traversal_filter" => assert_fixture::<RelationshipTraversalFilter>(value)?,
17094                "relationship_traversal_budget" => assert_fixture::<RelationshipTraversalBudget>(value)?,
17095                "traversed_relationship" => assert_fixture::<TraversedRelationship>(value)?,
17096                "profile_query_operation" => assert_fixture::<ProfileQueryOperation>(value)?,
17097                "profile_group_by" => assert_fixture::<ProfileGroupBy>(value)?,
17098                "profile_query_filter" => assert_fixture::<ProfileQueryFilter>(value)?,
17099                "profile_query_budget" => assert_fixture::<ProfileQueryBudget>(value)?,
17100                "profile_query_row" => assert_fixture::<ProfileQueryRow>(value)?,
17101                "temporal_input" => assert_fixture::<TemporalInput>(value)?,
17102                "temporal_pattern" => assert_fixture::<TemporalPattern>(value)?,
17103                "historical_temporal_definition" => assert_fixture::<HistoricalTemporalDefinition>(value)?,
17104                "temporal_evidence_status" => assert_fixture::<TemporalEvidenceStatus>(value)?,
17105                "temporal_source_event" => assert_fixture::<TemporalSourceEvent>(value)?,
17106                "temporal_evidence" => assert_fixture::<TemporalEvidence>(value)?,
17107                "continuous_temporal_start" => assert_fixture::<ContinuousTemporalStart>(value)?,
17108                "continuous_temporal_watermark_policy" => assert_fixture::<ContinuousTemporalWatermarkPolicy>(value)?,
17109                "continuous_temporal_late_data_policy" => assert_fixture::<ContinuousTemporalLateDataPolicy>(value)?,
17110                "continuous_temporal_output" => assert_fixture::<ContinuousTemporalOutput>(value)?,
17111                "continuous_temporal_definition" => assert_fixture::<ContinuousTemporalDefinition>(value)?,
17112                "continuous_temporal_frontier" => assert_fixture::<ContinuousTemporalFrontier>(value)?,
17113                "continuous_temporal_available_frontier" => {
17114                    assert_fixture::<ContinuousTemporalAvailableFrontier>(value)?
17115                }
17116                "continuous_temporal_gap_reason" => assert_fixture::<ContinuousTemporalGapReason>(value)?,
17117                "continuous_temporal_gap" => assert_fixture::<ContinuousTemporalGap>(value)?,
17118                "continuous_temporal_evaluation" => assert_fixture::<ContinuousTemporalEvaluation>(value)?,
17119                "composite_order" => assert_fixture::<CompositeOrder>(value)?,
17120                "composite_source" => assert_fixture::<CompositeSource>(value)?,
17121                "aggregation" => assert_fixture::<Aggregation>(value)?,
17122                "nested_search_hit" => assert_fixture::<NestedSearchHit>(value)?,
17123                "named_nested_inner_hits_result" => assert_fixture::<NamedNestedInnerHitsResult>(value)?,
17124                "fragment_boundary" => assert_fixture::<FragmentBoundary>(value)?,
17125                "fragment_offset_encoding" => assert_fixture::<FragmentOffsetEncoding>(value)?,
17126                "fragment_ranker" => assert_fixture::<FragmentRanker>(value)?,
17127                "fragment_request" => assert_fixture::<FragmentRequest>(value)?,
17128                "search_fragment" => assert_fixture::<SearchFragment>(value)?,
17129                "numeric_feature_transform" => assert_fixture::<NumericFeatureTransform>(value)?,
17130                "numeric_result_feature" => assert_fixture::<NumericResultFeature>(value)?,
17131                "result_feature_request" => assert_fixture::<ResultFeatureRequest>(value)?,
17132                "result_diversification" => assert_fixture::<ResultDiversification>(value)?,
17133                "branch_score_kind" => assert_fixture::<BranchScoreKind>(value)?,
17134                "result_feature" => assert_fixture::<ResultFeature>(value)?,
17135                "search_hit" => assert_fixture::<SearchHit>(value)?,
17136                "aggregation_bucket" => assert_fixture::<AggregationBucket>(value)?,
17137                "aggregation_result" => assert_fixture::<AggregationResult>(value)?,
17138                "shard_counts" => assert_fixture::<ShardCounts>(value)?,
17139                "total_hits_relation" => assert_fixture::<TotalHitsRelation>(value)?,
17140                "search_total" => assert_fixture::<SearchTotal>(value)?,
17141                "search_execution_freshness" => assert_fixture::<SearchExecutionFreshness>(value)?,
17142                "search_freshness" => assert_fixture::<SearchFreshness>(value)?,
17143                "search_degradation_reason" => assert_fixture::<SearchDegradationReason>(value)?,
17144                "search_achievement" => assert_fixture::<SearchAchievement>(value)?,
17145                "search_failure_stage" => assert_fixture::<SearchFailureStage>(value)?,
17146                "search_failure_reason" => assert_fixture::<SearchFailureReason>(value)?,
17147                "collection_shard" => assert_fixture::<CollectionShard>(value)?,
17148                "search_partial_failure" => assert_fixture::<SearchPartialFailure>(value)?,
17149                "artifact" => assert_fixture::<Artifact>(value)?,
17150                "portability_storage_capability" => assert_fixture::<PortabilityStorageCapability>(value)?,
17151                "collection_export_artifact" => assert_fixture::<CollectionExportArtifact>(value)?,
17152                "index_transfer_page" => assert_fixture::<IndexTransferPage>(value)?,
17153                "index_transfer_artifact" => assert_fixture::<IndexTransferArtifact>(value)?,
17154                "search_validation_bound" => assert_fixture::<SearchValidationBound>(value)?,
17155                "search_validation_estimates" => assert_fixture::<SearchValidationEstimates>(value)?,
17156                "search_validation_limit" => assert_fixture::<SearchValidationLimit>(value)?,
17157                "operation_kind" => assert_fixture::<OperationKind>(value)?,
17158                "operation_authority" => assert_fixture::<OperationAuthority>(value)?,
17159                "operation_target" => assert_fixture::<OperationTarget>(value)?,
17160                "operation_state" => assert_fixture::<OperationState>(value)?,
17161                "operation_pending_state" => assert_fixture::<OperationPendingState>(value)?,
17162                "operation_progress_unit" => assert_fixture::<OperationProgressUnit>(value)?,
17163                "operation_progress" => assert_fixture::<OperationProgress>(value)?,
17164                "operation_result" => assert_fixture::<OperationResult>(value)?,
17165                "operation_failure" => assert_fixture::<OperationFailure>(value)?,
17166                "operation_cancellation" => assert_fixture::<OperationCancellation>(value)?,
17167                "operation_retention_state" => assert_fixture::<OperationRetentionState>(value)?,
17168                "operation_retention" => assert_fixture::<OperationRetention>(value)?,
17169                "operation" => assert_fixture::<Operation>(value)?,
17170                "write_durability_boundary" => assert_fixture::<WriteDurabilityBoundary>(value)?,
17171                "write_visibility_mode" => assert_fixture::<WriteVisibilityMode>(value)?,
17172                "write_response_stage" => assert_fixture::<WriteResponseStage>(value)?,
17173                "write_achievement" => assert_fixture::<WriteAchievement>(value)?,
17174                "mutation_commit_position" => assert_fixture::<MutationCommitPosition>(value)?,
17175                "mutation_commit_receipt" => assert_fixture::<MutationCommitReceipt>(value)?,
17176                "mutation_resolver" => assert_fixture::<MutationResolver>(value)?,
17177                "mutation_outcome" => assert_fixture::<MutationOutcome>(value)?,
17178                "submission_state" => assert_fixture::<SubmissionState>(value)?,
17179                "expected_binding" => assert_fixture::<ExpectedBinding>(value)?,
17180                "administration_alias_action" => assert_fixture::<AdministrationAliasAction>(value)?,
17181                "administration_mutation" => assert_fixture::<AdministrationMutation>(value)?,
17182                "administration_outcome" => assert_fixture::<AdministrationOutcome>(value)?,
17183                "index_change_apply_receipt" => assert_fixture::<IndexChangeApplyReceipt>(value)?,
17184                "bulk_document_item" => assert_fixture::<BulkDocumentItem>(value)?,
17185                "bulk_document_item_outcome" => assert_fixture::<BulkDocumentItemOutcome>(value)?,
17186                "bulk_document_outcome" => assert_fixture::<BulkDocumentOutcome>(value)?,
17187                "metric_attribute_value" => assert_fixture::<MetricAttributeValue>(value)?,
17188                "metric_attribute" => assert_fixture::<MetricAttribute>(value)?,
17189                "metric_number" => assert_fixture::<MetricNumber>(value)?,
17190                "metric_temporality" => assert_fixture::<MetricTemporality>(value)?,
17191                "metric_point_kind" => assert_fixture::<MetricPointKind>(value)?,
17192                "metric_exponential_buckets" => assert_fixture::<MetricExponentialBuckets>(value)?,
17193                "metric_data" => assert_fixture::<MetricData>(value)?,
17194                "metric_instrumentation_scope" => assert_fixture::<MetricInstrumentationScope>(value)?,
17195                "metric_exemplar" => assert_fixture::<MetricExemplar>(value)?,
17196                "metric_point" => assert_fixture::<MetricPoint>(value)?,
17197                "entity_ref" => assert_fixture::<EntityRef>(value)?,
17198                "relationship_evidence_ref" => assert_fixture::<RelationshipEvidenceRef>(value)?,
17199                "relationship_directionality" => assert_fixture::<RelationshipDirectionality>(value)?,
17200                "relationship_record" => assert_fixture::<RelationshipRecord>(value)?,
17201                "profile_label" => assert_fixture::<ProfileLabel>(value)?,
17202                "profile_sample_type" => assert_fixture::<ProfileSampleType>(value)?,
17203                "profile_mapping" => assert_fixture::<ProfileMapping>(value)?,
17204                "profile_function" => assert_fixture::<ProfileFunction>(value)?,
17205                "profile_line" => assert_fixture::<ProfileLine>(value)?,
17206                "profile_location" => assert_fixture::<ProfileLocation>(value)?,
17207                "profile_stack" => assert_fixture::<ProfileStack>(value)?,
17208                "profile_sample" => assert_fixture::<ProfileSample>(value)?,
17209                "profile_instrumentation_scope" => assert_fixture::<ProfileInstrumentationScope>(value)?,
17210                "profile_batch" => assert_fixture::<ProfileBatch>(value)?,
17211                "native_record" => assert_fixture::<NativeRecord>(value)?,
17212                "retained_append_item" => assert_fixture::<RetainedAppendItem>(value)?,
17213                "retained_append_state" => assert_fixture::<RetainedAppendState>(value)?,
17214                "retained_append_retry_safety" => assert_fixture::<RetainedAppendRetrySafety>(value)?,
17215                "retained_append_item_outcome" => assert_fixture::<RetainedAppendItemOutcome>(value)?,
17216                "retained_append_bulk_outcome" => assert_fixture::<RetainedAppendBulkOutcome>(value)?,
17217                "retained_append_observation_state" => assert_fixture::<RetainedAppendObservationState>(value)?,
17218                "retained_append_observation_outcome" => assert_fixture::<RetainedAppendObservationOutcome>(value)?,
17219                "binary_value" => assert_fixture::<BinaryValue>(value)?,
17220                "state_hash_field" => assert_fixture::<StateHashField>(value)?,
17221                "state_set_entry" => assert_fixture::<StateSetEntry>(value)?,
17222                "state_set_condition" => assert_fixture::<StateSetCondition>(value)?,
17223                "state_operation" => assert_fixture::<StateOperation>(value)?,
17224                "state_optional_value" => assert_fixture::<StateOptionalValue>(value)?,
17225                "state_command_result" => assert_fixture::<StateCommandResult>(value)?,
17226                "state_write_resolution" => assert_fixture::<StateWriteResolution>(value)?,
17227                "service_credential_reservation" => assert_fixture::<ServiceCredentialReservation>(value)?,
17228                "subscription_metadata_field" => assert_fixture::<SubscriptionMetadataField>(value)?,
17229                "subscription_field" => assert_fixture::<SubscriptionField>(value)?,
17230                "subscription_filter" => assert_fixture::<SubscriptionFilter>(value)?,
17231                "subscription_cursor_entry" => assert_fixture::<SubscriptionCursorEntry>(value)?,
17232                "subscription_route" => assert_fixture::<SubscriptionRoute>(value)?,
17233                "subscription_start_position" => assert_fixture::<SubscriptionStartPosition>(value)?,
17234                "subscription_start" => assert_fixture::<SubscriptionStart>(value)?,
17235                "subscription_accepted" => assert_fixture::<SubscriptionAccepted>(value)?,
17236                "subscription_writer_fence" => assert_fixture::<SubscriptionWriterFence>(value)?,
17237                "subscription_event" => assert_fixture::<SubscriptionEvent>(value)?,
17238                "subscription_heartbeat" => assert_fixture::<SubscriptionHeartbeat>(value)?,
17239                "subscription_gap" => assert_fixture::<SubscriptionGap>(value)?,
17240                "subscription_terminal_reason" => assert_fixture::<SubscriptionTerminalReason>(value)?,
17241                "subscription_terminal" => assert_fixture::<SubscriptionTerminal>(value)?,
17242                "subscription_frame" => assert_fixture::<SubscriptionFrame>(value)?,
17243                "stream_binding" => assert_fixture::<StreamBinding>(value)?,
17244                "capability_grant" => assert_fixture::<CapabilityGrant>(value)?,
17245                "protocol_limit" => assert_fixture::<ProtocolLimit>(value)?,
17246                "document_mutation_condition" => assert_fixture::<DocumentMutationCondition>(value)?,
17247                "audit_adapter" => assert_fixture::<AuditAdapter>(value)?,
17248                "audit_decision" => assert_fixture::<AuditDecision>(value)?,
17249                "audit_outcome" => assert_fixture::<AuditOutcome>(value)?,
17250                "audit_detail" => assert_fixture::<AuditDetail>(value)?,
17251                "audit_gap_reason" => assert_fixture::<AuditGapReason>(value)?,
17252                "audit_event" => assert_fixture::<AuditEvent>(value)?,
17253                "audit_gap" => assert_fixture::<AuditGap>(value)?,
17254                "audit_stream_state" => assert_fixture::<AuditStreamState>(value)?,
17255                "service_credential_grant" => assert_fixture::<ServiceCredentialGrant>(value)?,
17256                "service_credential_summary" => assert_fixture::<ServiceCredentialSummary>(value)?,
17257                "security_role" => assert_fixture::<SecurityRole>(value)?,
17258                "role_append_scope_change" => assert_fixture::<RoleAppendScopeChange>(value)?,
17259                "role_append_access_preparation" => assert_fixture::<RoleAppendAccessPreparation>(value)?,
17260                "security_action_outcome" => assert_fixture::<SecurityActionOutcome>(value)?,
17261                "maintenance_work_state" => assert_fixture::<MaintenanceWorkState>(value)?,
17262                "maintenance_attempt_state" => assert_fixture::<MaintenanceAttemptState>(value)?,
17263                "maintenance_failure_class" => assert_fixture::<MaintenanceFailureClass>(value)?,
17264                "maintenance_failure_class_count" => assert_fixture::<MaintenanceFailureClassCount>(value)?,
17265                "maintenance_attempt_observation" => assert_fixture::<MaintenanceAttemptObservation>(value)?,
17266                "maintenance_task_scope" => assert_fixture::<MaintenanceTaskScope>(value)?,
17267                "maintenance_task_status" => assert_fixture::<MaintenanceTaskStatus>(value)?,
17268                "maintenance_status_aggregate" => assert_fixture::<MaintenanceStatusAggregate>(value)?,
17269                "runtime_status_detail" => assert_fixture::<RuntimeStatusDetail>(value)?,
17270                "result_cache_status" => assert_fixture::<ResultCacheStatus>(value)?,
17271                "field_promotion_status" => assert_fixture::<FieldPromotionStatus>(value)?,
17272                "overload_shard_status" => assert_fixture::<OverloadShardStatus>(value)?,
17273                "external_key_binding" => assert_fixture::<ExternalKeyBinding>(value)?,
17274                "rollup_measure" => assert_fixture::<RollupMeasure>(value)?,
17275                "aggregate_then_delete_policy" => assert_fixture::<AggregateThenDeletePolicy>(value)?,
17276                "lifecycle_binding_status" => assert_fixture::<LifecycleBindingStatus>(value)?,
17277                "lifecycle_rollup_status" => assert_fixture::<LifecycleRollupStatus>(value)?,
17278                "lifecycle_status" => assert_fixture::<LifecycleStatus>(value)?,
17279                "quota_limit" => assert_fixture::<QuotaLimit>(value)?,
17280                "quota_consumption" => assert_fixture::<QuotaConsumption>(value)?,
17281                "quota_update" => assert_fixture::<QuotaUpdate>(value)?,
17282                "storage_overall_posture" => assert_fixture::<StorageOverallPosture>(value)?,
17283                "storage_profile_role" => assert_fixture::<StorageProfileRole>(value)?,
17284                "storage_provider_posture" => assert_fixture::<StorageProviderPosture>(value)?,
17285                "storage_backend_service_class" => assert_fixture::<StorageBackendServiceClass>(value)?,
17286                "storage_profile_role_binding" => assert_fixture::<StorageProfileRoleBinding>(value)?,
17287                "storage_profile_attestation" => assert_fixture::<StorageProfileAttestation>(value)?,
17288                "storage_profile_expectation" => assert_fixture::<StorageProfileExpectation>(value)?,
17289                "core_binding" => assert_fixture::<CoreBinding>(value)?,
17290                "readiness_observation" => assert_fixture::<ReadinessObservation>(value)?,
17291                "usage_dimension" => assert_fixture::<UsageDimension>(value)?,
17292                "physical_usage_value" => assert_fixture::<PhysicalUsageValue>(value)?,
17293                "core_usage_units" => assert_fixture::<CoreUsageUnits>(value)?,
17294                "core_usage_correction" => assert_fixture::<CoreUsageCorrection>(value)?,
17295                "response_meta" => assert_fixture::<ResponseMeta>(value)?,
17296                "error_disposition" => assert_fixture::<ErrorDisposition>(value)?,
17297                "recovery_action" => assert_fixture::<RecoveryAction>(value)?,
17298                "limit_class" => assert_fixture::<LimitClass>(value)?,
17299                "error_detail" => assert_fixture::<ErrorDetail>(value)?,
17300                "connection_profile" => assert_fixture::<ConnectionProfile>(value)?,
17301                _ => return Err("fixture names an unknown generated type".into()),
17302            }
17303        }
17304        Ok(())
17305    }
17306    #[test]
17307    fn every_aggregation_variant_has_a_canonical_fixture() -> Result<(), Box<dyn std::error::Error>> {
17308        let document: serde_json::Value =
17309            serde_json::from_str(include_str!("../../../tests/native-api/closed-schema.json"))?;
17310        let fixtures = document["aggregation_variants"]
17311            .as_object()
17312            .ok_or("aggregation fixtures are not an object")?;
17313        assert_eq!(fixtures.len(), 17);
17314        for value in fixtures.values() {
17315            assert_fixture::<Aggregation>(value)?;
17316        }
17317        Ok(())
17318    }
17319    #[test]
17320    fn every_versioned_union_variant_has_a_canonical_fixture() -> Result<(), Box<dyn std::error::Error>> {
17321        let document: serde_json::Value =
17322            serde_json::from_str(include_str!("../../../tests/native-api/closed-schema.json"))?;
17323        let fixtures = document["versioned_union_variants"]
17324            .as_object()
17325            .ok_or("versioned union fixtures are not an object")?;
17326        assert_eq!(fixtures.len(), 6);
17327        for (name, value) in fixtures {
17328            match name.as_str() {
17329                "mapping_field_type.vector" => assert_fixture::<MappingFieldType>(value)?,
17330                "mapping_field_type.sparse_vector" => assert_fixture::<MappingFieldType>(value)?,
17331                "mapping_field_type.vector_set" => assert_fixture::<MappingFieldType>(value)?,
17332                "mapping_record_model.metric_v1" => assert_fixture::<MappingRecordModel>(value)?,
17333                "mapping_record_model.relationship_v1" => assert_fixture::<MappingRecordModel>(value)?,
17334                "mapping_record_model.profile_v1" => assert_fixture::<MappingRecordModel>(value)?,
17335                _ => return Err("fixture names an unknown versioned union variant".into()),
17336            }
17337        }
17338        Ok(())
17339    }
17340    #[test]
17341    fn exact_scalar_canonicality_is_closed() {
17342        assert_eq!(
17343            U64 {
17344                value: u64::MAX.to_string()
17345            }
17346            .validate(),
17347            Ok(())
17348        );
17349        assert_eq!(
17350            I64 {
17351                value: i64::MIN.to_string()
17352            }
17353            .validate(),
17354            Ok(())
17355        );
17356        assert_eq!(U64 { value: "01".to_owned() }.validate(), Err(ScalarError::InvalidU64));
17357        assert_eq!(
17358            ExactDecimal {
17359                coefficient: "12345".to_owned(),
17360                scale: 2
17361            }
17362            .validate(),
17363            Ok(())
17364        );
17365        assert_eq!(
17366            ExactDecimal {
17367                coefficient: "123450".to_owned(),
17368                scale: 3
17369            }
17370            .validate(),
17371            Err(ScalarError::InvalidDecimal)
17372        );
17373        assert_eq!(
17374            ExactDecimal {
17375                coefficient: "1".to_owned(),
17376                scale: 1_025
17377            }
17378            .validate(),
17379            Err(ScalarError::InvalidDecimal)
17380        );
17381    }
17382    #[test]
17383    fn scalar_decoders_refuse_numbers_and_noncanonical_strings() {
17384        assert!(serde_json::from_str::<U64>("9007199254740993").is_err());
17385        assert!(serde_json::from_str::<U64>(r#""01""#).is_err());
17386        assert!(serde_json::from_str::<Identity>(r#""0123456789ABCDEF0123456789ABCDEF""#).is_err());
17387        assert!(serde_json::from_str::<Digest>(r#""0123456789abcdef0123456789abcdef""#).is_err());
17388        assert!(serde_json::from_str::<ExactDecimal>(r#"{"coefficient":"123450","scale":3}"#).is_err());
17389        assert!(serde_json::from_str::<ApproximateNumber>(r#""1.0""#).is_err());
17390    }
17391    #[test]
17392    fn semantic_json_rejects_duplicate_fields() {
17393        let value = JsonValue::Object(vec![
17394            JsonField {
17395                name: "x".to_owned(),
17396                value: JsonValue::Null,
17397            },
17398            JsonField {
17399                name: "x".to_owned(),
17400                value: JsonValue::Bool(true),
17401            },
17402        ]);
17403        assert_eq!(validate_semantic_json(&value), Err(JsonError::DuplicateObjectField));
17404    }
17405    #[test]
17406    fn strict_generated_shapes_refuse_malformed_duplicate_unknown_field_and_tag() {
17407        assert!(serde_json::from_str::<DiscoverRequest>(r#"{"unexpected":true}"#).is_err());
17408        assert!(serde_json::from_str::<Cursor>(r#"{"value":"a","value":"b"}"#).is_err());
17409        assert!(serde_json::from_str::<Query>(r#"{"kind":"future_query"}"#).is_err());
17410        assert!(serde_json::from_str::<Cursor>(r#"{"value":1}"#).is_err());
17411    }
17412    fn admitted_error_detail(code: ErrorCode) -> ErrorDetail {
17413        match code {
17414            ErrorCode::Aborted => ErrorDetail::Aborted {
17415                reason: "test".to_owned(),
17416            },
17417            ErrorCode::DeadlineExceeded => ErrorDetail::DeadlineExceeded,
17418            ErrorCode::InvalidRequest => ErrorDetail::InvalidRequest {
17419                field: None,
17420                reason: "test".to_owned(),
17421            },
17422            ErrorCode::UnsupportedVersion => ErrorDetail::UnsupportedVersion {
17423                observed: 1,
17424                maximum_supported: 1,
17425            },
17426            ErrorCode::Unauthenticated => ErrorDetail::Unauthenticated,
17427            ErrorCode::PermissionDenied => ErrorDetail::PermissionDenied {
17428                action: None,
17429                workload_class: None,
17430            },
17431            ErrorCode::NotFound => ErrorDetail::NotFound { resource: None },
17432            ErrorCode::Conflict => ErrorDetail::Conflict {
17433                expected_revision: None,
17434                observed_revision: None,
17435            },
17436            ErrorCode::StaleCursor => ErrorDetail::StaleCursor { restart_count: 0 },
17437            ErrorCode::RestartBudgetExhausted => ErrorDetail::RestartBudgetExhausted { maximum_restarts: 0 },
17438            ErrorCode::LimitExceeded => ErrorDetail::LimitExceeded {
17439                class: LimitClass::RequestBound,
17440                limit_id: "test".to_owned(),
17441                maximum: U64 { value: "0".to_owned() },
17442            },
17443            ErrorCode::CapabilityUnavailable => ErrorDetail::CapabilityUnavailable { capability: None },
17444            ErrorCode::NotSubmitted => ErrorDetail::NotSubmitted {
17445                retry_after_millis: None,
17446            },
17447            ErrorCode::SubmittedIndeterminate => ErrorDetail::SubmittedIndeterminate { locator: None },
17448            ErrorCode::ExpiredUnknown => ErrorDetail::ExpiredUnknown { locator: None },
17449            ErrorCode::SecretNotEscrowed => ErrorDetail::SecretNotEscrowed,
17450            ErrorCode::RetentionGap => ErrorDetail::RetentionGap {
17451                retired_through: U64 { value: "0".to_owned() },
17452            },
17453            ErrorCode::ArtifactRangeInvalid => ErrorDetail::ArtifactRangeInvalid {
17454                maximum_bytes: U64 { value: "0".to_owned() },
17455            },
17456            ErrorCode::ChecksumMismatch => ErrorDetail::ChecksumMismatch {
17457                expected: Digest { value: "0".repeat(64) },
17458                observed: Digest { value: "0".repeat(64) },
17459            },
17460            ErrorCode::TemporarilyUnavailable => ErrorDetail::TemporarilyUnavailable {
17461                retry_after_millis: None,
17462            },
17463            ErrorCode::Internal => ErrorDetail::Internal,
17464        }
17465    }
17466    #[test]
17467    fn every_admitted_error_outcome_is_constructible_and_invalid_combinations_fail_closed() {
17468        let mut codes = std::collections::BTreeSet::new();
17469        for contract in LODESTONE_API_ERROR_OUTCOMES {
17470            codes.insert(format!("{:?}", contract.code));
17471            assert_eq!(
17472                ErrorBody::try_new(
17473                    contract.code,
17474                    "test".to_owned(),
17475                    contract.disposition,
17476                    contract.recovery,
17477                    admitted_error_detail(contract.code)
17478                ),
17479                Ok(ErrorBody {
17480                    code: contract.code,
17481                    message: "test".to_owned(),
17482                    disposition: contract.disposition,
17483                    recovery: contract.recovery,
17484                    details: admitted_error_detail(contract.code)
17485                })
17486            );
17487        }
17488        assert_eq!(codes.len(), 21);
17489        assert_eq!(
17490            ErrorBody::try_new(
17491                ErrorCode::Aborted,
17492                "test".to_owned(),
17493                ErrorDisposition::NotSubmitted,
17494                RecoveryAction::Stop,
17495                admitted_error_detail(ErrorCode::Aborted)
17496            ),
17497            Err(ErrorShapeError::OutcomeMismatch)
17498        );
17499        assert_eq!(
17500            ErrorBody::try_new(
17501                ErrorCode::Aborted,
17502                "test".to_owned(),
17503                ErrorDisposition::NotSubmitted,
17504                RecoveryAction::Retry,
17505                ErrorDetail::Internal
17506            ),
17507            Err(ErrorShapeError::DetailCodeMismatch)
17508        );
17509        assert_eq!(
17510            ErrorBody::try_new(
17511                ErrorCode::TemporarilyUnavailable,
17512                "test".to_owned(),
17513                ErrorDisposition::NotSubmitted,
17514                RecoveryAction::RetryAfter,
17515                ErrorDetail::TemporarilyUnavailable {
17516                    retry_after_millis: Some(U64 {
17517                        value: "60001".to_owned()
17518                    })
17519                }
17520            ),
17521            Err(ErrorShapeError::RetryAfterOutOfRange)
17522        );
17523    }
17524    #[test]
17525    fn registries_match_the_idl() {
17526        assert_eq!(LODESTONE_API_COMMAND_CONTRACTS.len(), 120);
17527        assert_eq!(LODESTONE_API_COMMAND_SEMANTICS.len(), 120);
17528        assert_eq!(LODESTONE_API_COMMAND_OUTCOMES.len(), 120);
17529        assert_eq!(LODESTONE_API_ERROR_CODES.len(), 21);
17530        assert_eq!(LODESTONE_API_ERROR_OUTCOMES.len(), 28);
17531        assert_eq!(LODESTONE_API_TYPE_CONTRACTS.len(), 334);
17532        assert_eq!(LODESTONE_API_STREAM_CONTRACTS.len(), 1);
17533        assert_eq!(LODESTONE_API_LIMITS.len(), 116);
17534        assert_eq!(LODESTONE_API_CLUSTER_CONTROL_ACTIONS.len(), 23);
17535        assert_eq!(LODESTONE_API_CLUSTER_CONTROL_TYPES.len(), 10);
17536    }
17537    #[test]
17538    fn mutation_outcome_metadata_matches_submission_boundaries() {
17539        for (command, outcome) in LODESTONE_API_COMMAND_CONTRACTS
17540            .iter()
17541            .zip(LODESTONE_API_COMMAND_OUTCOMES)
17542        {
17543            assert_eq!(command.command, outcome.command);
17544            let submits = !matches!(command.mutation, "read_only" | "read_only_prepare" | "catalog_prepare");
17545            assert_eq!(outcome.possible_submission_states.contains(&"submitted"), submits);
17546            assert_eq!(outcome.possible_submission_states.contains(&"indeterminate"), submits);
17547            assert_eq!(
17548                outcome.cancellation == "per_call_until_submission_then_resolve",
17549                submits
17550            );
17551        }
17552        for command in [
17553            Command::ReserveServiceCredential,
17554            Command::ReserveServiceCredentialRotation,
17555        ] {
17556            let outcome = LODESTONE_API_COMMAND_OUTCOMES
17557                .iter()
17558                .find(|outcome| outcome.command == command);
17559            assert!(
17560                matches!(outcome, Some(value) if value.identity_requirement == "caller_action_id" && value.resolver_command == Some(Command::ResolveServiceCredentialReservation))
17561            );
17562        }
17563    }
17564}