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;
6pub use bulk_batch_id::{BulkBatchIdError, bulk_batch_id};
7
8pub const LODESTONE_API_SCHEMA_ID: &str = "lodestone-api";
9pub const LODESTONE_API_SPEC_SHA256: &str = "3a14f2017b295839922ab36dd98b32e02dad1d314ecb9ccbc396a9c89cf84b5b";
10pub const LODESTONE_API_FORMAT_VERSION: u16 = 4;
11pub const LODESTONE_API_ALPN: &str = "lodestone";
12pub const BULK_BATCH_ID_FORMAT_VERSION: u16 = 2;
13pub const BULK_BATCH_ID_DOMAIN: &[u8] = b"lodestone/bulk-batch\0";
14pub const LODESTONE_API_MAX_OPERATION_WAIT_ATTEMPTS: u32 = 100;
15pub const LODESTONE_API_MAX_OPERATION_WAIT_INTERVAL_MILLIS: u64 = 60000;
16
17#[derive(Clone, Debug, Eq, PartialEq, Serialize)]
18#[serde(transparent)]
19pub struct I64 {
20    pub value: String,
21}
22#[derive(Clone, Debug, Eq, PartialEq, Serialize)]
23#[serde(transparent)]
24pub struct U64 {
25    pub value: String,
26}
27#[derive(Clone, Debug, Eq, PartialEq, Serialize)]
28#[serde(transparent)]
29pub struct Identity {
30    pub value: String,
31}
32#[derive(Clone, Debug, Eq, PartialEq, Serialize)]
33#[serde(transparent)]
34pub struct Digest {
35    pub value: String,
36}
37#[derive(Clone, Debug, Eq, PartialEq, Serialize)]
38pub struct ExactDecimal {
39    pub coefficient: String,
40    pub scale: u32,
41}
42#[derive(Clone, Debug, Eq, PartialEq, Serialize)]
43#[serde(transparent)]
44pub struct ApproximateNumber {
45    pub canonical_value: String,
46}
47#[derive(Clone, Debug, Deserialize, Eq, PartialEq, Serialize)]
48#[serde(deny_unknown_fields)]
49pub struct RawJson {
50    pub bytes_base64: String,
51}
52#[derive(Clone, Copy, Debug, Eq, PartialEq)]
53pub enum ScalarError {
54    InvalidI64,
55    InvalidU64,
56    InvalidIdentity,
57    InvalidDigest,
58    InvalidDecimal,
59    InvalidApproximateNumber,
60}
61impl std::fmt::Display for ScalarError {
62    fn fmt(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
63        write!(formatter, "invalid Lodestone API scalar: {self:?}")
64    }
65}
66impl I64 {
67    pub fn validate(&self) -> Result<(), ScalarError> {
68        self.value
69            .parse::<i64>()
70            .ok()
71            .filter(|parsed| parsed.to_string() == self.value)
72            .map(|_| ())
73            .ok_or(ScalarError::InvalidI64)
74    }
75}
76impl U64 {
77    pub fn validate(&self) -> Result<(), ScalarError> {
78        self.value
79            .parse::<u64>()
80            .ok()
81            .filter(|parsed| parsed.to_string() == self.value)
82            .map(|_| ())
83            .ok_or(ScalarError::InvalidU64)
84    }
85}
86impl Identity {
87    pub fn validate(&self) -> Result<(), ScalarError> {
88        (self.value.len() == 32
89            && self
90                .value
91                .bytes()
92                .all(|byte| byte.is_ascii_digit() || (b'a'..=b'f').contains(&byte)))
93        .then_some(())
94        .ok_or(ScalarError::InvalidIdentity)
95    }
96}
97impl Digest {
98    pub fn validate(&self) -> Result<(), ScalarError> {
99        (self.value.len() == 64
100            && self
101                .value
102                .bytes()
103                .all(|byte| byte.is_ascii_digit() || (b'a'..=b'f').contains(&byte)))
104        .then_some(())
105        .ok_or(ScalarError::InvalidDigest)
106    }
107}
108impl ExactDecimal {
109    pub fn validate(&self) -> Result<(), ScalarError> {
110        let unsigned = self.coefficient.strip_prefix('-').unwrap_or(&self.coefficient);
111        let canonical = self.coefficient == "0"
112            || (!unsigned.is_empty()
113                && !unsigned.starts_with('0')
114                && unsigned.bytes().all(|byte| byte.is_ascii_digit()));
115        (canonical
116            && self.coefficient != "-0"
117            && self.scale <= 1024
118            && (self.scale == 0 || !self.coefficient.ends_with('0')))
119        .then_some(())
120        .ok_or(ScalarError::InvalidDecimal)
121    }
122}
123impl ApproximateNumber {
124    pub fn validate(&self) -> Result<(), ScalarError> {
125        self.canonical_value
126            .parse::<f64>()
127            .ok()
128            .filter(|parsed| {
129                parsed.is_finite() && self.canonical_value != "-0" && parsed.to_string() == self.canonical_value
130            })
131            .map(|_| ())
132            .ok_or(ScalarError::InvalidApproximateNumber)
133    }
134}
135macro_rules! deserialize_validated_string_scalar {
136    ($type:ty) => {
137        impl<'de> Deserialize<'de> for $type {
138            fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
139            where
140                D: serde::Deserializer<'de>,
141            {
142                let value = String::deserialize(deserializer)?;
143                let scalar = Self { value };
144                scalar.validate().map_err(serde::de::Error::custom)?;
145                Ok(scalar)
146            }
147        }
148    };
149}
150deserialize_validated_string_scalar!(I64);
151deserialize_validated_string_scalar!(U64);
152deserialize_validated_string_scalar!(Identity);
153deserialize_validated_string_scalar!(Digest);
154impl<'de> Deserialize<'de> for ExactDecimal {
155    fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
156    where
157        D: serde::Deserializer<'de>,
158    {
159        #[derive(Deserialize)]
160        #[serde(deny_unknown_fields)]
161        struct Wire {
162            coefficient: String,
163            scale: u32,
164        }
165        let wire = Wire::deserialize(deserializer)?;
166        let scalar = Self {
167            coefficient: wire.coefficient,
168            scale: wire.scale,
169        };
170        scalar.validate().map_err(serde::de::Error::custom)?;
171        Ok(scalar)
172    }
173}
174impl<'de> Deserialize<'de> for ApproximateNumber {
175    fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
176    where
177        D: serde::Deserializer<'de>,
178    {
179        let canonical_value = String::deserialize(deserializer)?;
180        let scalar = Self { canonical_value };
181        scalar.validate().map_err(serde::de::Error::custom)?;
182        Ok(scalar)
183    }
184}
185#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
186#[serde(tag = "kind", content = "value", rename_all = "snake_case")]
187pub enum JsonValue {
188    Null,
189    Bool(bool),
190    String(String),
191    I64(I64),
192    U64(U64),
193    ExactDecimal(ExactDecimal),
194    Approximate(ApproximateNumber),
195    Array(Vec<JsonValue>),
196    Object(Vec<JsonField>),
197}
198#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
199#[serde(deny_unknown_fields)]
200pub struct JsonField {
201    pub name: String,
202    pub value: JsonValue,
203}
204#[derive(Clone, Copy, Debug, Deserialize, Eq, PartialEq, Serialize)]
205#[serde(rename_all = "snake_case")]
206pub enum Action {
207    IdentityDiscovery,
208    DataRead,
209    DataWrite,
210    Append,
211    ResolveAppend,
212    IndexAdmin,
213    CatalogRead,
214    TaskRead,
215    SubscriptionRead,
216    DiagnosticsRead,
217    DiagnosticsCreate,
218    SecurityRead,
219    SecurityAdmin,
220    AuditRead,
221    QuotaRead,
222    QuotaAdmin,
223    BindingRead,
224    LifecycleAdmin,
225    AdmissionRead,
226    AdmissionAdmin,
227    UsageRead,
228    OperationRead,
229    OperationCancel,
230    CollectionExport,
231    CollectionRestore,
232}
233
234#[derive(Clone, Copy, Debug, Deserialize, Eq, PartialEq, Serialize)]
235#[serde(rename_all = "snake_case")]
236pub enum ErrorCode {
237    Aborted,
238    DeadlineExceeded,
239    InvalidRequest,
240    UnsupportedVersion,
241    Unauthenticated,
242    PermissionDenied,
243    NotFound,
244    Conflict,
245    StaleCursor,
246    RestartBudgetExhausted,
247    LimitExceeded,
248    CapabilityUnavailable,
249    NotSubmitted,
250    SubmittedIndeterminate,
251    ExpiredUnknown,
252    SecretNotEscrowed,
253    RetentionGap,
254    ArtifactRangeInvalid,
255    ChecksumMismatch,
256    TemporarilyUnavailable,
257    Internal,
258}
259
260#[derive(Clone, Copy, Debug, Deserialize, Eq, PartialEq, Serialize)]
261#[serde(rename_all = "snake_case")]
262pub enum Command {
263    Discover,
264    ListIndexes,
265    GetIndex,
266    ValidateIndexChange,
267    ApplyIndexChange,
268    ApplyAdministrationMutation,
269    ListAliases,
270    GetAlias,
271    ListDataStreams,
272    GetDataStream,
273    ListComponentTemplates,
274    GetComponentTemplate,
275    ListIndexTemplates,
276    GetIndexTemplate,
277    ListIngestPipelines,
278    GetIngestPipeline,
279    SimulateIngestPipeline,
280    ReprocessByQuery,
281    ListLifecyclePolicies,
282    GetLifecyclePolicy,
283    PrepareCreateIndex,
284    PrepareDeleteIndex,
285    SubmitCatalogAction,
286    ResolveCatalogAction,
287    PrepareReplayableSourceIndex,
288    SubmitReplayableSourceIndex,
289    GetReplayableSource,
290    ControlReplayableSource,
291    CloneIndex,
292    ConfigureHistory,
293    GetHistory,
294    ResolveHistory,
295    PlaceHistoryHold,
296    ReleaseHistoryHold,
297    PrepareDocumentMutation,
298    SubmitDocumentMutation,
299    PrepareDocumentBulk,
300    SubmitDocumentBulk,
301    ResolveDocumentBulk,
302    PrepareAppendBulk,
303    SubmitAppendBulk,
304    ResolveAppendBulk,
305    ObserveAppendCommitted,
306    ResolveDocumentMutation,
307    GetDocument,
308    Search,
309    ValidateSearch,
310    OpenPit,
311    RenewPit,
312    ClosePit,
313    ListOperations,
314    GetOperation,
315    WaitOperation,
316    CancelOperation,
317    ListAuditEvents,
318    ExportAuditEvents,
319    ReserveServiceCredential,
320    ReserveServiceCredentialRotation,
321    ActivateServiceCredential,
322    ResolveServiceCredentialReservation,
323    PrepareRevokeServiceCredential,
324    RevokeServiceCredential,
325    ResolveSecurityAction,
326    GetSecurityRole,
327    PrepareRoleAppendAccessChange,
328    SubmitRoleAppendAccessChange,
329    ListServiceCredentials,
330    GetRuntimeStatus,
331    GetResultCacheStatus,
332    GetFieldPromotionStatus,
333    GetOverloadStatus,
334    ConfigureExternalKey,
335    RotateExternalKeyBinding,
336    ConfigureAggregateThenDelete,
337    GetLifecycleStatus,
338    GetQuota,
339    UpdateQuota,
340    GetBinding,
341    GetAdmissionStatus,
342    SetAdmission,
343    GetQuiesceStatus,
344    GetDecommissionReadiness,
345    GetUpgradeReadiness,
346    GetMaintenanceStatus,
347    WarmVectorIndex,
348    EvaluateVectorRecall,
349    CalibrateVectorStrategy,
350    GetVectorDiagnostic,
351    CreateDiagnostic,
352    GetDiagnostic,
353    PrepareCollectionExport,
354    StartCollectionExport,
355    ResolveCollectionExport,
356    VerifyCollectionExport,
357    PrepareCollectionRestore,
358    StartCollectionRestore,
359    ResolveCollectionRestore,
360    ReadArtifactChunk,
361    ExportUsage,
362    ExecuteStateRead,
363    PrepareStateWrite,
364    SubmitStateWrite,
365    ResolveStateWrite,
366}
367
368pub const LODESTONE_API_ERROR_CODES: &[ErrorCode] = &[
369    ErrorCode::Aborted,
370    ErrorCode::DeadlineExceeded,
371    ErrorCode::InvalidRequest,
372    ErrorCode::UnsupportedVersion,
373    ErrorCode::Unauthenticated,
374    ErrorCode::PermissionDenied,
375    ErrorCode::NotFound,
376    ErrorCode::Conflict,
377    ErrorCode::StaleCursor,
378    ErrorCode::RestartBudgetExhausted,
379    ErrorCode::LimitExceeded,
380    ErrorCode::CapabilityUnavailable,
381    ErrorCode::NotSubmitted,
382    ErrorCode::SubmittedIndeterminate,
383    ErrorCode::ExpiredUnknown,
384    ErrorCode::SecretNotEscrowed,
385    ErrorCode::RetentionGap,
386    ErrorCode::ArtifactRangeInvalid,
387    ErrorCode::ChecksumMismatch,
388    ErrorCode::TemporarilyUnavailable,
389    ErrorCode::Internal,
390];
391
392#[derive(Clone, Copy, Debug, Eq, PartialEq)]
393pub struct ActionAuthorizationContract {
394    pub action: Action,
395    pub any_of_permission_ids: &'static [&'static str],
396}
397pub const LODESTONE_API_ACTION_AUTHORIZATION: &[ActionAuthorizationContract] = &[
398    ActionAuthorizationContract {
399        action: Action::IdentityDiscovery,
400        any_of_permission_ids: &["security_read"],
401    },
402    ActionAuthorizationContract {
403        action: Action::DataRead,
404        any_of_permission_ids: &["data_read"],
405    },
406    ActionAuthorizationContract {
407        action: Action::DataWrite,
408        any_of_permission_ids: &["data_write"],
409    },
410    ActionAuthorizationContract {
411        action: Action::Append,
412        any_of_permission_ids: &["append"],
413    },
414    ActionAuthorizationContract {
415        action: Action::ResolveAppend,
416        any_of_permission_ids: &["resolve_append"],
417    },
418    ActionAuthorizationContract {
419        action: Action::IndexAdmin,
420        any_of_permission_ids: &["index_admin"],
421    },
422    ActionAuthorizationContract {
423        action: Action::CatalogRead,
424        any_of_permission_ids: &["catalog_read"],
425    },
426    ActionAuthorizationContract {
427        action: Action::TaskRead,
428        any_of_permission_ids: &["task_read"],
429    },
430    ActionAuthorizationContract {
431        action: Action::SubscriptionRead,
432        any_of_permission_ids: &["subscription_read"],
433    },
434    ActionAuthorizationContract {
435        action: Action::DiagnosticsRead,
436        any_of_permission_ids: &["diagnostics_read"],
437    },
438    ActionAuthorizationContract {
439        action: Action::DiagnosticsCreate,
440        any_of_permission_ids: &["diagnostics_create"],
441    },
442    ActionAuthorizationContract {
443        action: Action::SecurityRead,
444        any_of_permission_ids: &["security_read"],
445    },
446    ActionAuthorizationContract {
447        action: Action::SecurityAdmin,
448        any_of_permission_ids: &["security_admin"],
449    },
450    ActionAuthorizationContract {
451        action: Action::AuditRead,
452        any_of_permission_ids: &["audit_read"],
453    },
454    ActionAuthorizationContract {
455        action: Action::QuotaRead,
456        any_of_permission_ids: &["quota_read"],
457    },
458    ActionAuthorizationContract {
459        action: Action::QuotaAdmin,
460        any_of_permission_ids: &["quota_admin"],
461    },
462    ActionAuthorizationContract {
463        action: Action::BindingRead,
464        any_of_permission_ids: &["binding_read"],
465    },
466    ActionAuthorizationContract {
467        action: Action::LifecycleAdmin,
468        any_of_permission_ids: &["lifecycle_admin"],
469    },
470    ActionAuthorizationContract {
471        action: Action::AdmissionRead,
472        any_of_permission_ids: &["admission_read"],
473    },
474    ActionAuthorizationContract {
475        action: Action::AdmissionAdmin,
476        any_of_permission_ids: &["admission_admin"],
477    },
478    ActionAuthorizationContract {
479        action: Action::UsageRead,
480        any_of_permission_ids: &["usage_read"],
481    },
482    ActionAuthorizationContract {
483        action: Action::OperationRead,
484        any_of_permission_ids: &[
485            "catalog_read",
486            "task_read",
487            "security_read",
488            "diagnostics_read",
489            "collection_export",
490            "collection_restore",
491        ],
492    },
493    ActionAuthorizationContract {
494        action: Action::OperationCancel,
495        any_of_permission_ids: &[
496            "index_admin",
497            "task_admin",
498            "security_admin",
499            "diagnostics_create",
500            "collection_export",
501        ],
502    },
503    ActionAuthorizationContract {
504        action: Action::CollectionExport,
505        any_of_permission_ids: &["collection_export"],
506    },
507    ActionAuthorizationContract {
508        action: Action::CollectionRestore,
509        any_of_permission_ids: &["collection_restore"],
510    },
511];
512pub fn action_authorization(action: Action) -> Option<&'static ActionAuthorizationContract> {
513    LODESTONE_API_ACTION_AUTHORIZATION
514        .iter()
515        .find(|contract| contract.action == action)
516}
517
518#[derive(Clone, Copy, Debug, Eq, PartialEq)]
519pub struct RuntimeCapabilityAuthorizationContract {
520    pub capability_id: &'static str,
521    pub required_permission_ids: &'static [&'static str],
522}
523pub const LODESTONE_API_RUNTIME_CAPABILITY_AUTHORIZATION: &[RuntimeCapabilityAuthorizationContract] = &[
524    RuntimeCapabilityAuthorizationContract {
525        capability_id: "search_and_append_log",
526        required_permission_ids: &["data_read", "data_write"],
527    },
528    RuntimeCapabilityAuthorizationContract {
529        capability_id: "committed_vector_and_hybrid",
530        required_permission_ids: &["data_read"],
531    },
532    RuntimeCapabilityAuthorizationContract {
533        capability_id: "realtime_or_pit_vector",
534        required_permission_ids: &["data_read"],
535    },
536    RuntimeCapabilityAuthorizationContract {
537        capability_id: "state_standard_express_ephemeral",
538        required_permission_ids: &["data_read", "data_write"],
539    },
540    RuntimeCapabilityAuthorizationContract {
541        capability_id: "state_relaxed",
542        required_permission_ids: &[],
543    },
544    RuntimeCapabilityAuthorizationContract {
545        capability_id: "bounded_resp",
546        required_permission_ids: &["data_read", "data_write"],
547    },
548    RuntimeCapabilityAuthorizationContract {
549        capability_id: "lodestone_rust_client",
550        required_permission_ids: &[],
551    },
552    RuntimeCapabilityAuthorizationContract {
553        capability_id: "replayable_source_indexes",
554        required_permission_ids: &["index_admin"],
555    },
556    RuntimeCapabilityAuthorizationContract {
557        capability_id: "zero_copy_clones",
558        required_permission_ids: &["index_admin"],
559    },
560    RuntimeCapabilityAuthorizationContract {
561        capability_id: "retained_history",
562        required_permission_ids: &["data_read"],
563    },
564    RuntimeCapabilityAuthorizationContract {
565        capability_id: "generation_result_cache",
566        required_permission_ids: &["data_read"],
567    },
568    RuntimeCapabilityAuthorizationContract {
569        capability_id: "adaptive_field_promotion",
570        required_permission_ids: &["index_admin"],
571    },
572    RuntimeCapabilityAuthorizationContract {
573        capability_id: "durable_overload_buffering",
574        required_permission_ids: &["data_read", "data_write"],
575    },
576    RuntimeCapabilityAuthorizationContract {
577        capability_id: "current_table_reader",
578        required_permission_ids: &["data_read"],
579    },
580    RuntimeCapabilityAuthorizationContract {
581        capability_id: "crypto_shred_and_rollup_lifecycle",
582        required_permission_ids: &["lifecycle_admin"],
583    },
584];
585pub fn runtime_capability_authorization(
586    capability_id: &str,
587) -> Option<&'static RuntimeCapabilityAuthorizationContract> {
588    LODESTONE_API_RUNTIME_CAPABILITY_AUTHORIZATION
589        .iter()
590        .find(|contract| contract.capability_id == capability_id)
591}
592
593#[derive(Clone, Copy, Debug, Eq, PartialEq)]
594pub struct ClusterControlActionContract {
595    pub credential_kind: &'static str,
596    pub action: &'static str,
597}
598pub const LODESTONE_API_CLUSTER_CONTROL_FORMAT_VERSION: u16 = 1;
599pub const LODESTONE_API_CLUSTER_CONTROL_TRANSPORT: &str = "isolated_tls_u32_be_length_then_canonical_json";
600pub const LODESTONE_API_CLUSTER_CONTROL_ACTIONS: &[ClusterControlActionContract] = &[
601    ClusterControlActionContract {
602        credential_kind: "collection_provisioner",
603        action: "initialize_collection_authority",
604    },
605    ClusterControlActionContract {
606        credential_kind: "collection_provisioner",
607        action: "activate_collection_authority",
608    },
609    ClusterControlActionContract {
610        credential_kind: "collection_provisioner",
611        action: "resolve_collection_authority",
612    },
613    ClusterControlActionContract {
614        credential_kind: "collection_provisioner",
615        action: "inspect_collection_retirement",
616    },
617    ClusterControlActionContract {
618        credential_kind: "collection_provisioner",
619        action: "retire_collection_authority",
620    },
621    ClusterControlActionContract {
622        credential_kind: "collection_provisioner",
623        action: "reserve_cluster_control_credential_rotation",
624    },
625    ClusterControlActionContract {
626        credential_kind: "collection_provisioner",
627        action: "activate_cluster_control_credential_rotation",
628    },
629    ClusterControlActionContract {
630        credential_kind: "collection_provisioner",
631        action: "revoke_cluster_control_credential",
632    },
633    ClusterControlActionContract {
634        credential_kind: "collection_provisioner",
635        action: "resolve_cluster_control_credential",
636    },
637    ClusterControlActionContract {
638        credential_kind: "capacity_observer",
639        action: "observe_cluster_capacity",
640    },
641    ClusterControlActionContract {
642        credential_kind: "capacity_observer",
643        action: "observe_resource_diagnostics",
644    },
645    ClusterControlActionContract {
646        credential_kind: "recovery_operator",
647        action: "list_cluster_backups",
648    },
649    ClusterControlActionContract {
650        credential_kind: "recovery_operator",
651        action: "get_cluster_backup",
652    },
653    ClusterControlActionContract {
654        credential_kind: "recovery_operator",
655        action: "create_cluster_backup",
656    },
657    ClusterControlActionContract {
658        credential_kind: "recovery_operator",
659        action: "resolve_cluster_backup",
660    },
661    ClusterControlActionContract {
662        credential_kind: "recovery_operator",
663        action: "get_cluster_restore_readiness",
664    },
665    ClusterControlActionContract {
666        credential_kind: "recovery_operator",
667        action: "prepare_offline_recovery",
668    },
669    ClusterControlActionContract {
670        credential_kind: "recovery_operator",
671        action: "reserve_cluster_control_credential_rotation",
672    },
673    ClusterControlActionContract {
674        credential_kind: "recovery_operator",
675        action: "activate_cluster_control_credential_rotation",
676    },
677    ClusterControlActionContract {
678        credential_kind: "recovery_operator",
679        action: "revoke_cluster_control_credential",
680    },
681    ClusterControlActionContract {
682        credential_kind: "recovery_operator",
683        action: "resolve_cluster_control_credential",
684    },
685];
686pub const LODESTONE_API_CLUSTER_CONTROL_TYPES: &[&str] = &[
687    "cluster_control_session",
688    "cluster_control_request",
689    "cluster_control_response",
690    "collection_authority_operation",
691    "collection_retirement_blockers",
692    "core_capacity_observation",
693    "core_resource_diagnostic_page",
694    "cluster_control_credential_rotation",
695    "cluster_backup_operation",
696    "cluster_restore_readiness",
697];
698
699pub const LODESTONE_API_CURSOR_FORMAT_VERSION: u16 = 1;
700#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
701#[serde(deny_unknown_fields)]
702pub struct Cursor {
703    pub value: String,
704}
705
706pub const LODESTONE_API_LOCATOR_FORMAT_VERSION: u16 = 1;
707#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
708#[serde(deny_unknown_fields)]
709pub struct Locator {
710    pub authority: String,
711    pub value: String,
712}
713
714pub const LODESTONE_API_RESOURCE_FORMAT_VERSION: u16 = 1;
715#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
716#[serde(deny_unknown_fields)]
717pub struct Resource {
718    pub kind: String,
719    pub name: String,
720    pub incarnation: Identity,
721}
722
723pub const LODESTONE_API_FIELD_PROMOTION_CONFIGURATION_FORMAT_VERSION: u16 = 1;
724#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
725#[serde(deny_unknown_fields)]
726pub struct FieldPromotionConfiguration {
727    pub format_version: u32,
728    pub enabled: bool,
729    pub minimum_query_count: u32,
730    pub maximum_promoted_fields: u32,
731    pub maximum_cardinality: U64,
732    pub maximum_extra_bytes: U64,
733    pub allow_sensitive: bool,
734}
735
736pub const LODESTONE_API_OVERLOAD_CONFIGURATION_FORMAT_VERSION: u16 = 2;
737#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
738#[serde(deny_unknown_fields)]
739pub struct OverloadConfiguration {
740    pub format_version: u32,
741    pub mode: String,
742    pub maximum_backlog_bytes: U64,
743    pub maximum_backlog_age_millis: U64,
744    pub maximum_collection_share_bytes: U64,
745    pub maximum_recovery_ops_per_pass: u32,
746    pub maximum_pending_overlay_documents: U64,
747}
748
749pub const LODESTONE_API_INDEX_POLICIES_FORMAT_VERSION: u16 = 1;
750#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
751#[serde(deny_unknown_fields)]
752pub struct IndexPolicies {
753    pub durability: String,
754    pub storage: String,
755    pub cache: String,
756    #[serde(default, skip_serializing_if = "Option::is_none")]
757    pub default_visibility: Option<String>,
758    pub field_promotion: FieldPromotionConfiguration,
759    pub overload: OverloadConfiguration,
760}
761
762pub const LODESTONE_API_MAINTENANCE_BUDGETS_FORMAT_VERSION: u16 = 1;
763#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
764#[serde(deny_unknown_fields)]
765pub struct MaintenanceBudgets {
766    pub memtable_max_bytes: U64,
767    pub refresh_max_millis: U64,
768    pub seal_max_bytes: U64,
769    pub seal_max_millis: U64,
770    pub merge_max_bytes: U64,
771    pub delete_resolution_max_bytes: U64,
772    pub wal_retention_max_bytes: U64,
773    pub gc_max_keys: u32,
774    pub fsck_max_objects: u32,
775    pub deleted_tombstone_retention_millis: U64,
776}
777
778pub const LODESTONE_API_RESOURCE_DURABILITY_CLASS_FORMAT_VERSION: u16 = 1;
779#[derive(Clone, Copy, Debug, Deserialize, Eq, PartialEq, Serialize)]
780#[serde(rename_all = "snake_case")]
781pub enum ResourceDurabilityClass {
782    RegionalObject,
783    ZonalLowLatency,
784    Relaxed,
785    Ephemeral,
786}
787
788pub const LODESTONE_API_RESOURCE_STORAGE_CLASS_FORMAT_VERSION: u16 = 1;
789#[derive(Clone, Copy, Debug, Deserialize, Eq, PartialEq, Serialize)]
790#[serde(rename_all = "snake_case")]
791pub enum ResourceStorageClass {
792    Standard,
793    Cold,
794}
795
796pub const LODESTONE_API_VECTOR_QUALITY_OBJECTIVE_FORMAT_VERSION: u16 = 1;
797#[derive(Clone, Copy, Debug, Deserialize, Eq, PartialEq, Serialize)]
798#[serde(rename_all = "snake_case")]
799pub enum VectorQualityObjective {
800    Balanced,
801    HighRecall,
802    MemoryEfficient,
803}
804
805pub const LODESTONE_API_VECTOR_INDEXING_OBJECTIVE_FORMAT_VERSION: u16 = 1;
806#[derive(Clone, Copy, Debug, Deserialize, Eq, PartialEq, Serialize)]
807#[serde(rename_all = "snake_case")]
808pub enum VectorIndexingObjective {
809    FastBuild,
810    Balanced,
811    Compact,
812}
813
814pub const LODESTONE_API_VECTOR_RESIDENCY_INTENT_FORMAT_VERSION: u16 = 1;
815#[derive(Clone, Copy, Debug, Deserialize, Eq, PartialEq, Serialize)]
816#[serde(rename_all = "snake_case")]
817pub enum VectorResidencyIntent {
818    Automatic,
819    PreferResident,
820    RequireResident,
821}
822
823pub const LODESTONE_API_VECTOR_CALIBRATION_BINDING_FORMAT_VERSION: u16 = 1;
824#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
825#[serde(deny_unknown_fields)]
826pub struct VectorCalibrationBinding {
827    pub profile: VectorStrategyProfile,
828    pub evidence_digest: Digest,
829}
830
831pub const LODESTONE_API_VECTOR_RESOURCE_POLICY_FORMAT_VERSION: u16 = 2;
832#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
833#[serde(deny_unknown_fields)]
834pub struct VectorResourcePolicy {
835    pub quality: VectorQualityObjective,
836    pub indexing: VectorIndexingObjective,
837    #[serde(default, skip_serializing_if = "Option::is_none")]
838    pub residency: Option<VectorResidencyIntent>,
839    #[serde(default, skip_serializing_if = "Option::is_none")]
840    pub calibration: Option<VectorCalibrationBinding>,
841}
842
843pub const LODESTONE_API_WORKLOAD_CLASS_FORMAT_VERSION: u16 = 1;
844#[derive(Clone, Copy, Debug, Deserialize, Eq, PartialEq, Serialize)]
845#[serde(rename_all = "snake_case")]
846pub enum WorkloadClass {
847    InteractiveSearch,
848    BatchAnalytics,
849    StreamingIngest,
850    BulkBackfill,
851    InternalMaintenance,
852}
853
854pub const LODESTONE_API_INDEX_RESOURCE_SPEC_FORMAT_VERSION: u16 = 3;
855#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
856#[serde(deny_unknown_fields)]
857pub struct IndexResourceSpec {
858    pub format_version: u32,
859    pub revision: U64,
860    pub initial_shards: u32,
861    pub target_shard_bytes: U64,
862    pub durability: ResourceDurabilityClass,
863    pub storage_class: ResourceStorageClass,
864    pub ram_admission_weight: u32,
865    pub ram_hard_max_bytes: U64,
866    pub nvme_admission_weight: u32,
867    pub nvme_hard_max_bytes: U64,
868    pub refresh_objective_millis: u32,
869    pub memtable_hard_max_bytes: U64,
870    pub seal_parallelism: u32,
871    pub merge_parallelism: u32,
872    pub vector: VectorResourcePolicy,
873    #[serde(default, skip_serializing_if = "Option::is_none")]
874    pub lifecycle_binding: Option<Identity>,
875    pub encryption_required: bool,
876    #[serde(default, skip_serializing_if = "Option::is_none")]
877    pub resolver_capability: Option<Identity>,
878}
879
880pub const LODESTONE_API_INDEX_SUMMARY_FORMAT_VERSION: u16 = 1;
881#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
882#[serde(deny_unknown_fields)]
883pub struct IndexSummary {
884    pub name: String,
885    pub incarnation: Identity,
886    pub revision: U64,
887    pub mode: String,
888    pub retained_event_identity: bool,
889    pub state: String,
890    pub schema_generation: U64,
891    pub routing_revision: U64,
892    pub shard_count: u32,
893    pub policies: IndexPolicies,
894    pub management_mode: String,
895}
896
897pub const LODESTONE_API_MAPPING_MODE_FORMAT_VERSION: u16 = 1;
898#[derive(Clone, Copy, Debug, Deserialize, Eq, PartialEq, Serialize)]
899#[serde(rename_all = "snake_case")]
900pub enum MappingMode {
901    Mutable,
902    AppendLog,
903    State,
904}
905
906pub const LODESTONE_API_DYNAMIC_MAPPING_POLICY_FORMAT_VERSION: u16 = 1;
907#[derive(Clone, Copy, Debug, Deserialize, Eq, PartialEq, Serialize)]
908#[serde(rename_all = "snake_case")]
909pub enum DynamicMappingPolicy {
910    True,
911    False,
912    Strict,
913}
914
915pub const LODESTONE_API_MAPPING_ANALYZER_FORMAT_VERSION: u16 = 1;
916#[derive(Clone, Copy, Debug, Deserialize, Eq, PartialEq, Serialize)]
917#[serde(rename_all = "snake_case")]
918pub enum MappingAnalyzer {
919    Keyword,
920    Simple,
921    Standard,
922    Whitespace,
923}
924
925pub const LODESTONE_API_KEYWORD_NORMALIZER_FORMAT_VERSION: u16 = 1;
926#[derive(Clone, Copy, Debug, Deserialize, Eq, PartialEq, Serialize)]
927#[serde(rename_all = "snake_case")]
928pub enum KeywordNormalizer {
929    Keyword,
930    Lowercase,
931}
932
933pub const LODESTONE_API_VECTOR_METRIC_FORMAT_VERSION: u16 = 1;
934#[derive(Clone, Copy, Debug, Deserialize, Eq, PartialEq, Serialize)]
935#[serde(rename_all = "snake_case")]
936pub enum VectorMetric {
937    Cosine,
938    DotProduct,
939    SquaredL2,
940}
941
942pub const LODESTONE_API_MAPPING_SCALAR_FORMAT_VERSION: u16 = 1;
943#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
944#[serde(tag = "kind", rename_all = "snake_case", deny_unknown_fields)]
945pub enum MappingScalar {
946    Boolean { value: bool },
947    I64 { value: I64 },
948    U64 { value: U64 },
949    F64Bits { value: U64 },
950    Keyword { value: String },
951}
952
953pub const LODESTONE_API_SPARSE_VECTOR_WEIGHT_TYPE_FORMAT_VERSION: u16 = 1;
954#[derive(Clone, Copy, Debug, Deserialize, Eq, PartialEq, Serialize)]
955#[serde(rename_all = "snake_case")]
956pub enum SparseVectorWeightType {
957    F32,
958    F16,
959}
960
961pub const LODESTONE_API_MAPPING_FIELD_TYPE_FORMAT_VERSION: u16 = 3;
962#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
963#[serde(tag = "kind", rename_all = "snake_case", deny_unknown_fields)]
964pub enum MappingFieldType {
965    Text,
966    Keyword,
967    U64,
968    Date,
969    I64,
970    F64,
971    Bool,
972    Nested,
973    Vector {
974        format_version: u32,
975        field_id: u32,
976        dimensions: u32,
977        metric: VectorMetric,
978        element_type: DenseVectorElementType,
979        #[serde(default, skip_serializing_if = "Option::is_none")]
980        quantization_scale: Option<ApproximateNumber>,
981    },
982    SparseVector {
983        format_version: u32,
984        field_id: u32,
985        maximum_dimension: u32,
986        weight_type: SparseVectorWeightType,
987    },
988    VectorSet {
989        format_version: u32,
990        field_id: u32,
991        dimensions: u32,
992        metric: VectorMetric,
993        element_type: DenseVectorElementType,
994        #[serde(default, skip_serializing_if = "Option::is_none")]
995        quantization_scale: Option<ApproximateNumber>,
996        maximum_vectors: u32,
997    },
998}
999
1000pub const LODESTONE_API_MAPPING_FIELD_FORMAT_VERSION: u16 = 1;
1001#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
1002#[serde(deny_unknown_fields)]
1003pub struct MappingField {
1004    pub path: String,
1005    pub field_type: MappingFieldType,
1006    pub stored: bool,
1007    #[serde(default, skip_serializing_if = "Option::is_none")]
1008    pub null_value: Option<MappingScalar>,
1009}
1010
1011pub const LODESTONE_API_MULTI_FIELD_PROJECTION_FORMAT_VERSION: u16 = 1;
1012#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
1013#[serde(deny_unknown_fields)]
1014pub struct MultiFieldProjection {
1015    pub parent: String,
1016    pub child: String,
1017}
1018
1019pub const LODESTONE_API_ANALYZER_IDENTITY_FORMAT_VERSION: u16 = 1;
1020#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
1021#[serde(deny_unknown_fields)]
1022pub struct AnalyzerIdentity {
1023    pub field: String,
1024    pub index_analyzer: MappingAnalyzer,
1025    pub search_analyzer: MappingAnalyzer,
1026}
1027
1028pub const LODESTONE_API_KEYWORD_LIMIT_FORMAT_VERSION: u16 = 1;
1029#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
1030#[serde(deny_unknown_fields)]
1031pub struct KeywordLimit {
1032    pub field: String,
1033    pub max_bytes: u32,
1034    pub normalizer: KeywordNormalizer,
1035}
1036
1037pub const LODESTONE_API_MAPPING_FORMAT_VERSION: u16 = 1;
1038#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
1039#[serde(deny_unknown_fields)]
1040pub struct Mapping {
1041    pub format_version: u32,
1042    pub generation: U64,
1043    pub mode: MappingMode,
1044    pub dynamic_policy: DynamicMappingPolicy,
1045    pub fields: Vec<MappingField>,
1046    pub multi_field_projections: Vec<MultiFieldProjection>,
1047    pub analyzer_identities: Vec<AnalyzerIdentity>,
1048    pub keyword_limits: Vec<KeywordLimit>,
1049    pub nested_paths: Vec<String>,
1050}
1051
1052pub const LODESTONE_API_INDEX_DETAIL_FORMAT_VERSION: u16 = 1;
1053#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
1054#[serde(deny_unknown_fields)]
1055pub struct IndexDetail {
1056    pub summary: IndexSummary,
1057    pub current_mapping: Mapping,
1058    pub budgets: MaintenanceBudgets,
1059    pub resource_spec: IndexResourceSpec,
1060    pub aliases: Vec<String>,
1061    pub data_streams: Vec<String>,
1062}
1063
1064pub const LODESTONE_API_SOURCE_PROVIDER_FORMAT_VERSION: u16 = 1;
1065#[derive(Clone, Copy, Debug, Deserialize, Eq, PartialEq, Serialize)]
1066#[serde(rename_all = "snake_case")]
1067pub enum SourceProvider {
1068    Kafka,
1069    ObjectLog,
1070    HttpReplay,
1071    GrpcReplay,
1072}
1073
1074pub const LODESTONE_API_SOURCE_DECODER_FORMAT_VERSION: u16 = 1;
1075#[derive(Clone, Copy, Debug, Deserialize, Eq, PartialEq, Serialize)]
1076#[serde(rename_all = "snake_case")]
1077pub enum SourceDecoder {
1078    LodestoneDocumentJson,
1079    DebeziumPostgresJson,
1080}
1081
1082pub const LODESTONE_API_SOURCE_REPLAY_GUARANTEES_FORMAT_VERSION: u16 = 1;
1083#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
1084#[serde(deny_unknown_fields)]
1085pub struct SourceReplayGuarantees {
1086    pub durable_replay: bool,
1087    pub stable_partition_identity: bool,
1088    pub stable_operation_identity: bool,
1089    pub ordered_positions: bool,
1090    pub bounded_reads: bool,
1091    pub explicit_retention: bool,
1092    pub explicit_rewind: bool,
1093    pub minimum_replay_window_millis: U64,
1094}
1095
1096pub const LODESTONE_API_SOURCE_PARTITION_CONFIGURATION_FORMAT_VERSION: u16 = 1;
1097#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
1098#[serde(deny_unknown_fields)]
1099pub struct SourcePartitionConfiguration {
1100    pub partition_id: u32,
1101    pub partition_incarnation: U64,
1102    pub initial_next_ordinal: U64,
1103    pub initial_resume_token_base64: String,
1104}
1105
1106pub const LODESTONE_API_REPLAYABLE_SOURCE_CONFIGURATION_FORMAT_VERSION: u16 = 1;
1107#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
1108#[serde(deny_unknown_fields)]
1109pub struct ReplayableSourceConfiguration {
1110    pub source_incarnation: U64,
1111    pub source_identity_digest: Digest,
1112    pub provider: SourceProvider,
1113    pub decoder: SourceDecoder,
1114    pub partitions: Vec<SourcePartitionConfiguration>,
1115    pub guarantees: SourceReplayGuarantees,
1116}
1117
1118pub const LODESTONE_API_SOURCE_PARTITION_STATUS_FORMAT_VERSION: u16 = 1;
1119#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
1120#[serde(deny_unknown_fields)]
1121pub struct SourcePartitionStatus {
1122    pub partition_id: u32,
1123    pub partition_incarnation: U64,
1124    pub indexed_next_ordinal: U64,
1125    #[serde(default, skip_serializing_if = "Option::is_none")]
1126    pub provider_high_watermark_next_ordinal: Option<U64>,
1127    #[serde(default, skip_serializing_if = "Option::is_none")]
1128    pub retention_floor_next_ordinal: Option<U64>,
1129    #[serde(default, skip_serializing_if = "Option::is_none")]
1130    pub lag_records: Option<U64>,
1131}
1132
1133pub const LODESTONE_API_REPLAYABLE_SOURCE_STATUS_FORMAT_VERSION: u16 = 1;
1134#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
1135#[serde(deny_unknown_fields)]
1136pub struct ReplayableSourceStatus {
1137    pub index: Resource,
1138    pub provider: SourceProvider,
1139    pub decoder: SourceDecoder,
1140    pub source_incarnation: U64,
1141    pub source_identity_digest: Digest,
1142    pub lifecycle: String,
1143    pub lifecycle_generation: U64,
1144    #[serde(default, skip_serializing_if = "Option::is_none")]
1145    pub pause_reason: Option<String>,
1146    #[serde(default, skip_serializing_if = "Option::is_none")]
1147    pub rebuild_reason: Option<String>,
1148    pub retry_state: String,
1149    pub retention_risk: String,
1150    #[serde(default, skip_serializing_if = "Option::is_none")]
1151    pub last_batch_identity: Option<Identity>,
1152    pub partitions: Vec<SourcePartitionStatus>,
1153}
1154
1155pub const LODESTONE_API_SOURCE_CONTROL_TRANSITION_FORMAT_VERSION: u16 = 1;
1156#[derive(Clone, Copy, Debug, Deserialize, Eq, PartialEq, Serialize)]
1157#[serde(rename_all = "snake_case")]
1158pub enum SourceControlTransition {
1159    Pause,
1160    Resume,
1161    RequireRebuild,
1162}
1163
1164pub const LODESTONE_API_HISTORY_LEDGER_PRECONDITION_FORMAT_VERSION: u16 = 1;
1165#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
1166#[serde(tag = "kind", rename_all = "snake_case", deny_unknown_fields)]
1167pub enum HistoryLedgerPrecondition {
1168    Absent,
1169    Exact { revision: U64 },
1170}
1171
1172pub const LODESTONE_API_HISTORY_RETENTION_POLICY_FORMAT_VERSION: u16 = 1;
1173#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
1174#[serde(deny_unknown_fields)]
1175pub struct HistoryRetentionPolicy {
1176    pub keep_for_millis: U64,
1177    pub capture_interval_millis: U64,
1178    pub maximum_cuts: u32,
1179    pub privacy_overlay_identity_limit: u32,
1180}
1181
1182pub const LODESTONE_API_HISTORY_SELECTOR_FORMAT_VERSION: u16 = 1;
1183#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
1184#[serde(tag = "kind", rename_all = "snake_case", deny_unknown_fields)]
1185pub enum HistorySelector {
1186    ExactCut { cut_id: Identity },
1187    AtOrBeforeCommitTime { unix_millis: U64 },
1188}
1189
1190pub const LODESTONE_API_HISTORY_HOLD_FORMAT_VERSION: u16 = 1;
1191#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
1192#[serde(deny_unknown_fields)]
1193pub struct HistoryHold {
1194    pub hold_id: Identity,
1195    pub cut_ids: Vec<Identity>,
1196}
1197
1198pub const LODESTONE_API_HISTORY_STATUS_FORMAT_VERSION: u16 = 1;
1199#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
1200#[serde(deny_unknown_fields)]
1201pub struct HistoryStatus {
1202    pub index: Resource,
1203    pub revision: U64,
1204    pub policy: HistoryRetentionPolicy,
1205    pub page_count: u32,
1206    pub cut_count: u32,
1207    pub holds: Vec<HistoryHold>,
1208}
1209
1210pub const LODESTONE_API_HISTORY_RESOLUTION_FORMAT_VERSION: u16 = 1;
1211#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
1212#[serde(deny_unknown_fields)]
1213pub struct HistoryResolution {
1214    pub index: Resource,
1215    pub selector: HistorySelector,
1216    pub cut_id: Identity,
1217    pub committed_at_unix_millis: U64,
1218    pub uncertainty_millis: U64,
1219    pub shard_count: u32,
1220    pub security_policy_revision: U64,
1221}
1222
1223pub const LODESTONE_API_INDEX_REFERENCE_FORMAT_VERSION: u16 = 1;
1224#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
1225#[serde(deny_unknown_fields)]
1226pub struct IndexReference {
1227    pub name: String,
1228    pub incarnation: Identity,
1229}
1230
1231pub const LODESTONE_API_ALIAS_TARGET_FORMAT_VERSION: u16 = 1;
1232#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
1233#[serde(deny_unknown_fields)]
1234pub struct AliasTarget {
1235    pub index: IndexReference,
1236    pub write_index: bool,
1237}
1238
1239pub const LODESTONE_API_ALIAS_SUMMARY_FORMAT_VERSION: u16 = 1;
1240#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
1241#[serde(deny_unknown_fields)]
1242pub struct AliasSummary {
1243    pub name: String,
1244    pub revision: U64,
1245    pub visible_target_count: u32,
1246}
1247
1248pub const LODESTONE_API_ALIAS_DETAIL_FORMAT_VERSION: u16 = 1;
1249#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
1250#[serde(deny_unknown_fields)]
1251pub struct AliasDetail {
1252    pub summary: AliasSummary,
1253    pub visible_targets: Vec<AliasTarget>,
1254    #[serde(default, skip_serializing_if = "Option::is_none")]
1255    pub filter: Option<RawJson>,
1256    #[serde(default, skip_serializing_if = "Option::is_none")]
1257    pub index_routing: Option<String>,
1258    #[serde(default, skip_serializing_if = "Option::is_none")]
1259    pub search_routing: Option<String>,
1260}
1261
1262pub const LODESTONE_API_DATA_STREAM_SUMMARY_FORMAT_VERSION: u16 = 1;
1263#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
1264#[serde(deny_unknown_fields)]
1265pub struct DataStreamSummary {
1266    pub name: String,
1267    pub incarnation: Identity,
1268    pub revision: U64,
1269    pub generation: U64,
1270    pub state: String,
1271    pub visible_backing_count: u32,
1272}
1273
1274pub const LODESTONE_API_COMPONENT_TEMPLATE_BINDING_FORMAT_VERSION: u16 = 1;
1275#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
1276#[serde(deny_unknown_fields)]
1277pub struct ComponentTemplateBinding {
1278    pub name: String,
1279    pub incarnation: Identity,
1280    pub revision: U64,
1281}
1282
1283pub const LODESTONE_API_INDEX_TEMPLATE_BINDING_FORMAT_VERSION: u16 = 1;
1284#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
1285#[serde(deny_unknown_fields)]
1286pub struct IndexTemplateBinding {
1287    pub name: String,
1288    pub incarnation: Identity,
1289    pub revision: U64,
1290}
1291
1292pub const LODESTONE_API_LIFECYCLE_POLICY_BINDING_FORMAT_VERSION: u16 = 1;
1293#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
1294#[serde(deny_unknown_fields)]
1295pub struct LifecyclePolicyBinding {
1296    pub name: String,
1297    pub incarnation: Identity,
1298    pub revision: U64,
1299}
1300
1301pub const LODESTONE_API_DATA_STREAM_DETAIL_FORMAT_VERSION: u16 = 1;
1302#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
1303#[serde(deny_unknown_fields)]
1304pub struct DataStreamDetail {
1305    pub summary: DataStreamSummary,
1306    pub visible_backing_indices: Vec<IndexReference>,
1307    #[serde(default, skip_serializing_if = "Option::is_none")]
1308    pub write_index: Option<IndexReference>,
1309    pub timestamp_field: String,
1310    pub index_template: IndexTemplateBinding,
1311    #[serde(default, skip_serializing_if = "Option::is_none")]
1312    pub lifecycle_policy: Option<LifecyclePolicyBinding>,
1313}
1314
1315pub const LODESTONE_API_COMPONENT_TEMPLATE_SUMMARY_FORMAT_VERSION: u16 = 1;
1316#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
1317#[serde(deny_unknown_fields)]
1318pub struct ComponentTemplateSummary {
1319    pub name: String,
1320    pub incarnation: Identity,
1321    pub revision: U64,
1322}
1323
1324pub const LODESTONE_API_COMPONENT_TEMPLATE_DETAIL_FORMAT_VERSION: u16 = 1;
1325#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
1326#[serde(deny_unknown_fields)]
1327pub struct ComponentTemplateDetail {
1328    pub summary: ComponentTemplateSummary,
1329    pub mapping: Mapping,
1330    pub settings: RawJson,
1331    #[serde(default, skip_serializing_if = "Option::is_none")]
1332    pub resource_spec: Option<IndexResourceSpec>,
1333}
1334
1335pub const LODESTONE_API_INDEX_TEMPLATE_SUMMARY_FORMAT_VERSION: u16 = 1;
1336#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
1337#[serde(deny_unknown_fields)]
1338pub struct IndexTemplateSummary {
1339    pub name: String,
1340    pub incarnation: Identity,
1341    pub revision: U64,
1342    pub priority: i32,
1343    pub data_stream: bool,
1344}
1345
1346pub const LODESTONE_API_INDEX_TEMPLATE_DETAIL_FORMAT_VERSION: u16 = 1;
1347#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
1348#[serde(deny_unknown_fields)]
1349pub struct IndexTemplateDetail {
1350    pub summary: IndexTemplateSummary,
1351    pub index_patterns: Vec<String>,
1352    pub components: Vec<ComponentTemplateBinding>,
1353    pub mapping: Mapping,
1354    pub settings: RawJson,
1355    #[serde(default, skip_serializing_if = "Option::is_none")]
1356    pub resource_spec: Option<IndexResourceSpec>,
1357}
1358
1359pub const LODESTONE_API_INGEST_PIPELINE_SUMMARY_FORMAT_VERSION: u16 = 1;
1360#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
1361#[serde(deny_unknown_fields)]
1362pub struct IngestPipelineSummary {
1363    pub name: String,
1364    pub incarnation: Identity,
1365    pub revision: U64,
1366    pub digest: Digest,
1367}
1368
1369pub const LODESTONE_API_INGEST_PIPELINE_DETAIL_FORMAT_VERSION: u16 = 1;
1370#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
1371#[serde(deny_unknown_fields)]
1372pub struct IngestPipelineDetail {
1373    pub summary: IngestPipelineSummary,
1374    pub definition: RawJson,
1375}
1376
1377pub const LODESTONE_API_INGEST_PIPELINE_SELECTION_FORMAT_VERSION: u16 = 1;
1378#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
1379#[serde(deny_unknown_fields)]
1380pub struct IngestPipelineSelection {
1381    pub name: String,
1382    pub expected: ExpectedBinding,
1383}
1384
1385pub const LODESTONE_API_LIFECYCLE_POLICY_SUMMARY_FORMAT_VERSION: u16 = 1;
1386#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
1387#[serde(deny_unknown_fields)]
1388pub struct LifecyclePolicySummary {
1389    pub name: String,
1390    pub incarnation: Identity,
1391    pub revision: U64,
1392}
1393
1394pub const LODESTONE_API_ROLLOVER_THRESHOLDS_FORMAT_VERSION: u16 = 1;
1395#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
1396#[serde(deny_unknown_fields)]
1397pub struct RolloverThresholds {
1398    #[serde(default, skip_serializing_if = "Option::is_none")]
1399    pub max_primary_docs: Option<U64>,
1400    #[serde(default, skip_serializing_if = "Option::is_none")]
1401    pub max_primary_bytes: Option<U64>,
1402    #[serde(default, skip_serializing_if = "Option::is_none")]
1403    pub max_age_millis: Option<U64>,
1404}
1405
1406pub const LODESTONE_API_RETENTION_POLICY_FORMAT_VERSION: u16 = 1;
1407#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
1408#[serde(deny_unknown_fields)]
1409pub struct RetentionPolicy {
1410    #[serde(default, skip_serializing_if = "Option::is_none")]
1411    pub document_max_age_millis: Option<U64>,
1412    #[serde(default, skip_serializing_if = "Option::is_none")]
1413    pub backing_index_max_age_millis: Option<U64>,
1414}
1415
1416pub const LODESTONE_API_LIFECYCLE_POLICY_DETAIL_FORMAT_VERSION: u16 = 1;
1417#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
1418#[serde(deny_unknown_fields)]
1419pub struct LifecyclePolicyDetail {
1420    pub summary: LifecyclePolicySummary,
1421    pub rollover: RolloverThresholds,
1422    pub retention: RetentionPolicy,
1423    pub merge_hint: bool,
1424    pub freeze_hint: bool,
1425    pub delete_expired: bool,
1426}
1427
1428pub const LODESTONE_API_TEXT_QUERY_OPERATOR_FORMAT_VERSION: u16 = 1;
1429#[derive(Clone, Copy, Debug, Deserialize, Eq, PartialEq, Serialize)]
1430#[serde(rename_all = "snake_case")]
1431pub enum TextQueryOperator {
1432    Or,
1433    And,
1434}
1435
1436pub const LODESTONE_API_TEXT_QUERY_ANALYZER_FORMAT_VERSION: u16 = 1;
1437#[derive(Clone, Copy, Debug, Deserialize, Eq, PartialEq, Serialize)]
1438#[serde(rename_all = "snake_case")]
1439pub enum TextQueryAnalyzer {
1440    Mapping,
1441    Standard,
1442    Simple,
1443    Whitespace,
1444    Keyword,
1445}
1446
1447pub const LODESTONE_API_ZERO_TERMS_QUERY_FORMAT_VERSION: u16 = 1;
1448#[derive(Clone, Copy, Debug, Deserialize, Eq, PartialEq, Serialize)]
1449#[serde(rename_all = "snake_case")]
1450pub enum ZeroTermsQuery {
1451    None,
1452    All,
1453}
1454
1455pub const LODESTONE_API_TEXT_QUERY_OPTIONS_FORMAT_VERSION: u16 = 1;
1456#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
1457#[serde(deny_unknown_fields)]
1458pub struct TextQueryOptions {
1459    pub operator: TextQueryOperator,
1460    #[serde(default, skip_serializing_if = "Option::is_none")]
1461    pub minimum_should_match: Option<u32>,
1462    pub analyzer: TextQueryAnalyzer,
1463    pub zero_terms_query: ZeroTermsQuery,
1464}
1465
1466pub const LODESTONE_API_MULTI_MATCH_MODE_FORMAT_VERSION: u16 = 1;
1467#[derive(Clone, Copy, Debug, Deserialize, Eq, PartialEq, Serialize)]
1468#[serde(rename_all = "snake_case")]
1469pub enum MultiMatchMode {
1470    BestFields,
1471    MostFields,
1472    Phrase,
1473    PhrasePrefix,
1474    CrossFields,
1475}
1476
1477pub const LODESTONE_API_MULTI_MATCH_FIELD_FORMAT_VERSION: u16 = 1;
1478#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
1479#[serde(deny_unknown_fields)]
1480pub struct MultiMatchField {
1481    pub field: String,
1482    pub boost: ApproximateNumber,
1483}
1484
1485pub const LODESTONE_API_MULTI_MATCH_OPTIONS_FORMAT_VERSION: u16 = 1;
1486#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
1487#[serde(deny_unknown_fields)]
1488pub struct MultiMatchOptions {
1489    pub mode: MultiMatchMode,
1490    pub operator: TextQueryOperator,
1491    #[serde(default, skip_serializing_if = "Option::is_none")]
1492    pub minimum_should_match: Option<u32>,
1493    pub analyzer: TextQueryAnalyzer,
1494    pub zero_terms_query: ZeroTermsQuery,
1495    pub slop: u32,
1496}
1497
1498pub const LODESTONE_API_SORT_ORDER_FORMAT_VERSION: u16 = 1;
1499#[derive(Clone, Copy, Debug, Deserialize, Eq, PartialEq, Serialize)]
1500#[serde(rename_all = "snake_case")]
1501pub enum SortOrder {
1502    Asc,
1503    Desc,
1504}
1505
1506pub const LODESTONE_API_SORT_MODE_FORMAT_VERSION: u16 = 1;
1507#[derive(Clone, Copy, Debug, Deserialize, Eq, PartialEq, Serialize)]
1508#[serde(rename_all = "snake_case")]
1509pub enum SortMode {
1510    Auto,
1511    Min,
1512    Max,
1513}
1514
1515pub const LODESTONE_API_MISSING_ORDER_FORMAT_VERSION: u16 = 1;
1516#[derive(Clone, Copy, Debug, Deserialize, Eq, PartialEq, Serialize)]
1517#[serde(rename_all = "snake_case")]
1518pub enum MissingOrder {
1519    First,
1520    Last,
1521}
1522
1523pub const LODESTONE_API_NESTED_SCORE_MODE_FORMAT_VERSION: u16 = 1;
1524#[derive(Clone, Copy, Debug, Deserialize, Eq, PartialEq, Serialize)]
1525#[serde(rename_all = "snake_case")]
1526pub enum NestedScoreMode {
1527    Avg,
1528    Max,
1529    Min,
1530    None,
1531    Sum,
1532}
1533
1534pub const LODESTONE_API_NESTED_INNER_HITS_FORMAT_VERSION: u16 = 1;
1535#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
1536#[serde(deny_unknown_fields)]
1537pub struct NestedInnerHits {
1538    #[serde(default, skip_serializing_if = "Option::is_none")]
1539    pub name: Option<String>,
1540    pub from: u32,
1541    pub size: u32,
1542    pub sort: Vec<SortSpec>,
1543}
1544
1545pub const LODESTONE_API_SORT_SPEC_FORMAT_VERSION: u16 = 1;
1546#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
1547#[serde(tag = "kind", rename_all = "snake_case", deny_unknown_fields)]
1548pub enum SortSpec {
1549    Score {
1550        order: SortOrder,
1551    },
1552    Field {
1553        field: String,
1554        order: SortOrder,
1555        #[serde(default, skip_serializing_if = "Option::is_none")]
1556        missing: Option<MissingOrder>,
1557        mode: SortMode,
1558    },
1559    NestedField {
1560        path: String,
1561        field: String,
1562        #[serde(default, skip_serializing_if = "Option::is_none")]
1563        filter: Option<Box<Query>>,
1564        order: SortOrder,
1565        #[serde(default, skip_serializing_if = "Option::is_none")]
1566        missing: Option<MissingOrder>,
1567        mode: SortMode,
1568    },
1569}
1570
1571pub const LODESTONE_API_QUERY_FORMAT_VERSION: u16 = 1;
1572#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
1573#[serde(tag = "kind", rename_all = "snake_case", deny_unknown_fields)]
1574pub enum Query {
1575    MatchAll,
1576    Term {
1577        field: String,
1578        value: JsonValue,
1579    },
1580    Terms {
1581        field: String,
1582        values: Vec<JsonValue>,
1583    },
1584    Range {
1585        field: String,
1586        #[serde(default, skip_serializing_if = "Option::is_none")]
1587        lower: Option<JsonValue>,
1588        #[serde(default, skip_serializing_if = "Option::is_none")]
1589        upper: Option<JsonValue>,
1590        include_lower: bool,
1591        include_upper: bool,
1592    },
1593    Text {
1594        field: String,
1595        text: String,
1596        #[serde(default, skip_serializing_if = "Option::is_none")]
1597        options: Option<TextQueryOptions>,
1598    },
1599    MultiMatch {
1600        fields: Vec<MultiMatchField>,
1601        text: String,
1602        #[serde(default, skip_serializing_if = "Option::is_none")]
1603        options: Option<MultiMatchOptions>,
1604    },
1605    Exists {
1606        field: String,
1607    },
1608    Prefix {
1609        field: String,
1610        prefix: String,
1611        #[serde(default, skip_serializing_if = "Option::is_none")]
1612        analyzer: Option<TextQueryAnalyzer>,
1613        analyze_wildcard: bool,
1614    },
1615    Fuzzy {
1616        field: String,
1617        value: String,
1618        distance: u32,
1619        #[serde(default, skip_serializing_if = "Option::is_none")]
1620        analyzer: Option<TextQueryAnalyzer>,
1621    },
1622    Boost {
1623        query: Box<Query>,
1624        boost: ApproximateNumber,
1625    },
1626    Bool {
1627        must: Vec<Query>,
1628        filter: Vec<Query>,
1629        should: Vec<Query>,
1630        must_not: Vec<Query>,
1631        minimum_should_match: u32,
1632    },
1633    Nested {
1634        path: String,
1635        query: Box<Query>,
1636        score_mode: NestedScoreMode,
1637        ignore_unmapped: bool,
1638        #[serde(default, skip_serializing_if = "Option::is_none")]
1639        inner_hits: Option<NestedInnerHits>,
1640    },
1641}
1642
1643pub const LODESTONE_API_DENSE_RETRIEVAL_MODE_FORMAT_VERSION: u16 = 1;
1644#[derive(Clone, Copy, Debug, Deserialize, Eq, PartialEq, Serialize)]
1645#[serde(rename_all = "snake_case")]
1646pub enum DenseRetrievalMode {
1647    Auto,
1648    Ann,
1649    Exact,
1650}
1651
1652pub const LODESTONE_API_VECTOR_ACHIEVED_MODE_FORMAT_VERSION: u16 = 1;
1653#[derive(Clone, Copy, Debug, Deserialize, Eq, PartialEq, Serialize)]
1654#[serde(rename_all = "snake_case")]
1655pub enum VectorAchievedMode {
1656    Exact,
1657    Ann,
1658    Mixed,
1659}
1660
1661pub const LODESTONE_API_VECTOR_BRANCH_DIAGNOSTICS_FORMAT_VERSION: u16 = 2;
1662#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
1663#[serde(deny_unknown_fields)]
1664pub struct VectorBranchDiagnostics {
1665    pub name: String,
1666    pub requested_mode: DenseRetrievalMode,
1667    pub achieved_mode: VectorAchievedMode,
1668    pub result_count: U64,
1669    pub exact_segments: U64,
1670    pub ann_segments: U64,
1671    pub exact_fallback_segments: U64,
1672    pub distance_evaluations: U64,
1673    pub peak_scratch_bytes: U64,
1674    pub fresh_vectors_scanned: U64,
1675    pub realtime_overlay_queries: U64,
1676    pub realtime_overlay_candidates: U64,
1677    pub bundle_roots: U64,
1678    pub object_read_requests: U64,
1679    pub object_bytes_read: U64,
1680    pub cache_hits: U64,
1681    pub cache_misses: U64,
1682    pub snapshot_digests: Vec<Digest>,
1683}
1684
1685pub const LODESTONE_API_DENSE_VECTOR_ELEMENT_TYPE_FORMAT_VERSION: u16 = 1;
1686#[derive(Clone, Copy, Debug, Deserialize, Eq, PartialEq, Serialize)]
1687#[serde(rename_all = "snake_case")]
1688pub enum DenseVectorElementType {
1689    F32,
1690    F16,
1691    I8,
1692}
1693
1694pub const LODESTONE_API_DENSE_VECTOR_BYTE_ORDER_FORMAT_VERSION: u16 = 1;
1695#[derive(Clone, Copy, Debug, Deserialize, Eq, PartialEq, Serialize)]
1696#[serde(rename_all = "snake_case")]
1697pub enum DenseVectorByteOrder {
1698    LittleEndian,
1699}
1700
1701pub const LODESTONE_API_VECTOR_VALUE_FORMAT_VERSION: u16 = 1;
1702#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
1703#[serde(tag = "kind", rename_all = "snake_case", deny_unknown_fields)]
1704pub enum VectorValue {
1705    Numeric {
1706        values: Vec<ApproximateNumber>,
1707    },
1708    Binary {
1709        element_type: DenseVectorElementType,
1710        byte_order: DenseVectorByteOrder,
1711        data_base64: String,
1712        #[serde(default, skip_serializing_if = "Option::is_none")]
1713        quantization_scale: Option<ApproximateNumber>,
1714    },
1715}
1716
1717pub const LODESTONE_API_SPARSE_VECTOR_ENTRY_FORMAT_VERSION: u16 = 1;
1718#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
1719#[serde(deny_unknown_fields)]
1720pub struct SparseVectorEntry {
1721    pub dimension: u32,
1722    pub weight: ApproximateNumber,
1723}
1724
1725pub const LODESTONE_API_SPARSE_VECTOR_VALUE_FORMAT_VERSION: u16 = 1;
1726#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
1727#[serde(deny_unknown_fields)]
1728pub struct SparseVectorValue {
1729    pub entries: Vec<SparseVectorEntry>,
1730}
1731
1732pub const LODESTONE_API_VECTOR_SET_VALUE_FORMAT_VERSION: u16 = 1;
1733#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
1734#[serde(deny_unknown_fields)]
1735pub struct VectorSetValue {
1736    pub vectors: Vec<VectorValue>,
1737}
1738
1739pub const LODESTONE_API_VECTOR_EVALUATION_SNAPSHOT_FORMAT_VERSION: u16 = 1;
1740#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
1741#[serde(tag = "kind", rename_all = "snake_case", deny_unknown_fields)]
1742pub enum VectorEvaluationSnapshot {
1743    CommittedCut { digest: Digest },
1744    Pit { pit: Cursor },
1745}
1746
1747pub const LODESTONE_API_VECTOR_EVALUATION_QUERY_SET_FORMAT_VERSION: u16 = 1;
1748#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
1749#[serde(tag = "kind", rename_all = "snake_case", deny_unknown_fields)]
1750pub enum VectorEvaluationQuerySet {
1751    Sample { seed: U64, sample_count: u32 },
1752    Supplied { digest: Digest, queries: Vec<VectorValue> },
1753}
1754
1755pub const LODESTONE_API_VECTOR_EVALUATION_BUDGET_FORMAT_VERSION: u16 = 1;
1756#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
1757#[serde(deny_unknown_fields)]
1758pub struct VectorEvaluationBudget {
1759    pub maximum_distance_evaluations: U64,
1760    pub maximum_elapsed_work_units: U64,
1761    pub maximum_peak_memory_bytes: U64,
1762    pub maximum_object_reads: U64,
1763    pub maximum_object_bytes: U64,
1764    pub maximum_build_scratch_bytes: U64,
1765    pub maximum_profile_comparisons: u32,
1766}
1767
1768pub const LODESTONE_API_VECTOR_CANDIDATE_POLICY_FORMAT_VERSION: u16 = 1;
1769#[derive(Clone, Copy, Debug, Deserialize, Eq, PartialEq, Serialize)]
1770#[serde(rename_all = "snake_case")]
1771pub enum VectorCandidatePolicy {
1772    Balanced,
1773    HighRecall,
1774    MemoryEfficient,
1775}
1776
1777pub const LODESTONE_API_VECTOR_CALIBRATION_OBJECTIVE_FORMAT_VERSION: u16 = 1;
1778#[derive(Clone, Copy, Debug, Deserialize, Eq, PartialEq, Serialize)]
1779#[serde(rename_all = "snake_case")]
1780pub enum VectorCalibrationObjective {
1781    Balanced,
1782    HighRecall,
1783    MemoryEfficient,
1784}
1785
1786pub const LODESTONE_API_VECTOR_STRATEGY_PROFILE_FORMAT_VERSION: u16 = 1;
1787#[derive(Clone, Copy, Debug, Deserialize, Eq, PartialEq, Serialize)]
1788#[serde(rename_all = "snake_case")]
1789pub enum VectorStrategyProfile {
1790    BalancedV1,
1791    HighRecallV1,
1792    MemoryEfficientV1,
1793}
1794
1795pub const LODESTONE_API_VECTOR_EVALUATION_WORK_FORMAT_VERSION: u16 = 1;
1796#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
1797#[serde(deny_unknown_fields)]
1798pub struct VectorEvaluationWork {
1799    pub distance_evaluations: U64,
1800    pub elapsed_work_units: U64,
1801    pub peak_memory_bytes: U64,
1802    pub object_reads: U64,
1803    pub object_bytes: U64,
1804}
1805
1806pub const LODESTONE_API_VECTOR_EVALUATION_ERROR_CODE_FORMAT_VERSION: u16 = 1;
1807#[derive(Clone, Copy, Debug, Deserialize, Eq, PartialEq, Serialize)]
1808#[serde(rename_all = "snake_case")]
1809pub enum VectorEvaluationErrorCode {
1810    AnnRefused,
1811    ExhaustiveRefused,
1812    TimedOut,
1813    Cancelled,
1814    Internal,
1815}
1816
1817pub const LODESTONE_API_VECTOR_EVALUATION_ERROR_FORMAT_VERSION: u16 = 1;
1818#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
1819#[serde(deny_unknown_fields)]
1820pub struct VectorEvaluationError {
1821    pub sample_ordinal: u32,
1822    pub code: VectorEvaluationErrorCode,
1823}
1824
1825pub const LODESTONE_API_VECTOR_RECALL_RESULT_FORMAT_VERSION: u16 = 1;
1826#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
1827#[serde(deny_unknown_fields)]
1828pub struct VectorRecallResult {
1829    pub format_version: u32,
1830    pub index: Resource,
1831    pub field: String,
1832    pub mapping_generation: U64,
1833    pub snapshot_digest: Digest,
1834    pub query_set_digest: Digest,
1835    pub metric: VectorMetric,
1836    pub k: u32,
1837    pub candidate_policy: VectorCandidatePolicy,
1838    pub strategy_identity: String,
1839    pub completed_samples: u32,
1840    pub ann_result_count: U64,
1841    pub exhaustive_result_count: U64,
1842    pub mean_recall_basis_points: u32,
1843    pub minimum_recall_basis_points: u32,
1844    pub p05_recall_basis_points: u32,
1845    pub p50_recall_basis_points: u32,
1846    pub p90_recall_basis_points: u32,
1847    pub p99_recall_basis_points: u32,
1848    pub ann_work: VectorEvaluationWork,
1849    pub exhaustive_work: VectorEvaluationWork,
1850    pub errors: Vec<VectorEvaluationError>,
1851}
1852
1853pub const LODESTONE_API_VECTOR_CALIBRATION_CANDIDATE_FORMAT_VERSION: u16 = 1;
1854#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
1855#[serde(deny_unknown_fields)]
1856pub struct VectorCalibrationCandidate {
1857    pub profile: VectorStrategyProfile,
1858    pub recall: VectorRecallResult,
1859    pub build_scratch_bytes: U64,
1860    pub resident_bytes: U64,
1861    pub evidence_digest: Digest,
1862}
1863
1864pub const LODESTONE_API_VECTOR_CALIBRATION_RESULT_FORMAT_VERSION: u16 = 1;
1865#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
1866#[serde(deny_unknown_fields)]
1867pub struct VectorCalibrationResult {
1868    pub format_version: u32,
1869    pub objective: VectorCalibrationObjective,
1870    pub candidates: Vec<VectorCalibrationCandidate>,
1871    pub recommended_profile: VectorStrategyProfile,
1872    pub recommended_evidence_digest: Digest,
1873    pub requires_explicit_resource_revision_and_rebuild: bool,
1874}
1875
1876pub const LODESTONE_API_VECTOR_DIAGNOSTIC_RESULT_FORMAT_VERSION: u16 = 1;
1877#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
1878#[serde(tag = "kind", rename_all = "snake_case", deny_unknown_fields)]
1879pub enum VectorDiagnosticResult {
1880    Recall { result: Box<VectorRecallResult> },
1881    Calibration { result: Box<VectorCalibrationResult> },
1882}
1883
1884pub const LODESTONE_API_VECTOR_WARM_COMPONENT_FORMAT_VERSION: u16 = 1;
1885#[derive(Clone, Copy, Debug, Deserialize, Eq, PartialEq, Serialize)]
1886#[serde(rename_all = "snake_case")]
1887pub enum VectorWarmComponent {
1888    Directory,
1889    Approximate,
1890    Exact,
1891}
1892
1893pub const LODESTONE_API_VECTOR_WARM_STATE_FORMAT_VERSION: u16 = 1;
1894#[derive(Clone, Copy, Debug, Deserialize, Eq, PartialEq, Serialize)]
1895#[serde(rename_all = "snake_case")]
1896pub enum VectorWarmState {
1897    Warmed,
1898    Partial,
1899    Stale,
1900}
1901
1902pub const LODESTONE_API_VECTOR_WARM_ACHIEVEMENT_FORMAT_VERSION: u16 = 1;
1903#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
1904#[serde(deny_unknown_fields)]
1905pub struct VectorWarmAchievement {
1906    pub component: VectorWarmComponent,
1907    pub cache_identity: Digest,
1908    pub resident_bytes: U64,
1909}
1910
1911pub const LODESTONE_API_VECTOR_WARM_RESULT_FORMAT_VERSION: u16 = 1;
1912#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
1913#[serde(deny_unknown_fields)]
1914pub struct VectorWarmResult {
1915    pub format_version: u32,
1916    pub operation_identity: Digest,
1917    pub index: Resource,
1918    pub root_digest: Digest,
1919    pub state: VectorWarmState,
1920    pub progress: ExactDecimal,
1921    pub achieved: Vec<VectorWarmAchievement>,
1922    pub object_requests: U64,
1923    pub object_bytes: U64,
1924    pub cache_hits: U64,
1925    pub cache_misses: U64,
1926    pub started_at: U64,
1927    pub completed_at: U64,
1928    pub expires_at: U64,
1929    #[serde(default, skip_serializing_if = "Option::is_none")]
1930    pub residency_intent: Option<VectorResidencyIntent>,
1931}
1932
1933pub const LODESTONE_API_DENSE_RETRIEVAL_THRESHOLD_FORMAT_VERSION: u16 = 1;
1934#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
1935#[serde(tag = "kind", rename_all = "snake_case", deny_unknown_fields)]
1936pub enum DenseRetrievalThreshold {
1937    MinimumScore { value: ApproximateNumber },
1938    MaximumDistance { value: ApproximateNumber },
1939}
1940
1941pub const LODESTONE_API_RETRIEVAL_BRANCH_FORMAT_VERSION: u16 = 3;
1942#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
1943#[serde(tag = "kind", rename_all = "snake_case", deny_unknown_fields)]
1944pub enum RetrievalBranch {
1945    Lexical {
1946        name: String,
1947        query: Box<Query>,
1948        #[serde(default, skip_serializing_if = "Option::is_none")]
1949        filter: Option<Box<Query>>,
1950        window: u32,
1951        weight: ApproximateNumber,
1952    },
1953    Dense {
1954        name: String,
1955        field: String,
1956        query_vector: VectorValue,
1957        #[serde(default, skip_serializing_if = "Option::is_none")]
1958        filter: Option<Box<Query>>,
1959        window: u32,
1960        #[serde(default, skip_serializing_if = "Option::is_none")]
1961        candidates: Option<u32>,
1962        weight: ApproximateNumber,
1963        mode: DenseRetrievalMode,
1964        #[serde(default, skip_serializing_if = "Option::is_none")]
1965        threshold: Option<DenseRetrievalThreshold>,
1966    },
1967    Sparse {
1968        name: String,
1969        field: String,
1970        query_vector: SparseVectorValue,
1971        #[serde(default, skip_serializing_if = "Option::is_none")]
1972        filter: Option<Box<Query>>,
1973        window: u32,
1974        weight: ApproximateNumber,
1975    },
1976    LateInteraction {
1977        name: String,
1978        field: String,
1979        query_vectors: VectorSetValue,
1980        #[serde(default, skip_serializing_if = "Option::is_none")]
1981        filter: Option<Box<Query>>,
1982        window: u32,
1983        candidates: u32,
1984        weight: ApproximateNumber,
1985    },
1986}
1987
1988pub const LODESTONE_API_WEIGHTED_RRF_FUSION_FORMAT_VERSION: u16 = 1;
1989#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
1990#[serde(deny_unknown_fields)]
1991pub struct WeightedRrfFusion {
1992    pub rank_constant: u32,
1993}
1994
1995pub const LODESTONE_API_RETRIEVAL_PLAN_FORMAT_VERSION: u16 = 1;
1996#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
1997#[serde(deny_unknown_fields)]
1998pub struct RetrievalPlan {
1999    pub format_version: u32,
2000    #[serde(default, skip_serializing_if = "Option::is_none")]
2001    pub global_filter: Option<Box<Query>>,
2002    pub branches: Vec<RetrievalBranch>,
2003    pub fusion: WeightedRrfFusion,
2004    pub result_window: u32,
2005}
2006
2007pub const LODESTONE_API_HISTOGRAM_BOUNDS_FORMAT_VERSION: u16 = 1;
2008#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
2009#[serde(deny_unknown_fields)]
2010pub struct HistogramBounds {
2011    #[serde(default, skip_serializing_if = "Option::is_none")]
2012    pub min: Option<ApproximateNumber>,
2013    #[serde(default, skip_serializing_if = "Option::is_none")]
2014    pub max: Option<ApproximateNumber>,
2015}
2016
2017pub const LODESTONE_API_DATE_HISTOGRAM_BOUNDS_FORMAT_VERSION: u16 = 1;
2018#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
2019#[serde(deny_unknown_fields)]
2020pub struct DateHistogramBounds {
2021    #[serde(default, skip_serializing_if = "Option::is_none")]
2022    pub min: Option<I64>,
2023    #[serde(default, skip_serializing_if = "Option::is_none")]
2024    pub max: Option<I64>,
2025}
2026
2027pub const LODESTONE_API_APPROXIMATION_ALGORITHM_FORMAT_VERSION: u16 = 1;
2028#[derive(Clone, Copy, Debug, Deserialize, Eq, PartialEq, Serialize)]
2029#[serde(rename_all = "snake_case")]
2030pub enum ApproximationAlgorithm {
2031    HyperloglogV1,
2032    FloatPrefixHistogramV1,
2033}
2034
2035pub const LODESTONE_API_APPROXIMATION_FORMAT_VERSION: u16 = 1;
2036#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
2037#[serde(deny_unknown_fields)]
2038pub struct Approximation {
2039    pub algorithm: ApproximationAlgorithm,
2040    pub algorithm_version: u32,
2041    pub precision: u32,
2042    pub state_bytes: U64,
2043    #[serde(default, skip_serializing_if = "Option::is_none")]
2044    pub relative_standard_error: Option<ApproximateNumber>,
2045    #[serde(default, skip_serializing_if = "Option::is_none")]
2046    pub maximum_rank_error: Option<ApproximateNumber>,
2047}
2048
2049pub const LODESTONE_API_PERCENTILE_VALUE_FORMAT_VERSION: u16 = 1;
2050#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
2051#[serde(deny_unknown_fields)]
2052pub struct PercentileValue {
2053    pub percent: ApproximateNumber,
2054    #[serde(default, skip_serializing_if = "Option::is_none")]
2055    pub value: Option<ApproximateNumber>,
2056}
2057
2058pub const LODESTONE_API_APPROXIMATE_PERCENTILE_VALUE_FORMAT_VERSION: u16 = 1;
2059#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
2060#[serde(deny_unknown_fields)]
2061pub struct ApproximatePercentileValue {
2062    pub percent: ApproximateNumber,
2063    pub value: ApproximateNumber,
2064    pub lower_bound: ApproximateNumber,
2065    pub upper_bound: ApproximateNumber,
2066    pub maximum_rank_error: ApproximateNumber,
2067}
2068
2069pub const LODESTONE_API_COMPOSITE_ORDER_FORMAT_VERSION: u16 = 1;
2070#[derive(Clone, Copy, Debug, Deserialize, Eq, PartialEq, Serialize)]
2071#[serde(rename_all = "snake_case")]
2072pub enum CompositeOrder {
2073    Asc,
2074    Desc,
2075}
2076
2077pub const LODESTONE_API_COMPOSITE_SOURCE_FORMAT_VERSION: u16 = 1;
2078#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
2079#[serde(tag = "kind", rename_all = "snake_case", deny_unknown_fields)]
2080pub enum CompositeSource {
2081    Terms {
2082        name: String,
2083        field: String,
2084        order: CompositeOrder,
2085    },
2086    DateHistogram {
2087        name: String,
2088        field: String,
2089        #[serde(default, skip_serializing_if = "Option::is_none")]
2090        fixed_interval_millis: Option<U64>,
2091        #[serde(default, skip_serializing_if = "Option::is_none")]
2092        calendar_interval: Option<String>,
2093        #[serde(default, skip_serializing_if = "Option::is_none")]
2094        time_zone: Option<String>,
2095        offset_millis: I64,
2096        order: CompositeOrder,
2097    },
2098}
2099
2100pub const LODESTONE_API_AGGREGATION_FORMAT_VERSION: u16 = 2;
2101#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
2102#[serde(tag = "kind", rename_all = "snake_case", deny_unknown_fields)]
2103pub enum Aggregation {
2104    Terms {
2105        name: String,
2106        field: String,
2107        size: u32,
2108        sub_aggregations: Vec<Aggregation>,
2109    },
2110    Histogram {
2111        name: String,
2112        field: String,
2113        interval: ApproximateNumber,
2114        min_doc_count: U64,
2115        #[serde(default, skip_serializing_if = "Option::is_none")]
2116        extended_bounds: Option<HistogramBounds>,
2117        #[serde(default, skip_serializing_if = "Option::is_none")]
2118        hard_bounds: Option<HistogramBounds>,
2119        offset: ApproximateNumber,
2120        #[serde(default, skip_serializing_if = "Option::is_none")]
2121        missing: Option<ApproximateNumber>,
2122        sub_aggregations: Vec<Aggregation>,
2123    },
2124    Cardinality {
2125        name: String,
2126        field: String,
2127    },
2128    Percentiles {
2129        name: String,
2130        field: String,
2131        percents: Vec<ApproximateNumber>,
2132    },
2133    ApproximateCardinality {
2134        name: String,
2135        field: String,
2136        precision: u32,
2137    },
2138    ApproximatePercentiles {
2139        name: String,
2140        field: String,
2141        percents: Vec<ApproximateNumber>,
2142        precision: u32,
2143    },
2144    Sum {
2145        name: String,
2146        field: String,
2147    },
2148    Avg {
2149        name: String,
2150        field: String,
2151    },
2152    Min {
2153        name: String,
2154        field: String,
2155    },
2156    Max {
2157        name: String,
2158        field: String,
2159    },
2160    Stats {
2161        name: String,
2162        field: String,
2163    },
2164    DateHistogram {
2165        name: String,
2166        field: String,
2167        #[serde(default, skip_serializing_if = "Option::is_none")]
2168        fixed_interval_millis: Option<U64>,
2169        #[serde(default, skip_serializing_if = "Option::is_none")]
2170        calendar_interval: Option<String>,
2171        #[serde(default, skip_serializing_if = "Option::is_none")]
2172        time_zone: Option<String>,
2173        min_doc_count: U64,
2174        #[serde(default, skip_serializing_if = "Option::is_none")]
2175        extended_bounds: Option<DateHistogramBounds>,
2176        #[serde(default, skip_serializing_if = "Option::is_none")]
2177        hard_bounds: Option<DateHistogramBounds>,
2178        offset_millis: I64,
2179        #[serde(default, skip_serializing_if = "Option::is_none")]
2180        missing: Option<I64>,
2181        sub_aggregations: Vec<Aggregation>,
2182    },
2183    Composite {
2184        name: String,
2185        size: u32,
2186        sources: Vec<CompositeSource>,
2187        #[serde(default, skip_serializing_if = "Option::is_none")]
2188        after: Option<Cursor>,
2189        sub_aggregations: Vec<Aggregation>,
2190    },
2191    Filter {
2192        name: String,
2193        query: Box<Query>,
2194        sub_aggregations: Vec<Aggregation>,
2195    },
2196    Nested {
2197        name: String,
2198        path: String,
2199        sub_aggregations: Vec<Aggregation>,
2200    },
2201    ReverseNested {
2202        name: String,
2203        #[serde(default, skip_serializing_if = "Option::is_none")]
2204        path: Option<String>,
2205        sub_aggregations: Vec<Aggregation>,
2206    },
2207}
2208
2209pub const LODESTONE_API_NESTED_SEARCH_HIT_FORMAT_VERSION: u16 = 1;
2210#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
2211#[serde(deny_unknown_fields)]
2212pub struct NestedSearchHit {
2213    pub path: String,
2214    pub ordinal: u32,
2215    #[serde(default, skip_serializing_if = "Option::is_none")]
2216    pub score: Option<ApproximateNumber>,
2217    pub source: RawJson,
2218    pub sort: Vec<JsonValue>,
2219}
2220
2221pub const LODESTONE_API_NAMED_NESTED_INNER_HITS_RESULT_FORMAT_VERSION: u16 = 1;
2222#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
2223#[serde(deny_unknown_fields)]
2224pub struct NamedNestedInnerHitsResult {
2225    pub name: String,
2226    pub total: U64,
2227    pub hits: Vec<NestedSearchHit>,
2228}
2229
2230pub const LODESTONE_API_FRAGMENT_BOUNDARY_FORMAT_VERSION: u16 = 1;
2231#[derive(Clone, Copy, Debug, Deserialize, Eq, PartialEq, Serialize)]
2232#[serde(rename_all = "snake_case")]
2233pub enum FragmentBoundary {
2234    Word,
2235    Sentence,
2236    Paragraph,
2237    WholeField,
2238}
2239
2240pub const LODESTONE_API_FRAGMENT_OFFSET_ENCODING_FORMAT_VERSION: u16 = 1;
2241#[derive(Clone, Copy, Debug, Deserialize, Eq, PartialEq, Serialize)]
2242#[serde(rename_all = "snake_case")]
2243pub enum FragmentOffsetEncoding {
2244    Utf8Bytes,
2245    Utf16CodeUnits,
2246    UnicodeCodepoints,
2247}
2248
2249pub const LODESTONE_API_FRAGMENT_RANKER_FORMAT_VERSION: u16 = 1;
2250#[derive(Clone, Copy, Debug, Deserialize, Eq, PartialEq, Serialize)]
2251#[serde(rename_all = "snake_case")]
2252pub enum FragmentRanker {
2253    LexicalMatchCountV1,
2254}
2255
2256pub const LODESTONE_API_FRAGMENT_REQUEST_FORMAT_VERSION: u16 = 1;
2257#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
2258#[serde(deny_unknown_fields)]
2259pub struct FragmentRequest {
2260    pub fields: Vec<String>,
2261    pub max_fragment_bytes: u32,
2262    pub max_fragments: u32,
2263    pub boundary: FragmentBoundary,
2264    pub offset_encoding: FragmentOffsetEncoding,
2265    pub ranker: FragmentRanker,
2266}
2267
2268pub const LODESTONE_API_SEARCH_FRAGMENT_FORMAT_VERSION: u16 = 1;
2269#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
2270#[serde(deny_unknown_fields)]
2271pub struct SearchFragment {
2272    pub field: String,
2273    pub text: String,
2274    pub start: u32,
2275    pub end: u32,
2276    pub offset_encoding: FragmentOffsetEncoding,
2277    pub rank: u32,
2278    pub match_count: u32,
2279    pub truncated: bool,
2280    pub partial: bool,
2281}
2282
2283pub const LODESTONE_API_NUMERIC_FEATURE_TRANSFORM_FORMAT_VERSION: u16 = 1;
2284#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
2285#[serde(tag = "kind", rename_all = "snake_case", deny_unknown_fields)]
2286pub enum NumericFeatureTransform {
2287    Identity,
2288    Log1p,
2289    Clamp {
2290        minimum: ApproximateNumber,
2291        maximum: ApproximateNumber,
2292    },
2293}
2294
2295pub const LODESTONE_API_NUMERIC_RESULT_FEATURE_FORMAT_VERSION: u16 = 1;
2296#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
2297#[serde(deny_unknown_fields)]
2298pub struct NumericResultFeature {
2299    pub name: String,
2300    pub field: String,
2301    pub transform: NumericFeatureTransform,
2302}
2303
2304pub const LODESTONE_API_RESULT_FEATURE_REQUEST_FORMAT_VERSION: u16 = 1;
2305#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
2306#[serde(deny_unknown_fields)]
2307pub struct ResultFeatureRequest {
2308    pub top_n: u32,
2309    pub include_branch_components: bool,
2310    pub numeric: Vec<NumericResultFeature>,
2311}
2312
2313pub const LODESTONE_API_RESULT_DIVERSIFICATION_FORMAT_VERSION: u16 = 1;
2314#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
2315#[serde(deny_unknown_fields)]
2316pub struct ResultDiversification {
2317    pub fields: Vec<String>,
2318    pub max_per_group: u32,
2319}
2320
2321pub const LODESTONE_API_BRANCH_SCORE_KIND_FORMAT_VERSION: u16 = 2;
2322#[derive(Clone, Copy, Debug, Deserialize, Eq, PartialEq, Serialize)]
2323#[serde(rename_all = "snake_case")]
2324pub enum BranchScoreKind {
2325    LexicalScore,
2326    DenseSimilarity,
2327    SparseDotProduct,
2328    LateInteractionMaxsim,
2329}
2330
2331pub const LODESTONE_API_RESULT_FEATURE_FORMAT_VERSION: u16 = 1;
2332#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
2333#[serde(tag = "kind", rename_all = "snake_case", deny_unknown_fields)]
2334pub enum ResultFeature {
2335    Branch {
2336        branch: String,
2337        score_kind: BranchScoreKind,
2338        rank: u32,
2339        score: ApproximateNumber,
2340    },
2341    Numeric {
2342        name: String,
2343        field: String,
2344        value: ApproximateNumber,
2345    },
2346}
2347
2348pub const LODESTONE_API_SEARCH_HIT_FORMAT_VERSION: u16 = 2;
2349#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
2350#[serde(deny_unknown_fields)]
2351pub struct SearchHit {
2352    pub index: Resource,
2353    pub document_id: String,
2354    #[serde(default, skip_serializing_if = "Option::is_none")]
2355    pub score: Option<ApproximateNumber>,
2356    #[serde(default, skip_serializing_if = "Option::is_none")]
2357    pub source: Option<RawJson>,
2358    pub sort: Vec<JsonValue>,
2359    pub fragments: Vec<SearchFragment>,
2360    pub features: Vec<ResultFeature>,
2361    pub group_values: Vec<JsonValue>,
2362    pub inner_hits: Vec<NamedNestedInnerHitsResult>,
2363}
2364
2365pub const LODESTONE_API_AGGREGATION_BUCKET_FORMAT_VERSION: u16 = 1;
2366#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
2367#[serde(deny_unknown_fields)]
2368pub struct AggregationBucket {
2369    pub key: JsonValue,
2370    pub document_count: U64,
2371    pub sub_aggregations: Vec<AggregationResult>,
2372}
2373
2374pub const LODESTONE_API_AGGREGATION_RESULT_FORMAT_VERSION: u16 = 2;
2375#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
2376#[serde(tag = "kind", rename_all = "snake_case", deny_unknown_fields)]
2377pub enum AggregationResult {
2378    Terms {
2379        name: String,
2380        buckets: Vec<AggregationBucket>,
2381        partial: bool,
2382    },
2383    Histogram {
2384        name: String,
2385        buckets: Vec<AggregationBucket>,
2386        partial: bool,
2387    },
2388    DateHistogram {
2389        name: String,
2390        buckets: Vec<AggregationBucket>,
2391        partial: bool,
2392    },
2393    Composite {
2394        name: String,
2395        buckets: Vec<AggregationBucket>,
2396        #[serde(default, skip_serializing_if = "Option::is_none")]
2397        after: Option<Cursor>,
2398        partial: bool,
2399    },
2400    Filter {
2401        name: String,
2402        buckets: Vec<AggregationBucket>,
2403        partial: bool,
2404    },
2405    SingleBucket {
2406        name: String,
2407        document_count: U64,
2408        sub_aggregations: Vec<AggregationResult>,
2409        partial: bool,
2410    },
2411    Cardinality {
2412        name: String,
2413        #[serde(default, skip_serializing_if = "Option::is_none")]
2414        value: Option<ApproximateNumber>,
2415        partial: bool,
2416    },
2417    Percentiles {
2418        name: String,
2419        values: Vec<PercentileValue>,
2420        partial: bool,
2421    },
2422    ApproximateCardinality {
2423        name: String,
2424        value: ApproximateNumber,
2425        approximation: Approximation,
2426        partial: bool,
2427    },
2428    ApproximatePercentiles {
2429        name: String,
2430        values: Vec<ApproximatePercentileValue>,
2431        approximation: Approximation,
2432        partial: bool,
2433    },
2434    Sum {
2435        name: String,
2436        #[serde(default, skip_serializing_if = "Option::is_none")]
2437        value: Option<ApproximateNumber>,
2438        partial: bool,
2439    },
2440    Avg {
2441        name: String,
2442        #[serde(default, skip_serializing_if = "Option::is_none")]
2443        value: Option<ApproximateNumber>,
2444        partial: bool,
2445    },
2446    Min {
2447        name: String,
2448        #[serde(default, skip_serializing_if = "Option::is_none")]
2449        value: Option<ApproximateNumber>,
2450        partial: bool,
2451    },
2452    Max {
2453        name: String,
2454        #[serde(default, skip_serializing_if = "Option::is_none")]
2455        value: Option<ApproximateNumber>,
2456        partial: bool,
2457    },
2458    Stats {
2459        name: String,
2460        count: U64,
2461        #[serde(default, skip_serializing_if = "Option::is_none")]
2462        min: Option<ApproximateNumber>,
2463        #[serde(default, skip_serializing_if = "Option::is_none")]
2464        max: Option<ApproximateNumber>,
2465        #[serde(default, skip_serializing_if = "Option::is_none")]
2466        avg: Option<ApproximateNumber>,
2467        sum: ApproximateNumber,
2468        partial: bool,
2469    },
2470}
2471
2472pub const LODESTONE_API_SHARD_COUNTS_FORMAT_VERSION: u16 = 1;
2473#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
2474#[serde(deny_unknown_fields)]
2475pub struct ShardCounts {
2476    pub total: u32,
2477    pub successful: u32,
2478    pub skipped: u32,
2479    pub failed: u32,
2480}
2481
2482pub const LODESTONE_API_TOTAL_HITS_RELATION_FORMAT_VERSION: u16 = 1;
2483#[derive(Clone, Copy, Debug, Deserialize, Eq, PartialEq, Serialize)]
2484#[serde(rename_all = "snake_case")]
2485pub enum TotalHitsRelation {
2486    Exact,
2487    LowerBound,
2488    Incomplete,
2489}
2490
2491pub const LODESTONE_API_SEARCH_TOTAL_FORMAT_VERSION: u16 = 1;
2492#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
2493#[serde(deny_unknown_fields)]
2494pub struct SearchTotal {
2495    pub value: U64,
2496    pub relation: TotalHitsRelation,
2497    pub partial: bool,
2498}
2499
2500pub const LODESTONE_API_SEARCH_EXECUTION_FRESHNESS_FORMAT_VERSION: u16 = 1;
2501#[derive(Clone, Copy, Debug, Deserialize, Eq, PartialEq, Serialize)]
2502#[serde(rename_all = "snake_case")]
2503pub enum SearchExecutionFreshness {
2504    Realtime,
2505    Committed,
2506}
2507
2508pub const LODESTONE_API_SEARCH_FRESHNESS_FORMAT_VERSION: u16 = 1;
2509#[derive(Clone, Copy, Debug, Deserialize, Eq, PartialEq, Serialize)]
2510#[serde(rename_all = "snake_case")]
2511pub enum SearchFreshness {
2512    Auto,
2513    Realtime,
2514    Committed,
2515}
2516
2517pub const LODESTONE_API_SEARCH_DEGRADATION_REASON_FORMAT_VERSION: u16 = 1;
2518#[derive(Clone, Copy, Debug, Deserialize, Eq, PartialEq, Serialize)]
2519#[serde(rename_all = "snake_case")]
2520pub enum SearchDegradationReason {
2521    WriterUnavailable,
2522}
2523
2524pub const LODESTONE_API_SEARCH_ACHIEVEMENT_FORMAT_VERSION: u16 = 1;
2525#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
2526#[serde(deny_unknown_fields)]
2527pub struct SearchAchievement {
2528    pub freshness: SearchExecutionFreshness,
2529    pub degradation_reasons: Vec<SearchDegradationReason>,
2530}
2531
2532pub const LODESTONE_API_SEARCH_FAILURE_STAGE_FORMAT_VERSION: u16 = 1;
2533#[derive(Clone, Copy, Debug, Deserialize, Eq, PartialEq, Serialize)]
2534#[serde(rename_all = "snake_case")]
2535pub enum SearchFailureStage {
2536    Preflight,
2537    Dispatch,
2538}
2539
2540pub const LODESTONE_API_SEARCH_FAILURE_REASON_FORMAT_VERSION: u16 = 1;
2541#[derive(Clone, Copy, Debug, Deserialize, Eq, PartialEq, Serialize)]
2542#[serde(rename_all = "snake_case")]
2543pub enum SearchFailureReason {
2544    Cancelled,
2545    Overloaded,
2546    ResourceLimit,
2547    DeadlineExceeded,
2548    Unavailable,
2549    InvalidResponse,
2550}
2551
2552pub const LODESTONE_API_COLLECTION_SHARD_FORMAT_VERSION: u16 = 1;
2553#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
2554#[serde(deny_unknown_fields)]
2555pub struct CollectionShard {
2556    pub collection_id: Identity,
2557    pub index_id: Identity,
2558    pub shard_id: u32,
2559}
2560
2561pub const LODESTONE_API_SEARCH_PARTIAL_FAILURE_FORMAT_VERSION: u16 = 1;
2562#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
2563#[serde(deny_unknown_fields)]
2564pub struct SearchPartialFailure {
2565    pub shard: CollectionShard,
2566    pub stage: SearchFailureStage,
2567    pub reason: SearchFailureReason,
2568    pub recovery: RecoveryAction,
2569}
2570
2571pub const LODESTONE_API_ARTIFACT_FORMAT_VERSION: u16 = 1;
2572#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
2573#[serde(deny_unknown_fields)]
2574pub struct Artifact {
2575    pub locator: Locator,
2576    pub bytes: U64,
2577    pub sha256: Digest,
2578    pub expires_at: U64,
2579}
2580
2581pub const LODESTONE_API_PORTABILITY_STORAGE_CAPABILITY_FORMAT_VERSION: u16 = 1;
2582#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
2583#[serde(deny_unknown_fields)]
2584pub struct PortabilityStorageCapability {
2585    pub backend_authority: String,
2586    pub object_prefix: String,
2587    pub maximum_bytes: U64,
2588    #[serde(default, skip_serializing_if = "Option::is_none")]
2589    pub key_capability_digest: Option<Digest>,
2590}
2591
2592pub const LODESTONE_API_COLLECTION_EXPORT_ARTIFACT_FORMAT_VERSION: u16 = 1;
2593#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
2594#[serde(deny_unknown_fields)]
2595pub struct CollectionExportArtifact {
2596    pub artifact: Artifact,
2597    pub backend_authority: String,
2598    pub object_key: String,
2599    pub source_collection_id: Identity,
2600    pub source_catalog_revision: U64,
2601}
2602
2603pub const LODESTONE_API_SEARCH_VALIDATION_BOUND_FORMAT_VERSION: u16 = 1;
2604#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
2605#[serde(tag = "kind", rename_all = "snake_case", deny_unknown_fields)]
2606pub enum SearchValidationBound {
2607    Exact { value: U64 },
2608    UpperBound { value: U64 },
2609    Unknown { reason: String },
2610}
2611
2612pub const LODESTONE_API_SEARCH_VALIDATION_ESTIMATES_FORMAT_VERSION: u16 = 1;
2613#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
2614#[serde(deny_unknown_fields)]
2615pub struct SearchValidationEstimates {
2616    pub shard_fanout: SearchValidationBound,
2617    pub candidate_documents: SearchValidationBound,
2618    pub segments: SearchValidationBound,
2619    pub buckets: SearchValidationBound,
2620    pub memory_bytes: SearchValidationBound,
2621    pub object_reads: SearchValidationBound,
2622    pub object_bytes: SearchValidationBound,
2623    pub response_bytes: SearchValidationBound,
2624    pub planning_work: SearchValidationBound,
2625}
2626
2627pub const LODESTONE_API_SEARCH_VALIDATION_LIMIT_FORMAT_VERSION: u16 = 1;
2628#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
2629#[serde(deny_unknown_fields)]
2630pub struct SearchValidationLimit {
2631    pub id: String,
2632    pub applied: U64,
2633    pub unit: String,
2634}
2635
2636pub const LODESTONE_API_OPERATION_KIND_FORMAT_VERSION: u16 = 1;
2637#[derive(Clone, Copy, Debug, Deserialize, Eq, PartialEq, Serialize)]
2638#[serde(rename_all = "snake_case")]
2639pub enum OperationKind {
2640    Catalog,
2641    MaintenanceTask,
2642    Security,
2643    Diagnostic,
2644    CollectionExport,
2645    CollectionRestore,
2646    VectorEvaluation,
2647    VectorWarm,
2648    Lifecycle,
2649    Quota,
2650    Admission,
2651}
2652
2653pub const LODESTONE_API_OPERATION_AUTHORITY_FORMAT_VERSION: u16 = 1;
2654#[derive(Clone, Copy, Debug, Deserialize, Eq, PartialEq, Serialize)]
2655#[serde(rename_all = "snake_case")]
2656pub enum OperationAuthority {
2657    Catalog,
2658    Tasks,
2659    Security,
2660    Diagnostics,
2661    Portability,
2662    Lifecycle,
2663    Quota,
2664    Admission,
2665}
2666
2667pub const LODESTONE_API_OPERATION_TARGET_FORMAT_VERSION: u16 = 1;
2668#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
2669#[serde(tag = "kind", rename_all = "snake_case", deny_unknown_fields)]
2670pub enum OperationTarget {
2671    Collection { collection_id: Identity },
2672    Resource { resource: Resource },
2673    Artifact { locator: Locator },
2674    None,
2675}
2676
2677pub const LODESTONE_API_OPERATION_STATE_FORMAT_VERSION: u16 = 1;
2678#[derive(Clone, Copy, Debug, Deserialize, Eq, PartialEq, Serialize)]
2679#[serde(rename_all = "snake_case")]
2680pub enum OperationState {
2681    Pending,
2682    Succeeded,
2683    Failed,
2684    Cancelled,
2685}
2686
2687pub const LODESTONE_API_OPERATION_PENDING_STATE_FORMAT_VERSION: u16 = 1;
2688#[derive(Clone, Copy, Debug, Deserialize, Eq, PartialEq, Serialize)]
2689#[serde(rename_all = "snake_case")]
2690pub enum OperationPendingState {
2691    Queued,
2692    Running,
2693    CancelRequested,
2694}
2695
2696pub const LODESTONE_API_OPERATION_PROGRESS_UNIT_FORMAT_VERSION: u16 = 1;
2697#[derive(Clone, Copy, Debug, Deserialize, Eq, PartialEq, Serialize)]
2698#[serde(rename_all = "snake_case")]
2699pub enum OperationProgressUnit {
2700    BasisPoints,
2701    Items,
2702    Bytes,
2703    WorkUnits,
2704}
2705
2706pub const LODESTONE_API_OPERATION_PROGRESS_FORMAT_VERSION: u16 = 1;
2707#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
2708#[serde(deny_unknown_fields)]
2709pub struct OperationProgress {
2710    pub completed: U64,
2711    pub total: U64,
2712    pub unit: OperationProgressUnit,
2713}
2714
2715pub const LODESTONE_API_OPERATION_RESULT_FORMAT_VERSION: u16 = 1;
2716#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
2717#[serde(tag = "kind", rename_all = "snake_case", deny_unknown_fields)]
2718pub enum OperationResult {
2719    None,
2720    Artifacts { items: Vec<Artifact> },
2721}
2722
2723pub const LODESTONE_API_OPERATION_FAILURE_FORMAT_VERSION: u16 = 1;
2724#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
2725#[serde(deny_unknown_fields)]
2726pub struct OperationFailure {
2727    pub error: ErrorBody,
2728}
2729
2730pub const LODESTONE_API_OPERATION_CANCELLATION_FORMAT_VERSION: u16 = 1;
2731#[derive(Clone, Copy, Debug, Deserialize, Eq, PartialEq, Serialize)]
2732#[serde(rename_all = "snake_case")]
2733pub enum OperationCancellation {
2734    NotCancellable,
2735    Cancellable,
2736    CancelRequested,
2737    Cancelled,
2738}
2739
2740pub const LODESTONE_API_OPERATION_RETENTION_STATE_FORMAT_VERSION: u16 = 1;
2741#[derive(Clone, Copy, Debug, Deserialize, Eq, PartialEq, Serialize)]
2742#[serde(rename_all = "snake_case")]
2743pub enum OperationRetentionState {
2744    Active,
2745    Retired,
2746}
2747
2748pub const LODESTONE_API_OPERATION_RETENTION_FORMAT_VERSION: u16 = 1;
2749#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
2750#[serde(deny_unknown_fields)]
2751pub struct OperationRetention {
2752    pub state: OperationRetentionState,
2753    #[serde(default, skip_serializing_if = "Option::is_none")]
2754    pub retire_after: Option<U64>,
2755}
2756
2757pub const LODESTONE_API_OPERATION_FORMAT_VERSION: u16 = 2;
2758#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
2759#[serde(deny_unknown_fields)]
2760pub struct Operation {
2761    pub locator: Locator,
2762    pub kind: OperationKind,
2763    pub authority: OperationAuthority,
2764    pub target: OperationTarget,
2765    pub authority_revision: U64,
2766    pub current_state: OperationState,
2767    #[serde(default, skip_serializing_if = "Option::is_none")]
2768    pub pending_state: Option<OperationPendingState>,
2769    #[serde(default, skip_serializing_if = "Option::is_none")]
2770    pub progress: Option<OperationProgress>,
2771    #[serde(default, skip_serializing_if = "Option::is_none")]
2772    pub result: Option<OperationResult>,
2773    #[serde(default, skip_serializing_if = "Option::is_none")]
2774    pub failure: Option<OperationFailure>,
2775    pub cancellation: OperationCancellation,
2776    pub retention: OperationRetention,
2777    pub submitted_at: U64,
2778    #[serde(default, skip_serializing_if = "Option::is_none")]
2779    pub terminal_at: Option<U64>,
2780}
2781
2782pub const LODESTONE_API_WRITE_DURABILITY_BOUNDARY_FORMAT_VERSION: u16 = 1;
2783#[derive(Clone, Copy, Debug, Deserialize, Eq, PartialEq, Serialize)]
2784#[serde(rename_all = "snake_case")]
2785pub enum WriteDurabilityBoundary {
2786    Registered,
2787    IncarnationMemory,
2788}
2789
2790pub const LODESTONE_API_WRITE_VISIBILITY_MODE_FORMAT_VERSION: u16 = 1;
2791#[derive(Clone, Copy, Debug, Deserialize, Eq, PartialEq, Serialize)]
2792#[serde(rename_all = "snake_case")]
2793pub enum WriteVisibilityMode {
2794    Applied,
2795    WaitFor,
2796}
2797
2798pub const LODESTONE_API_WRITE_RESPONSE_STAGE_FORMAT_VERSION: u16 = 1;
2799#[derive(Clone, Copy, Debug, Deserialize, Eq, PartialEq, Serialize)]
2800#[serde(rename_all = "snake_case")]
2801pub enum WriteResponseStage {
2802    Validated,
2803    Admitted,
2804    Sequenced,
2805    ObjectPut,
2806    Registered,
2807    AppliedToActiveMemtable,
2808    MicroCommitted,
2809    Sealed,
2810}
2811
2812pub const LODESTONE_API_WRITE_ACHIEVEMENT_FORMAT_VERSION: u16 = 1;
2813#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
2814#[serde(deny_unknown_fields)]
2815pub struct WriteAchievement {
2816    pub durability_class: ResourceDurabilityClass,
2817    pub durability_boundary: WriteDurabilityBoundary,
2818    pub visibility_mode: WriteVisibilityMode,
2819    pub response_stage: WriteResponseStage,
2820}
2821
2822pub const LODESTONE_API_MUTATION_RESOLVER_FORMAT_VERSION: u16 = 1;
2823#[derive(Clone, Copy, Debug, Deserialize, Eq, PartialEq, Serialize)]
2824#[serde(rename_all = "snake_case")]
2825pub enum MutationResolver {
2826    CloneIndex,
2827    GetHistory,
2828    ResolveAppendBulk,
2829    ResolveCatalogAction,
2830    ResolveDocumentBulk,
2831    ResolveDocumentMutation,
2832    ResolveSecurityAction,
2833    ResolveServiceCredentialReservation,
2834    ResolveStateWrite,
2835}
2836
2837pub const LODESTONE_API_MUTATION_OUTCOME_FORMAT_VERSION: u16 = 1;
2838#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
2839#[serde(tag = "state", rename_all = "snake_case", deny_unknown_fields)]
2840pub enum MutationOutcome {
2841    Terminal,
2842    Pending {
2843        #[serde(default, skip_serializing_if = "Option::is_none")]
2844        resolver: Option<MutationResolver>,
2845    },
2846    Indeterminate {
2847        #[serde(default, skip_serializing_if = "Option::is_none")]
2848        resolver: Option<MutationResolver>,
2849    },
2850    ResolutionRequired {
2851        resolver: MutationResolver,
2852    },
2853}
2854
2855pub const LODESTONE_API_SUBMISSION_STATE_FORMAT_VERSION: u16 = 1;
2856#[derive(Clone, Copy, Debug, Deserialize, Eq, PartialEq, Serialize)]
2857#[serde(rename_all = "snake_case")]
2858pub enum SubmissionState {
2859    NotSubmitted,
2860    Submitted,
2861    Resolved,
2862    KnownRetired,
2863    Indeterminate,
2864}
2865
2866pub const LODESTONE_API_EXPECTED_BINDING_FORMAT_VERSION: u16 = 1;
2867#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
2868#[serde(deny_unknown_fields)]
2869pub struct ExpectedBinding {
2870    pub incarnation: Identity,
2871    pub revision: U64,
2872}
2873
2874pub const LODESTONE_API_ADMINISTRATION_ALIAS_ACTION_FORMAT_VERSION: u16 = 1;
2875#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
2876#[serde(tag = "kind", rename_all = "snake_case", deny_unknown_fields)]
2877pub enum AdministrationAliasAction {
2878    Put {
2879        name: String,
2880        #[serde(default, skip_serializing_if = "Option::is_none")]
2881        expected_revision: Option<U64>,
2882        targets: Vec<AliasTarget>,
2883        #[serde(default, skip_serializing_if = "Option::is_none")]
2884        filter: Option<RawJson>,
2885        #[serde(default, skip_serializing_if = "Option::is_none")]
2886        index_routing: Option<String>,
2887        #[serde(default, skip_serializing_if = "Option::is_none")]
2888        search_routing: Option<String>,
2889    },
2890    Delete {
2891        name: String,
2892        expected_revision: U64,
2893    },
2894}
2895
2896pub const LODESTONE_API_ADMINISTRATION_MUTATION_FORMAT_VERSION: u16 = 1;
2897#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
2898#[serde(tag = "kind", rename_all = "snake_case", deny_unknown_fields)]
2899pub enum AdministrationMutation {
2900    ApplyAliasActions {
2901        actions: Vec<AdministrationAliasAction>,
2902    },
2903    PutComponentTemplate {
2904        name: String,
2905        #[serde(default, skip_serializing_if = "Option::is_none")]
2906        expected: Option<ExpectedBinding>,
2907        mapping: Mapping,
2908        settings: RawJson,
2909        #[serde(default, skip_serializing_if = "Option::is_none")]
2910        resource_spec: Option<IndexResourceSpec>,
2911    },
2912    DeleteComponentTemplate {
2913        name: String,
2914        expected: ExpectedBinding,
2915    },
2916    PutIndexTemplate {
2917        name: String,
2918        #[serde(default, skip_serializing_if = "Option::is_none")]
2919        expected: Option<ExpectedBinding>,
2920        priority: i32,
2921        data_stream: bool,
2922        index_patterns: Vec<String>,
2923        components: Vec<ExpectedBinding>,
2924        mapping: Mapping,
2925        settings: RawJson,
2926        #[serde(default, skip_serializing_if = "Option::is_none")]
2927        resource_spec: Option<IndexResourceSpec>,
2928    },
2929    DeleteIndexTemplate {
2930        name: String,
2931        expected: ExpectedBinding,
2932    },
2933    PutIngestPipeline {
2934        name: String,
2935        #[serde(default, skip_serializing_if = "Option::is_none")]
2936        expected: Option<ExpectedBinding>,
2937        definition: RawJson,
2938    },
2939    DeleteIngestPipeline {
2940        name: String,
2941        expected: ExpectedBinding,
2942    },
2943    PutLifecyclePolicy {
2944        name: String,
2945        #[serde(default, skip_serializing_if = "Option::is_none")]
2946        expected: Option<ExpectedBinding>,
2947        rollover: RolloverThresholds,
2948        retention: RetentionPolicy,
2949        merge_hint: bool,
2950        freeze_hint: bool,
2951        delete_expired: bool,
2952    },
2953    DeleteLifecyclePolicy {
2954        name: String,
2955        expected: ExpectedBinding,
2956    },
2957    CreateDataStream {
2958        name: String,
2959        timestamp_field: String,
2960        index_template: ExpectedBinding,
2961        #[serde(default, skip_serializing_if = "Option::is_none")]
2962        lifecycle_policy: Option<ExpectedBinding>,
2963    },
2964    DeleteDataStream {
2965        name: String,
2966        expected_revision: U64,
2967    },
2968    RolloverDataStream {
2969        name: String,
2970        expected_revision: U64,
2971    },
2972}
2973
2974pub const LODESTONE_API_ADMINISTRATION_OUTCOME_FORMAT_VERSION: u16 = 1;
2975#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
2976#[serde(deny_unknown_fields)]
2977pub struct AdministrationOutcome {
2978    pub action_id: Digest,
2979    pub authority_revision: U64,
2980    pub state: String,
2981    #[serde(default, skip_serializing_if = "Option::is_none")]
2982    pub resource: Option<Resource>,
2983}
2984
2985pub const LODESTONE_API_INDEX_CHANGE_APPLY_RECEIPT_FORMAT_VERSION: u16 = 1;
2986#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
2987#[serde(deny_unknown_fields)]
2988pub struct IndexChangeApplyReceipt {
2989    pub action_id: Digest,
2990    pub semantic_digest: Digest,
2991    pub index: Resource,
2992    pub revision: U64,
2993    pub schema_generation: U64,
2994    pub state: String,
2995}
2996
2997pub const LODESTONE_API_BULK_DOCUMENT_ITEM_FORMAT_VERSION: u16 = 1;
2998#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
2999#[serde(deny_unknown_fields)]
3000pub struct BulkDocumentItem {
3001    pub item_action_id: Digest,
3002    pub document_id: String,
3003    pub operation: String,
3004    #[serde(default, skip_serializing_if = "Option::is_none")]
3005    pub source: Option<RawJson>,
3006    #[serde(default, skip_serializing_if = "Option::is_none")]
3007    pub routing: Option<String>,
3008    #[serde(default, skip_serializing_if = "Option::is_none")]
3009    pub condition: Option<DocumentMutationCondition>,
3010    #[serde(default, skip_serializing_if = "Option::is_none")]
3011    pub pipeline: Option<IngestPipelineSelection>,
3012    pub semantic_digest: Digest,
3013}
3014
3015pub const LODESTONE_API_BULK_DOCUMENT_ITEM_OUTCOME_FORMAT_VERSION: u16 = 1;
3016#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
3017#[serde(deny_unknown_fields)]
3018pub struct BulkDocumentItemOutcome {
3019    pub item_action_id: Digest,
3020    #[serde(default, skip_serializing_if = "Option::is_none")]
3021    pub locator: Option<Locator>,
3022    pub state: SubmissionState,
3023    #[serde(default, skip_serializing_if = "Option::is_none")]
3024    pub sequence: Option<U64>,
3025    #[serde(default, skip_serializing_if = "Option::is_none")]
3026    pub mapping_generation: Option<U64>,
3027    pub mapping_adopted: bool,
3028    pub no_document_effect: bool,
3029    #[serde(default, skip_serializing_if = "Option::is_none")]
3030    pub error: Option<ErrorBody>,
3031}
3032
3033pub const LODESTONE_API_BULK_DOCUMENT_OUTCOME_FORMAT_VERSION: u16 = 1;
3034#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
3035#[serde(deny_unknown_fields)]
3036pub struct BulkDocumentOutcome {
3037    pub batch_id: Digest,
3038    pub index: Resource,
3039    pub items: Vec<BulkDocumentItemOutcome>,
3040    pub complete: bool,
3041    #[serde(default, skip_serializing_if = "Option::is_none")]
3042    pub achievement: Option<WriteAchievement>,
3043}
3044
3045pub const LODESTONE_API_RETAINED_APPEND_ITEM_FORMAT_VERSION: u16 = 1;
3046#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
3047#[serde(deny_unknown_fields)]
3048pub struct RetainedAppendItem {
3049    pub item_action_id: Digest,
3050    pub document_id: String,
3051    pub source: RawJson,
3052}
3053
3054pub const LODESTONE_API_RETAINED_APPEND_STATE_FORMAT_VERSION: u16 = 1;
3055#[derive(Clone, Copy, Debug, Deserialize, Eq, PartialEq, Serialize)]
3056#[serde(rename_all = "snake_case")]
3057pub enum RetainedAppendState {
3058    Prepared,
3059    Committed,
3060    Replayed,
3061    Conflict,
3062    NotSubmittedRetryable,
3063    NotSubmittedTerminal,
3064    SubmittedIndeterminate,
3065    Retired,
3066}
3067
3068pub const LODESTONE_API_RETAINED_APPEND_RETRY_SAFETY_FORMAT_VERSION: u16 = 1;
3069#[derive(Clone, Copy, Debug, Deserialize, Eq, PartialEq, Serialize)]
3070#[serde(rename_all = "snake_case")]
3071pub enum RetainedAppendRetrySafety {
3072    Safe,
3073    ResolveOnly,
3074    Terminal,
3075}
3076
3077pub const LODESTONE_API_RETAINED_APPEND_ITEM_OUTCOME_FORMAT_VERSION: u16 = 1;
3078#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
3079#[serde(deny_unknown_fields)]
3080pub struct RetainedAppendItemOutcome {
3081    pub item_action_id: Digest,
3082    #[serde(default, skip_serializing_if = "Option::is_none")]
3083    pub locator: Option<Locator>,
3084    #[serde(default, skip_serializing_if = "Option::is_none")]
3085    pub semantic_digest: Option<Digest>,
3086    pub state: RetainedAppendState,
3087    pub retry_safety: RetainedAppendRetrySafety,
3088    #[serde(default, skip_serializing_if = "Option::is_none")]
3089    pub sequence: Option<U64>,
3090    #[serde(default, skip_serializing_if = "Option::is_none")]
3091    pub primary_term: Option<U64>,
3092    #[serde(default, skip_serializing_if = "Option::is_none")]
3093    pub error: Option<ErrorBody>,
3094}
3095
3096pub const LODESTONE_API_RETAINED_APPEND_BULK_OUTCOME_FORMAT_VERSION: u16 = 1;
3097#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
3098#[serde(deny_unknown_fields)]
3099pub struct RetainedAppendBulkOutcome {
3100    pub batch_id: Digest,
3101    pub index: Resource,
3102    pub items: Vec<RetainedAppendItemOutcome>,
3103    pub complete: bool,
3104    #[serde(default, skip_serializing_if = "Option::is_none")]
3105    pub achievement: Option<WriteAchievement>,
3106}
3107
3108pub const LODESTONE_API_RETAINED_APPEND_OBSERVATION_STATE_FORMAT_VERSION: u16 = 1;
3109#[derive(Clone, Copy, Debug, Deserialize, Eq, PartialEq, Serialize)]
3110#[serde(rename_all = "snake_case")]
3111pub enum RetainedAppendObservationState {
3112    Visible,
3113    Pending,
3114    SubmittedIndeterminate,
3115    Conflict,
3116    Retired,
3117}
3118
3119pub const LODESTONE_API_RETAINED_APPEND_OBSERVATION_OUTCOME_FORMAT_VERSION: u16 = 1;
3120#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
3121#[serde(deny_unknown_fields)]
3122pub struct RetainedAppendObservationOutcome {
3123    pub index: Resource,
3124    pub locator: Locator,
3125    pub state: RetainedAppendObservationState,
3126    #[serde(default, skip_serializing_if = "Option::is_none")]
3127    pub sequence: Option<U64>,
3128    #[serde(default, skip_serializing_if = "Option::is_none")]
3129    pub primary_term: Option<U64>,
3130}
3131
3132pub const LODESTONE_API_BINARY_VALUE_FORMAT_VERSION: u16 = 1;
3133#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
3134#[serde(deny_unknown_fields)]
3135pub struct BinaryValue {
3136    pub bytes_base64: String,
3137}
3138
3139pub const LODESTONE_API_STATE_HASH_FIELD_FORMAT_VERSION: u16 = 1;
3140#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
3141#[serde(deny_unknown_fields)]
3142pub struct StateHashField {
3143    pub field: BinaryValue,
3144    pub value: BinaryValue,
3145}
3146
3147pub const LODESTONE_API_STATE_SET_ENTRY_FORMAT_VERSION: u16 = 1;
3148#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
3149#[serde(deny_unknown_fields)]
3150pub struct StateSetEntry {
3151    pub key: BinaryValue,
3152    pub value: BinaryValue,
3153}
3154
3155pub const LODESTONE_API_STATE_SET_CONDITION_FORMAT_VERSION: u16 = 1;
3156#[derive(Clone, Copy, Debug, Deserialize, Eq, PartialEq, Serialize)]
3157#[serde(rename_all = "snake_case")]
3158pub enum StateSetCondition {
3159    Always,
3160    IfAbsent,
3161    IfPresent,
3162}
3163
3164pub const LODESTONE_API_STATE_OPERATION_FORMAT_VERSION: u16 = 1;
3165#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
3166#[serde(tag = "kind", rename_all = "snake_case", deny_unknown_fields)]
3167pub enum StateOperation {
3168    Get {
3169        key: BinaryValue,
3170    },
3171    Set {
3172        key: BinaryValue,
3173        value: BinaryValue,
3174        condition: StateSetCondition,
3175        #[serde(default, skip_serializing_if = "Option::is_none")]
3176        expires_at_millis: Option<U64>,
3177    },
3178    Delete {
3179        keys: Vec<BinaryValue>,
3180    },
3181    Exists {
3182        keys: Vec<BinaryValue>,
3183    },
3184    ExpireAt {
3185        key: BinaryValue,
3186        absolute_millis: U64,
3187    },
3188    TtlStatus {
3189        key: BinaryValue,
3190    },
3191    Persist {
3192        key: BinaryValue,
3193    },
3194    MultiGet {
3195        keys: Vec<BinaryValue>,
3196    },
3197    MultiSet {
3198        entries: Vec<StateSetEntry>,
3199    },
3200    Increment {
3201        key: BinaryValue,
3202        delta: I64,
3203    },
3204    HashGet {
3205        key: BinaryValue,
3206        field: BinaryValue,
3207    },
3208    HashSet {
3209        key: BinaryValue,
3210        fields: Vec<StateHashField>,
3211    },
3212    HashGetAll {
3213        key: BinaryValue,
3214    },
3215}
3216
3217pub const LODESTONE_API_STATE_OPTIONAL_VALUE_FORMAT_VERSION: u16 = 1;
3218#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
3219#[serde(tag = "state", rename_all = "snake_case", deny_unknown_fields)]
3220pub enum StateOptionalValue {
3221    Missing,
3222    Value { value: BinaryValue },
3223}
3224
3225pub const LODESTONE_API_STATE_COMMAND_RESULT_FORMAT_VERSION: u16 = 1;
3226#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
3227#[serde(tag = "kind", rename_all = "snake_case", deny_unknown_fields)]
3228pub enum StateCommandResult {
3229    Get {
3230        value: StateOptionalValue,
3231    },
3232    Set {
3233        applied: bool,
3234    },
3235    Delete {
3236        removed: u32,
3237    },
3238    Exists {
3239        count: u32,
3240    },
3241    Expire {
3242        changed: bool,
3243    },
3244    TtlStatus {
3245        state: String,
3246        #[serde(default, skip_serializing_if = "Option::is_none")]
3247        remaining_millis: Option<U64>,
3248    },
3249    Persist {
3250        changed: bool,
3251    },
3252    MultiGet {
3253        values: Vec<StateOptionalValue>,
3254    },
3255    MultiSet {
3256        written: u32,
3257    },
3258    Increment {
3259        value: I64,
3260    },
3261    HashGet {
3262        value: StateOptionalValue,
3263    },
3264    HashSet {
3265        fields_added: u32,
3266    },
3267    HashGetAll {
3268        fields: Vec<StateHashField>,
3269    },
3270}
3271
3272pub const LODESTONE_API_STATE_WRITE_RESOLUTION_FORMAT_VERSION: u16 = 1;
3273#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
3274#[serde(tag = "state", rename_all = "snake_case", deny_unknown_fields)]
3275pub enum StateWriteResolution {
3276    NotSubmitted,
3277    Resolved {
3278        result: StateCommandResult,
3279        sequence: U64,
3280    },
3281    KnownRetired {
3282        retired_through: U64,
3283    },
3284    StateReset {
3285        submitted_reset_epoch: U64,
3286        current_reset_epoch: U64,
3287    },
3288    Indeterminate {
3289        #[serde(default, skip_serializing_if = "Option::is_none")]
3290        observed_high_water: Option<U64>,
3291        #[serde(default, skip_serializing_if = "Option::is_none")]
3292        current_high_water: Option<U64>,
3293        #[serde(default, skip_serializing_if = "Option::is_none")]
3294        retired_through: Option<U64>,
3295    },
3296}
3297
3298pub const LODESTONE_API_SERVICE_CREDENTIAL_RESERVATION_FORMAT_VERSION: u16 = 1;
3299#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
3300#[serde(deny_unknown_fields)]
3301pub struct ServiceCredentialReservation {
3302    pub locator: Locator,
3303    pub reservation_action_id: Digest,
3304    pub activation_action_id: Digest,
3305    pub principal_id: Identity,
3306    pub api_key_id: Identity,
3307    pub generation: U64,
3308    pub reservation_expires_at: U64,
3309    pub credential_expires_at: U64,
3310    pub verifier_algorithm: String,
3311    pub verifier_algorithm_version: u32,
3312    pub required_secret_bytes: u32,
3313}
3314
3315pub const LODESTONE_API_SUBSCRIPTION_METADATA_FIELD_FORMAT_VERSION: u16 = 1;
3316#[derive(Clone, Copy, Debug, Deserialize, Eq, PartialEq, Serialize)]
3317#[serde(rename_all = "snake_case")]
3318pub enum SubscriptionMetadataField {
3319    Id,
3320    RoutingHash,
3321    Operation,
3322    Shard,
3323    Sequence,
3324}
3325
3326pub const LODESTONE_API_SUBSCRIPTION_FIELD_FORMAT_VERSION: u16 = 1;
3327#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
3328#[serde(tag = "kind", rename_all = "snake_case", deny_unknown_fields)]
3329pub enum SubscriptionField {
3330    Source { path: String },
3331    Metadata { field: SubscriptionMetadataField },
3332}
3333
3334pub const LODESTONE_API_SUBSCRIPTION_FILTER_FORMAT_VERSION: u16 = 1;
3335#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
3336#[serde(tag = "kind", rename_all = "snake_case", deny_unknown_fields)]
3337pub enum SubscriptionFilter {
3338    All,
3339    Bool {
3340        must: Vec<SubscriptionFilter>,
3341        should: Vec<SubscriptionFilter>,
3342        must_not: Vec<SubscriptionFilter>,
3343        minimum_should_match: u32,
3344    },
3345    Term {
3346        field: SubscriptionField,
3347        value: JsonValue,
3348    },
3349    Terms {
3350        field: SubscriptionField,
3351        values: Vec<JsonValue>,
3352    },
3353    Range {
3354        field: SubscriptionField,
3355        #[serde(default, skip_serializing_if = "Option::is_none")]
3356        gt: Option<JsonValue>,
3357        #[serde(default, skip_serializing_if = "Option::is_none")]
3358        gte: Option<JsonValue>,
3359        #[serde(default, skip_serializing_if = "Option::is_none")]
3360        lt: Option<JsonValue>,
3361        #[serde(default, skip_serializing_if = "Option::is_none")]
3362        lte: Option<JsonValue>,
3363    },
3364    Exists {
3365        field: SubscriptionField,
3366    },
3367    Prefix {
3368        field: SubscriptionField,
3369        value: String,
3370    },
3371}
3372
3373pub const LODESTONE_API_SUBSCRIPTION_CURSOR_ENTRY_FORMAT_VERSION: u16 = 1;
3374#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
3375#[serde(deny_unknown_fields)]
3376pub struct SubscriptionCursorEntry {
3377    pub index: Resource,
3378    pub routing_revision: U64,
3379    pub recovery_era: Identity,
3380    pub shard_id: U64,
3381    pub sequence: U64,
3382}
3383
3384pub const LODESTONE_API_SUBSCRIPTION_ROUTE_FORMAT_VERSION: u16 = 1;
3385#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
3386#[serde(deny_unknown_fields)]
3387pub struct SubscriptionRoute {
3388    pub index: Resource,
3389    pub routing_revision: U64,
3390    pub shard_ids: Vec<U64>,
3391}
3392
3393pub const LODESTONE_API_SUBSCRIPTION_START_POSITION_FORMAT_VERSION: u16 = 1;
3394#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
3395#[serde(tag = "kind", rename_all = "snake_case", deny_unknown_fields)]
3396pub enum SubscriptionStartPosition {
3397    FromNow,
3398    Resume {
3399        routes: Vec<SubscriptionRoute>,
3400        cut: Vec<SubscriptionCursorEntry>,
3401    },
3402}
3403
3404pub const LODESTONE_API_SUBSCRIPTION_START_FORMAT_VERSION: u16 = 1;
3405#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
3406#[serde(deny_unknown_fields)]
3407pub struct SubscriptionStart {
3408    pub format_version: u32,
3409    pub request_id: String,
3410    pub index: Resource,
3411    #[serde(default, skip_serializing_if = "Option::is_none")]
3412    pub filter: Option<SubscriptionFilter>,
3413    pub include_deletes: bool,
3414    pub source_projection: Vec<String>,
3415    pub reconnect_attempt: u32,
3416    pub start: SubscriptionStartPosition,
3417    pub heartbeat_millis: U64,
3418    pub schema_digest: Digest,
3419}
3420
3421pub const LODESTONE_API_SUBSCRIPTION_ACCEPTED_FORMAT_VERSION: u16 = 1;
3422#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
3423#[serde(deny_unknown_fields)]
3424pub struct SubscriptionAccepted {
3425    pub format_version: u32,
3426    pub routes: Vec<SubscriptionRoute>,
3427    pub accepted_cut: Vec<SubscriptionCursorEntry>,
3428    pub schema_digest: Digest,
3429}
3430
3431pub const LODESTONE_API_SUBSCRIPTION_WRITER_FENCE_FORMAT_VERSION: u16 = 1;
3432#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
3433#[serde(deny_unknown_fields)]
3434pub struct SubscriptionWriterFence {
3435    pub recovery_era: Identity,
3436    pub epoch: u32,
3437}
3438
3439pub const LODESTONE_API_SUBSCRIPTION_EVENT_FORMAT_VERSION: u16 = 1;
3440#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
3441#[serde(deny_unknown_fields)]
3442pub struct SubscriptionEvent {
3443    pub format_version: u32,
3444    pub event_id: Digest,
3445    pub index: Resource,
3446    pub shard_id: U64,
3447    pub recovery_era: Identity,
3448    pub writer_fence: SubscriptionWriterFence,
3449    pub routing_revision: U64,
3450    pub sequence: U64,
3451    pub operation: String,
3452    pub document_id: String,
3453    pub routing_hash: u32,
3454    #[serde(default, skip_serializing_if = "Option::is_none")]
3455    pub source: Option<RawJson>,
3456}
3457
3458pub const LODESTONE_API_SUBSCRIPTION_HEARTBEAT_FORMAT_VERSION: u16 = 1;
3459#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
3460#[serde(deny_unknown_fields)]
3461pub struct SubscriptionHeartbeat {
3462    pub format_version: u32,
3463    pub confirmed_cut: Vec<SubscriptionCursorEntry>,
3464    pub route_revision: U64,
3465    pub authorization_revision: U64,
3466    pub authorization_valid_until_millis: U64,
3467}
3468
3469pub const LODESTONE_API_SUBSCRIPTION_GAP_FORMAT_VERSION: u16 = 1;
3470#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
3471#[serde(deny_unknown_fields)]
3472pub struct SubscriptionGap {
3473    pub format_version: u32,
3474    pub affected: Vec<SubscriptionCursorEntry>,
3475    pub last_confirmed: Vec<SubscriptionCursorEntry>,
3476    pub earliest_available: Vec<SubscriptionCursorEntry>,
3477    pub reason: String,
3478    pub terminal: bool,
3479}
3480
3481pub const LODESTONE_API_SUBSCRIPTION_TERMINAL_REASON_FORMAT_VERSION: u16 = 1;
3482#[derive(Clone, Copy, Debug, Deserialize, Eq, PartialEq, Serialize)]
3483#[serde(rename_all = "snake_case")]
3484pub enum SubscriptionTerminalReason {
3485    Completed,
3486    Cancelled,
3487    DeadlineExceeded,
3488    StaleCursor,
3489    RetentionGap,
3490    Unavailable,
3491    Internal,
3492}
3493
3494pub const LODESTONE_API_SUBSCRIPTION_TERMINAL_FORMAT_VERSION: u16 = 2;
3495#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
3496#[serde(deny_unknown_fields)]
3497pub struct SubscriptionTerminal {
3498    pub format_version: u32,
3499    pub reason: SubscriptionTerminalReason,
3500    pub recovery: RecoveryAction,
3501}
3502
3503pub const LODESTONE_API_SUBSCRIPTION_FRAME_FORMAT_VERSION: u16 = 1;
3504#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
3505#[serde(tag = "frame", rename_all = "snake_case", deny_unknown_fields)]
3506pub enum SubscriptionFrame {
3507    Accepted { body: SubscriptionAccepted },
3508    Event { body: SubscriptionEvent },
3509    Heartbeat { body: SubscriptionHeartbeat },
3510    Gap { body: SubscriptionGap },
3511    Terminal { body: SubscriptionTerminal },
3512}
3513
3514pub const LODESTONE_API_STREAM_BINDING_FORMAT_VERSION: u16 = 1;
3515#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
3516#[serde(deny_unknown_fields)]
3517pub struct StreamBinding {
3518    pub name: String,
3519    pub transport: String,
3520    pub service: String,
3521    pub method: String,
3522    pub endpoint: String,
3523    pub auth_metadata: String,
3524    pub auth_scheme: String,
3525    pub semantic_format_version: u32,
3526    pub schema_digest: Digest,
3527}
3528
3529pub const LODESTONE_API_CAPABILITY_GRANT_FORMAT_VERSION: u16 = 1;
3530#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
3531#[serde(deny_unknown_fields)]
3532pub struct CapabilityGrant {
3533    pub command: String,
3534    pub action: String,
3535    pub state: String,
3536    pub reason: String,
3537    pub mutation_class: String,
3538    pub cancellable: bool,
3539    pub workload_classes: Vec<WorkloadClass>,
3540    pub possible_submission_states: Vec<String>,
3541    pub capability_family: String,
3542    pub effect_class: String,
3543    pub risk_flags: Vec<String>,
3544    pub admissible_errors: Vec<String>,
3545    pub referenced_limits: Vec<String>,
3546    pub retry_safety: String,
3547    pub identity_requirement: String,
3548    #[serde(default, skip_serializing_if = "Option::is_none")]
3549    pub resolver_command: Option<String>,
3550    pub cancellation: String,
3551    pub side_effects: Vec<String>,
3552    pub recovery: String,
3553    pub index_patterns: Vec<String>,
3554    pub exact_index_incarnations: Vec<Identity>,
3555}
3556
3557pub const LODESTONE_API_PROTOCOL_LIMIT_FORMAT_VERSION: u16 = 1;
3558#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
3559#[serde(deny_unknown_fields)]
3560pub struct ProtocolLimit {
3561    pub id: String,
3562    pub default: U64,
3563    pub maximum: U64,
3564    pub unit: String,
3565}
3566
3567pub const LODESTONE_API_DOCUMENT_MUTATION_CONDITION_FORMAT_VERSION: u16 = 1;
3568#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
3569#[serde(tag = "kind", rename_all = "snake_case", deny_unknown_fields)]
3570pub enum DocumentMutationCondition {
3571    Any,
3572    MustNotExist,
3573    IfSeqNo { seq_no: U64 },
3574    IfSeqNoAndPrimaryTerm { seq_no: U64, primary_term: U64 },
3575}
3576
3577pub const LODESTONE_API_AUDIT_ADAPTER_FORMAT_VERSION: u16 = 1;
3578#[derive(Clone, Copy, Debug, Deserialize, Eq, PartialEq, Serialize)]
3579#[serde(rename_all = "snake_case")]
3580pub enum AuditAdapter {
3581    Native,
3582    Elasticsearch,
3583    Otlp,
3584    Jaeger,
3585    Grpc,
3586    WebSocket,
3587    Resp,
3588    InternalRpc,
3589    ControlPlane,
3590}
3591
3592pub const LODESTONE_API_AUDIT_DECISION_FORMAT_VERSION: u16 = 1;
3593#[derive(Clone, Copy, Debug, Deserialize, Eq, PartialEq, Serialize)]
3594#[serde(rename_all = "snake_case")]
3595pub enum AuditDecision {
3596    Allowed,
3597    DeniedAuthentication,
3598    DeniedAuthorization,
3599    DeniedQuota,
3600    DeniedStalePolicy,
3601}
3602
3603pub const LODESTONE_API_AUDIT_OUTCOME_FORMAT_VERSION: u16 = 1;
3604#[derive(Clone, Copy, Debug, Deserialize, Eq, PartialEq, Serialize)]
3605#[serde(rename_all = "snake_case")]
3606pub enum AuditOutcome {
3607    AdmissionAccepted,
3608    AuthenticationRefused,
3609    AuthorizationRefused,
3610    QuotaRefused,
3611    PolicyUnavailable,
3612    DecodeFailed,
3613    OperationSucceeded,
3614    OperationFailed,
3615    OperationIndeterminate,
3616    FailedRedacted,
3617}
3618
3619pub const LODESTONE_API_AUDIT_DETAIL_FORMAT_VERSION: u16 = 1;
3620#[derive(Clone, Copy, Debug, Deserialize, Eq, PartialEq, Serialize)]
3621#[serde(rename_all = "snake_case")]
3622pub enum AuditDetail {
3623    PolicyMutation,
3624    CredentialRotation,
3625    CredentialRevocation,
3626    QuotaAdmission,
3627    RequestAdmission,
3628    ExplicitCrashGap,
3629    BackupLifecycle,
3630    RetentionLifecycle,
3631    FieldPromotion,
3632}
3633
3634pub const LODESTONE_API_AUDIT_GAP_REASON_FORMAT_VERSION: u16 = 1;
3635#[derive(Clone, Copy, Debug, Deserialize, Eq, PartialEq, Serialize)]
3636#[serde(rename_all = "snake_case")]
3637pub enum AuditGapReason {
3638    ExplicitCrashGap,
3639    Retention,
3640}
3641
3642pub const LODESTONE_API_AUDIT_EVENT_FORMAT_VERSION: u16 = 2;
3643#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
3644#[serde(deny_unknown_fields)]
3645pub struct AuditEvent {
3646    pub event_id: Digest,
3647    pub recovery_era: Identity,
3648    pub sequence: U64,
3649    pub server_time: U64,
3650    #[serde(default, skip_serializing_if = "Option::is_none")]
3651    pub principal_id: Option<Identity>,
3652    #[serde(default, skip_serializing_if = "Option::is_none")]
3653    pub api_key_id: Option<Identity>,
3654    pub policy_revision: U64,
3655    pub adapter: AuditAdapter,
3656    pub action: String,
3657    pub resource_digest: Digest,
3658    pub request_digest: Digest,
3659    #[serde(default, skip_serializing_if = "Option::is_none")]
3660    pub correlation_id: Option<Identity>,
3661    #[serde(default, skip_serializing_if = "Option::is_none")]
3662    pub diagnostic_id: Option<Identity>,
3663    pub decision: AuditDecision,
3664    pub outcome: AuditOutcome,
3665    pub detail: AuditDetail,
3666}
3667
3668pub const LODESTONE_API_AUDIT_GAP_FORMAT_VERSION: u16 = 2;
3669#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
3670#[serde(deny_unknown_fields)]
3671pub struct AuditGap {
3672    pub recovery_era: Identity,
3673    pub first_sequence: U64,
3674    pub last_sequence: U64,
3675    pub reason: AuditGapReason,
3676}
3677
3678pub const LODESTONE_API_AUDIT_STREAM_STATE_FORMAT_VERSION: u16 = 1;
3679#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
3680#[serde(deny_unknown_fields)]
3681pub struct AuditStreamState {
3682    pub recovery_era: Identity,
3683    pub earliest_available_sequence: U64,
3684    pub snapshot_through: U64,
3685}
3686
3687pub const LODESTONE_API_SERVICE_CREDENTIAL_GRANT_FORMAT_VERSION: u16 = 1;
3688#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
3689#[serde(deny_unknown_fields)]
3690pub struct ServiceCredentialGrant {
3691    pub role_name: String,
3692    pub role_version: U64,
3693}
3694
3695pub const LODESTONE_API_SERVICE_CREDENTIAL_SUMMARY_FORMAT_VERSION: u16 = 1;
3696#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
3697#[serde(deny_unknown_fields)]
3698pub struct ServiceCredentialSummary {
3699    pub principal_id: Identity,
3700    pub api_key_id: Identity,
3701    pub generation: U64,
3702    pub state: String,
3703    #[serde(default, skip_serializing_if = "Option::is_none")]
3704    pub expires_at: Option<U64>,
3705    pub grants: Vec<ServiceCredentialGrant>,
3706}
3707
3708pub const LODESTONE_API_SECURITY_ROLE_FORMAT_VERSION: u16 = 1;
3709#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
3710#[serde(deny_unknown_fields)]
3711pub struct SecurityRole {
3712    pub role_name: String,
3713    pub version: U64,
3714    pub permissions: Vec<String>,
3715    pub delegable_permissions: Vec<String>,
3716    pub allowed_workload_classes: Vec<WorkloadClass>,
3717    pub index_patterns: Vec<String>,
3718    pub append_index_incarnations: Vec<Identity>,
3719}
3720
3721pub const LODESTONE_API_ROLE_APPEND_SCOPE_CHANGE_FORMAT_VERSION: u16 = 1;
3722#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
3723#[serde(tag = "kind", rename_all = "snake_case", deny_unknown_fields)]
3724pub enum RoleAppendScopeChange {
3725    Add { index: Resource },
3726    Remove { index_incarnation: Identity },
3727}
3728
3729pub const LODESTONE_API_ROLE_APPEND_ACCESS_PREPARATION_FORMAT_VERSION: u16 = 1;
3730#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
3731#[serde(tag = "state", rename_all = "snake_case", deny_unknown_fields)]
3732pub enum RoleAppendAccessPreparation {
3733    Prepared {
3734        locator: Locator,
3735        semantic_digest: Digest,
3736        expires_at: U64,
3737        predecessor_role_version: U64,
3738        successor_role_version: U64,
3739    },
3740    AlreadySatisfied {
3741        role: SecurityRole,
3742    },
3743}
3744
3745pub const LODESTONE_API_SECURITY_ACTION_OUTCOME_FORMAT_VERSION: u16 = 1;
3746#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
3747#[serde(tag = "kind", rename_all = "snake_case", deny_unknown_fields)]
3748pub enum SecurityActionOutcome {
3749    Reserved {
3750        principal_id: Identity,
3751        api_key_id: Identity,
3752        generation: U64,
3753    },
3754    Activated {
3755        principal_id: Identity,
3756        api_key_id: Identity,
3757        generation: U64,
3758    },
3759    Revoked {
3760        principal_id: Identity,
3761        api_key_id: Identity,
3762        generation: U64,
3763    },
3764    Retired {
3765        principal_id: Identity,
3766        api_key_id: Identity,
3767        generation: U64,
3768    },
3769}
3770
3771pub const LODESTONE_API_MAINTENANCE_WORK_STATE_FORMAT_VERSION: u16 = 1;
3772#[derive(Clone, Copy, Debug, Deserialize, Eq, PartialEq, Serialize)]
3773#[serde(rename_all = "snake_case")]
3774pub enum MaintenanceWorkState {
3775    ParkedOperatorRequired,
3776    RetryWait,
3777    RetryReady,
3778    Leased,
3779    Deferred,
3780    Runnable,
3781}
3782
3783pub const LODESTONE_API_MAINTENANCE_ATTEMPT_STATE_FORMAT_VERSION: u16 = 1;
3784#[derive(Clone, Copy, Debug, Deserialize, Eq, PartialEq, Serialize)]
3785#[serde(rename_all = "snake_case")]
3786pub enum MaintenanceAttemptState {
3787    Running,
3788    DeadlineExceededDraining,
3789    DeadlineExceededReclaimPending,
3790    CancellationDraining,
3791    ClaimRecoveryPending,
3792}
3793
3794pub const LODESTONE_API_MAINTENANCE_FAILURE_CLASS_FORMAT_VERSION: u16 = 1;
3795#[derive(Clone, Copy, Debug, Deserialize, Eq, PartialEq, Serialize)]
3796#[serde(rename_all = "snake_case")]
3797pub enum MaintenanceFailureClass {
3798    Corruption,
3799    AttemptBudget,
3800    StructuralLimit,
3801    Execution,
3802    Other,
3803}
3804
3805pub const LODESTONE_API_MAINTENANCE_FAILURE_CLASS_COUNT_FORMAT_VERSION: u16 = 1;
3806#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
3807#[serde(deny_unknown_fields)]
3808pub struct MaintenanceFailureClassCount {
3809    pub class: MaintenanceFailureClass,
3810    pub count: U64,
3811}
3812
3813pub const LODESTONE_API_MAINTENANCE_ATTEMPT_OBSERVATION_FORMAT_VERSION: u16 = 1;
3814#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
3815#[serde(deny_unknown_fields)]
3816pub struct MaintenanceAttemptObservation {
3817    pub state: MaintenanceAttemptState,
3818    pub lease_epoch: U64,
3819    pub lease_expires_at: U64,
3820    pub observed_at_millis: U64,
3821}
3822
3823pub const LODESTONE_API_MAINTENANCE_TASK_SCOPE_FORMAT_VERSION: u16 = 1;
3824#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
3825#[serde(deny_unknown_fields)]
3826pub struct MaintenanceTaskScope {
3827    pub kind: String,
3828    #[serde(default, skip_serializing_if = "Option::is_none")]
3829    pub index: Option<Resource>,
3830    #[serde(default, skip_serializing_if = "Option::is_none")]
3831    pub shard_id: Option<u32>,
3832}
3833
3834pub const LODESTONE_API_MAINTENANCE_TASK_STATUS_FORMAT_VERSION: u16 = 1;
3835#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
3836#[serde(deny_unknown_fields)]
3837pub struct MaintenanceTaskStatus {
3838    pub task_id: Identity,
3839    pub kind: String,
3840    pub scope: MaintenanceTaskScope,
3841    pub checkpoint_generation: U64,
3842    pub attempt_count: u32,
3843    pub admitted_at: U64,
3844    pub last_transition_at: U64,
3845    pub last_progress_at: U64,
3846    pub work_state: MaintenanceWorkState,
3847    pub state_since: U64,
3848    #[serde(default, skip_serializing_if = "Option::is_none")]
3849    pub defer_reason: Option<String>,
3850    pub cancellation_requested: bool,
3851    #[serde(default, skip_serializing_if = "Option::is_none")]
3852    pub retry_not_before: Option<U64>,
3853    #[serde(default, skip_serializing_if = "Option::is_none")]
3854    pub failure_at: Option<U64>,
3855    #[serde(default, skip_serializing_if = "Option::is_none")]
3856    pub lease_acquired_at: Option<U64>,
3857    #[serde(default, skip_serializing_if = "Option::is_none")]
3858    pub lease_expires_at: Option<U64>,
3859    #[serde(default, skip_serializing_if = "Option::is_none")]
3860    pub failure_class: Option<MaintenanceFailureClass>,
3861    #[serde(default, skip_serializing_if = "Option::is_none")]
3862    pub failure_code: Option<String>,
3863    pub operator_action_required: bool,
3864    #[serde(default, skip_serializing_if = "Option::is_none")]
3865    pub local_attempt: Option<MaintenanceAttemptObservation>,
3866}
3867
3868pub const LODESTONE_API_MAINTENANCE_STATUS_AGGREGATE_FORMAT_VERSION: u16 = 1;
3869#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
3870#[serde(deny_unknown_fields)]
3871pub struct MaintenanceStatusAggregate {
3872    pub format_version: u32,
3873    pub recovery_era: Identity,
3874    pub source_revision: U64,
3875    pub root_revision: U64,
3876    pub logical_observation_time: U64,
3877    #[serde(default, skip_serializing_if = "Option::is_none")]
3878    pub local_observation_millis: Option<U64>,
3879    pub total_incomplete: U64,
3880    pub parked_operator_required: U64,
3881    pub retry_wait: U64,
3882    pub retry_ready: U64,
3883    pub leased: U64,
3884    pub deferred: U64,
3885    pub runnable: U64,
3886    pub eligible_backlog: U64,
3887    pub cancellation_requested: U64,
3888    #[serde(default, skip_serializing_if = "Option::is_none")]
3889    pub oldest_backlog_age: Option<U64>,
3890    #[serde(default, skip_serializing_if = "Option::is_none")]
3891    pub oldest_runnable_age: Option<U64>,
3892    #[serde(default, skip_serializing_if = "Option::is_none")]
3893    pub oldest_retry_wait_age: Option<U64>,
3894    #[serde(default, skip_serializing_if = "Option::is_none")]
3895    pub oldest_parked_age: Option<U64>,
3896    #[serde(default, skip_serializing_if = "Option::is_none")]
3897    pub oldest_no_progress_age: Option<U64>,
3898    pub current_action_capacity: u32,
3899    pub maximum_action_capacity: u32,
3900    pub active_passes: U64,
3901    pub local_in_flight: U64,
3902    pub deadline_draining: U64,
3903    pub cancellation_draining: U64,
3904    pub claim_recovery_pending: U64,
3905    pub projection_refresh_pending: bool,
3906    #[serde(default, skip_serializing_if = "Option::is_none")]
3907    pub durable_last_progress_at: Option<U64>,
3908    pub tasks_claimed_total: U64,
3909    pub tasks_progressed_total: U64,
3910    pub tasks_completed_total: U64,
3911    pub task_retries_total: U64,
3912    pub task_failures_total: U64,
3913    pub deadline_failures_total: U64,
3914    pub cancellations_total: U64,
3915    pub overlay_capacity_exhaustions_total: U64,
3916    pub failure_classes: Vec<MaintenanceFailureClassCount>,
3917}
3918
3919pub const LODESTONE_API_RUNTIME_STATUS_DETAIL_FORMAT_VERSION: u16 = 1;
3920#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
3921#[serde(deny_unknown_fields)]
3922pub struct RuntimeStatusDetail {
3923    pub metastore_revision: U64,
3924    pub root_revision: U64,
3925    pub logical_time: U64,
3926    pub degraded_dependencies: Vec<String>,
3927}
3928
3929pub const LODESTONE_API_RESULT_CACHE_STATUS_FORMAT_VERSION: u16 = 2;
3930#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
3931#[serde(deny_unknown_fields)]
3932pub struct ResultCacheStatus {
3933    pub format_version: u32,
3934    pub hits: U64,
3935    pub misses: U64,
3936    pub admissions: U64,
3937    pub bypasses: U64,
3938    pub evictions: U64,
3939    pub collection_bytes: U64,
3940    pub collection_entries: u32,
3941}
3942
3943pub const LODESTONE_API_FIELD_PROMOTION_STATUS_FORMAT_VERSION: u16 = 1;
3944#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
3945#[serde(deny_unknown_fields)]
3946pub struct FieldPromotionStatus {
3947    pub format_version: u32,
3948    pub index: Resource,
3949    pub mapping_generation: U64,
3950    pub policy_generation: U64,
3951    #[serde(default, skip_serializing_if = "Option::is_none")]
3952    pub last_decision_generation: Option<U64>,
3953    pub heat_records: u32,
3954    pub promoted_fields: u32,
3955    pub extra_bytes: U64,
3956    pub enabled: bool,
3957}
3958
3959pub const LODESTONE_API_OVERLOAD_SHARD_STATUS_FORMAT_VERSION: u16 = 2;
3960#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
3961#[serde(deny_unknown_fields)]
3962pub struct OverloadShardStatus {
3963    pub format_version: u32,
3964    pub shard_id: u32,
3965    pub writer_epoch: U64,
3966    pub configured_mode: String,
3967    pub effective_disposition: String,
3968    pub registered_through: U64,
3969    pub indexed_through: U64,
3970    pub lag_operations: U64,
3971    pub backlog_bytes: U64,
3972    pub oldest_age_millis: U64,
3973    pub collection_share_bytes: U64,
3974    pub recovery_ops_this_pass: u32,
3975    pub pending_overlay_documents: U64,
3976    #[serde(default, skip_serializing_if = "Option::is_none")]
3977    pub shed_reason: Option<String>,
3978}
3979
3980pub const LODESTONE_API_EXTERNAL_KEY_BINDING_FORMAT_VERSION: u16 = 1;
3981#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
3982#[serde(deny_unknown_fields)]
3983pub struct ExternalKeyBinding {
3984    pub content_key_id: Identity,
3985    pub content_key_generation: U64,
3986    pub binding_id: Identity,
3987    pub binding_generation: U64,
3988    pub access_generation: U64,
3989    pub opaque_binding_base64: String,
3990    pub object_context_digest: Digest,
3991}
3992
3993pub const LODESTONE_API_ROLLUP_MEASURE_FORMAT_VERSION: u16 = 1;
3994#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
3995#[serde(tag = "kind", rename_all = "snake_case", deny_unknown_fields)]
3996pub enum RollupMeasure {
3997    Count,
3998    Sum { field_path_digest: Digest },
3999    Min { field_path_digest: Digest },
4000    Max { field_path_digest: Digest },
4001}
4002
4003pub const LODESTONE_API_AGGREGATE_THEN_DELETE_POLICY_FORMAT_VERSION: u16 = 1;
4004#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
4005#[serde(deny_unknown_fields)]
4006pub struct AggregateThenDeletePolicy {
4007    pub policy_id: Identity,
4008    pub policy_generation: U64,
4009    pub detail_retirement_acknowledged: bool,
4010    #[serde(default, skip_serializing_if = "Option::is_none")]
4011    pub expected_policy_generation: Option<U64>,
4012    pub timestamp_field_digest: Digest,
4013    pub bucket_width_millis: U64,
4014    pub bucket_alignment_millis: U64,
4015    pub dimensions: Vec<Digest>,
4016    pub measures: Vec<RollupMeasure>,
4017}
4018
4019pub const LODESTONE_API_LIFECYCLE_BINDING_STATUS_FORMAT_VERSION: u16 = 1;
4020#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
4021#[serde(deny_unknown_fields)]
4022pub struct LifecycleBindingStatus {
4023    pub content_key_id: Identity,
4024    pub content_key_generation: U64,
4025    pub binding_id: Identity,
4026    pub binding_generation: U64,
4027    pub access_generation: U64,
4028}
4029
4030pub const LODESTONE_API_LIFECYCLE_ROLLUP_STATUS_FORMAT_VERSION: u16 = 1;
4031#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
4032#[serde(deny_unknown_fields)]
4033pub struct LifecycleRollupStatus {
4034    pub policy_id: Identity,
4035    pub policy_generation: U64,
4036    pub ledger_revision: U64,
4037    pub coverages: u32,
4038    pub raw_retired_coverages: u32,
4039    pub detail_retirement_acknowledged: bool,
4040    pub query_contract_version: u32,
4041    pub timestamp_field_digest: Digest,
4042    pub bucket_width_millis: U64,
4043    pub bucket_alignment_millis: U64,
4044    pub dimensions: Vec<Digest>,
4045    pub measures: Vec<RollupMeasure>,
4046}
4047
4048pub const LODESTONE_API_LIFECYCLE_STATUS_FORMAT_VERSION: u16 = 2;
4049#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
4050#[serde(deny_unknown_fields)]
4051pub struct LifecycleStatus {
4052    pub format_version: u32,
4053    pub index: Resource,
4054    pub authority_revision: U64,
4055    pub active_bindings: Vec<LifecycleBindingStatus>,
4056    #[serde(default, skip_serializing_if = "Option::is_none")]
4057    pub rollup: Option<LifecycleRollupStatus>,
4058}
4059
4060pub const LODESTONE_API_QUOTA_LIMIT_FORMAT_VERSION: u16 = 1;
4061#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
4062#[serde(deny_unknown_fields)]
4063pub struct QuotaLimit {
4064    pub dimension: String,
4065    pub maximum: U64,
4066    pub window_millis: U64,
4067}
4068
4069pub const LODESTONE_API_QUOTA_CONSUMPTION_FORMAT_VERSION: u16 = 1;
4070#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
4071#[serde(deny_unknown_fields)]
4072pub struct QuotaConsumption {
4073    pub dimension: String,
4074    pub consumed: U64,
4075    pub window_millis: U64,
4076}
4077
4078pub const LODESTONE_API_QUOTA_UPDATE_FORMAT_VERSION: u16 = 1;
4079#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
4080#[serde(deny_unknown_fields)]
4081pub struct QuotaUpdate {
4082    pub revision: U64,
4083    pub state: String,
4084}
4085
4086pub const LODESTONE_API_CORE_BINDING_FORMAT_VERSION: u16 = 2;
4087#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
4088#[serde(deny_unknown_fields)]
4089pub struct CoreBinding {
4090    pub cluster_id: Identity,
4091    pub collection_id: Identity,
4092    pub configuration_generation: U64,
4093    pub native_endpoints: Vec<String>,
4094    pub selected_stream_endpoint: String,
4095    pub schema_id: String,
4096    pub schema_digest: Digest,
4097}
4098
4099pub const LODESTONE_API_READINESS_OBSERVATION_FORMAT_VERSION: u16 = 1;
4100#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
4101#[serde(deny_unknown_fields)]
4102pub struct ReadinessObservation {
4103    pub subject: String,
4104    pub state: String,
4105    #[serde(default, skip_serializing_if = "Option::is_none")]
4106    pub reason: Option<String>,
4107    pub revision: U64,
4108    pub observed_cut: U64,
4109}
4110
4111pub const LODESTONE_API_USAGE_DIMENSION_FORMAT_VERSION: u16 = 1;
4112#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
4113#[serde(deny_unknown_fields)]
4114pub struct UsageDimension {
4115    pub name: String,
4116    pub value: String,
4117}
4118
4119pub const LODESTONE_API_PHYSICAL_USAGE_VALUE_FORMAT_VERSION: u16 = 2;
4120#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
4121#[serde(deny_unknown_fields)]
4122pub struct PhysicalUsageValue {
4123    pub meter: String,
4124    pub unit: String,
4125    pub value: ExactDecimal,
4126}
4127
4128pub const LODESTONE_API_CORE_USAGE_UNITS_FORMAT_VERSION: u16 = 2;
4129#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
4130#[serde(deny_unknown_fields)]
4131pub struct CoreUsageUnits {
4132    pub sequence: U64,
4133    pub record_identity: Digest,
4134    pub index_id: Identity,
4135    pub workload_class: WorkloadClass,
4136    pub window_start: U64,
4137    pub window_end: U64,
4138    pub meter_set_version: u32,
4139    pub dimensions: Vec<UsageDimension>,
4140    pub values: Vec<PhysicalUsageValue>,
4141    pub authority_revision: U64,
4142    pub source_digest: Digest,
4143}
4144
4145pub const LODESTONE_API_CORE_USAGE_CORRECTION_FORMAT_VERSION: u16 = 2;
4146#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
4147#[serde(deny_unknown_fields)]
4148pub struct CoreUsageCorrection {
4149    pub sequence: U64,
4150    pub correction_sequence: U64,
4151    pub correction_identity: Digest,
4152    pub target_record_identity: Digest,
4153    pub index_id: Identity,
4154    pub workload_class: WorkloadClass,
4155    pub window_start: U64,
4156    pub window_end: U64,
4157    pub meter_set_version: u32,
4158    pub dimensions: Vec<UsageDimension>,
4159    pub values: Vec<PhysicalUsageValue>,
4160    pub reason_digest: Digest,
4161    pub authority_revision: U64,
4162    pub source_digest: Digest,
4163}
4164
4165pub const LODESTONE_API_RESPONSE_META_FORMAT_VERSION: u16 = 1;
4166#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
4167#[serde(deny_unknown_fields)]
4168pub struct ResponseMeta {
4169    pub format_version: u32,
4170    pub request_id: String,
4171    pub correlation_id: Identity,
4172    pub diagnostic_id: Identity,
4173}
4174
4175pub const LODESTONE_API_ERROR_DISPOSITION_FORMAT_VERSION: u16 = 1;
4176#[derive(Clone, Copy, Debug, Deserialize, Eq, PartialEq, Serialize)]
4177#[serde(rename_all = "snake_case")]
4178pub enum ErrorDisposition {
4179    NotSubmitted,
4180    Submitted,
4181    Resolved,
4182    KnownRetired,
4183    Indeterminate,
4184}
4185
4186pub const LODESTONE_API_RECOVERY_ACTION_FORMAT_VERSION: u16 = 1;
4187#[derive(Clone, Copy, Debug, Deserialize, Eq, PartialEq, Serialize)]
4188#[serde(rename_all = "snake_case")]
4189pub enum RecoveryAction {
4190    Retry,
4191    RetryAfter,
4192    RefreshCredential,
4193    RestartPage,
4194    ReduceRequest,
4195    Resolve,
4196    RefreshPrecondition,
4197    CorrectRange,
4198    Stop,
4199}
4200
4201pub const LODESTONE_API_LIMIT_CLASS_FORMAT_VERSION: u16 = 1;
4202#[derive(Clone, Copy, Debug, Deserialize, Eq, PartialEq, Serialize)]
4203#[serde(rename_all = "snake_case")]
4204pub enum LimitClass {
4205    RequestBound,
4206    CollectionQuota,
4207    EngineSafety,
4208}
4209
4210pub const LODESTONE_API_ERROR_DETAIL_FORMAT_VERSION: u16 = 3;
4211#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
4212#[serde(tag = "code", rename_all = "snake_case", deny_unknown_fields)]
4213pub enum ErrorDetail {
4214    Aborted {
4215        reason: String,
4216    },
4217    DeadlineExceeded,
4218    InvalidRequest {
4219        #[serde(default, skip_serializing_if = "Option::is_none")]
4220        field: Option<String>,
4221        reason: String,
4222    },
4223    UnsupportedVersion {
4224        observed: u32,
4225        maximum_supported: u32,
4226    },
4227    Unauthenticated,
4228    PermissionDenied {
4229        #[serde(default, skip_serializing_if = "Option::is_none")]
4230        action: Option<String>,
4231        #[serde(default, skip_serializing_if = "Option::is_none")]
4232        workload_class: Option<WorkloadClass>,
4233    },
4234    NotFound {
4235        #[serde(default, skip_serializing_if = "Option::is_none")]
4236        resource: Option<String>,
4237    },
4238    Conflict {
4239        #[serde(default, skip_serializing_if = "Option::is_none")]
4240        expected_revision: Option<U64>,
4241        #[serde(default, skip_serializing_if = "Option::is_none")]
4242        observed_revision: Option<U64>,
4243    },
4244    StaleCursor {
4245        restart_count: u32,
4246    },
4247    RestartBudgetExhausted {
4248        maximum_restarts: u32,
4249    },
4250    LimitExceeded {
4251        class: LimitClass,
4252        limit_id: String,
4253        maximum: U64,
4254    },
4255    CapabilityUnavailable {
4256        #[serde(default, skip_serializing_if = "Option::is_none")]
4257        capability: Option<String>,
4258    },
4259    NotSubmitted {
4260        #[serde(default, skip_serializing_if = "Option::is_none")]
4261        retry_after_millis: Option<U64>,
4262    },
4263    SubmittedIndeterminate {
4264        #[serde(default, skip_serializing_if = "Option::is_none")]
4265        locator: Option<Locator>,
4266    },
4267    ExpiredUnknown {
4268        #[serde(default, skip_serializing_if = "Option::is_none")]
4269        locator: Option<Locator>,
4270    },
4271    SecretNotEscrowed,
4272    RetentionGap {
4273        retired_through: U64,
4274    },
4275    ArtifactRangeInvalid {
4276        maximum_bytes: U64,
4277    },
4278    ChecksumMismatch {
4279        expected: Digest,
4280        observed: Digest,
4281    },
4282    TemporarilyUnavailable {
4283        #[serde(default, skip_serializing_if = "Option::is_none")]
4284        retry_after_millis: Option<U64>,
4285    },
4286    Internal,
4287}
4288
4289pub const LODESTONE_API_CONNECTION_PROFILE_FORMAT_VERSION: u16 = 3;
4290#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
4291#[serde(deny_unknown_fields)]
4292pub struct ConnectionProfile {
4293    pub format_version: u32,
4294    pub profile_generation: U64,
4295    pub native_endpoints: Vec<String>,
4296    pub selected_stream_endpoint: String,
4297    pub tls_server_name: String,
4298    pub tls_trust_sha256: Digest,
4299    pub expected_cluster_id: Identity,
4300    pub expected_collection_id: Identity,
4301    pub expected_principal_id: Identity,
4302    pub schema_id: String,
4303    pub schema_digest: Digest,
4304    pub credential_id: Identity,
4305    pub credential_generation: U64,
4306    #[serde(default, skip_serializing_if = "Option::is_none")]
4307    pub credential_expires_at: Option<U64>,
4308    pub secret_reference: String,
4309}
4310
4311#[derive(Clone, Copy, Debug, Eq, PartialEq)]
4312pub enum TypeKind {
4313    Enum,
4314    Struct,
4315    TaggedUnion,
4316}
4317#[derive(Clone, Copy, Debug, Eq, PartialEq)]
4318pub struct TypeContract {
4319    pub name: &'static str,
4320    pub format_version: u16,
4321    pub kind: TypeKind,
4322    pub wire: bool,
4323}
4324pub const LODESTONE_API_TYPE_CONTRACTS: &[TypeContract] = &[
4325    TypeContract {
4326        name: "cursor",
4327        format_version: 1,
4328        kind: TypeKind::Struct,
4329        wire: true,
4330    },
4331    TypeContract {
4332        name: "locator",
4333        format_version: 1,
4334        kind: TypeKind::Struct,
4335        wire: true,
4336    },
4337    TypeContract {
4338        name: "resource",
4339        format_version: 1,
4340        kind: TypeKind::Struct,
4341        wire: true,
4342    },
4343    TypeContract {
4344        name: "field_promotion_configuration",
4345        format_version: 1,
4346        kind: TypeKind::Struct,
4347        wire: true,
4348    },
4349    TypeContract {
4350        name: "overload_configuration",
4351        format_version: 2,
4352        kind: TypeKind::Struct,
4353        wire: true,
4354    },
4355    TypeContract {
4356        name: "index_policies",
4357        format_version: 1,
4358        kind: TypeKind::Struct,
4359        wire: true,
4360    },
4361    TypeContract {
4362        name: "maintenance_budgets",
4363        format_version: 1,
4364        kind: TypeKind::Struct,
4365        wire: true,
4366    },
4367    TypeContract {
4368        name: "resource_durability_class",
4369        format_version: 1,
4370        kind: TypeKind::Enum,
4371        wire: true,
4372    },
4373    TypeContract {
4374        name: "resource_storage_class",
4375        format_version: 1,
4376        kind: TypeKind::Enum,
4377        wire: true,
4378    },
4379    TypeContract {
4380        name: "vector_quality_objective",
4381        format_version: 1,
4382        kind: TypeKind::Enum,
4383        wire: true,
4384    },
4385    TypeContract {
4386        name: "vector_indexing_objective",
4387        format_version: 1,
4388        kind: TypeKind::Enum,
4389        wire: true,
4390    },
4391    TypeContract {
4392        name: "vector_residency_intent",
4393        format_version: 1,
4394        kind: TypeKind::Enum,
4395        wire: true,
4396    },
4397    TypeContract {
4398        name: "vector_calibration_binding",
4399        format_version: 1,
4400        kind: TypeKind::Struct,
4401        wire: true,
4402    },
4403    TypeContract {
4404        name: "vector_resource_policy",
4405        format_version: 2,
4406        kind: TypeKind::Struct,
4407        wire: true,
4408    },
4409    TypeContract {
4410        name: "workload_class",
4411        format_version: 1,
4412        kind: TypeKind::Enum,
4413        wire: true,
4414    },
4415    TypeContract {
4416        name: "index_resource_spec",
4417        format_version: 3,
4418        kind: TypeKind::Struct,
4419        wire: true,
4420    },
4421    TypeContract {
4422        name: "index_summary",
4423        format_version: 1,
4424        kind: TypeKind::Struct,
4425        wire: true,
4426    },
4427    TypeContract {
4428        name: "mapping_mode",
4429        format_version: 1,
4430        kind: TypeKind::Enum,
4431        wire: true,
4432    },
4433    TypeContract {
4434        name: "dynamic_mapping_policy",
4435        format_version: 1,
4436        kind: TypeKind::Enum,
4437        wire: true,
4438    },
4439    TypeContract {
4440        name: "mapping_analyzer",
4441        format_version: 1,
4442        kind: TypeKind::Enum,
4443        wire: true,
4444    },
4445    TypeContract {
4446        name: "keyword_normalizer",
4447        format_version: 1,
4448        kind: TypeKind::Enum,
4449        wire: true,
4450    },
4451    TypeContract {
4452        name: "vector_metric",
4453        format_version: 1,
4454        kind: TypeKind::Enum,
4455        wire: true,
4456    },
4457    TypeContract {
4458        name: "mapping_scalar",
4459        format_version: 1,
4460        kind: TypeKind::TaggedUnion,
4461        wire: true,
4462    },
4463    TypeContract {
4464        name: "sparse_vector_weight_type",
4465        format_version: 1,
4466        kind: TypeKind::Enum,
4467        wire: true,
4468    },
4469    TypeContract {
4470        name: "mapping_field_type",
4471        format_version: 3,
4472        kind: TypeKind::TaggedUnion,
4473        wire: true,
4474    },
4475    TypeContract {
4476        name: "mapping_field",
4477        format_version: 1,
4478        kind: TypeKind::Struct,
4479        wire: true,
4480    },
4481    TypeContract {
4482        name: "multi_field_projection",
4483        format_version: 1,
4484        kind: TypeKind::Struct,
4485        wire: true,
4486    },
4487    TypeContract {
4488        name: "analyzer_identity",
4489        format_version: 1,
4490        kind: TypeKind::Struct,
4491        wire: true,
4492    },
4493    TypeContract {
4494        name: "keyword_limit",
4495        format_version: 1,
4496        kind: TypeKind::Struct,
4497        wire: true,
4498    },
4499    TypeContract {
4500        name: "mapping",
4501        format_version: 1,
4502        kind: TypeKind::Struct,
4503        wire: true,
4504    },
4505    TypeContract {
4506        name: "index_detail",
4507        format_version: 1,
4508        kind: TypeKind::Struct,
4509        wire: true,
4510    },
4511    TypeContract {
4512        name: "source_provider",
4513        format_version: 1,
4514        kind: TypeKind::Enum,
4515        wire: true,
4516    },
4517    TypeContract {
4518        name: "source_decoder",
4519        format_version: 1,
4520        kind: TypeKind::Enum,
4521        wire: true,
4522    },
4523    TypeContract {
4524        name: "source_replay_guarantees",
4525        format_version: 1,
4526        kind: TypeKind::Struct,
4527        wire: true,
4528    },
4529    TypeContract {
4530        name: "source_partition_configuration",
4531        format_version: 1,
4532        kind: TypeKind::Struct,
4533        wire: true,
4534    },
4535    TypeContract {
4536        name: "replayable_source_configuration",
4537        format_version: 1,
4538        kind: TypeKind::Struct,
4539        wire: true,
4540    },
4541    TypeContract {
4542        name: "source_partition_status",
4543        format_version: 1,
4544        kind: TypeKind::Struct,
4545        wire: true,
4546    },
4547    TypeContract {
4548        name: "replayable_source_status",
4549        format_version: 1,
4550        kind: TypeKind::Struct,
4551        wire: true,
4552    },
4553    TypeContract {
4554        name: "source_control_transition",
4555        format_version: 1,
4556        kind: TypeKind::Enum,
4557        wire: true,
4558    },
4559    TypeContract {
4560        name: "history_ledger_precondition",
4561        format_version: 1,
4562        kind: TypeKind::TaggedUnion,
4563        wire: true,
4564    },
4565    TypeContract {
4566        name: "history_retention_policy",
4567        format_version: 1,
4568        kind: TypeKind::Struct,
4569        wire: true,
4570    },
4571    TypeContract {
4572        name: "history_selector",
4573        format_version: 1,
4574        kind: TypeKind::TaggedUnion,
4575        wire: true,
4576    },
4577    TypeContract {
4578        name: "history_hold",
4579        format_version: 1,
4580        kind: TypeKind::Struct,
4581        wire: true,
4582    },
4583    TypeContract {
4584        name: "history_status",
4585        format_version: 1,
4586        kind: TypeKind::Struct,
4587        wire: true,
4588    },
4589    TypeContract {
4590        name: "history_resolution",
4591        format_version: 1,
4592        kind: TypeKind::Struct,
4593        wire: true,
4594    },
4595    TypeContract {
4596        name: "index_reference",
4597        format_version: 1,
4598        kind: TypeKind::Struct,
4599        wire: true,
4600    },
4601    TypeContract {
4602        name: "alias_target",
4603        format_version: 1,
4604        kind: TypeKind::Struct,
4605        wire: true,
4606    },
4607    TypeContract {
4608        name: "alias_summary",
4609        format_version: 1,
4610        kind: TypeKind::Struct,
4611        wire: true,
4612    },
4613    TypeContract {
4614        name: "alias_detail",
4615        format_version: 1,
4616        kind: TypeKind::Struct,
4617        wire: true,
4618    },
4619    TypeContract {
4620        name: "data_stream_summary",
4621        format_version: 1,
4622        kind: TypeKind::Struct,
4623        wire: true,
4624    },
4625    TypeContract {
4626        name: "component_template_binding",
4627        format_version: 1,
4628        kind: TypeKind::Struct,
4629        wire: true,
4630    },
4631    TypeContract {
4632        name: "index_template_binding",
4633        format_version: 1,
4634        kind: TypeKind::Struct,
4635        wire: true,
4636    },
4637    TypeContract {
4638        name: "lifecycle_policy_binding",
4639        format_version: 1,
4640        kind: TypeKind::Struct,
4641        wire: true,
4642    },
4643    TypeContract {
4644        name: "data_stream_detail",
4645        format_version: 1,
4646        kind: TypeKind::Struct,
4647        wire: true,
4648    },
4649    TypeContract {
4650        name: "component_template_summary",
4651        format_version: 1,
4652        kind: TypeKind::Struct,
4653        wire: true,
4654    },
4655    TypeContract {
4656        name: "component_template_detail",
4657        format_version: 1,
4658        kind: TypeKind::Struct,
4659        wire: true,
4660    },
4661    TypeContract {
4662        name: "index_template_summary",
4663        format_version: 1,
4664        kind: TypeKind::Struct,
4665        wire: true,
4666    },
4667    TypeContract {
4668        name: "index_template_detail",
4669        format_version: 1,
4670        kind: TypeKind::Struct,
4671        wire: true,
4672    },
4673    TypeContract {
4674        name: "ingest_pipeline_summary",
4675        format_version: 1,
4676        kind: TypeKind::Struct,
4677        wire: true,
4678    },
4679    TypeContract {
4680        name: "ingest_pipeline_detail",
4681        format_version: 1,
4682        kind: TypeKind::Struct,
4683        wire: true,
4684    },
4685    TypeContract {
4686        name: "ingest_pipeline_selection",
4687        format_version: 1,
4688        kind: TypeKind::Struct,
4689        wire: true,
4690    },
4691    TypeContract {
4692        name: "lifecycle_policy_summary",
4693        format_version: 1,
4694        kind: TypeKind::Struct,
4695        wire: true,
4696    },
4697    TypeContract {
4698        name: "rollover_thresholds",
4699        format_version: 1,
4700        kind: TypeKind::Struct,
4701        wire: true,
4702    },
4703    TypeContract {
4704        name: "retention_policy",
4705        format_version: 1,
4706        kind: TypeKind::Struct,
4707        wire: true,
4708    },
4709    TypeContract {
4710        name: "lifecycle_policy_detail",
4711        format_version: 1,
4712        kind: TypeKind::Struct,
4713        wire: true,
4714    },
4715    TypeContract {
4716        name: "text_query_operator",
4717        format_version: 1,
4718        kind: TypeKind::Enum,
4719        wire: true,
4720    },
4721    TypeContract {
4722        name: "text_query_analyzer",
4723        format_version: 1,
4724        kind: TypeKind::Enum,
4725        wire: true,
4726    },
4727    TypeContract {
4728        name: "zero_terms_query",
4729        format_version: 1,
4730        kind: TypeKind::Enum,
4731        wire: true,
4732    },
4733    TypeContract {
4734        name: "text_query_options",
4735        format_version: 1,
4736        kind: TypeKind::Struct,
4737        wire: true,
4738    },
4739    TypeContract {
4740        name: "multi_match_mode",
4741        format_version: 1,
4742        kind: TypeKind::Enum,
4743        wire: true,
4744    },
4745    TypeContract {
4746        name: "multi_match_field",
4747        format_version: 1,
4748        kind: TypeKind::Struct,
4749        wire: true,
4750    },
4751    TypeContract {
4752        name: "multi_match_options",
4753        format_version: 1,
4754        kind: TypeKind::Struct,
4755        wire: true,
4756    },
4757    TypeContract {
4758        name: "sort_order",
4759        format_version: 1,
4760        kind: TypeKind::Enum,
4761        wire: true,
4762    },
4763    TypeContract {
4764        name: "sort_mode",
4765        format_version: 1,
4766        kind: TypeKind::Enum,
4767        wire: true,
4768    },
4769    TypeContract {
4770        name: "missing_order",
4771        format_version: 1,
4772        kind: TypeKind::Enum,
4773        wire: true,
4774    },
4775    TypeContract {
4776        name: "nested_score_mode",
4777        format_version: 1,
4778        kind: TypeKind::Enum,
4779        wire: true,
4780    },
4781    TypeContract {
4782        name: "nested_inner_hits",
4783        format_version: 1,
4784        kind: TypeKind::Struct,
4785        wire: true,
4786    },
4787    TypeContract {
4788        name: "sort_spec",
4789        format_version: 1,
4790        kind: TypeKind::TaggedUnion,
4791        wire: true,
4792    },
4793    TypeContract {
4794        name: "query",
4795        format_version: 1,
4796        kind: TypeKind::TaggedUnion,
4797        wire: true,
4798    },
4799    TypeContract {
4800        name: "dense_retrieval_mode",
4801        format_version: 1,
4802        kind: TypeKind::Enum,
4803        wire: true,
4804    },
4805    TypeContract {
4806        name: "vector_achieved_mode",
4807        format_version: 1,
4808        kind: TypeKind::Enum,
4809        wire: true,
4810    },
4811    TypeContract {
4812        name: "vector_branch_diagnostics",
4813        format_version: 2,
4814        kind: TypeKind::Struct,
4815        wire: true,
4816    },
4817    TypeContract {
4818        name: "dense_vector_element_type",
4819        format_version: 1,
4820        kind: TypeKind::Enum,
4821        wire: true,
4822    },
4823    TypeContract {
4824        name: "dense_vector_byte_order",
4825        format_version: 1,
4826        kind: TypeKind::Enum,
4827        wire: true,
4828    },
4829    TypeContract {
4830        name: "vector_value",
4831        format_version: 1,
4832        kind: TypeKind::TaggedUnion,
4833        wire: true,
4834    },
4835    TypeContract {
4836        name: "sparse_vector_entry",
4837        format_version: 1,
4838        kind: TypeKind::Struct,
4839        wire: true,
4840    },
4841    TypeContract {
4842        name: "sparse_vector_value",
4843        format_version: 1,
4844        kind: TypeKind::Struct,
4845        wire: true,
4846    },
4847    TypeContract {
4848        name: "vector_set_value",
4849        format_version: 1,
4850        kind: TypeKind::Struct,
4851        wire: true,
4852    },
4853    TypeContract {
4854        name: "vector_evaluation_snapshot",
4855        format_version: 1,
4856        kind: TypeKind::TaggedUnion,
4857        wire: true,
4858    },
4859    TypeContract {
4860        name: "vector_evaluation_query_set",
4861        format_version: 1,
4862        kind: TypeKind::TaggedUnion,
4863        wire: true,
4864    },
4865    TypeContract {
4866        name: "vector_evaluation_budget",
4867        format_version: 1,
4868        kind: TypeKind::Struct,
4869        wire: true,
4870    },
4871    TypeContract {
4872        name: "vector_candidate_policy",
4873        format_version: 1,
4874        kind: TypeKind::Enum,
4875        wire: true,
4876    },
4877    TypeContract {
4878        name: "vector_calibration_objective",
4879        format_version: 1,
4880        kind: TypeKind::Enum,
4881        wire: true,
4882    },
4883    TypeContract {
4884        name: "vector_strategy_profile",
4885        format_version: 1,
4886        kind: TypeKind::Enum,
4887        wire: true,
4888    },
4889    TypeContract {
4890        name: "vector_evaluation_work",
4891        format_version: 1,
4892        kind: TypeKind::Struct,
4893        wire: true,
4894    },
4895    TypeContract {
4896        name: "vector_evaluation_error_code",
4897        format_version: 1,
4898        kind: TypeKind::Enum,
4899        wire: true,
4900    },
4901    TypeContract {
4902        name: "vector_evaluation_error",
4903        format_version: 1,
4904        kind: TypeKind::Struct,
4905        wire: true,
4906    },
4907    TypeContract {
4908        name: "vector_recall_result",
4909        format_version: 1,
4910        kind: TypeKind::Struct,
4911        wire: true,
4912    },
4913    TypeContract {
4914        name: "vector_calibration_candidate",
4915        format_version: 1,
4916        kind: TypeKind::Struct,
4917        wire: true,
4918    },
4919    TypeContract {
4920        name: "vector_calibration_result",
4921        format_version: 1,
4922        kind: TypeKind::Struct,
4923        wire: true,
4924    },
4925    TypeContract {
4926        name: "vector_diagnostic_result",
4927        format_version: 1,
4928        kind: TypeKind::TaggedUnion,
4929        wire: true,
4930    },
4931    TypeContract {
4932        name: "vector_warm_component",
4933        format_version: 1,
4934        kind: TypeKind::Enum,
4935        wire: true,
4936    },
4937    TypeContract {
4938        name: "vector_warm_state",
4939        format_version: 1,
4940        kind: TypeKind::Enum,
4941        wire: true,
4942    },
4943    TypeContract {
4944        name: "vector_warm_achievement",
4945        format_version: 1,
4946        kind: TypeKind::Struct,
4947        wire: true,
4948    },
4949    TypeContract {
4950        name: "vector_warm_result",
4951        format_version: 1,
4952        kind: TypeKind::Struct,
4953        wire: true,
4954    },
4955    TypeContract {
4956        name: "dense_retrieval_threshold",
4957        format_version: 1,
4958        kind: TypeKind::TaggedUnion,
4959        wire: true,
4960    },
4961    TypeContract {
4962        name: "retrieval_branch",
4963        format_version: 3,
4964        kind: TypeKind::TaggedUnion,
4965        wire: true,
4966    },
4967    TypeContract {
4968        name: "weighted_rrf_fusion",
4969        format_version: 1,
4970        kind: TypeKind::Struct,
4971        wire: true,
4972    },
4973    TypeContract {
4974        name: "retrieval_plan",
4975        format_version: 1,
4976        kind: TypeKind::Struct,
4977        wire: true,
4978    },
4979    TypeContract {
4980        name: "histogram_bounds",
4981        format_version: 1,
4982        kind: TypeKind::Struct,
4983        wire: true,
4984    },
4985    TypeContract {
4986        name: "date_histogram_bounds",
4987        format_version: 1,
4988        kind: TypeKind::Struct,
4989        wire: true,
4990    },
4991    TypeContract {
4992        name: "approximation_algorithm",
4993        format_version: 1,
4994        kind: TypeKind::Enum,
4995        wire: true,
4996    },
4997    TypeContract {
4998        name: "approximation",
4999        format_version: 1,
5000        kind: TypeKind::Struct,
5001        wire: true,
5002    },
5003    TypeContract {
5004        name: "percentile_value",
5005        format_version: 1,
5006        kind: TypeKind::Struct,
5007        wire: true,
5008    },
5009    TypeContract {
5010        name: "approximate_percentile_value",
5011        format_version: 1,
5012        kind: TypeKind::Struct,
5013        wire: true,
5014    },
5015    TypeContract {
5016        name: "composite_order",
5017        format_version: 1,
5018        kind: TypeKind::Enum,
5019        wire: true,
5020    },
5021    TypeContract {
5022        name: "composite_source",
5023        format_version: 1,
5024        kind: TypeKind::TaggedUnion,
5025        wire: true,
5026    },
5027    TypeContract {
5028        name: "aggregation",
5029        format_version: 2,
5030        kind: TypeKind::TaggedUnion,
5031        wire: true,
5032    },
5033    TypeContract {
5034        name: "nested_search_hit",
5035        format_version: 1,
5036        kind: TypeKind::Struct,
5037        wire: true,
5038    },
5039    TypeContract {
5040        name: "named_nested_inner_hits_result",
5041        format_version: 1,
5042        kind: TypeKind::Struct,
5043        wire: true,
5044    },
5045    TypeContract {
5046        name: "fragment_boundary",
5047        format_version: 1,
5048        kind: TypeKind::Enum,
5049        wire: true,
5050    },
5051    TypeContract {
5052        name: "fragment_offset_encoding",
5053        format_version: 1,
5054        kind: TypeKind::Enum,
5055        wire: true,
5056    },
5057    TypeContract {
5058        name: "fragment_ranker",
5059        format_version: 1,
5060        kind: TypeKind::Enum,
5061        wire: true,
5062    },
5063    TypeContract {
5064        name: "fragment_request",
5065        format_version: 1,
5066        kind: TypeKind::Struct,
5067        wire: true,
5068    },
5069    TypeContract {
5070        name: "search_fragment",
5071        format_version: 1,
5072        kind: TypeKind::Struct,
5073        wire: true,
5074    },
5075    TypeContract {
5076        name: "numeric_feature_transform",
5077        format_version: 1,
5078        kind: TypeKind::TaggedUnion,
5079        wire: true,
5080    },
5081    TypeContract {
5082        name: "numeric_result_feature",
5083        format_version: 1,
5084        kind: TypeKind::Struct,
5085        wire: true,
5086    },
5087    TypeContract {
5088        name: "result_feature_request",
5089        format_version: 1,
5090        kind: TypeKind::Struct,
5091        wire: true,
5092    },
5093    TypeContract {
5094        name: "result_diversification",
5095        format_version: 1,
5096        kind: TypeKind::Struct,
5097        wire: true,
5098    },
5099    TypeContract {
5100        name: "branch_score_kind",
5101        format_version: 2,
5102        kind: TypeKind::Enum,
5103        wire: true,
5104    },
5105    TypeContract {
5106        name: "result_feature",
5107        format_version: 1,
5108        kind: TypeKind::TaggedUnion,
5109        wire: true,
5110    },
5111    TypeContract {
5112        name: "search_hit",
5113        format_version: 2,
5114        kind: TypeKind::Struct,
5115        wire: true,
5116    },
5117    TypeContract {
5118        name: "aggregation_bucket",
5119        format_version: 1,
5120        kind: TypeKind::Struct,
5121        wire: true,
5122    },
5123    TypeContract {
5124        name: "aggregation_result",
5125        format_version: 2,
5126        kind: TypeKind::TaggedUnion,
5127        wire: true,
5128    },
5129    TypeContract {
5130        name: "shard_counts",
5131        format_version: 1,
5132        kind: TypeKind::Struct,
5133        wire: true,
5134    },
5135    TypeContract {
5136        name: "total_hits_relation",
5137        format_version: 1,
5138        kind: TypeKind::Enum,
5139        wire: true,
5140    },
5141    TypeContract {
5142        name: "search_total",
5143        format_version: 1,
5144        kind: TypeKind::Struct,
5145        wire: true,
5146    },
5147    TypeContract {
5148        name: "search_execution_freshness",
5149        format_version: 1,
5150        kind: TypeKind::Enum,
5151        wire: true,
5152    },
5153    TypeContract {
5154        name: "search_freshness",
5155        format_version: 1,
5156        kind: TypeKind::Enum,
5157        wire: true,
5158    },
5159    TypeContract {
5160        name: "search_degradation_reason",
5161        format_version: 1,
5162        kind: TypeKind::Enum,
5163        wire: true,
5164    },
5165    TypeContract {
5166        name: "search_achievement",
5167        format_version: 1,
5168        kind: TypeKind::Struct,
5169        wire: true,
5170    },
5171    TypeContract {
5172        name: "search_failure_stage",
5173        format_version: 1,
5174        kind: TypeKind::Enum,
5175        wire: true,
5176    },
5177    TypeContract {
5178        name: "search_failure_reason",
5179        format_version: 1,
5180        kind: TypeKind::Enum,
5181        wire: true,
5182    },
5183    TypeContract {
5184        name: "collection_shard",
5185        format_version: 1,
5186        kind: TypeKind::Struct,
5187        wire: true,
5188    },
5189    TypeContract {
5190        name: "search_partial_failure",
5191        format_version: 1,
5192        kind: TypeKind::Struct,
5193        wire: true,
5194    },
5195    TypeContract {
5196        name: "artifact",
5197        format_version: 1,
5198        kind: TypeKind::Struct,
5199        wire: true,
5200    },
5201    TypeContract {
5202        name: "portability_storage_capability",
5203        format_version: 1,
5204        kind: TypeKind::Struct,
5205        wire: true,
5206    },
5207    TypeContract {
5208        name: "collection_export_artifact",
5209        format_version: 1,
5210        kind: TypeKind::Struct,
5211        wire: true,
5212    },
5213    TypeContract {
5214        name: "search_validation_bound",
5215        format_version: 1,
5216        kind: TypeKind::TaggedUnion,
5217        wire: true,
5218    },
5219    TypeContract {
5220        name: "search_validation_estimates",
5221        format_version: 1,
5222        kind: TypeKind::Struct,
5223        wire: true,
5224    },
5225    TypeContract {
5226        name: "search_validation_limit",
5227        format_version: 1,
5228        kind: TypeKind::Struct,
5229        wire: true,
5230    },
5231    TypeContract {
5232        name: "operation_kind",
5233        format_version: 1,
5234        kind: TypeKind::Enum,
5235        wire: true,
5236    },
5237    TypeContract {
5238        name: "operation_authority",
5239        format_version: 1,
5240        kind: TypeKind::Enum,
5241        wire: true,
5242    },
5243    TypeContract {
5244        name: "operation_target",
5245        format_version: 1,
5246        kind: TypeKind::TaggedUnion,
5247        wire: true,
5248    },
5249    TypeContract {
5250        name: "operation_state",
5251        format_version: 1,
5252        kind: TypeKind::Enum,
5253        wire: true,
5254    },
5255    TypeContract {
5256        name: "operation_pending_state",
5257        format_version: 1,
5258        kind: TypeKind::Enum,
5259        wire: true,
5260    },
5261    TypeContract {
5262        name: "operation_progress_unit",
5263        format_version: 1,
5264        kind: TypeKind::Enum,
5265        wire: true,
5266    },
5267    TypeContract {
5268        name: "operation_progress",
5269        format_version: 1,
5270        kind: TypeKind::Struct,
5271        wire: true,
5272    },
5273    TypeContract {
5274        name: "operation_result",
5275        format_version: 1,
5276        kind: TypeKind::TaggedUnion,
5277        wire: true,
5278    },
5279    TypeContract {
5280        name: "operation_failure",
5281        format_version: 1,
5282        kind: TypeKind::Struct,
5283        wire: true,
5284    },
5285    TypeContract {
5286        name: "operation_cancellation",
5287        format_version: 1,
5288        kind: TypeKind::Enum,
5289        wire: true,
5290    },
5291    TypeContract {
5292        name: "operation_retention_state",
5293        format_version: 1,
5294        kind: TypeKind::Enum,
5295        wire: true,
5296    },
5297    TypeContract {
5298        name: "operation_retention",
5299        format_version: 1,
5300        kind: TypeKind::Struct,
5301        wire: true,
5302    },
5303    TypeContract {
5304        name: "operation",
5305        format_version: 2,
5306        kind: TypeKind::Struct,
5307        wire: true,
5308    },
5309    TypeContract {
5310        name: "write_durability_boundary",
5311        format_version: 1,
5312        kind: TypeKind::Enum,
5313        wire: true,
5314    },
5315    TypeContract {
5316        name: "write_visibility_mode",
5317        format_version: 1,
5318        kind: TypeKind::Enum,
5319        wire: true,
5320    },
5321    TypeContract {
5322        name: "write_response_stage",
5323        format_version: 1,
5324        kind: TypeKind::Enum,
5325        wire: true,
5326    },
5327    TypeContract {
5328        name: "write_achievement",
5329        format_version: 1,
5330        kind: TypeKind::Struct,
5331        wire: true,
5332    },
5333    TypeContract {
5334        name: "mutation_resolver",
5335        format_version: 1,
5336        kind: TypeKind::Enum,
5337        wire: true,
5338    },
5339    TypeContract {
5340        name: "mutation_outcome",
5341        format_version: 1,
5342        kind: TypeKind::TaggedUnion,
5343        wire: true,
5344    },
5345    TypeContract {
5346        name: "submission_state",
5347        format_version: 1,
5348        kind: TypeKind::Enum,
5349        wire: true,
5350    },
5351    TypeContract {
5352        name: "expected_binding",
5353        format_version: 1,
5354        kind: TypeKind::Struct,
5355        wire: true,
5356    },
5357    TypeContract {
5358        name: "administration_alias_action",
5359        format_version: 1,
5360        kind: TypeKind::TaggedUnion,
5361        wire: true,
5362    },
5363    TypeContract {
5364        name: "administration_mutation",
5365        format_version: 1,
5366        kind: TypeKind::TaggedUnion,
5367        wire: true,
5368    },
5369    TypeContract {
5370        name: "administration_outcome",
5371        format_version: 1,
5372        kind: TypeKind::Struct,
5373        wire: true,
5374    },
5375    TypeContract {
5376        name: "index_change_apply_receipt",
5377        format_version: 1,
5378        kind: TypeKind::Struct,
5379        wire: true,
5380    },
5381    TypeContract {
5382        name: "bulk_document_item",
5383        format_version: 1,
5384        kind: TypeKind::Struct,
5385        wire: true,
5386    },
5387    TypeContract {
5388        name: "bulk_document_item_outcome",
5389        format_version: 1,
5390        kind: TypeKind::Struct,
5391        wire: true,
5392    },
5393    TypeContract {
5394        name: "bulk_document_outcome",
5395        format_version: 1,
5396        kind: TypeKind::Struct,
5397        wire: true,
5398    },
5399    TypeContract {
5400        name: "retained_append_item",
5401        format_version: 1,
5402        kind: TypeKind::Struct,
5403        wire: true,
5404    },
5405    TypeContract {
5406        name: "retained_append_state",
5407        format_version: 1,
5408        kind: TypeKind::Enum,
5409        wire: true,
5410    },
5411    TypeContract {
5412        name: "retained_append_retry_safety",
5413        format_version: 1,
5414        kind: TypeKind::Enum,
5415        wire: true,
5416    },
5417    TypeContract {
5418        name: "retained_append_item_outcome",
5419        format_version: 1,
5420        kind: TypeKind::Struct,
5421        wire: true,
5422    },
5423    TypeContract {
5424        name: "retained_append_bulk_outcome",
5425        format_version: 1,
5426        kind: TypeKind::Struct,
5427        wire: true,
5428    },
5429    TypeContract {
5430        name: "retained_append_observation_state",
5431        format_version: 1,
5432        kind: TypeKind::Enum,
5433        wire: true,
5434    },
5435    TypeContract {
5436        name: "retained_append_observation_outcome",
5437        format_version: 1,
5438        kind: TypeKind::Struct,
5439        wire: true,
5440    },
5441    TypeContract {
5442        name: "binary_value",
5443        format_version: 1,
5444        kind: TypeKind::Struct,
5445        wire: true,
5446    },
5447    TypeContract {
5448        name: "state_hash_field",
5449        format_version: 1,
5450        kind: TypeKind::Struct,
5451        wire: true,
5452    },
5453    TypeContract {
5454        name: "state_set_entry",
5455        format_version: 1,
5456        kind: TypeKind::Struct,
5457        wire: true,
5458    },
5459    TypeContract {
5460        name: "state_set_condition",
5461        format_version: 1,
5462        kind: TypeKind::Enum,
5463        wire: true,
5464    },
5465    TypeContract {
5466        name: "state_operation",
5467        format_version: 1,
5468        kind: TypeKind::TaggedUnion,
5469        wire: true,
5470    },
5471    TypeContract {
5472        name: "state_optional_value",
5473        format_version: 1,
5474        kind: TypeKind::TaggedUnion,
5475        wire: true,
5476    },
5477    TypeContract {
5478        name: "state_command_result",
5479        format_version: 1,
5480        kind: TypeKind::TaggedUnion,
5481        wire: true,
5482    },
5483    TypeContract {
5484        name: "state_write_resolution",
5485        format_version: 1,
5486        kind: TypeKind::TaggedUnion,
5487        wire: true,
5488    },
5489    TypeContract {
5490        name: "service_credential_reservation",
5491        format_version: 1,
5492        kind: TypeKind::Struct,
5493        wire: true,
5494    },
5495    TypeContract {
5496        name: "subscription_metadata_field",
5497        format_version: 1,
5498        kind: TypeKind::Enum,
5499        wire: true,
5500    },
5501    TypeContract {
5502        name: "subscription_field",
5503        format_version: 1,
5504        kind: TypeKind::TaggedUnion,
5505        wire: true,
5506    },
5507    TypeContract {
5508        name: "subscription_filter",
5509        format_version: 1,
5510        kind: TypeKind::TaggedUnion,
5511        wire: true,
5512    },
5513    TypeContract {
5514        name: "subscription_cursor_entry",
5515        format_version: 1,
5516        kind: TypeKind::Struct,
5517        wire: true,
5518    },
5519    TypeContract {
5520        name: "subscription_route",
5521        format_version: 1,
5522        kind: TypeKind::Struct,
5523        wire: true,
5524    },
5525    TypeContract {
5526        name: "subscription_start_position",
5527        format_version: 1,
5528        kind: TypeKind::TaggedUnion,
5529        wire: true,
5530    },
5531    TypeContract {
5532        name: "subscription_start",
5533        format_version: 1,
5534        kind: TypeKind::Struct,
5535        wire: true,
5536    },
5537    TypeContract {
5538        name: "subscription_accepted",
5539        format_version: 1,
5540        kind: TypeKind::Struct,
5541        wire: true,
5542    },
5543    TypeContract {
5544        name: "subscription_writer_fence",
5545        format_version: 1,
5546        kind: TypeKind::Struct,
5547        wire: true,
5548    },
5549    TypeContract {
5550        name: "subscription_event",
5551        format_version: 1,
5552        kind: TypeKind::Struct,
5553        wire: true,
5554    },
5555    TypeContract {
5556        name: "subscription_heartbeat",
5557        format_version: 1,
5558        kind: TypeKind::Struct,
5559        wire: true,
5560    },
5561    TypeContract {
5562        name: "subscription_gap",
5563        format_version: 1,
5564        kind: TypeKind::Struct,
5565        wire: true,
5566    },
5567    TypeContract {
5568        name: "subscription_terminal_reason",
5569        format_version: 1,
5570        kind: TypeKind::Enum,
5571        wire: true,
5572    },
5573    TypeContract {
5574        name: "subscription_terminal",
5575        format_version: 2,
5576        kind: TypeKind::Struct,
5577        wire: true,
5578    },
5579    TypeContract {
5580        name: "subscription_frame",
5581        format_version: 1,
5582        kind: TypeKind::TaggedUnion,
5583        wire: true,
5584    },
5585    TypeContract {
5586        name: "stream_binding",
5587        format_version: 1,
5588        kind: TypeKind::Struct,
5589        wire: true,
5590    },
5591    TypeContract {
5592        name: "capability_grant",
5593        format_version: 1,
5594        kind: TypeKind::Struct,
5595        wire: true,
5596    },
5597    TypeContract {
5598        name: "protocol_limit",
5599        format_version: 1,
5600        kind: TypeKind::Struct,
5601        wire: true,
5602    },
5603    TypeContract {
5604        name: "document_mutation_condition",
5605        format_version: 1,
5606        kind: TypeKind::TaggedUnion,
5607        wire: true,
5608    },
5609    TypeContract {
5610        name: "audit_adapter",
5611        format_version: 1,
5612        kind: TypeKind::Enum,
5613        wire: true,
5614    },
5615    TypeContract {
5616        name: "audit_decision",
5617        format_version: 1,
5618        kind: TypeKind::Enum,
5619        wire: true,
5620    },
5621    TypeContract {
5622        name: "audit_outcome",
5623        format_version: 1,
5624        kind: TypeKind::Enum,
5625        wire: true,
5626    },
5627    TypeContract {
5628        name: "audit_detail",
5629        format_version: 1,
5630        kind: TypeKind::Enum,
5631        wire: true,
5632    },
5633    TypeContract {
5634        name: "audit_gap_reason",
5635        format_version: 1,
5636        kind: TypeKind::Enum,
5637        wire: true,
5638    },
5639    TypeContract {
5640        name: "audit_event",
5641        format_version: 2,
5642        kind: TypeKind::Struct,
5643        wire: true,
5644    },
5645    TypeContract {
5646        name: "audit_gap",
5647        format_version: 2,
5648        kind: TypeKind::Struct,
5649        wire: true,
5650    },
5651    TypeContract {
5652        name: "audit_stream_state",
5653        format_version: 1,
5654        kind: TypeKind::Struct,
5655        wire: true,
5656    },
5657    TypeContract {
5658        name: "service_credential_grant",
5659        format_version: 1,
5660        kind: TypeKind::Struct,
5661        wire: true,
5662    },
5663    TypeContract {
5664        name: "service_credential_summary",
5665        format_version: 1,
5666        kind: TypeKind::Struct,
5667        wire: true,
5668    },
5669    TypeContract {
5670        name: "security_role",
5671        format_version: 1,
5672        kind: TypeKind::Struct,
5673        wire: true,
5674    },
5675    TypeContract {
5676        name: "role_append_scope_change",
5677        format_version: 1,
5678        kind: TypeKind::TaggedUnion,
5679        wire: true,
5680    },
5681    TypeContract {
5682        name: "role_append_access_preparation",
5683        format_version: 1,
5684        kind: TypeKind::TaggedUnion,
5685        wire: true,
5686    },
5687    TypeContract {
5688        name: "security_action_outcome",
5689        format_version: 1,
5690        kind: TypeKind::TaggedUnion,
5691        wire: true,
5692    },
5693    TypeContract {
5694        name: "maintenance_work_state",
5695        format_version: 1,
5696        kind: TypeKind::Enum,
5697        wire: true,
5698    },
5699    TypeContract {
5700        name: "maintenance_attempt_state",
5701        format_version: 1,
5702        kind: TypeKind::Enum,
5703        wire: true,
5704    },
5705    TypeContract {
5706        name: "maintenance_failure_class",
5707        format_version: 1,
5708        kind: TypeKind::Enum,
5709        wire: true,
5710    },
5711    TypeContract {
5712        name: "maintenance_failure_class_count",
5713        format_version: 1,
5714        kind: TypeKind::Struct,
5715        wire: true,
5716    },
5717    TypeContract {
5718        name: "maintenance_attempt_observation",
5719        format_version: 1,
5720        kind: TypeKind::Struct,
5721        wire: true,
5722    },
5723    TypeContract {
5724        name: "maintenance_task_scope",
5725        format_version: 1,
5726        kind: TypeKind::Struct,
5727        wire: true,
5728    },
5729    TypeContract {
5730        name: "maintenance_task_status",
5731        format_version: 1,
5732        kind: TypeKind::Struct,
5733        wire: true,
5734    },
5735    TypeContract {
5736        name: "maintenance_status_aggregate",
5737        format_version: 1,
5738        kind: TypeKind::Struct,
5739        wire: true,
5740    },
5741    TypeContract {
5742        name: "runtime_status_detail",
5743        format_version: 1,
5744        kind: TypeKind::Struct,
5745        wire: true,
5746    },
5747    TypeContract {
5748        name: "result_cache_status",
5749        format_version: 2,
5750        kind: TypeKind::Struct,
5751        wire: true,
5752    },
5753    TypeContract {
5754        name: "field_promotion_status",
5755        format_version: 1,
5756        kind: TypeKind::Struct,
5757        wire: true,
5758    },
5759    TypeContract {
5760        name: "overload_shard_status",
5761        format_version: 2,
5762        kind: TypeKind::Struct,
5763        wire: true,
5764    },
5765    TypeContract {
5766        name: "external_key_binding",
5767        format_version: 1,
5768        kind: TypeKind::Struct,
5769        wire: true,
5770    },
5771    TypeContract {
5772        name: "rollup_measure",
5773        format_version: 1,
5774        kind: TypeKind::TaggedUnion,
5775        wire: true,
5776    },
5777    TypeContract {
5778        name: "aggregate_then_delete_policy",
5779        format_version: 1,
5780        kind: TypeKind::Struct,
5781        wire: true,
5782    },
5783    TypeContract {
5784        name: "lifecycle_binding_status",
5785        format_version: 1,
5786        kind: TypeKind::Struct,
5787        wire: true,
5788    },
5789    TypeContract {
5790        name: "lifecycle_rollup_status",
5791        format_version: 1,
5792        kind: TypeKind::Struct,
5793        wire: true,
5794    },
5795    TypeContract {
5796        name: "lifecycle_status",
5797        format_version: 2,
5798        kind: TypeKind::Struct,
5799        wire: true,
5800    },
5801    TypeContract {
5802        name: "quota_limit",
5803        format_version: 1,
5804        kind: TypeKind::Struct,
5805        wire: true,
5806    },
5807    TypeContract {
5808        name: "quota_consumption",
5809        format_version: 1,
5810        kind: TypeKind::Struct,
5811        wire: true,
5812    },
5813    TypeContract {
5814        name: "quota_update",
5815        format_version: 1,
5816        kind: TypeKind::Struct,
5817        wire: true,
5818    },
5819    TypeContract {
5820        name: "core_binding",
5821        format_version: 2,
5822        kind: TypeKind::Struct,
5823        wire: true,
5824    },
5825    TypeContract {
5826        name: "readiness_observation",
5827        format_version: 1,
5828        kind: TypeKind::Struct,
5829        wire: true,
5830    },
5831    TypeContract {
5832        name: "usage_dimension",
5833        format_version: 1,
5834        kind: TypeKind::Struct,
5835        wire: true,
5836    },
5837    TypeContract {
5838        name: "physical_usage_value",
5839        format_version: 2,
5840        kind: TypeKind::Struct,
5841        wire: true,
5842    },
5843    TypeContract {
5844        name: "core_usage_units",
5845        format_version: 2,
5846        kind: TypeKind::Struct,
5847        wire: true,
5848    },
5849    TypeContract {
5850        name: "core_usage_correction",
5851        format_version: 2,
5852        kind: TypeKind::Struct,
5853        wire: true,
5854    },
5855    TypeContract {
5856        name: "response_meta",
5857        format_version: 1,
5858        kind: TypeKind::Struct,
5859        wire: true,
5860    },
5861    TypeContract {
5862        name: "error_disposition",
5863        format_version: 1,
5864        kind: TypeKind::Enum,
5865        wire: true,
5866    },
5867    TypeContract {
5868        name: "recovery_action",
5869        format_version: 1,
5870        kind: TypeKind::Enum,
5871        wire: true,
5872    },
5873    TypeContract {
5874        name: "limit_class",
5875        format_version: 1,
5876        kind: TypeKind::Enum,
5877        wire: true,
5878    },
5879    TypeContract {
5880        name: "error_detail",
5881        format_version: 3,
5882        kind: TypeKind::TaggedUnion,
5883        wire: true,
5884    },
5885    TypeContract {
5886        name: "connection_profile",
5887        format_version: 3,
5888        kind: TypeKind::Struct,
5889        wire: false,
5890    },
5891];
5892#[derive(Clone, Copy, Debug, Eq, PartialEq)]
5893pub struct StreamContract {
5894    pub name: &'static str,
5895    pub action: Action,
5896    pub transport: &'static str,
5897    pub service: &'static str,
5898    pub method: &'static str,
5899    pub auth_metadata: &'static str,
5900    pub auth_scheme: &'static str,
5901    pub semantic_format_version: u16,
5902    pub start_type: &'static str,
5903    pub frame_type: &'static str,
5904}
5905pub const LODESTONE_API_STREAM_CONTRACTS: &[StreamContract] = &[StreamContract {
5906    name: "subscription",
5907    action: Action::SubscriptionRead,
5908    transport: "grpc_tls",
5909    service: "lodestone.api.FilterSubscription",
5910    method: "/lodestone.api.FilterSubscription/Subscribe",
5911    auth_metadata: "authorization",
5912    auth_scheme: "ApiKey",
5913    semantic_format_version: 1,
5914    start_type: "subscription_start",
5915    frame_type: "subscription_frame",
5916}];
5917#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
5918#[serde(deny_unknown_fields)]
5919pub struct ErrorBody {
5920    pub code: ErrorCode,
5921    pub message: String,
5922    pub disposition: ErrorDisposition,
5923    pub recovery: RecoveryAction,
5924    pub details: ErrorDetail,
5925}
5926#[derive(Clone, Copy, Debug, Eq, PartialEq)]
5927pub enum ErrorShapeError {
5928    DetailCodeMismatch,
5929    OutcomeMismatch,
5930    RetryAfterOutOfRange,
5931}
5932impl ErrorBody {
5933    pub fn try_new(
5934        code: ErrorCode,
5935        message: String,
5936        disposition: ErrorDisposition,
5937        recovery: RecoveryAction,
5938        details: ErrorDetail,
5939    ) -> Result<Self, ErrorShapeError> {
5940        let body = Self {
5941            code,
5942            message,
5943            disposition,
5944            recovery,
5945            details,
5946        };
5947        validate_error_body(&body)?;
5948        Ok(body)
5949    }
5950    pub fn retry_safe(&self) -> bool {
5951        self.disposition == ErrorDisposition::NotSubmitted
5952            && matches!(
5953                self.recovery,
5954                RecoveryAction::Retry
5955                    | RecoveryAction::RetryAfter
5956                    | RecoveryAction::RefreshCredential
5957                    | RecoveryAction::RestartPage
5958                    | RecoveryAction::ReduceRequest
5959                    | RecoveryAction::RefreshPrecondition
5960                    | RecoveryAction::CorrectRange
5961            )
5962    }
5963    pub fn submitted(&self) -> bool {
5964        self.disposition != ErrorDisposition::NotSubmitted
5965    }
5966}
5967pub fn validate_error_body(body: &ErrorBody) -> Result<(), ErrorShapeError> {
5968    let detail_matches = matches!(
5969        (&body.code, &body.details),
5970        (ErrorCode::Aborted, ErrorDetail::Aborted { .. })
5971            | (ErrorCode::DeadlineExceeded, ErrorDetail::DeadlineExceeded)
5972            | (ErrorCode::InvalidRequest, ErrorDetail::InvalidRequest { .. })
5973            | (ErrorCode::UnsupportedVersion, ErrorDetail::UnsupportedVersion { .. })
5974            | (ErrorCode::Unauthenticated, ErrorDetail::Unauthenticated)
5975            | (ErrorCode::PermissionDenied, ErrorDetail::PermissionDenied { .. })
5976            | (ErrorCode::NotFound, ErrorDetail::NotFound { .. })
5977            | (ErrorCode::Conflict, ErrorDetail::Conflict { .. })
5978            | (ErrorCode::StaleCursor, ErrorDetail::StaleCursor { .. })
5979            | (
5980                ErrorCode::RestartBudgetExhausted,
5981                ErrorDetail::RestartBudgetExhausted { .. }
5982            )
5983            | (ErrorCode::LimitExceeded, ErrorDetail::LimitExceeded { .. })
5984            | (
5985                ErrorCode::CapabilityUnavailable,
5986                ErrorDetail::CapabilityUnavailable { .. }
5987            )
5988            | (ErrorCode::NotSubmitted, ErrorDetail::NotSubmitted { .. })
5989            | (
5990                ErrorCode::SubmittedIndeterminate,
5991                ErrorDetail::SubmittedIndeterminate { .. }
5992            )
5993            | (ErrorCode::ExpiredUnknown, ErrorDetail::ExpiredUnknown { .. })
5994            | (ErrorCode::SecretNotEscrowed, ErrorDetail::SecretNotEscrowed)
5995            | (ErrorCode::RetentionGap, ErrorDetail::RetentionGap { .. })
5996            | (
5997                ErrorCode::ArtifactRangeInvalid,
5998                ErrorDetail::ArtifactRangeInvalid { .. }
5999            )
6000            | (ErrorCode::ChecksumMismatch, ErrorDetail::ChecksumMismatch { .. })
6001            | (
6002                ErrorCode::TemporarilyUnavailable,
6003                ErrorDetail::TemporarilyUnavailable { .. }
6004            )
6005            | (ErrorCode::Internal, ErrorDetail::Internal)
6006    );
6007    if !detail_matches {
6008        return Err(ErrorShapeError::DetailCodeMismatch);
6009    }
6010    if !LODESTONE_API_ERROR_OUTCOMES.iter().any(|contract| {
6011        contract.code == body.code && contract.disposition == body.disposition && contract.recovery == body.recovery
6012    }) {
6013        return Err(ErrorShapeError::OutcomeMismatch);
6014    }
6015    let retry_after = match &body.details {
6016        ErrorDetail::NotSubmitted { retry_after_millis }
6017        | ErrorDetail::TemporarilyUnavailable { retry_after_millis } => retry_after_millis.as_ref(),
6018        _ => None,
6019    };
6020    if retry_after
6021        .and_then(|value| value.value.parse::<u64>().ok())
6022        .is_some_and(|value| value > 60000)
6023    {
6024        return Err(ErrorShapeError::RetryAfterOutOfRange);
6025    }
6026    Ok(())
6027}
6028#[derive(Clone, Debug, Deserialize, Eq, PartialEq, Serialize)]
6029#[serde(deny_unknown_fields)]
6030pub struct RequestMeta {
6031    pub format_version: u16,
6032    pub request_id: String,
6033    pub correlation_id: Identity,
6034    pub absolute_deadline_unix_millis: U64,
6035    pub workload_class: WorkloadClass,
6036}
6037
6038#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
6039#[serde(deny_unknown_fields)]
6040pub struct DiscoverRequest {}
6041
6042#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
6043#[serde(deny_unknown_fields)]
6044pub struct DiscoverResult {
6045    pub principal_id: Identity,
6046    pub collection_id: Identity,
6047    pub policy_revision: U64,
6048    pub artifact_version: String,
6049    pub schema_id: String,
6050    pub schema_digest: Digest,
6051    pub streams: Vec<StreamBinding>,
6052    pub capabilities: Vec<CapabilityGrant>,
6053    pub limits: Vec<ProtocolLimit>,
6054}
6055
6056#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
6057#[serde(deny_unknown_fields)]
6058pub struct ListIndexesRequest {
6059    pub page_size: u32,
6060    #[serde(default, skip_serializing_if = "Option::is_none")]
6061    pub cursor: Option<Cursor>,
6062    #[serde(default, skip_serializing_if = "Option::is_none")]
6063    pub name_prefix: Option<String>,
6064    #[serde(default, skip_serializing_if = "Option::is_none")]
6065    pub mode: Option<String>,
6066    #[serde(default, skip_serializing_if = "Option::is_none")]
6067    pub state: Option<String>,
6068    pub restart_count: u32,
6069}
6070
6071#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
6072#[serde(deny_unknown_fields)]
6073pub struct ListIndexesResult {
6074    pub items: Vec<IndexSummary>,
6075    #[serde(default, skip_serializing_if = "Option::is_none")]
6076    pub next_cursor: Option<Cursor>,
6077    pub restart_count: u32,
6078}
6079
6080#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
6081#[serde(deny_unknown_fields)]
6082pub struct GetIndexRequest {
6083    pub name: String,
6084    #[serde(default, skip_serializing_if = "Option::is_none")]
6085    pub expected_incarnation: Option<Identity>,
6086}
6087
6088#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
6089#[serde(deny_unknown_fields)]
6090pub struct GetIndexResult {
6091    pub resource: IndexDetail,
6092}
6093
6094#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
6095#[serde(deny_unknown_fields)]
6096pub struct ValidateIndexChangeRequest {
6097    pub action_kind: String,
6098    pub name: String,
6099    #[serde(default, skip_serializing_if = "Option::is_none")]
6100    pub expected_incarnation: Option<Identity>,
6101    #[serde(default, skip_serializing_if = "Option::is_none")]
6102    pub expected_revision: Option<U64>,
6103    #[serde(default, skip_serializing_if = "Option::is_none")]
6104    pub mode: Option<String>,
6105    #[serde(default, skip_serializing_if = "Option::is_none")]
6106    pub mapping: Option<Mapping>,
6107    #[serde(default, skip_serializing_if = "Option::is_none")]
6108    pub policies: Option<IndexPolicies>,
6109}
6110
6111#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
6112#[serde(deny_unknown_fields)]
6113pub struct ValidateIndexChangeResult {
6114    pub change_kind: String,
6115    pub fields_added: Vec<String>,
6116    pub policy_axes_changed: Vec<String>,
6117    pub required_capabilities: Vec<String>,
6118    pub catalog_revision: U64,
6119    pub policy_revision: U64,
6120}
6121
6122#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
6123#[serde(deny_unknown_fields)]
6124pub struct ApplyIndexChangeRequest {
6125    pub action_id: Digest,
6126    pub index: Resource,
6127    pub expected_revision: U64,
6128    #[serde(default, skip_serializing_if = "Option::is_none")]
6129    pub mapping: Option<Mapping>,
6130    #[serde(default, skip_serializing_if = "Option::is_none")]
6131    pub policies: Option<IndexPolicies>,
6132}
6133
6134#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
6135#[serde(deny_unknown_fields)]
6136pub struct ApplyIndexChangeResult {
6137    pub receipt: IndexChangeApplyReceipt,
6138}
6139
6140#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
6141#[serde(deny_unknown_fields)]
6142pub struct ApplyAdministrationMutationRequest {
6143    pub action_id: Digest,
6144    pub expected_revision: U64,
6145    pub mutation: AdministrationMutation,
6146}
6147
6148#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
6149#[serde(deny_unknown_fields)]
6150pub struct ApplyAdministrationMutationResult {
6151    pub outcome: AdministrationOutcome,
6152}
6153
6154#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
6155#[serde(deny_unknown_fields)]
6156pub struct ListAliasesRequest {
6157    pub page_size: u32,
6158    #[serde(default, skip_serializing_if = "Option::is_none")]
6159    pub cursor: Option<Cursor>,
6160    #[serde(default, skip_serializing_if = "Option::is_none")]
6161    pub name_prefix: Option<String>,
6162    pub restart_count: u32,
6163}
6164
6165#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
6166#[serde(deny_unknown_fields)]
6167pub struct ListAliasesResult {
6168    pub items: Vec<AliasSummary>,
6169    #[serde(default, skip_serializing_if = "Option::is_none")]
6170    pub next_cursor: Option<Cursor>,
6171    pub restart_count: u32,
6172}
6173
6174#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
6175#[serde(deny_unknown_fields)]
6176pub struct GetAliasRequest {
6177    pub name: String,
6178}
6179
6180#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
6181#[serde(deny_unknown_fields)]
6182pub struct GetAliasResult {
6183    pub resource: AliasDetail,
6184}
6185
6186#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
6187#[serde(deny_unknown_fields)]
6188pub struct ListDataStreamsRequest {
6189    pub page_size: u32,
6190    #[serde(default, skip_serializing_if = "Option::is_none")]
6191    pub cursor: Option<Cursor>,
6192    #[serde(default, skip_serializing_if = "Option::is_none")]
6193    pub name_prefix: Option<String>,
6194    pub restart_count: u32,
6195}
6196
6197#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
6198#[serde(deny_unknown_fields)]
6199pub struct ListDataStreamsResult {
6200    pub items: Vec<DataStreamSummary>,
6201    #[serde(default, skip_serializing_if = "Option::is_none")]
6202    pub next_cursor: Option<Cursor>,
6203    pub restart_count: u32,
6204}
6205
6206#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
6207#[serde(deny_unknown_fields)]
6208pub struct GetDataStreamRequest {
6209    pub name: String,
6210}
6211
6212#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
6213#[serde(deny_unknown_fields)]
6214pub struct GetDataStreamResult {
6215    pub resource: DataStreamDetail,
6216}
6217
6218#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
6219#[serde(deny_unknown_fields)]
6220pub struct ListComponentTemplatesRequest {
6221    pub page_size: u32,
6222    #[serde(default, skip_serializing_if = "Option::is_none")]
6223    pub cursor: Option<Cursor>,
6224    #[serde(default, skip_serializing_if = "Option::is_none")]
6225    pub name_prefix: Option<String>,
6226    pub restart_count: u32,
6227}
6228
6229#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
6230#[serde(deny_unknown_fields)]
6231pub struct ListComponentTemplatesResult {
6232    pub items: Vec<ComponentTemplateSummary>,
6233    #[serde(default, skip_serializing_if = "Option::is_none")]
6234    pub next_cursor: Option<Cursor>,
6235    pub restart_count: u32,
6236}
6237
6238#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
6239#[serde(deny_unknown_fields)]
6240pub struct GetComponentTemplateRequest {
6241    pub name: String,
6242    #[serde(default, skip_serializing_if = "Option::is_none")]
6243    pub expected_incarnation: Option<Identity>,
6244}
6245
6246#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
6247#[serde(deny_unknown_fields)]
6248pub struct GetComponentTemplateResult {
6249    pub resource: ComponentTemplateDetail,
6250}
6251
6252#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
6253#[serde(deny_unknown_fields)]
6254pub struct ListIndexTemplatesRequest {
6255    pub page_size: u32,
6256    #[serde(default, skip_serializing_if = "Option::is_none")]
6257    pub cursor: Option<Cursor>,
6258    #[serde(default, skip_serializing_if = "Option::is_none")]
6259    pub name_prefix: Option<String>,
6260    pub restart_count: u32,
6261}
6262
6263#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
6264#[serde(deny_unknown_fields)]
6265pub struct ListIndexTemplatesResult {
6266    pub items: Vec<IndexTemplateSummary>,
6267    #[serde(default, skip_serializing_if = "Option::is_none")]
6268    pub next_cursor: Option<Cursor>,
6269    pub restart_count: u32,
6270}
6271
6272#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
6273#[serde(deny_unknown_fields)]
6274pub struct GetIndexTemplateRequest {
6275    pub name: String,
6276    #[serde(default, skip_serializing_if = "Option::is_none")]
6277    pub expected_incarnation: Option<Identity>,
6278}
6279
6280#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
6281#[serde(deny_unknown_fields)]
6282pub struct GetIndexTemplateResult {
6283    pub resource: IndexTemplateDetail,
6284}
6285
6286#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
6287#[serde(deny_unknown_fields)]
6288pub struct ListIngestPipelinesRequest {
6289    pub page_size: u32,
6290    #[serde(default, skip_serializing_if = "Option::is_none")]
6291    pub cursor: Option<Cursor>,
6292    #[serde(default, skip_serializing_if = "Option::is_none")]
6293    pub name_prefix: Option<String>,
6294    pub restart_count: u32,
6295}
6296
6297#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
6298#[serde(deny_unknown_fields)]
6299pub struct ListIngestPipelinesResult {
6300    pub items: Vec<IngestPipelineSummary>,
6301    #[serde(default, skip_serializing_if = "Option::is_none")]
6302    pub next_cursor: Option<Cursor>,
6303    pub restart_count: u32,
6304}
6305
6306#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
6307#[serde(deny_unknown_fields)]
6308pub struct GetIngestPipelineRequest {
6309    pub name: String,
6310    #[serde(default, skip_serializing_if = "Option::is_none")]
6311    pub expected_incarnation: Option<Identity>,
6312}
6313
6314#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
6315#[serde(deny_unknown_fields)]
6316pub struct GetIngestPipelineResult {
6317    pub resource: IngestPipelineDetail,
6318}
6319
6320#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
6321#[serde(deny_unknown_fields)]
6322pub struct SimulateIngestPipelineRequest {
6323    #[serde(default, skip_serializing_if = "Option::is_none")]
6324    pub name: Option<String>,
6325    #[serde(default, skip_serializing_if = "Option::is_none")]
6326    pub expected: Option<ExpectedBinding>,
6327    #[serde(default, skip_serializing_if = "Option::is_none")]
6328    pub definition: Option<RawJson>,
6329    pub source: RawJson,
6330}
6331
6332#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
6333#[serde(deny_unknown_fields)]
6334pub struct SimulateIngestPipelineResult {
6335    #[serde(default, skip_serializing_if = "Option::is_none")]
6336    pub source: Option<RawJson>,
6337    pub dropped: bool,
6338    pub changed: bool,
6339}
6340
6341#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
6342#[serde(deny_unknown_fields)]
6343pub struct ReprocessByQueryRequest {
6344    pub action_id: Digest,
6345    pub index: Resource,
6346    pub query: Query,
6347    #[serde(default, skip_serializing_if = "Option::is_none")]
6348    pub pipeline: Option<IngestPipelineSelection>,
6349    pub batch_size: u32,
6350    pub max_docs: U64,
6351    pub proceed_on_conflict: bool,
6352    pub slices: u32,
6353    pub requests_per_second: u32,
6354    pub wait_for_completion: bool,
6355}
6356
6357#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
6358#[serde(deny_unknown_fields)]
6359pub struct ReprocessByQueryResult {
6360    pub task_id: Identity,
6361    pub scanned: U64,
6362    pub updated: U64,
6363    pub noops: U64,
6364    pub version_conflicts: U64,
6365    pub batches: U64,
6366    pub completed: bool,
6367}
6368
6369#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
6370#[serde(deny_unknown_fields)]
6371pub struct ListLifecyclePoliciesRequest {
6372    pub page_size: u32,
6373    #[serde(default, skip_serializing_if = "Option::is_none")]
6374    pub cursor: Option<Cursor>,
6375    #[serde(default, skip_serializing_if = "Option::is_none")]
6376    pub name_prefix: Option<String>,
6377    pub restart_count: u32,
6378}
6379
6380#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
6381#[serde(deny_unknown_fields)]
6382pub struct ListLifecyclePoliciesResult {
6383    pub items: Vec<LifecyclePolicySummary>,
6384    #[serde(default, skip_serializing_if = "Option::is_none")]
6385    pub next_cursor: Option<Cursor>,
6386    pub restart_count: u32,
6387}
6388
6389#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
6390#[serde(deny_unknown_fields)]
6391pub struct GetLifecyclePolicyRequest {
6392    pub name: String,
6393}
6394
6395#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
6396#[serde(deny_unknown_fields)]
6397pub struct GetLifecyclePolicyResult {
6398    pub resource: LifecyclePolicyDetail,
6399}
6400
6401#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
6402#[serde(deny_unknown_fields)]
6403pub struct PrepareCreateIndexRequest {
6404    pub name: String,
6405    pub mapping: Mapping,
6406    #[serde(default, skip_serializing_if = "Option::is_none")]
6407    pub resource_spec: Option<IndexResourceSpec>,
6408    #[serde(default, skip_serializing_if = "Option::is_none")]
6409    pub retained_event_identity: Option<bool>,
6410}
6411
6412#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
6413#[serde(deny_unknown_fields)]
6414pub struct PrepareCreateIndexResult {
6415    pub locator: Locator,
6416    pub expires_at: U64,
6417    pub semantic_digest: Digest,
6418    pub resource_spec: IndexResourceSpec,
6419}
6420
6421#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
6422#[serde(deny_unknown_fields)]
6423pub struct PrepareDeleteIndexRequest {
6424    pub name: String,
6425    pub expected_incarnation: Identity,
6426}
6427
6428#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
6429#[serde(deny_unknown_fields)]
6430pub struct PrepareDeleteIndexResult {
6431    #[serde(default, skip_serializing_if = "Option::is_none")]
6432    pub locator: Option<Locator>,
6433    #[serde(default, skip_serializing_if = "Option::is_none")]
6434    pub expires_at: Option<U64>,
6435    #[serde(default, skip_serializing_if = "Option::is_none")]
6436    pub semantic_digest: Option<Digest>,
6437    pub impact_digest: Digest,
6438    pub blockers: Vec<String>,
6439    pub scheduled_effects: Vec<String>,
6440    #[serde(default, skip_serializing_if = "Option::is_none")]
6441    pub estimated_documents: Option<U64>,
6442    #[serde(default, skip_serializing_if = "Option::is_none")]
6443    pub estimated_logical_bytes: Option<U64>,
6444}
6445
6446#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
6447#[serde(deny_unknown_fields)]
6448pub struct SubmitCatalogActionRequest {
6449    pub locator: Locator,
6450    pub semantic_digest: Digest,
6451    pub action_kind: String,
6452    pub name: String,
6453    #[serde(default, skip_serializing_if = "Option::is_none")]
6454    pub mapping: Option<Mapping>,
6455    #[serde(default, skip_serializing_if = "Option::is_none")]
6456    pub resource_spec: Option<IndexResourceSpec>,
6457    #[serde(default, skip_serializing_if = "Option::is_none")]
6458    pub expected_incarnation: Option<Identity>,
6459}
6460
6461#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
6462#[serde(deny_unknown_fields)]
6463pub struct SubmitCatalogActionResult {
6464    pub locator: Locator,
6465    pub state: String,
6466    pub mutation_outcome: MutationOutcome,
6467}
6468
6469#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
6470#[serde(deny_unknown_fields)]
6471pub struct ResolveCatalogActionRequest {
6472    pub locator: Locator,
6473}
6474
6475#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
6476#[serde(deny_unknown_fields)]
6477pub struct ResolveCatalogActionResult {
6478    pub locator: Locator,
6479    pub state: String,
6480    #[serde(default, skip_serializing_if = "Option::is_none")]
6481    pub resource: Option<Resource>,
6482}
6483
6484#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
6485#[serde(deny_unknown_fields)]
6486pub struct PrepareReplayableSourceIndexRequest {
6487    pub name: String,
6488    pub mapping: Mapping,
6489    #[serde(default, skip_serializing_if = "Option::is_none")]
6490    pub resource_spec: Option<IndexResourceSpec>,
6491    pub source: ReplayableSourceConfiguration,
6492}
6493
6494#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
6495#[serde(deny_unknown_fields)]
6496pub struct PrepareReplayableSourceIndexResult {
6497    pub locator: Locator,
6498    pub expires_at: U64,
6499    pub semantic_digest: Digest,
6500    pub resource_spec: IndexResourceSpec,
6501}
6502
6503#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
6504#[serde(deny_unknown_fields)]
6505pub struct SubmitReplayableSourceIndexRequest {
6506    pub locator: Locator,
6507    pub semantic_digest: Digest,
6508    pub name: String,
6509    pub mapping: Mapping,
6510    pub resource_spec: IndexResourceSpec,
6511    pub source: ReplayableSourceConfiguration,
6512}
6513
6514#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
6515#[serde(deny_unknown_fields)]
6516pub struct SubmitReplayableSourceIndexResult {
6517    pub locator: Locator,
6518    pub state: String,
6519    pub mutation_outcome: MutationOutcome,
6520}
6521
6522#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
6523#[serde(deny_unknown_fields)]
6524pub struct GetReplayableSourceRequest {
6525    pub index: Resource,
6526}
6527
6528#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
6529#[serde(deny_unknown_fields)]
6530pub struct GetReplayableSourceResult {
6531    pub status: ReplayableSourceStatus,
6532}
6533
6534#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
6535#[serde(deny_unknown_fields)]
6536pub struct ControlReplayableSourceRequest {
6537    pub index: Resource,
6538    pub expected_generation: U64,
6539    pub transition: SourceControlTransition,
6540}
6541
6542#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
6543#[serde(deny_unknown_fields)]
6544pub struct ControlReplayableSourceResult {
6545    pub status: ReplayableSourceStatus,
6546    pub mutation_outcome: MutationOutcome,
6547}
6548
6549#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
6550#[serde(deny_unknown_fields)]
6551pub struct CloneIndexRequest {
6552    pub source: Resource,
6553    pub destination_name: String,
6554    pub operation_id: Identity,
6555    pub source_cut_id: Identity,
6556}
6557
6558#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
6559#[serde(deny_unknown_fields)]
6560pub struct CloneIndexResult {
6561    pub destination: Resource,
6562    pub source_cut_id: Identity,
6563    pub mutation_outcome: MutationOutcome,
6564}
6565
6566#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
6567#[serde(deny_unknown_fields)]
6568pub struct ConfigureHistoryRequest {
6569    pub index: Resource,
6570    pub precondition: HistoryLedgerPrecondition,
6571    pub policy: HistoryRetentionPolicy,
6572}
6573
6574#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
6575#[serde(deny_unknown_fields)]
6576pub struct ConfigureHistoryResult {
6577    pub status: HistoryStatus,
6578    pub mutation_outcome: MutationOutcome,
6579}
6580
6581#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
6582#[serde(deny_unknown_fields)]
6583pub struct GetHistoryRequest {
6584    pub index: Resource,
6585}
6586
6587#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
6588#[serde(deny_unknown_fields)]
6589pub struct GetHistoryResult {
6590    pub status: HistoryStatus,
6591}
6592
6593#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
6594#[serde(deny_unknown_fields)]
6595pub struct ResolveHistoryRequest {
6596    pub index: Resource,
6597    pub selector: HistorySelector,
6598}
6599
6600#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
6601#[serde(deny_unknown_fields)]
6602pub struct ResolveHistoryResult {
6603    pub resolution: HistoryResolution,
6604}
6605
6606#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
6607#[serde(deny_unknown_fields)]
6608pub struct PlaceHistoryHoldRequest {
6609    pub index: Resource,
6610    pub expected_ledger_revision: U64,
6611    pub hold: HistoryHold,
6612}
6613
6614#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
6615#[serde(deny_unknown_fields)]
6616pub struct PlaceHistoryHoldResult {
6617    pub status: HistoryStatus,
6618    pub mutation_outcome: MutationOutcome,
6619}
6620
6621#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
6622#[serde(deny_unknown_fields)]
6623pub struct ReleaseHistoryHoldRequest {
6624    pub index: Resource,
6625    pub expected_ledger_revision: U64,
6626    pub hold_id: Identity,
6627}
6628
6629#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
6630#[serde(deny_unknown_fields)]
6631pub struct ReleaseHistoryHoldResult {
6632    pub status: HistoryStatus,
6633    pub mutation_outcome: MutationOutcome,
6634}
6635
6636#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
6637#[serde(deny_unknown_fields)]
6638pub struct PrepareDocumentMutationRequest {
6639    pub index: Resource,
6640    pub document_id: String,
6641    pub operation: String,
6642    #[serde(default, skip_serializing_if = "Option::is_none")]
6643    pub source: Option<RawJson>,
6644    #[serde(default, skip_serializing_if = "Option::is_none")]
6645    pub routing: Option<String>,
6646    #[serde(default, skip_serializing_if = "Option::is_none")]
6647    pub condition: Option<DocumentMutationCondition>,
6648    #[serde(default, skip_serializing_if = "Option::is_none")]
6649    pub pipeline: Option<IngestPipelineSelection>,
6650}
6651
6652#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
6653#[serde(deny_unknown_fields)]
6654pub struct PrepareDocumentMutationResult {
6655    pub locator: Locator,
6656    pub semantic_digest: Digest,
6657    pub retention_max_entries: U64,
6658    pub retention_sequence_window: U64,
6659}
6660
6661#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
6662#[serde(deny_unknown_fields)]
6663pub struct SubmitDocumentMutationRequest {
6664    pub locator: Locator,
6665    pub semantic_digest: Digest,
6666    pub index: Resource,
6667    pub document_id: String,
6668    pub operation: String,
6669    #[serde(default, skip_serializing_if = "Option::is_none")]
6670    pub source: Option<RawJson>,
6671    #[serde(default, skip_serializing_if = "Option::is_none")]
6672    pub routing: Option<String>,
6673    #[serde(default, skip_serializing_if = "Option::is_none")]
6674    pub condition: Option<DocumentMutationCondition>,
6675    #[serde(default, skip_serializing_if = "Option::is_none")]
6676    pub pipeline: Option<IngestPipelineSelection>,
6677}
6678
6679#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
6680#[serde(deny_unknown_fields)]
6681pub struct SubmitDocumentMutationResult {
6682    pub locator: Locator,
6683    pub state: String,
6684    pub mutation_outcome: MutationOutcome,
6685    #[serde(default, skip_serializing_if = "Option::is_none")]
6686    pub achievement: Option<WriteAchievement>,
6687    #[serde(default, skip_serializing_if = "Option::is_none")]
6688    pub sequence: Option<U64>,
6689    #[serde(default, skip_serializing_if = "Option::is_none")]
6690    pub mapping_generation: Option<U64>,
6691    pub mapping_adopted: bool,
6692}
6693
6694#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
6695#[serde(deny_unknown_fields)]
6696pub struct PrepareDocumentBulkRequest {
6697    pub batch_id: Digest,
6698    pub index: Resource,
6699    pub items: Vec<BulkDocumentItem>,
6700}
6701
6702#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
6703#[serde(deny_unknown_fields)]
6704pub struct PrepareDocumentBulkResult {
6705    pub outcome: BulkDocumentOutcome,
6706}
6707
6708#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
6709#[serde(deny_unknown_fields)]
6710pub struct SubmitDocumentBulkRequest {
6711    pub batch_id: Digest,
6712    pub index: Resource,
6713    pub items: Vec<BulkDocumentItem>,
6714    pub preparations: Vec<BulkDocumentItemOutcome>,
6715}
6716
6717#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
6718#[serde(deny_unknown_fields)]
6719pub struct SubmitDocumentBulkResult {
6720    pub outcome: BulkDocumentOutcome,
6721}
6722
6723#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
6724#[serde(deny_unknown_fields)]
6725pub struct ResolveDocumentBulkRequest {
6726    pub batch_id: Digest,
6727    pub index: Resource,
6728    pub items: Vec<BulkDocumentItemOutcome>,
6729}
6730
6731#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
6732#[serde(deny_unknown_fields)]
6733pub struct ResolveDocumentBulkResult {
6734    pub outcome: BulkDocumentOutcome,
6735}
6736
6737#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
6738#[serde(deny_unknown_fields)]
6739pub struct PrepareAppendBulkRequest {
6740    pub batch_id: Digest,
6741    pub index: Resource,
6742    pub items: Vec<RetainedAppendItem>,
6743}
6744
6745#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
6746#[serde(deny_unknown_fields)]
6747pub struct PrepareAppendBulkResult {
6748    pub outcome: RetainedAppendBulkOutcome,
6749}
6750
6751#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
6752#[serde(deny_unknown_fields)]
6753pub struct SubmitAppendBulkRequest {
6754    pub batch_id: Digest,
6755    pub index: Resource,
6756    pub items: Vec<RetainedAppendItem>,
6757    pub preparations: Vec<RetainedAppendItemOutcome>,
6758}
6759
6760#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
6761#[serde(deny_unknown_fields)]
6762pub struct SubmitAppendBulkResult {
6763    pub outcome: RetainedAppendBulkOutcome,
6764}
6765
6766#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
6767#[serde(deny_unknown_fields)]
6768pub struct ResolveAppendBulkRequest {
6769    pub batch_id: Digest,
6770    pub index: Resource,
6771    pub items: Vec<RetainedAppendItemOutcome>,
6772}
6773
6774#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
6775#[serde(deny_unknown_fields)]
6776pub struct ResolveAppendBulkResult {
6777    pub outcome: RetainedAppendBulkOutcome,
6778}
6779
6780#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
6781#[serde(deny_unknown_fields)]
6782pub struct ObserveAppendCommittedRequest {
6783    pub index: Resource,
6784    pub locator: Locator,
6785}
6786
6787#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
6788#[serde(deny_unknown_fields)]
6789pub struct ObserveAppendCommittedResult {
6790    pub outcome: RetainedAppendObservationOutcome,
6791}
6792
6793#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
6794#[serde(deny_unknown_fields)]
6795pub struct ResolveDocumentMutationRequest {
6796    pub locator: Locator,
6797}
6798
6799#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
6800#[serde(deny_unknown_fields)]
6801pub struct ResolveDocumentMutationResult {
6802    pub locator: Locator,
6803    pub state: String,
6804    #[serde(default, skip_serializing_if = "Option::is_none")]
6805    pub sequence: Option<U64>,
6806    #[serde(default, skip_serializing_if = "Option::is_none")]
6807    pub mapping_generation: Option<U64>,
6808    pub mapping_adopted: bool,
6809    #[serde(default, skip_serializing_if = "Option::is_none")]
6810    pub source: Option<RawJson>,
6811}
6812
6813#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
6814#[serde(deny_unknown_fields)]
6815pub struct GetDocumentRequest {
6816    pub index: Resource,
6817    pub document_id: String,
6818    #[serde(default, skip_serializing_if = "Option::is_none")]
6819    pub routing: Option<String>,
6820}
6821
6822#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
6823#[serde(deny_unknown_fields)]
6824pub struct GetDocumentResult {
6825    pub found: bool,
6826    #[serde(default, skip_serializing_if = "Option::is_none")]
6827    pub source: Option<RawJson>,
6828    #[serde(default, skip_serializing_if = "Option::is_none")]
6829    pub sequence: Option<U64>,
6830    #[serde(default, skip_serializing_if = "Option::is_none")]
6831    pub primary_term: Option<U64>,
6832}
6833
6834#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
6835#[serde(deny_unknown_fields)]
6836pub struct SearchRequest {
6837    #[serde(default, skip_serializing_if = "Option::is_none")]
6838    pub indexes: Option<Vec<Resource>>,
6839    #[serde(default, skip_serializing_if = "Option::is_none")]
6840    pub query: Option<Query>,
6841    #[serde(default, skip_serializing_if = "Option::is_none")]
6842    pub retrieval: Option<RetrievalPlan>,
6843    #[serde(default, skip_serializing_if = "Option::is_none")]
6844    pub aggregations: Option<Vec<Aggregation>>,
6845    pub sort: Vec<SortSpec>,
6846    #[serde(default, skip_serializing_if = "Option::is_none")]
6847    pub routing: Option<Vec<String>>,
6848    pub freshness: SearchFreshness,
6849    pub page_size: u32,
6850    #[serde(default, skip_serializing_if = "Option::is_none")]
6851    pub cursor: Option<Cursor>,
6852    #[serde(default, skip_serializing_if = "Option::is_none")]
6853    pub pit: Option<Cursor>,
6854    pub allow_partial: bool,
6855    #[serde(default, skip_serializing_if = "Option::is_none")]
6856    pub total_hits_threshold: Option<U64>,
6857    pub diagnostics: bool,
6858    #[serde(default, skip_serializing_if = "Option::is_none")]
6859    pub fragments: Option<FragmentRequest>,
6860    #[serde(default, skip_serializing_if = "Option::is_none")]
6861    pub features: Option<ResultFeatureRequest>,
6862    #[serde(default, skip_serializing_if = "Option::is_none")]
6863    pub diversification: Option<ResultDiversification>,
6864}
6865
6866#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
6867#[serde(deny_unknown_fields)]
6868pub struct SearchResult {
6869    pub hits: Vec<SearchHit>,
6870    pub aggregations: Vec<AggregationResult>,
6871    #[serde(default, skip_serializing_if = "Option::is_none")]
6872    pub next_cursor: Option<Cursor>,
6873    pub timed_out: bool,
6874    pub partial: bool,
6875    pub achieved: SearchAchievement,
6876    pub shards: ShardCounts,
6877    pub total: SearchTotal,
6878    pub failures: Vec<SearchPartialFailure>,
6879    pub vector_diagnostics: Vec<VectorBranchDiagnostics>,
6880}
6881
6882#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
6883#[serde(deny_unknown_fields)]
6884pub struct ValidateSearchRequest {
6885    pub indexes: Vec<Resource>,
6886    #[serde(default, skip_serializing_if = "Option::is_none")]
6887    pub query: Option<Query>,
6888    #[serde(default, skip_serializing_if = "Option::is_none")]
6889    pub retrieval: Option<RetrievalPlan>,
6890    #[serde(default, skip_serializing_if = "Option::is_none")]
6891    pub aggregations: Option<Vec<Aggregation>>,
6892    pub sort: Vec<SortSpec>,
6893    #[serde(default, skip_serializing_if = "Option::is_none")]
6894    pub routing: Option<Vec<String>>,
6895    pub freshness: SearchFreshness,
6896    pub page_size: u32,
6897    pub allow_partial: bool,
6898    #[serde(default, skip_serializing_if = "Option::is_none")]
6899    pub total_hits_threshold: Option<U64>,
6900    #[serde(default, skip_serializing_if = "Option::is_none")]
6901    pub fragments: Option<FragmentRequest>,
6902    #[serde(default, skip_serializing_if = "Option::is_none")]
6903    pub features: Option<ResultFeatureRequest>,
6904    #[serde(default, skip_serializing_if = "Option::is_none")]
6905    pub diversification: Option<ResultDiversification>,
6906}
6907
6908#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
6909#[serde(deny_unknown_fields)]
6910pub struct ValidateSearchResult {
6911    pub catalog_revision: U64,
6912    pub resolved_indexes: Vec<Resource>,
6913    pub authorized: bool,
6914    pub capabilities: Vec<String>,
6915    pub shape_digest: Digest,
6916    pub warnings: Vec<String>,
6917    pub refusals: Vec<String>,
6918    pub limits: Vec<SearchValidationLimit>,
6919    pub estimates: SearchValidationEstimates,
6920}
6921
6922#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
6923#[serde(deny_unknown_fields)]
6924pub struct OpenPitRequest {
6925    pub indexes: Vec<Resource>,
6926    pub keep_alive_millis: U64,
6927}
6928
6929#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
6930#[serde(deny_unknown_fields)]
6931pub struct OpenPitResult {
6932    pub pit: Cursor,
6933    pub expires_at: U64,
6934    pub shard_count: u32,
6935}
6936
6937#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
6938#[serde(deny_unknown_fields)]
6939pub struct RenewPitRequest {
6940    pub pit: Cursor,
6941    pub keep_alive_millis: U64,
6942}
6943
6944#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
6945#[serde(deny_unknown_fields)]
6946pub struct RenewPitResult {
6947    pub pit: Cursor,
6948    pub expires_at: U64,
6949    pub shard_count: u32,
6950}
6951
6952#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
6953#[serde(deny_unknown_fields)]
6954pub struct ClosePitRequest {
6955    pub pit: Cursor,
6956}
6957
6958#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
6959#[serde(deny_unknown_fields)]
6960pub struct ClosePitResult {
6961    pub removed: bool,
6962}
6963
6964#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
6965#[serde(deny_unknown_fields)]
6966pub struct ListOperationsRequest {
6967    pub page_size: u32,
6968    #[serde(default, skip_serializing_if = "Option::is_none")]
6969    pub cursor: Option<Cursor>,
6970}
6971
6972#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
6973#[serde(deny_unknown_fields)]
6974pub struct ListOperationsResult {
6975    pub items: Vec<Operation>,
6976    #[serde(default, skip_serializing_if = "Option::is_none")]
6977    pub next_cursor: Option<Cursor>,
6978}
6979
6980#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
6981#[serde(deny_unknown_fields)]
6982pub struct GetOperationRequest {
6983    pub locator: Locator,
6984}
6985
6986#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
6987#[serde(deny_unknown_fields)]
6988pub struct GetOperationResult {
6989    pub operation: Operation,
6990}
6991
6992#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
6993#[serde(deny_unknown_fields)]
6994pub struct WaitOperationRequest {
6995    pub locator: Locator,
6996    pub after_authority_revision: U64,
6997    pub maximum_attempts: u32,
6998    pub interval_millis: U64,
6999}
7000
7001#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
7002#[serde(deny_unknown_fields)]
7003pub struct WaitOperationResult {
7004    pub operation: Operation,
7005    pub attempts: u32,
7006}
7007
7008#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
7009#[serde(deny_unknown_fields)]
7010pub struct CancelOperationRequest {
7011    pub locator: Locator,
7012    pub expected_authority_revision: U64,
7013    pub cancel_action: Identity,
7014}
7015
7016#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
7017#[serde(deny_unknown_fields)]
7018pub struct CancelOperationResult {
7019    pub locator: Locator,
7020    pub cancel_generation: U64,
7021    pub mutation_outcome: MutationOutcome,
7022}
7023
7024#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
7025#[serde(deny_unknown_fields)]
7026pub struct ListAuditEventsRequest {
7027    pub start_time: U64,
7028    pub end_time: U64,
7029    pub actions: Vec<String>,
7030    pub page_size: u32,
7031    #[serde(default, skip_serializing_if = "Option::is_none")]
7032    pub cursor: Option<Cursor>,
7033}
7034
7035#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
7036#[serde(deny_unknown_fields)]
7037pub struct ListAuditEventsResult {
7038    pub stream: AuditStreamState,
7039    pub events: Vec<AuditEvent>,
7040    #[serde(default, skip_serializing_if = "Option::is_none")]
7041    pub next_cursor: Option<Cursor>,
7042    pub gaps: Vec<AuditGap>,
7043    pub object_reads: u32,
7044}
7045
7046#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
7047#[serde(deny_unknown_fields)]
7048pub struct ExportAuditEventsRequest {
7049    pub start_time: U64,
7050    pub end_time: U64,
7051    pub actions: Vec<String>,
7052    pub page_size: u32,
7053    #[serde(default, skip_serializing_if = "Option::is_none")]
7054    pub cursor: Option<Cursor>,
7055}
7056
7057#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
7058#[serde(deny_unknown_fields)]
7059pub struct ExportAuditEventsResult {
7060    pub stream: AuditStreamState,
7061    pub events: Vec<AuditEvent>,
7062    #[serde(default, skip_serializing_if = "Option::is_none")]
7063    pub next_cursor: Option<Cursor>,
7064    pub gaps: Vec<AuditGap>,
7065    pub object_reads: u32,
7066}
7067
7068#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
7069#[serde(deny_unknown_fields)]
7070pub struct ReserveServiceCredentialRequest {
7071    pub reservation_action_id: Digest,
7072    pub activation_action_id: Digest,
7073    pub role_grants: Vec<ServiceCredentialGrant>,
7074    pub credential_expires_at: U64,
7075    pub reservation_expires_at: U64,
7076}
7077
7078#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
7079#[serde(deny_unknown_fields)]
7080pub struct ReserveServiceCredentialResult {
7081    pub reservation: ServiceCredentialReservation,
7082}
7083
7084#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
7085#[serde(deny_unknown_fields)]
7086pub struct ReserveServiceCredentialRotationRequest {
7087    pub reservation_action_id: Digest,
7088    pub activation_action_id: Digest,
7089    pub current_api_key_id: Identity,
7090    pub expected_generation: U64,
7091    pub credential_expires_at: U64,
7092    pub overlap_until: U64,
7093    pub reservation_expires_at: U64,
7094}
7095
7096#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
7097#[serde(deny_unknown_fields)]
7098pub struct ReserveServiceCredentialRotationResult {
7099    pub reservation: ServiceCredentialReservation,
7100}
7101
7102#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
7103#[serde(deny_unknown_fields)]
7104pub struct ActivateServiceCredentialRequest {
7105    pub reservation: ServiceCredentialReservation,
7106    pub verifier: Digest,
7107}
7108
7109#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
7110#[serde(deny_unknown_fields)]
7111pub struct ActivateServiceCredentialResult {
7112    pub locator: Locator,
7113    pub outcome: SecurityActionOutcome,
7114    pub secret_escrowed: bool,
7115}
7116
7117#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
7118#[serde(deny_unknown_fields)]
7119pub struct ResolveServiceCredentialReservationRequest {
7120    pub reservation_action_id: Digest,
7121}
7122
7123#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
7124#[serde(deny_unknown_fields)]
7125pub struct ResolveServiceCredentialReservationResult {
7126    pub state: String,
7127    #[serde(default, skip_serializing_if = "Option::is_none")]
7128    pub reservation: Option<ServiceCredentialReservation>,
7129    #[serde(default, skip_serializing_if = "Option::is_none")]
7130    pub outcome: Option<SecurityActionOutcome>,
7131}
7132
7133#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
7134#[serde(deny_unknown_fields)]
7135pub struct PrepareRevokeServiceCredentialRequest {
7136    pub api_key_id: Identity,
7137    pub expected_generation: U64,
7138}
7139
7140#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
7141#[serde(deny_unknown_fields)]
7142pub struct PrepareRevokeServiceCredentialResult {
7143    pub locator: Locator,
7144    pub semantic_digest: Digest,
7145    pub expires_at: U64,
7146}
7147
7148#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
7149#[serde(deny_unknown_fields)]
7150pub struct RevokeServiceCredentialRequest {
7151    pub locator: Locator,
7152    pub api_key_id: Identity,
7153    pub expected_generation: U64,
7154}
7155
7156#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
7157#[serde(deny_unknown_fields)]
7158pub struct RevokeServiceCredentialResult {
7159    pub locator: Locator,
7160    pub principal_id: Identity,
7161    pub api_key_id: Identity,
7162    pub state: String,
7163}
7164
7165#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
7166#[serde(deny_unknown_fields)]
7167pub struct ResolveSecurityActionRequest {
7168    pub locator: Locator,
7169}
7170
7171#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
7172#[serde(deny_unknown_fields)]
7173pub struct ResolveSecurityActionResult {
7174    pub locator: Locator,
7175    pub state: String,
7176    #[serde(default, skip_serializing_if = "Option::is_none")]
7177    pub result: Option<SecurityActionOutcome>,
7178    pub secret_escrowed: bool,
7179}
7180
7181#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
7182#[serde(deny_unknown_fields)]
7183pub struct GetSecurityRoleRequest {
7184    pub role_name: String,
7185}
7186
7187#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
7188#[serde(deny_unknown_fields)]
7189pub struct GetSecurityRoleResult {
7190    pub role: SecurityRole,
7191}
7192
7193#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
7194#[serde(deny_unknown_fields)]
7195pub struct PrepareRoleAppendAccessChangeRequest {
7196    pub role_name: String,
7197    pub expected_role_version: U64,
7198    pub changes: Vec<RoleAppendScopeChange>,
7199}
7200
7201#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
7202#[serde(deny_unknown_fields)]
7203pub struct PrepareRoleAppendAccessChangeResult {
7204    pub preparation: RoleAppendAccessPreparation,
7205}
7206
7207#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
7208#[serde(deny_unknown_fields)]
7209pub struct SubmitRoleAppendAccessChangeRequest {
7210    pub locator: Locator,
7211    pub semantic_digest: Digest,
7212    pub role_name: String,
7213    pub expected_role_version: U64,
7214    pub changes: Vec<RoleAppendScopeChange>,
7215}
7216
7217#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
7218#[serde(deny_unknown_fields)]
7219pub struct SubmitRoleAppendAccessChangeResult {
7220    pub locator: Locator,
7221    pub state: String,
7222    pub target_policy_revision: U64,
7223    pub role: SecurityRole,
7224}
7225
7226#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
7227#[serde(deny_unknown_fields)]
7228pub struct ListServiceCredentialsRequest {
7229    pub page_size: u32,
7230    #[serde(default, skip_serializing_if = "Option::is_none")]
7231    pub cursor: Option<Cursor>,
7232}
7233
7234#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
7235#[serde(deny_unknown_fields)]
7236pub struct ListServiceCredentialsResult {
7237    pub items: Vec<ServiceCredentialSummary>,
7238    #[serde(default, skip_serializing_if = "Option::is_none")]
7239    pub next_cursor: Option<Cursor>,
7240}
7241
7242#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
7243#[serde(deny_unknown_fields)]
7244pub struct GetRuntimeStatusRequest {}
7245
7246#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
7247#[serde(deny_unknown_fields)]
7248pub struct GetRuntimeStatusResult {
7249    pub ready: bool,
7250    pub recovery_era: Identity,
7251    pub catalog_revision: U64,
7252    pub policy_revision: U64,
7253    pub redacted: RuntimeStatusDetail,
7254}
7255
7256#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
7257#[serde(deny_unknown_fields)]
7258pub struct GetResultCacheStatusRequest {}
7259
7260#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
7261#[serde(deny_unknown_fields)]
7262pub struct GetResultCacheStatusResult {
7263    pub status: ResultCacheStatus,
7264}
7265
7266#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
7267#[serde(deny_unknown_fields)]
7268pub struct GetFieldPromotionStatusRequest {
7269    pub index: Resource,
7270}
7271
7272#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
7273#[serde(deny_unknown_fields)]
7274pub struct GetFieldPromotionStatusResult {
7275    pub status: FieldPromotionStatus,
7276}
7277
7278#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
7279#[serde(deny_unknown_fields)]
7280pub struct GetOverloadStatusRequest {
7281    pub index: Resource,
7282}
7283
7284#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
7285#[serde(deny_unknown_fields)]
7286pub struct GetOverloadStatusResult {
7287    pub runtime_observed: bool,
7288    pub shards: Vec<OverloadShardStatus>,
7289}
7290
7291#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
7292#[serde(deny_unknown_fields)]
7293pub struct ConfigureExternalKeyRequest {
7294    pub index: Resource,
7295    pub expected_authority_revision: U64,
7296    pub binding: ExternalKeyBinding,
7297}
7298
7299#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
7300#[serde(deny_unknown_fields)]
7301pub struct ConfigureExternalKeyResult {
7302    pub status: LifecycleStatus,
7303    pub mutation_outcome: MutationOutcome,
7304}
7305
7306#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
7307#[serde(deny_unknown_fields)]
7308pub struct RotateExternalKeyBindingRequest {
7309    pub index: Resource,
7310    pub expected_authority_revision: U64,
7311    pub predecessor_binding_id: Identity,
7312    pub binding: ExternalKeyBinding,
7313}
7314
7315#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
7316#[serde(deny_unknown_fields)]
7317pub struct RotateExternalKeyBindingResult {
7318    pub status: LifecycleStatus,
7319    pub mutation_outcome: MutationOutcome,
7320}
7321
7322#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
7323#[serde(deny_unknown_fields)]
7324pub struct ConfigureAggregateThenDeleteRequest {
7325    pub index: Resource,
7326    pub expected_authority_revision: U64,
7327    pub policy: AggregateThenDeletePolicy,
7328}
7329
7330#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
7331#[serde(deny_unknown_fields)]
7332pub struct ConfigureAggregateThenDeleteResult {
7333    pub status: LifecycleStatus,
7334    pub mutation_outcome: MutationOutcome,
7335}
7336
7337#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
7338#[serde(deny_unknown_fields)]
7339pub struct GetLifecycleStatusRequest {
7340    pub index: Resource,
7341}
7342
7343#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
7344#[serde(deny_unknown_fields)]
7345pub struct GetLifecycleStatusResult {
7346    pub status: LifecycleStatus,
7347}
7348
7349#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
7350#[serde(deny_unknown_fields)]
7351pub struct GetQuotaRequest {}
7352
7353#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
7354#[serde(deny_unknown_fields)]
7355pub struct GetQuotaResult {
7356    pub revision: U64,
7357    pub limits: Vec<QuotaLimit>,
7358    pub usage: Vec<QuotaConsumption>,
7359}
7360
7361#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
7362#[serde(deny_unknown_fields)]
7363pub struct UpdateQuotaRequest {
7364    pub expected_revision: U64,
7365    pub limits: Vec<QuotaLimit>,
7366}
7367
7368#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
7369#[serde(deny_unknown_fields)]
7370pub struct UpdateQuotaResult {
7371    pub update: QuotaUpdate,
7372}
7373
7374#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
7375#[serde(deny_unknown_fields)]
7376pub struct GetBindingRequest {}
7377
7378#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
7379#[serde(deny_unknown_fields)]
7380pub struct GetBindingResult {
7381    pub binding: CoreBinding,
7382    pub derived: bool,
7383    pub revision: U64,
7384}
7385
7386#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
7387#[serde(deny_unknown_fields)]
7388pub struct GetAdmissionStatusRequest {}
7389
7390#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
7391#[serde(deny_unknown_fields)]
7392pub struct GetAdmissionStatusResult {
7393    pub state: String,
7394    pub revision: U64,
7395    pub converged: bool,
7396}
7397
7398#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
7399#[serde(deny_unknown_fields)]
7400pub struct SetAdmissionRequest {
7401    pub expected_revision: U64,
7402    pub state: String,
7403}
7404
7405#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
7406#[serde(deny_unknown_fields)]
7407pub struct SetAdmissionResult {
7408    pub state: String,
7409    pub revision: U64,
7410    pub converged: bool,
7411}
7412
7413#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
7414#[serde(deny_unknown_fields)]
7415pub struct GetQuiesceStatusRequest {}
7416
7417#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
7418#[serde(deny_unknown_fields)]
7419pub struct GetQuiesceStatusResult {
7420    pub ready: bool,
7421    pub blockers: Vec<String>,
7422    pub observations: Vec<ReadinessObservation>,
7423    pub recovery_era: Identity,
7424    pub observed_at: U64,
7425    pub expires_at: U64,
7426}
7427
7428#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
7429#[serde(deny_unknown_fields)]
7430pub struct GetDecommissionReadinessRequest {}
7431
7432#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
7433#[serde(deny_unknown_fields)]
7434pub struct GetDecommissionReadinessResult {
7435    pub ready: bool,
7436    pub blockers: Vec<String>,
7437    pub observations: Vec<ReadinessObservation>,
7438    pub recovery_era: Identity,
7439    pub observed_at: U64,
7440    pub expires_at: U64,
7441}
7442
7443#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
7444#[serde(deny_unknown_fields)]
7445pub struct GetUpgradeReadinessRequest {}
7446
7447#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
7448#[serde(deny_unknown_fields)]
7449pub struct GetUpgradeReadinessResult {
7450    pub ready: bool,
7451    pub blockers: Vec<String>,
7452    pub observations: Vec<ReadinessObservation>,
7453    pub recovery_era: Identity,
7454    pub observed_at: U64,
7455    pub expires_at: U64,
7456}
7457
7458#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
7459#[serde(deny_unknown_fields)]
7460pub struct GetMaintenanceStatusRequest {
7461    pub page_size: u32,
7462    #[serde(default, skip_serializing_if = "Option::is_none")]
7463    pub cursor: Option<Cursor>,
7464    #[serde(default, skip_serializing_if = "Option::is_none")]
7465    pub index: Option<Resource>,
7466}
7467
7468#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
7469#[serde(deny_unknown_fields)]
7470pub struct GetMaintenanceStatusResult {
7471    pub aggregate: MaintenanceStatusAggregate,
7472    pub items: Vec<MaintenanceTaskStatus>,
7473    #[serde(default, skip_serializing_if = "Option::is_none")]
7474    pub next_cursor: Option<Cursor>,
7475}
7476
7477#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
7478#[serde(deny_unknown_fields)]
7479pub struct WarmVectorIndexRequest {
7480    pub index: Resource,
7481    #[serde(default, skip_serializing_if = "Option::is_none")]
7482    pub expected_root_digest: Option<Digest>,
7483    pub components: Vec<VectorWarmComponent>,
7484    pub maximum_requests: u32,
7485    pub maximum_bytes: U64,
7486    pub maximum_achievements: u32,
7487    pub expires_at: U64,
7488}
7489
7490#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
7491#[serde(deny_unknown_fields)]
7492pub struct WarmVectorIndexResult {
7493    pub result: VectorWarmResult,
7494}
7495
7496#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
7497#[serde(deny_unknown_fields)]
7498pub struct EvaluateVectorRecallRequest {
7499    pub action_id: Digest,
7500    pub index: Resource,
7501    pub field: String,
7502    pub mapping_generation: U64,
7503    pub snapshot: VectorEvaluationSnapshot,
7504    pub query_set: VectorEvaluationQuerySet,
7505    #[serde(default, skip_serializing_if = "Option::is_none")]
7506    pub filter: Option<Query>,
7507    pub metric: VectorMetric,
7508    pub k: u32,
7509    pub candidate_policy: VectorCandidatePolicy,
7510    pub budget: VectorEvaluationBudget,
7511    pub maximum_bytes: U64,
7512}
7513
7514#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
7515#[serde(deny_unknown_fields)]
7516pub struct EvaluateVectorRecallResult {
7517    pub operation: Operation,
7518}
7519
7520#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
7521#[serde(deny_unknown_fields)]
7522pub struct CalibrateVectorStrategyRequest {
7523    pub action_id: Digest,
7524    pub index: Resource,
7525    pub field: String,
7526    pub mapping_generation: U64,
7527    pub snapshot: VectorEvaluationSnapshot,
7528    pub query_set: VectorEvaluationQuerySet,
7529    #[serde(default, skip_serializing_if = "Option::is_none")]
7530    pub filter: Option<Query>,
7531    pub metric: VectorMetric,
7532    pub k: u32,
7533    pub objective: VectorCalibrationObjective,
7534    pub minimum_recall_basis_points: u32,
7535    pub budget: VectorEvaluationBudget,
7536    pub maximum_bytes: U64,
7537}
7538
7539#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
7540#[serde(deny_unknown_fields)]
7541pub struct CalibrateVectorStrategyResult {
7542    pub operation: Operation,
7543}
7544
7545#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
7546#[serde(deny_unknown_fields)]
7547pub struct GetVectorDiagnosticRequest {
7548    pub locator: Locator,
7549}
7550
7551#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
7552#[serde(deny_unknown_fields)]
7553pub struct GetVectorDiagnosticResult {
7554    pub operation: Operation,
7555    pub artifacts: Vec<Artifact>,
7556    #[serde(default, skip_serializing_if = "Option::is_none")]
7557    pub result: Option<VectorDiagnosticResult>,
7558}
7559
7560#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
7561#[serde(deny_unknown_fields)]
7562pub struct CreateDiagnosticRequest {
7563    pub scope: String,
7564    pub maximum_bytes: U64,
7565}
7566
7567#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
7568#[serde(deny_unknown_fields)]
7569pub struct CreateDiagnosticResult {
7570    pub operation: Operation,
7571}
7572
7573#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
7574#[serde(deny_unknown_fields)]
7575pub struct GetDiagnosticRequest {
7576    pub locator: Locator,
7577}
7578
7579#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
7580#[serde(deny_unknown_fields)]
7581pub struct GetDiagnosticResult {
7582    pub operation: Operation,
7583    pub artifacts: Vec<Artifact>,
7584}
7585
7586#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
7587#[serde(deny_unknown_fields)]
7588pub struct PrepareCollectionExportRequest {
7589    pub action_id: Digest,
7590    pub storage: PortabilityStorageCapability,
7591}
7592
7593#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
7594#[serde(deny_unknown_fields)]
7595pub struct PrepareCollectionExportResult {
7596    pub semantic_digest: Digest,
7597    pub maximum_bytes: U64,
7598}
7599
7600#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
7601#[serde(deny_unknown_fields)]
7602pub struct StartCollectionExportRequest {
7603    pub action_id: Digest,
7604    pub semantic_digest: Digest,
7605    pub storage: PortabilityStorageCapability,
7606}
7607
7608#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
7609#[serde(deny_unknown_fields)]
7610pub struct StartCollectionExportResult {
7611    pub operation: Operation,
7612}
7613
7614#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
7615#[serde(deny_unknown_fields)]
7616pub struct ResolveCollectionExportRequest {
7617    pub action_id: Digest,
7618    pub semantic_digest: Digest,
7619    pub storage: PortabilityStorageCapability,
7620}
7621
7622#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
7623#[serde(deny_unknown_fields)]
7624pub struct ResolveCollectionExportResult {
7625    #[serde(default, skip_serializing_if = "Option::is_none")]
7626    pub operation: Option<Operation>,
7627    #[serde(default, skip_serializing_if = "Option::is_none")]
7628    pub artifact: Option<CollectionExportArtifact>,
7629    pub expired_unknown: bool,
7630}
7631
7632#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
7633#[serde(deny_unknown_fields)]
7634pub struct VerifyCollectionExportRequest {
7635    pub artifact: CollectionExportArtifact,
7636    pub storage: PortabilityStorageCapability,
7637}
7638
7639#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
7640#[serde(deny_unknown_fields)]
7641pub struct VerifyCollectionExportResult {
7642    pub verified: bool,
7643    pub source_collection_id: Identity,
7644    pub source_catalog_revision: U64,
7645    pub index_count: u32,
7646    pub document_count: U64,
7647}
7648
7649#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
7650#[serde(deny_unknown_fields)]
7651pub struct PrepareCollectionRestoreRequest {
7652    pub action_id: Digest,
7653    pub artifact: CollectionExportArtifact,
7654    pub storage: PortabilityStorageCapability,
7655}
7656
7657#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
7658#[serde(deny_unknown_fields)]
7659pub struct PrepareCollectionRestoreResult {
7660    pub semantic_digest: Digest,
7661    pub source_collection_id: Identity,
7662    pub maximum_bytes: U64,
7663}
7664
7665#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
7666#[serde(deny_unknown_fields)]
7667pub struct StartCollectionRestoreRequest {
7668    pub action_id: Digest,
7669    pub semantic_digest: Digest,
7670    pub artifact: CollectionExportArtifact,
7671    pub storage: PortabilityStorageCapability,
7672}
7673
7674#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
7675#[serde(deny_unknown_fields)]
7676pub struct StartCollectionRestoreResult {
7677    pub operation: Operation,
7678}
7679
7680#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
7681#[serde(deny_unknown_fields)]
7682pub struct ResolveCollectionRestoreRequest {
7683    pub action_id: Digest,
7684    pub semantic_digest: Digest,
7685    pub artifact: CollectionExportArtifact,
7686    pub storage: PortabilityStorageCapability,
7687}
7688
7689#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
7690#[serde(deny_unknown_fields)]
7691pub struct ResolveCollectionRestoreResult {
7692    #[serde(default, skip_serializing_if = "Option::is_none")]
7693    pub operation: Option<Operation>,
7694    pub expired_unknown: bool,
7695}
7696
7697#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
7698#[serde(deny_unknown_fields)]
7699pub struct ReadArtifactChunkRequest {
7700    pub artifact: Artifact,
7701    pub offset: U64,
7702    pub length: u32,
7703}
7704
7705#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
7706#[serde(deny_unknown_fields)]
7707pub struct ReadArtifactChunkResult {
7708    pub offset: U64,
7709    pub bytes_base64: String,
7710    pub chunk_sha256: String,
7711    pub artifact_sha256: String,
7712    pub complete: bool,
7713}
7714
7715#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
7716#[serde(deny_unknown_fields)]
7717pub struct ExportUsageRequest {
7718    pub window_start: U64,
7719    pub window_end: U64,
7720    pub page_size: u32,
7721    #[serde(default, skip_serializing_if = "Option::is_none")]
7722    pub cursor: Option<Cursor>,
7723}
7724
7725#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
7726#[serde(deny_unknown_fields)]
7727pub struct ExportUsageResult {
7728    pub units: Vec<CoreUsageUnits>,
7729    pub corrections: Vec<CoreUsageCorrection>,
7730    #[serde(default, skip_serializing_if = "Option::is_none")]
7731    pub next_cursor: Option<Cursor>,
7732    pub cumulative_through: U64,
7733}
7734
7735#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
7736#[serde(deny_unknown_fields)]
7737pub struct ExecuteStateReadRequest {
7738    pub index: Resource,
7739    pub operation: StateOperation,
7740}
7741
7742#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
7743#[serde(deny_unknown_fields)]
7744pub struct ExecuteStateReadResult {
7745    pub result: StateCommandResult,
7746}
7747
7748#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
7749#[serde(deny_unknown_fields)]
7750pub struct PrepareStateWriteRequest {
7751    pub index: Resource,
7752    pub action_id: Digest,
7753    pub operation: StateOperation,
7754}
7755
7756#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
7757#[serde(deny_unknown_fields)]
7758pub struct PrepareStateWriteResult {
7759    pub locator: Locator,
7760    pub semantic_digest: Digest,
7761    pub retention_max_entries: U64,
7762    pub retention_sequence_window: U64,
7763}
7764
7765#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
7766#[serde(deny_unknown_fields)]
7767pub struct SubmitStateWriteRequest {
7768    pub index: Resource,
7769    pub action_id: Digest,
7770    pub operation: StateOperation,
7771    pub locator: Locator,
7772    pub semantic_digest: Digest,
7773}
7774
7775#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
7776#[serde(deny_unknown_fields)]
7777pub struct SubmitStateWriteResult {
7778    #[serde(default, skip_serializing_if = "Option::is_none")]
7779    pub result: Option<StateCommandResult>,
7780    #[serde(default, skip_serializing_if = "Option::is_none")]
7781    pub resolution: Option<StateWriteResolution>,
7782    pub mutation_outcome: MutationOutcome,
7783    #[serde(default, skip_serializing_if = "Option::is_none")]
7784    pub achievement: Option<WriteAchievement>,
7785}
7786
7787#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
7788#[serde(deny_unknown_fields)]
7789pub struct ResolveStateWriteRequest {
7790    pub index: Resource,
7791    pub action_id: Digest,
7792    pub operation: StateOperation,
7793    pub locator: Locator,
7794    pub semantic_digest: Digest,
7795}
7796
7797#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
7798#[serde(deny_unknown_fields)]
7799pub struct ResolveStateWriteResult {
7800    pub resolution: StateWriteResolution,
7801}
7802
7803#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
7804#[serde(tag = "command", content = "body", rename_all = "snake_case")]
7805pub enum RequestBody {
7806    Discover(DiscoverRequest),
7807    ListIndexes(ListIndexesRequest),
7808    GetIndex(GetIndexRequest),
7809    ValidateIndexChange(ValidateIndexChangeRequest),
7810    ApplyIndexChange(ApplyIndexChangeRequest),
7811    ApplyAdministrationMutation(ApplyAdministrationMutationRequest),
7812    ListAliases(ListAliasesRequest),
7813    GetAlias(GetAliasRequest),
7814    ListDataStreams(ListDataStreamsRequest),
7815    GetDataStream(GetDataStreamRequest),
7816    ListComponentTemplates(ListComponentTemplatesRequest),
7817    GetComponentTemplate(GetComponentTemplateRequest),
7818    ListIndexTemplates(ListIndexTemplatesRequest),
7819    GetIndexTemplate(GetIndexTemplateRequest),
7820    ListIngestPipelines(ListIngestPipelinesRequest),
7821    GetIngestPipeline(GetIngestPipelineRequest),
7822    SimulateIngestPipeline(SimulateIngestPipelineRequest),
7823    ReprocessByQuery(ReprocessByQueryRequest),
7824    ListLifecyclePolicies(ListLifecyclePoliciesRequest),
7825    GetLifecyclePolicy(GetLifecyclePolicyRequest),
7826    PrepareCreateIndex(PrepareCreateIndexRequest),
7827    PrepareDeleteIndex(PrepareDeleteIndexRequest),
7828    SubmitCatalogAction(SubmitCatalogActionRequest),
7829    ResolveCatalogAction(ResolveCatalogActionRequest),
7830    PrepareReplayableSourceIndex(PrepareReplayableSourceIndexRequest),
7831    SubmitReplayableSourceIndex(SubmitReplayableSourceIndexRequest),
7832    GetReplayableSource(GetReplayableSourceRequest),
7833    ControlReplayableSource(ControlReplayableSourceRequest),
7834    CloneIndex(CloneIndexRequest),
7835    ConfigureHistory(ConfigureHistoryRequest),
7836    GetHistory(GetHistoryRequest),
7837    ResolveHistory(ResolveHistoryRequest),
7838    PlaceHistoryHold(PlaceHistoryHoldRequest),
7839    ReleaseHistoryHold(ReleaseHistoryHoldRequest),
7840    PrepareDocumentMutation(PrepareDocumentMutationRequest),
7841    SubmitDocumentMutation(SubmitDocumentMutationRequest),
7842    PrepareDocumentBulk(PrepareDocumentBulkRequest),
7843    SubmitDocumentBulk(SubmitDocumentBulkRequest),
7844    ResolveDocumentBulk(ResolveDocumentBulkRequest),
7845    PrepareAppendBulk(PrepareAppendBulkRequest),
7846    SubmitAppendBulk(SubmitAppendBulkRequest),
7847    ResolveAppendBulk(ResolveAppendBulkRequest),
7848    ObserveAppendCommitted(ObserveAppendCommittedRequest),
7849    ResolveDocumentMutation(ResolveDocumentMutationRequest),
7850    GetDocument(GetDocumentRequest),
7851    Search(SearchRequest),
7852    ValidateSearch(ValidateSearchRequest),
7853    OpenPit(OpenPitRequest),
7854    RenewPit(RenewPitRequest),
7855    ClosePit(ClosePitRequest),
7856    ListOperations(ListOperationsRequest),
7857    GetOperation(GetOperationRequest),
7858    WaitOperation(WaitOperationRequest),
7859    CancelOperation(CancelOperationRequest),
7860    ListAuditEvents(ListAuditEventsRequest),
7861    ExportAuditEvents(ExportAuditEventsRequest),
7862    ReserveServiceCredential(ReserveServiceCredentialRequest),
7863    ReserveServiceCredentialRotation(ReserveServiceCredentialRotationRequest),
7864    ActivateServiceCredential(ActivateServiceCredentialRequest),
7865    ResolveServiceCredentialReservation(ResolveServiceCredentialReservationRequest),
7866    PrepareRevokeServiceCredential(PrepareRevokeServiceCredentialRequest),
7867    RevokeServiceCredential(RevokeServiceCredentialRequest),
7868    ResolveSecurityAction(ResolveSecurityActionRequest),
7869    GetSecurityRole(GetSecurityRoleRequest),
7870    PrepareRoleAppendAccessChange(PrepareRoleAppendAccessChangeRequest),
7871    SubmitRoleAppendAccessChange(SubmitRoleAppendAccessChangeRequest),
7872    ListServiceCredentials(ListServiceCredentialsRequest),
7873    GetRuntimeStatus(GetRuntimeStatusRequest),
7874    GetResultCacheStatus(GetResultCacheStatusRequest),
7875    GetFieldPromotionStatus(GetFieldPromotionStatusRequest),
7876    GetOverloadStatus(GetOverloadStatusRequest),
7877    ConfigureExternalKey(ConfigureExternalKeyRequest),
7878    RotateExternalKeyBinding(RotateExternalKeyBindingRequest),
7879    ConfigureAggregateThenDelete(ConfigureAggregateThenDeleteRequest),
7880    GetLifecycleStatus(GetLifecycleStatusRequest),
7881    GetQuota(GetQuotaRequest),
7882    UpdateQuota(UpdateQuotaRequest),
7883    GetBinding(GetBindingRequest),
7884    GetAdmissionStatus(GetAdmissionStatusRequest),
7885    SetAdmission(SetAdmissionRequest),
7886    GetQuiesceStatus(GetQuiesceStatusRequest),
7887    GetDecommissionReadiness(GetDecommissionReadinessRequest),
7888    GetUpgradeReadiness(GetUpgradeReadinessRequest),
7889    GetMaintenanceStatus(GetMaintenanceStatusRequest),
7890    WarmVectorIndex(WarmVectorIndexRequest),
7891    EvaluateVectorRecall(EvaluateVectorRecallRequest),
7892    CalibrateVectorStrategy(CalibrateVectorStrategyRequest),
7893    GetVectorDiagnostic(GetVectorDiagnosticRequest),
7894    CreateDiagnostic(CreateDiagnosticRequest),
7895    GetDiagnostic(GetDiagnosticRequest),
7896    PrepareCollectionExport(PrepareCollectionExportRequest),
7897    StartCollectionExport(StartCollectionExportRequest),
7898    ResolveCollectionExport(ResolveCollectionExportRequest),
7899    VerifyCollectionExport(VerifyCollectionExportRequest),
7900    PrepareCollectionRestore(PrepareCollectionRestoreRequest),
7901    StartCollectionRestore(StartCollectionRestoreRequest),
7902    ResolveCollectionRestore(ResolveCollectionRestoreRequest),
7903    ReadArtifactChunk(ReadArtifactChunkRequest),
7904    ExportUsage(ExportUsageRequest),
7905    ExecuteStateRead(ExecuteStateReadRequest),
7906    PrepareStateWrite(PrepareStateWriteRequest),
7907    SubmitStateWrite(SubmitStateWriteRequest),
7908    ResolveStateWrite(ResolveStateWriteRequest),
7909}
7910
7911// INVARIANT: the response envelope already boxes this closed wire union; boxing
7912// individual variants would add a second allocation without changing the wire.
7913#[allow(clippy::large_enum_variant)]
7914#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
7915#[serde(tag = "command", content = "body", rename_all = "snake_case")]
7916pub enum ResultBody {
7917    Discover(DiscoverResult),
7918    ListIndexes(ListIndexesResult),
7919    GetIndex(GetIndexResult),
7920    ValidateIndexChange(ValidateIndexChangeResult),
7921    ApplyIndexChange(ApplyIndexChangeResult),
7922    ApplyAdministrationMutation(ApplyAdministrationMutationResult),
7923    ListAliases(ListAliasesResult),
7924    GetAlias(GetAliasResult),
7925    ListDataStreams(ListDataStreamsResult),
7926    GetDataStream(GetDataStreamResult),
7927    ListComponentTemplates(ListComponentTemplatesResult),
7928    GetComponentTemplate(GetComponentTemplateResult),
7929    ListIndexTemplates(ListIndexTemplatesResult),
7930    GetIndexTemplate(GetIndexTemplateResult),
7931    ListIngestPipelines(ListIngestPipelinesResult),
7932    GetIngestPipeline(GetIngestPipelineResult),
7933    SimulateIngestPipeline(SimulateIngestPipelineResult),
7934    ReprocessByQuery(ReprocessByQueryResult),
7935    ListLifecyclePolicies(ListLifecyclePoliciesResult),
7936    GetLifecyclePolicy(GetLifecyclePolicyResult),
7937    PrepareCreateIndex(PrepareCreateIndexResult),
7938    PrepareDeleteIndex(PrepareDeleteIndexResult),
7939    SubmitCatalogAction(SubmitCatalogActionResult),
7940    ResolveCatalogAction(ResolveCatalogActionResult),
7941    PrepareReplayableSourceIndex(PrepareReplayableSourceIndexResult),
7942    SubmitReplayableSourceIndex(SubmitReplayableSourceIndexResult),
7943    GetReplayableSource(GetReplayableSourceResult),
7944    ControlReplayableSource(ControlReplayableSourceResult),
7945    CloneIndex(CloneIndexResult),
7946    ConfigureHistory(ConfigureHistoryResult),
7947    GetHistory(GetHistoryResult),
7948    ResolveHistory(ResolveHistoryResult),
7949    PlaceHistoryHold(PlaceHistoryHoldResult),
7950    ReleaseHistoryHold(ReleaseHistoryHoldResult),
7951    PrepareDocumentMutation(PrepareDocumentMutationResult),
7952    SubmitDocumentMutation(SubmitDocumentMutationResult),
7953    PrepareDocumentBulk(PrepareDocumentBulkResult),
7954    SubmitDocumentBulk(SubmitDocumentBulkResult),
7955    ResolveDocumentBulk(ResolveDocumentBulkResult),
7956    PrepareAppendBulk(PrepareAppendBulkResult),
7957    SubmitAppendBulk(SubmitAppendBulkResult),
7958    ResolveAppendBulk(ResolveAppendBulkResult),
7959    ObserveAppendCommitted(ObserveAppendCommittedResult),
7960    ResolveDocumentMutation(ResolveDocumentMutationResult),
7961    GetDocument(GetDocumentResult),
7962    Search(SearchResult),
7963    ValidateSearch(ValidateSearchResult),
7964    OpenPit(OpenPitResult),
7965    RenewPit(RenewPitResult),
7966    ClosePit(ClosePitResult),
7967    ListOperations(ListOperationsResult),
7968    GetOperation(GetOperationResult),
7969    WaitOperation(WaitOperationResult),
7970    CancelOperation(CancelOperationResult),
7971    ListAuditEvents(ListAuditEventsResult),
7972    ExportAuditEvents(ExportAuditEventsResult),
7973    ReserveServiceCredential(ReserveServiceCredentialResult),
7974    ReserveServiceCredentialRotation(ReserveServiceCredentialRotationResult),
7975    ActivateServiceCredential(ActivateServiceCredentialResult),
7976    ResolveServiceCredentialReservation(ResolveServiceCredentialReservationResult),
7977    PrepareRevokeServiceCredential(PrepareRevokeServiceCredentialResult),
7978    RevokeServiceCredential(RevokeServiceCredentialResult),
7979    ResolveSecurityAction(ResolveSecurityActionResult),
7980    GetSecurityRole(GetSecurityRoleResult),
7981    PrepareRoleAppendAccessChange(PrepareRoleAppendAccessChangeResult),
7982    SubmitRoleAppendAccessChange(SubmitRoleAppendAccessChangeResult),
7983    ListServiceCredentials(ListServiceCredentialsResult),
7984    GetRuntimeStatus(GetRuntimeStatusResult),
7985    GetResultCacheStatus(GetResultCacheStatusResult),
7986    GetFieldPromotionStatus(GetFieldPromotionStatusResult),
7987    GetOverloadStatus(GetOverloadStatusResult),
7988    ConfigureExternalKey(ConfigureExternalKeyResult),
7989    RotateExternalKeyBinding(RotateExternalKeyBindingResult),
7990    ConfigureAggregateThenDelete(ConfigureAggregateThenDeleteResult),
7991    GetLifecycleStatus(GetLifecycleStatusResult),
7992    GetQuota(GetQuotaResult),
7993    UpdateQuota(UpdateQuotaResult),
7994    GetBinding(GetBindingResult),
7995    GetAdmissionStatus(GetAdmissionStatusResult),
7996    SetAdmission(SetAdmissionResult),
7997    GetQuiesceStatus(GetQuiesceStatusResult),
7998    GetDecommissionReadiness(GetDecommissionReadinessResult),
7999    GetUpgradeReadiness(GetUpgradeReadinessResult),
8000    GetMaintenanceStatus(GetMaintenanceStatusResult),
8001    WarmVectorIndex(WarmVectorIndexResult),
8002    EvaluateVectorRecall(EvaluateVectorRecallResult),
8003    CalibrateVectorStrategy(CalibrateVectorStrategyResult),
8004    GetVectorDiagnostic(GetVectorDiagnosticResult),
8005    CreateDiagnostic(CreateDiagnosticResult),
8006    GetDiagnostic(GetDiagnosticResult),
8007    PrepareCollectionExport(PrepareCollectionExportResult),
8008    StartCollectionExport(StartCollectionExportResult),
8009    ResolveCollectionExport(ResolveCollectionExportResult),
8010    VerifyCollectionExport(VerifyCollectionExportResult),
8011    PrepareCollectionRestore(PrepareCollectionRestoreResult),
8012    StartCollectionRestore(StartCollectionRestoreResult),
8013    ResolveCollectionRestore(ResolveCollectionRestoreResult),
8014    ReadArtifactChunk(ReadArtifactChunkResult),
8015    ExportUsage(ExportUsageResult),
8016    ExecuteStateRead(ExecuteStateReadResult),
8017    PrepareStateWrite(PrepareStateWriteResult),
8018    SubmitStateWrite(SubmitStateWriteResult),
8019    ResolveStateWrite(ResolveStateWriteResult),
8020}
8021
8022pub const fn command_for_request(value: &RequestBody) -> Command {
8023    match value {
8024        RequestBody::Discover(_) => Command::Discover,
8025        RequestBody::ListIndexes(_) => Command::ListIndexes,
8026        RequestBody::GetIndex(_) => Command::GetIndex,
8027        RequestBody::ValidateIndexChange(_) => Command::ValidateIndexChange,
8028        RequestBody::ApplyIndexChange(_) => Command::ApplyIndexChange,
8029        RequestBody::ApplyAdministrationMutation(_) => Command::ApplyAdministrationMutation,
8030        RequestBody::ListAliases(_) => Command::ListAliases,
8031        RequestBody::GetAlias(_) => Command::GetAlias,
8032        RequestBody::ListDataStreams(_) => Command::ListDataStreams,
8033        RequestBody::GetDataStream(_) => Command::GetDataStream,
8034        RequestBody::ListComponentTemplates(_) => Command::ListComponentTemplates,
8035        RequestBody::GetComponentTemplate(_) => Command::GetComponentTemplate,
8036        RequestBody::ListIndexTemplates(_) => Command::ListIndexTemplates,
8037        RequestBody::GetIndexTemplate(_) => Command::GetIndexTemplate,
8038        RequestBody::ListIngestPipelines(_) => Command::ListIngestPipelines,
8039        RequestBody::GetIngestPipeline(_) => Command::GetIngestPipeline,
8040        RequestBody::SimulateIngestPipeline(_) => Command::SimulateIngestPipeline,
8041        RequestBody::ReprocessByQuery(_) => Command::ReprocessByQuery,
8042        RequestBody::ListLifecyclePolicies(_) => Command::ListLifecyclePolicies,
8043        RequestBody::GetLifecyclePolicy(_) => Command::GetLifecyclePolicy,
8044        RequestBody::PrepareCreateIndex(_) => Command::PrepareCreateIndex,
8045        RequestBody::PrepareDeleteIndex(_) => Command::PrepareDeleteIndex,
8046        RequestBody::SubmitCatalogAction(_) => Command::SubmitCatalogAction,
8047        RequestBody::ResolveCatalogAction(_) => Command::ResolveCatalogAction,
8048        RequestBody::PrepareReplayableSourceIndex(_) => Command::PrepareReplayableSourceIndex,
8049        RequestBody::SubmitReplayableSourceIndex(_) => Command::SubmitReplayableSourceIndex,
8050        RequestBody::GetReplayableSource(_) => Command::GetReplayableSource,
8051        RequestBody::ControlReplayableSource(_) => Command::ControlReplayableSource,
8052        RequestBody::CloneIndex(_) => Command::CloneIndex,
8053        RequestBody::ConfigureHistory(_) => Command::ConfigureHistory,
8054        RequestBody::GetHistory(_) => Command::GetHistory,
8055        RequestBody::ResolveHistory(_) => Command::ResolveHistory,
8056        RequestBody::PlaceHistoryHold(_) => Command::PlaceHistoryHold,
8057        RequestBody::ReleaseHistoryHold(_) => Command::ReleaseHistoryHold,
8058        RequestBody::PrepareDocumentMutation(_) => Command::PrepareDocumentMutation,
8059        RequestBody::SubmitDocumentMutation(_) => Command::SubmitDocumentMutation,
8060        RequestBody::PrepareDocumentBulk(_) => Command::PrepareDocumentBulk,
8061        RequestBody::SubmitDocumentBulk(_) => Command::SubmitDocumentBulk,
8062        RequestBody::ResolveDocumentBulk(_) => Command::ResolveDocumentBulk,
8063        RequestBody::PrepareAppendBulk(_) => Command::PrepareAppendBulk,
8064        RequestBody::SubmitAppendBulk(_) => Command::SubmitAppendBulk,
8065        RequestBody::ResolveAppendBulk(_) => Command::ResolveAppendBulk,
8066        RequestBody::ObserveAppendCommitted(_) => Command::ObserveAppendCommitted,
8067        RequestBody::ResolveDocumentMutation(_) => Command::ResolveDocumentMutation,
8068        RequestBody::GetDocument(_) => Command::GetDocument,
8069        RequestBody::Search(_) => Command::Search,
8070        RequestBody::ValidateSearch(_) => Command::ValidateSearch,
8071        RequestBody::OpenPit(_) => Command::OpenPit,
8072        RequestBody::RenewPit(_) => Command::RenewPit,
8073        RequestBody::ClosePit(_) => Command::ClosePit,
8074        RequestBody::ListOperations(_) => Command::ListOperations,
8075        RequestBody::GetOperation(_) => Command::GetOperation,
8076        RequestBody::WaitOperation(_) => Command::WaitOperation,
8077        RequestBody::CancelOperation(_) => Command::CancelOperation,
8078        RequestBody::ListAuditEvents(_) => Command::ListAuditEvents,
8079        RequestBody::ExportAuditEvents(_) => Command::ExportAuditEvents,
8080        RequestBody::ReserveServiceCredential(_) => Command::ReserveServiceCredential,
8081        RequestBody::ReserveServiceCredentialRotation(_) => Command::ReserveServiceCredentialRotation,
8082        RequestBody::ActivateServiceCredential(_) => Command::ActivateServiceCredential,
8083        RequestBody::ResolveServiceCredentialReservation(_) => Command::ResolveServiceCredentialReservation,
8084        RequestBody::PrepareRevokeServiceCredential(_) => Command::PrepareRevokeServiceCredential,
8085        RequestBody::RevokeServiceCredential(_) => Command::RevokeServiceCredential,
8086        RequestBody::ResolveSecurityAction(_) => Command::ResolveSecurityAction,
8087        RequestBody::GetSecurityRole(_) => Command::GetSecurityRole,
8088        RequestBody::PrepareRoleAppendAccessChange(_) => Command::PrepareRoleAppendAccessChange,
8089        RequestBody::SubmitRoleAppendAccessChange(_) => Command::SubmitRoleAppendAccessChange,
8090        RequestBody::ListServiceCredentials(_) => Command::ListServiceCredentials,
8091        RequestBody::GetRuntimeStatus(_) => Command::GetRuntimeStatus,
8092        RequestBody::GetResultCacheStatus(_) => Command::GetResultCacheStatus,
8093        RequestBody::GetFieldPromotionStatus(_) => Command::GetFieldPromotionStatus,
8094        RequestBody::GetOverloadStatus(_) => Command::GetOverloadStatus,
8095        RequestBody::ConfigureExternalKey(_) => Command::ConfigureExternalKey,
8096        RequestBody::RotateExternalKeyBinding(_) => Command::RotateExternalKeyBinding,
8097        RequestBody::ConfigureAggregateThenDelete(_) => Command::ConfigureAggregateThenDelete,
8098        RequestBody::GetLifecycleStatus(_) => Command::GetLifecycleStatus,
8099        RequestBody::GetQuota(_) => Command::GetQuota,
8100        RequestBody::UpdateQuota(_) => Command::UpdateQuota,
8101        RequestBody::GetBinding(_) => Command::GetBinding,
8102        RequestBody::GetAdmissionStatus(_) => Command::GetAdmissionStatus,
8103        RequestBody::SetAdmission(_) => Command::SetAdmission,
8104        RequestBody::GetQuiesceStatus(_) => Command::GetQuiesceStatus,
8105        RequestBody::GetDecommissionReadiness(_) => Command::GetDecommissionReadiness,
8106        RequestBody::GetUpgradeReadiness(_) => Command::GetUpgradeReadiness,
8107        RequestBody::GetMaintenanceStatus(_) => Command::GetMaintenanceStatus,
8108        RequestBody::WarmVectorIndex(_) => Command::WarmVectorIndex,
8109        RequestBody::EvaluateVectorRecall(_) => Command::EvaluateVectorRecall,
8110        RequestBody::CalibrateVectorStrategy(_) => Command::CalibrateVectorStrategy,
8111        RequestBody::GetVectorDiagnostic(_) => Command::GetVectorDiagnostic,
8112        RequestBody::CreateDiagnostic(_) => Command::CreateDiagnostic,
8113        RequestBody::GetDiagnostic(_) => Command::GetDiagnostic,
8114        RequestBody::PrepareCollectionExport(_) => Command::PrepareCollectionExport,
8115        RequestBody::StartCollectionExport(_) => Command::StartCollectionExport,
8116        RequestBody::ResolveCollectionExport(_) => Command::ResolveCollectionExport,
8117        RequestBody::VerifyCollectionExport(_) => Command::VerifyCollectionExport,
8118        RequestBody::PrepareCollectionRestore(_) => Command::PrepareCollectionRestore,
8119        RequestBody::StartCollectionRestore(_) => Command::StartCollectionRestore,
8120        RequestBody::ResolveCollectionRestore(_) => Command::ResolveCollectionRestore,
8121        RequestBody::ReadArtifactChunk(_) => Command::ReadArtifactChunk,
8122        RequestBody::ExportUsage(_) => Command::ExportUsage,
8123        RequestBody::ExecuteStateRead(_) => Command::ExecuteStateRead,
8124        RequestBody::PrepareStateWrite(_) => Command::PrepareStateWrite,
8125        RequestBody::SubmitStateWrite(_) => Command::SubmitStateWrite,
8126        RequestBody::ResolveStateWrite(_) => Command::ResolveStateWrite,
8127    }
8128}
8129
8130pub const fn command_for_result(value: &ResultBody) -> Command {
8131    match value {
8132        ResultBody::Discover(_) => Command::Discover,
8133        ResultBody::ListIndexes(_) => Command::ListIndexes,
8134        ResultBody::GetIndex(_) => Command::GetIndex,
8135        ResultBody::ValidateIndexChange(_) => Command::ValidateIndexChange,
8136        ResultBody::ApplyIndexChange(_) => Command::ApplyIndexChange,
8137        ResultBody::ApplyAdministrationMutation(_) => Command::ApplyAdministrationMutation,
8138        ResultBody::ListAliases(_) => Command::ListAliases,
8139        ResultBody::GetAlias(_) => Command::GetAlias,
8140        ResultBody::ListDataStreams(_) => Command::ListDataStreams,
8141        ResultBody::GetDataStream(_) => Command::GetDataStream,
8142        ResultBody::ListComponentTemplates(_) => Command::ListComponentTemplates,
8143        ResultBody::GetComponentTemplate(_) => Command::GetComponentTemplate,
8144        ResultBody::ListIndexTemplates(_) => Command::ListIndexTemplates,
8145        ResultBody::GetIndexTemplate(_) => Command::GetIndexTemplate,
8146        ResultBody::ListIngestPipelines(_) => Command::ListIngestPipelines,
8147        ResultBody::GetIngestPipeline(_) => Command::GetIngestPipeline,
8148        ResultBody::SimulateIngestPipeline(_) => Command::SimulateIngestPipeline,
8149        ResultBody::ReprocessByQuery(_) => Command::ReprocessByQuery,
8150        ResultBody::ListLifecyclePolicies(_) => Command::ListLifecyclePolicies,
8151        ResultBody::GetLifecyclePolicy(_) => Command::GetLifecyclePolicy,
8152        ResultBody::PrepareCreateIndex(_) => Command::PrepareCreateIndex,
8153        ResultBody::PrepareDeleteIndex(_) => Command::PrepareDeleteIndex,
8154        ResultBody::SubmitCatalogAction(_) => Command::SubmitCatalogAction,
8155        ResultBody::ResolveCatalogAction(_) => Command::ResolveCatalogAction,
8156        ResultBody::PrepareReplayableSourceIndex(_) => Command::PrepareReplayableSourceIndex,
8157        ResultBody::SubmitReplayableSourceIndex(_) => Command::SubmitReplayableSourceIndex,
8158        ResultBody::GetReplayableSource(_) => Command::GetReplayableSource,
8159        ResultBody::ControlReplayableSource(_) => Command::ControlReplayableSource,
8160        ResultBody::CloneIndex(_) => Command::CloneIndex,
8161        ResultBody::ConfigureHistory(_) => Command::ConfigureHistory,
8162        ResultBody::GetHistory(_) => Command::GetHistory,
8163        ResultBody::ResolveHistory(_) => Command::ResolveHistory,
8164        ResultBody::PlaceHistoryHold(_) => Command::PlaceHistoryHold,
8165        ResultBody::ReleaseHistoryHold(_) => Command::ReleaseHistoryHold,
8166        ResultBody::PrepareDocumentMutation(_) => Command::PrepareDocumentMutation,
8167        ResultBody::SubmitDocumentMutation(_) => Command::SubmitDocumentMutation,
8168        ResultBody::PrepareDocumentBulk(_) => Command::PrepareDocumentBulk,
8169        ResultBody::SubmitDocumentBulk(_) => Command::SubmitDocumentBulk,
8170        ResultBody::ResolveDocumentBulk(_) => Command::ResolveDocumentBulk,
8171        ResultBody::PrepareAppendBulk(_) => Command::PrepareAppendBulk,
8172        ResultBody::SubmitAppendBulk(_) => Command::SubmitAppendBulk,
8173        ResultBody::ResolveAppendBulk(_) => Command::ResolveAppendBulk,
8174        ResultBody::ObserveAppendCommitted(_) => Command::ObserveAppendCommitted,
8175        ResultBody::ResolveDocumentMutation(_) => Command::ResolveDocumentMutation,
8176        ResultBody::GetDocument(_) => Command::GetDocument,
8177        ResultBody::Search(_) => Command::Search,
8178        ResultBody::ValidateSearch(_) => Command::ValidateSearch,
8179        ResultBody::OpenPit(_) => Command::OpenPit,
8180        ResultBody::RenewPit(_) => Command::RenewPit,
8181        ResultBody::ClosePit(_) => Command::ClosePit,
8182        ResultBody::ListOperations(_) => Command::ListOperations,
8183        ResultBody::GetOperation(_) => Command::GetOperation,
8184        ResultBody::WaitOperation(_) => Command::WaitOperation,
8185        ResultBody::CancelOperation(_) => Command::CancelOperation,
8186        ResultBody::ListAuditEvents(_) => Command::ListAuditEvents,
8187        ResultBody::ExportAuditEvents(_) => Command::ExportAuditEvents,
8188        ResultBody::ReserveServiceCredential(_) => Command::ReserveServiceCredential,
8189        ResultBody::ReserveServiceCredentialRotation(_) => Command::ReserveServiceCredentialRotation,
8190        ResultBody::ActivateServiceCredential(_) => Command::ActivateServiceCredential,
8191        ResultBody::ResolveServiceCredentialReservation(_) => Command::ResolveServiceCredentialReservation,
8192        ResultBody::PrepareRevokeServiceCredential(_) => Command::PrepareRevokeServiceCredential,
8193        ResultBody::RevokeServiceCredential(_) => Command::RevokeServiceCredential,
8194        ResultBody::ResolveSecurityAction(_) => Command::ResolveSecurityAction,
8195        ResultBody::GetSecurityRole(_) => Command::GetSecurityRole,
8196        ResultBody::PrepareRoleAppendAccessChange(_) => Command::PrepareRoleAppendAccessChange,
8197        ResultBody::SubmitRoleAppendAccessChange(_) => Command::SubmitRoleAppendAccessChange,
8198        ResultBody::ListServiceCredentials(_) => Command::ListServiceCredentials,
8199        ResultBody::GetRuntimeStatus(_) => Command::GetRuntimeStatus,
8200        ResultBody::GetResultCacheStatus(_) => Command::GetResultCacheStatus,
8201        ResultBody::GetFieldPromotionStatus(_) => Command::GetFieldPromotionStatus,
8202        ResultBody::GetOverloadStatus(_) => Command::GetOverloadStatus,
8203        ResultBody::ConfigureExternalKey(_) => Command::ConfigureExternalKey,
8204        ResultBody::RotateExternalKeyBinding(_) => Command::RotateExternalKeyBinding,
8205        ResultBody::ConfigureAggregateThenDelete(_) => Command::ConfigureAggregateThenDelete,
8206        ResultBody::GetLifecycleStatus(_) => Command::GetLifecycleStatus,
8207        ResultBody::GetQuota(_) => Command::GetQuota,
8208        ResultBody::UpdateQuota(_) => Command::UpdateQuota,
8209        ResultBody::GetBinding(_) => Command::GetBinding,
8210        ResultBody::GetAdmissionStatus(_) => Command::GetAdmissionStatus,
8211        ResultBody::SetAdmission(_) => Command::SetAdmission,
8212        ResultBody::GetQuiesceStatus(_) => Command::GetQuiesceStatus,
8213        ResultBody::GetDecommissionReadiness(_) => Command::GetDecommissionReadiness,
8214        ResultBody::GetUpgradeReadiness(_) => Command::GetUpgradeReadiness,
8215        ResultBody::GetMaintenanceStatus(_) => Command::GetMaintenanceStatus,
8216        ResultBody::WarmVectorIndex(_) => Command::WarmVectorIndex,
8217        ResultBody::EvaluateVectorRecall(_) => Command::EvaluateVectorRecall,
8218        ResultBody::CalibrateVectorStrategy(_) => Command::CalibrateVectorStrategy,
8219        ResultBody::GetVectorDiagnostic(_) => Command::GetVectorDiagnostic,
8220        ResultBody::CreateDiagnostic(_) => Command::CreateDiagnostic,
8221        ResultBody::GetDiagnostic(_) => Command::GetDiagnostic,
8222        ResultBody::PrepareCollectionExport(_) => Command::PrepareCollectionExport,
8223        ResultBody::StartCollectionExport(_) => Command::StartCollectionExport,
8224        ResultBody::ResolveCollectionExport(_) => Command::ResolveCollectionExport,
8225        ResultBody::VerifyCollectionExport(_) => Command::VerifyCollectionExport,
8226        ResultBody::PrepareCollectionRestore(_) => Command::PrepareCollectionRestore,
8227        ResultBody::StartCollectionRestore(_) => Command::StartCollectionRestore,
8228        ResultBody::ResolveCollectionRestore(_) => Command::ResolveCollectionRestore,
8229        ResultBody::ReadArtifactChunk(_) => Command::ReadArtifactChunk,
8230        ResultBody::ExportUsage(_) => Command::ExportUsage,
8231        ResultBody::ExecuteStateRead(_) => Command::ExecuteStateRead,
8232        ResultBody::PrepareStateWrite(_) => Command::PrepareStateWrite,
8233        ResultBody::SubmitStateWrite(_) => Command::SubmitStateWrite,
8234        ResultBody::ResolveStateWrite(_) => Command::ResolveStateWrite,
8235    }
8236}
8237
8238#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
8239#[serde(deny_unknown_fields)]
8240pub struct RequestEnvelope {
8241    pub meta: RequestMeta,
8242    pub request: RequestBody,
8243}
8244#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
8245#[serde(tag = "outcome", rename_all = "snake_case")]
8246pub enum ResponseEnvelope {
8247    Success {
8248        meta: ResponseMeta,
8249        result: Box<ResultBody>,
8250    },
8251    Error {
8252        meta: ResponseMeta,
8253        error: ErrorBody,
8254    },
8255}
8256
8257#[derive(Clone, Copy, Debug, Eq, PartialEq)]
8258pub struct CommandContract {
8259    pub command: Command,
8260    pub action: Action,
8261    pub cancellable: bool,
8262    pub mutation: &'static str,
8263}
8264pub const LODESTONE_API_COMMAND_CONTRACTS: &[CommandContract] = &[
8265    CommandContract {
8266        command: Command::Discover,
8267        action: Action::IdentityDiscovery,
8268        cancellable: true,
8269        mutation: "read_only",
8270    },
8271    CommandContract {
8272        command: Command::ListIndexes,
8273        action: Action::CatalogRead,
8274        cancellable: true,
8275        mutation: "read_only",
8276    },
8277    CommandContract {
8278        command: Command::GetIndex,
8279        action: Action::CatalogRead,
8280        cancellable: true,
8281        mutation: "read_only",
8282    },
8283    CommandContract {
8284        command: Command::ValidateIndexChange,
8285        action: Action::IndexAdmin,
8286        cancellable: true,
8287        mutation: "read_only",
8288    },
8289    CommandContract {
8290        command: Command::ApplyIndexChange,
8291        action: Action::IndexAdmin,
8292        cancellable: true,
8293        mutation: "catalog_submit",
8294    },
8295    CommandContract {
8296        command: Command::ApplyAdministrationMutation,
8297        action: Action::LifecycleAdmin,
8298        cancellable: true,
8299        mutation: "administration_submit",
8300    },
8301    CommandContract {
8302        command: Command::ListAliases,
8303        action: Action::CatalogRead,
8304        cancellable: true,
8305        mutation: "read_only",
8306    },
8307    CommandContract {
8308        command: Command::GetAlias,
8309        action: Action::CatalogRead,
8310        cancellable: true,
8311        mutation: "read_only",
8312    },
8313    CommandContract {
8314        command: Command::ListDataStreams,
8315        action: Action::CatalogRead,
8316        cancellable: true,
8317        mutation: "read_only",
8318    },
8319    CommandContract {
8320        command: Command::GetDataStream,
8321        action: Action::CatalogRead,
8322        cancellable: true,
8323        mutation: "read_only",
8324    },
8325    CommandContract {
8326        command: Command::ListComponentTemplates,
8327        action: Action::CatalogRead,
8328        cancellable: true,
8329        mutation: "read_only",
8330    },
8331    CommandContract {
8332        command: Command::GetComponentTemplate,
8333        action: Action::CatalogRead,
8334        cancellable: true,
8335        mutation: "read_only",
8336    },
8337    CommandContract {
8338        command: Command::ListIndexTemplates,
8339        action: Action::CatalogRead,
8340        cancellable: true,
8341        mutation: "read_only",
8342    },
8343    CommandContract {
8344        command: Command::GetIndexTemplate,
8345        action: Action::CatalogRead,
8346        cancellable: true,
8347        mutation: "read_only",
8348    },
8349    CommandContract {
8350        command: Command::ListIngestPipelines,
8351        action: Action::LifecycleAdmin,
8352        cancellable: true,
8353        mutation: "read_only",
8354    },
8355    CommandContract {
8356        command: Command::GetIngestPipeline,
8357        action: Action::LifecycleAdmin,
8358        cancellable: true,
8359        mutation: "read_only",
8360    },
8361    CommandContract {
8362        command: Command::SimulateIngestPipeline,
8363        action: Action::LifecycleAdmin,
8364        cancellable: true,
8365        mutation: "read_only",
8366    },
8367    CommandContract {
8368        command: Command::ReprocessByQuery,
8369        action: Action::DataWrite,
8370        cancellable: true,
8371        mutation: "authority_submit",
8372    },
8373    CommandContract {
8374        command: Command::ListLifecyclePolicies,
8375        action: Action::CatalogRead,
8376        cancellable: true,
8377        mutation: "read_only",
8378    },
8379    CommandContract {
8380        command: Command::GetLifecyclePolicy,
8381        action: Action::CatalogRead,
8382        cancellable: true,
8383        mutation: "read_only",
8384    },
8385    CommandContract {
8386        command: Command::PrepareCreateIndex,
8387        action: Action::IndexAdmin,
8388        cancellable: true,
8389        mutation: "catalog_prepare",
8390    },
8391    CommandContract {
8392        command: Command::PrepareDeleteIndex,
8393        action: Action::IndexAdmin,
8394        cancellable: true,
8395        mutation: "catalog_prepare",
8396    },
8397    CommandContract {
8398        command: Command::SubmitCatalogAction,
8399        action: Action::IndexAdmin,
8400        cancellable: true,
8401        mutation: "catalog_submit",
8402    },
8403    CommandContract {
8404        command: Command::ResolveCatalogAction,
8405        action: Action::IndexAdmin,
8406        cancellable: true,
8407        mutation: "read_only",
8408    },
8409    CommandContract {
8410        command: Command::PrepareReplayableSourceIndex,
8411        action: Action::IndexAdmin,
8412        cancellable: true,
8413        mutation: "catalog_prepare",
8414    },
8415    CommandContract {
8416        command: Command::SubmitReplayableSourceIndex,
8417        action: Action::IndexAdmin,
8418        cancellable: true,
8419        mutation: "catalog_submit",
8420    },
8421    CommandContract {
8422        command: Command::GetReplayableSource,
8423        action: Action::CatalogRead,
8424        cancellable: true,
8425        mutation: "read_only",
8426    },
8427    CommandContract {
8428        command: Command::ControlReplayableSource,
8429        action: Action::IndexAdmin,
8430        cancellable: true,
8431        mutation: "catalog_submit",
8432    },
8433    CommandContract {
8434        command: Command::CloneIndex,
8435        action: Action::IndexAdmin,
8436        cancellable: true,
8437        mutation: "catalog_submit",
8438    },
8439    CommandContract {
8440        command: Command::ConfigureHistory,
8441        action: Action::IndexAdmin,
8442        cancellable: true,
8443        mutation: "catalog_submit",
8444    },
8445    CommandContract {
8446        command: Command::GetHistory,
8447        action: Action::CatalogRead,
8448        cancellable: true,
8449        mutation: "read_only",
8450    },
8451    CommandContract {
8452        command: Command::ResolveHistory,
8453        action: Action::DataRead,
8454        cancellable: true,
8455        mutation: "read_only",
8456    },
8457    CommandContract {
8458        command: Command::PlaceHistoryHold,
8459        action: Action::IndexAdmin,
8460        cancellable: true,
8461        mutation: "catalog_submit",
8462    },
8463    CommandContract {
8464        command: Command::ReleaseHistoryHold,
8465        action: Action::IndexAdmin,
8466        cancellable: true,
8467        mutation: "catalog_submit",
8468    },
8469    CommandContract {
8470        command: Command::PrepareDocumentMutation,
8471        action: Action::DataWrite,
8472        cancellable: true,
8473        mutation: "read_only_prepare",
8474    },
8475    CommandContract {
8476        command: Command::SubmitDocumentMutation,
8477        action: Action::DataWrite,
8478        cancellable: true,
8479        mutation: "wal_submit",
8480    },
8481    CommandContract {
8482        command: Command::PrepareDocumentBulk,
8483        action: Action::DataWrite,
8484        cancellable: true,
8485        mutation: "read_only_prepare",
8486    },
8487    CommandContract {
8488        command: Command::SubmitDocumentBulk,
8489        action: Action::DataWrite,
8490        cancellable: true,
8491        mutation: "wal_submit",
8492    },
8493    CommandContract {
8494        command: Command::ResolveDocumentBulk,
8495        action: Action::DataRead,
8496        cancellable: true,
8497        mutation: "read_only",
8498    },
8499    CommandContract {
8500        command: Command::PrepareAppendBulk,
8501        action: Action::Append,
8502        cancellable: true,
8503        mutation: "read_only_prepare",
8504    },
8505    CommandContract {
8506        command: Command::SubmitAppendBulk,
8507        action: Action::Append,
8508        cancellable: true,
8509        mutation: "wal_submit",
8510    },
8511    CommandContract {
8512        command: Command::ResolveAppendBulk,
8513        action: Action::ResolveAppend,
8514        cancellable: true,
8515        mutation: "read_only",
8516    },
8517    CommandContract {
8518        command: Command::ObserveAppendCommitted,
8519        action: Action::ResolveAppend,
8520        cancellable: true,
8521        mutation: "read_only",
8522    },
8523    CommandContract {
8524        command: Command::ResolveDocumentMutation,
8525        action: Action::DataRead,
8526        cancellable: true,
8527        mutation: "read_only",
8528    },
8529    CommandContract {
8530        command: Command::GetDocument,
8531        action: Action::DataRead,
8532        cancellable: true,
8533        mutation: "read_only",
8534    },
8535    CommandContract {
8536        command: Command::Search,
8537        action: Action::DataRead,
8538        cancellable: true,
8539        mutation: "read_only",
8540    },
8541    CommandContract {
8542        command: Command::ValidateSearch,
8543        action: Action::DataRead,
8544        cancellable: true,
8545        mutation: "read_only",
8546    },
8547    CommandContract {
8548        command: Command::OpenPit,
8549        action: Action::DataRead,
8550        cancellable: true,
8551        mutation: "authority_submit",
8552    },
8553    CommandContract {
8554        command: Command::RenewPit,
8555        action: Action::DataRead,
8556        cancellable: true,
8557        mutation: "authority_submit",
8558    },
8559    CommandContract {
8560        command: Command::ClosePit,
8561        action: Action::DataRead,
8562        cancellable: true,
8563        mutation: "authority_submit",
8564    },
8565    CommandContract {
8566        command: Command::ListOperations,
8567        action: Action::OperationRead,
8568        cancellable: true,
8569        mutation: "read_only",
8570    },
8571    CommandContract {
8572        command: Command::GetOperation,
8573        action: Action::OperationRead,
8574        cancellable: true,
8575        mutation: "read_only",
8576    },
8577    CommandContract {
8578        command: Command::WaitOperation,
8579        action: Action::OperationRead,
8580        cancellable: true,
8581        mutation: "read_only",
8582    },
8583    CommandContract {
8584        command: Command::CancelOperation,
8585        action: Action::OperationCancel,
8586        cancellable: true,
8587        mutation: "authority_submit",
8588    },
8589    CommandContract {
8590        command: Command::ListAuditEvents,
8591        action: Action::AuditRead,
8592        cancellable: true,
8593        mutation: "read_only",
8594    },
8595    CommandContract {
8596        command: Command::ExportAuditEvents,
8597        action: Action::AuditRead,
8598        cancellable: true,
8599        mutation: "read_only",
8600    },
8601    CommandContract {
8602        command: Command::ReserveServiceCredential,
8603        action: Action::SecurityAdmin,
8604        cancellable: true,
8605        mutation: "security_reserve",
8606    },
8607    CommandContract {
8608        command: Command::ReserveServiceCredentialRotation,
8609        action: Action::SecurityAdmin,
8610        cancellable: true,
8611        mutation: "security_reserve",
8612    },
8613    CommandContract {
8614        command: Command::ActivateServiceCredential,
8615        action: Action::SecurityAdmin,
8616        cancellable: true,
8617        mutation: "security_submit",
8618    },
8619    CommandContract {
8620        command: Command::ResolveServiceCredentialReservation,
8621        action: Action::SecurityRead,
8622        cancellable: true,
8623        mutation: "read_only",
8624    },
8625    CommandContract {
8626        command: Command::PrepareRevokeServiceCredential,
8627        action: Action::SecurityAdmin,
8628        cancellable: true,
8629        mutation: "read_only_prepare",
8630    },
8631    CommandContract {
8632        command: Command::RevokeServiceCredential,
8633        action: Action::SecurityAdmin,
8634        cancellable: true,
8635        mutation: "security_submit",
8636    },
8637    CommandContract {
8638        command: Command::ResolveSecurityAction,
8639        action: Action::SecurityRead,
8640        cancellable: true,
8641        mutation: "read_only",
8642    },
8643    CommandContract {
8644        command: Command::GetSecurityRole,
8645        action: Action::SecurityRead,
8646        cancellable: true,
8647        mutation: "read_only",
8648    },
8649    CommandContract {
8650        command: Command::PrepareRoleAppendAccessChange,
8651        action: Action::SecurityAdmin,
8652        cancellable: true,
8653        mutation: "read_only_prepare",
8654    },
8655    CommandContract {
8656        command: Command::SubmitRoleAppendAccessChange,
8657        action: Action::SecurityAdmin,
8658        cancellable: true,
8659        mutation: "security_submit",
8660    },
8661    CommandContract {
8662        command: Command::ListServiceCredentials,
8663        action: Action::SecurityRead,
8664        cancellable: true,
8665        mutation: "read_only",
8666    },
8667    CommandContract {
8668        command: Command::GetRuntimeStatus,
8669        action: Action::CatalogRead,
8670        cancellable: true,
8671        mutation: "read_only",
8672    },
8673    CommandContract {
8674        command: Command::GetResultCacheStatus,
8675        action: Action::CatalogRead,
8676        cancellable: true,
8677        mutation: "read_only",
8678    },
8679    CommandContract {
8680        command: Command::GetFieldPromotionStatus,
8681        action: Action::CatalogRead,
8682        cancellable: true,
8683        mutation: "read_only",
8684    },
8685    CommandContract {
8686        command: Command::GetOverloadStatus,
8687        action: Action::CatalogRead,
8688        cancellable: true,
8689        mutation: "read_only",
8690    },
8691    CommandContract {
8692        command: Command::ConfigureExternalKey,
8693        action: Action::LifecycleAdmin,
8694        cancellable: true,
8695        mutation: "authority_submit",
8696    },
8697    CommandContract {
8698        command: Command::RotateExternalKeyBinding,
8699        action: Action::LifecycleAdmin,
8700        cancellable: true,
8701        mutation: "authority_submit",
8702    },
8703    CommandContract {
8704        command: Command::ConfigureAggregateThenDelete,
8705        action: Action::LifecycleAdmin,
8706        cancellable: true,
8707        mutation: "authority_submit",
8708    },
8709    CommandContract {
8710        command: Command::GetLifecycleStatus,
8711        action: Action::CatalogRead,
8712        cancellable: true,
8713        mutation: "read_only",
8714    },
8715    CommandContract {
8716        command: Command::GetQuota,
8717        action: Action::QuotaRead,
8718        cancellable: true,
8719        mutation: "read_only",
8720    },
8721    CommandContract {
8722        command: Command::UpdateQuota,
8723        action: Action::QuotaAdmin,
8724        cancellable: true,
8725        mutation: "quota_submit",
8726    },
8727    CommandContract {
8728        command: Command::GetBinding,
8729        action: Action::BindingRead,
8730        cancellable: true,
8731        mutation: "read_only",
8732    },
8733    CommandContract {
8734        command: Command::GetAdmissionStatus,
8735        action: Action::AdmissionRead,
8736        cancellable: true,
8737        mutation: "read_only",
8738    },
8739    CommandContract {
8740        command: Command::SetAdmission,
8741        action: Action::AdmissionAdmin,
8742        cancellable: true,
8743        mutation: "admission_submit",
8744    },
8745    CommandContract {
8746        command: Command::GetQuiesceStatus,
8747        action: Action::AdmissionRead,
8748        cancellable: true,
8749        mutation: "read_only",
8750    },
8751    CommandContract {
8752        command: Command::GetDecommissionReadiness,
8753        action: Action::AdmissionRead,
8754        cancellable: true,
8755        mutation: "read_only",
8756    },
8757    CommandContract {
8758        command: Command::GetUpgradeReadiness,
8759        action: Action::TaskRead,
8760        cancellable: true,
8761        mutation: "read_only",
8762    },
8763    CommandContract {
8764        command: Command::GetMaintenanceStatus,
8765        action: Action::TaskRead,
8766        cancellable: true,
8767        mutation: "read_only",
8768    },
8769    CommandContract {
8770        command: Command::WarmVectorIndex,
8771        action: Action::DataRead,
8772        cancellable: true,
8773        mutation: "read_only",
8774    },
8775    CommandContract {
8776        command: Command::EvaluateVectorRecall,
8777        action: Action::DiagnosticsCreate,
8778        cancellable: true,
8779        mutation: "diagnostic_submit",
8780    },
8781    CommandContract {
8782        command: Command::CalibrateVectorStrategy,
8783        action: Action::DiagnosticsCreate,
8784        cancellable: true,
8785        mutation: "diagnostic_submit",
8786    },
8787    CommandContract {
8788        command: Command::GetVectorDiagnostic,
8789        action: Action::DiagnosticsRead,
8790        cancellable: true,
8791        mutation: "read_only",
8792    },
8793    CommandContract {
8794        command: Command::CreateDiagnostic,
8795        action: Action::DiagnosticsCreate,
8796        cancellable: true,
8797        mutation: "diagnostic_submit",
8798    },
8799    CommandContract {
8800        command: Command::GetDiagnostic,
8801        action: Action::DiagnosticsRead,
8802        cancellable: true,
8803        mutation: "read_only",
8804    },
8805    CommandContract {
8806        command: Command::PrepareCollectionExport,
8807        action: Action::CollectionExport,
8808        cancellable: true,
8809        mutation: "read_only_prepare",
8810    },
8811    CommandContract {
8812        command: Command::StartCollectionExport,
8813        action: Action::CollectionExport,
8814        cancellable: true,
8815        mutation: "portability_submit",
8816    },
8817    CommandContract {
8818        command: Command::ResolveCollectionExport,
8819        action: Action::CollectionExport,
8820        cancellable: true,
8821        mutation: "read_only",
8822    },
8823    CommandContract {
8824        command: Command::VerifyCollectionExport,
8825        action: Action::CollectionExport,
8826        cancellable: true,
8827        mutation: "read_only",
8828    },
8829    CommandContract {
8830        command: Command::PrepareCollectionRestore,
8831        action: Action::CollectionRestore,
8832        cancellable: true,
8833        mutation: "read_only_prepare",
8834    },
8835    CommandContract {
8836        command: Command::StartCollectionRestore,
8837        action: Action::CollectionRestore,
8838        cancellable: true,
8839        mutation: "portability_submit",
8840    },
8841    CommandContract {
8842        command: Command::ResolveCollectionRestore,
8843        action: Action::CollectionRestore,
8844        cancellable: true,
8845        mutation: "read_only",
8846    },
8847    CommandContract {
8848        command: Command::ReadArtifactChunk,
8849        action: Action::OperationRead,
8850        cancellable: true,
8851        mutation: "read_only",
8852    },
8853    CommandContract {
8854        command: Command::ExportUsage,
8855        action: Action::UsageRead,
8856        cancellable: true,
8857        mutation: "read_only",
8858    },
8859    CommandContract {
8860        command: Command::ExecuteStateRead,
8861        action: Action::DataRead,
8862        cancellable: true,
8863        mutation: "read_only",
8864    },
8865    CommandContract {
8866        command: Command::PrepareStateWrite,
8867        action: Action::DataWrite,
8868        cancellable: true,
8869        mutation: "read_only_prepare",
8870    },
8871    CommandContract {
8872        command: Command::SubmitStateWrite,
8873        action: Action::DataWrite,
8874        cancellable: true,
8875        mutation: "state_submit",
8876    },
8877    CommandContract {
8878        command: Command::ResolveStateWrite,
8879        action: Action::DataRead,
8880        cancellable: true,
8881        mutation: "read_only",
8882    },
8883];
8884#[derive(Clone, Copy, Debug, Eq, PartialEq)]
8885pub struct CommandSemanticContract {
8886    pub command: Command,
8887    pub admissible_errors: &'static [ErrorCode],
8888    pub limit_ids: &'static [&'static str],
8889    pub effect_class: &'static str,
8890    pub risk_flags: &'static [&'static str],
8891    pub capability_family: &'static str,
8892    pub retry_safety: &'static str,
8893    pub identity_requirement: &'static str,
8894    pub resolver: Option<Command>,
8895    pub cancellation: &'static str,
8896    pub side_effects: &'static [&'static str],
8897    pub recovery: &'static str,
8898    pub collection_index_ref: &'static str,
8899}
8900pub const LODESTONE_API_COMMAND_SEMANTICS: &[CommandSemanticContract] = &[
8901    CommandSemanticContract {
8902        command: Command::Discover,
8903        admissible_errors: &[
8904            ErrorCode::Aborted,
8905            ErrorCode::DeadlineExceeded,
8906            ErrorCode::InvalidRequest,
8907            ErrorCode::UnsupportedVersion,
8908            ErrorCode::Unauthenticated,
8909            ErrorCode::PermissionDenied,
8910            ErrorCode::NotFound,
8911            ErrorCode::LimitExceeded,
8912            ErrorCode::CapabilityUnavailable,
8913            ErrorCode::TemporarilyUnavailable,
8914            ErrorCode::Internal,
8915        ],
8916        limit_ids: &["request_bytes", "response_bytes"],
8917        effect_class: "read_only",
8918        risk_flags: &[],
8919        capability_family: "discovery",
8920        retry_safety: "safe",
8921        identity_requirement: "none",
8922        resolver: None,
8923        cancellation: "per_call",
8924        side_effects: &[],
8925        recovery: "retry",
8926        collection_index_ref: "none",
8927    },
8928    CommandSemanticContract {
8929        command: Command::ListIndexes,
8930        admissible_errors: &[
8931            ErrorCode::Aborted,
8932            ErrorCode::DeadlineExceeded,
8933            ErrorCode::InvalidRequest,
8934            ErrorCode::UnsupportedVersion,
8935            ErrorCode::Unauthenticated,
8936            ErrorCode::PermissionDenied,
8937            ErrorCode::NotFound,
8938            ErrorCode::StaleCursor,
8939            ErrorCode::RestartBudgetExhausted,
8940            ErrorCode::LimitExceeded,
8941            ErrorCode::CapabilityUnavailable,
8942            ErrorCode::TemporarilyUnavailable,
8943            ErrorCode::Internal,
8944        ],
8945        limit_ids: &[
8946            "request_bytes",
8947            "response_bytes",
8948            "page_size",
8949            "catalog_page_size",
8950            "catalog_restart_budget",
8951        ],
8952        effect_class: "read_only",
8953        risk_flags: &[],
8954        capability_family: "catalog",
8955        retry_safety: "safe",
8956        identity_requirement: "none",
8957        resolver: None,
8958        cancellation: "per_call",
8959        side_effects: &[],
8960        recovery: "retry",
8961        collection_index_ref: "none",
8962    },
8963    CommandSemanticContract {
8964        command: Command::GetIndex,
8965        admissible_errors: &[
8966            ErrorCode::Aborted,
8967            ErrorCode::DeadlineExceeded,
8968            ErrorCode::InvalidRequest,
8969            ErrorCode::UnsupportedVersion,
8970            ErrorCode::Unauthenticated,
8971            ErrorCode::PermissionDenied,
8972            ErrorCode::NotFound,
8973            ErrorCode::LimitExceeded,
8974            ErrorCode::CapabilityUnavailable,
8975            ErrorCode::TemporarilyUnavailable,
8976            ErrorCode::Internal,
8977        ],
8978        limit_ids: &["request_bytes", "response_bytes"],
8979        effect_class: "read_only",
8980        risk_flags: &[],
8981        capability_family: "catalog",
8982        retry_safety: "safe",
8983        identity_requirement: "none",
8984        resolver: None,
8985        cancellation: "per_call",
8986        side_effects: &[],
8987        recovery: "retry",
8988        collection_index_ref: "none",
8989    },
8990    CommandSemanticContract {
8991        command: Command::ValidateIndexChange,
8992        admissible_errors: &[
8993            ErrorCode::Aborted,
8994            ErrorCode::DeadlineExceeded,
8995            ErrorCode::InvalidRequest,
8996            ErrorCode::UnsupportedVersion,
8997            ErrorCode::Unauthenticated,
8998            ErrorCode::PermissionDenied,
8999            ErrorCode::NotFound,
9000            ErrorCode::LimitExceeded,
9001            ErrorCode::CapabilityUnavailable,
9002            ErrorCode::TemporarilyUnavailable,
9003            ErrorCode::Internal,
9004        ],
9005        limit_ids: &["request_bytes", "response_bytes"],
9006        effect_class: "read_only",
9007        risk_flags: &[],
9008        capability_family: "catalog",
9009        retry_safety: "safe",
9010        identity_requirement: "none",
9011        resolver: None,
9012        cancellation: "per_call",
9013        side_effects: &[],
9014        recovery: "retry",
9015        collection_index_ref: "request_name",
9016    },
9017    CommandSemanticContract {
9018        command: Command::ApplyIndexChange,
9019        admissible_errors: &[
9020            ErrorCode::Aborted,
9021            ErrorCode::DeadlineExceeded,
9022            ErrorCode::InvalidRequest,
9023            ErrorCode::UnsupportedVersion,
9024            ErrorCode::Unauthenticated,
9025            ErrorCode::PermissionDenied,
9026            ErrorCode::NotFound,
9027            ErrorCode::Conflict,
9028            ErrorCode::LimitExceeded,
9029            ErrorCode::CapabilityUnavailable,
9030            ErrorCode::NotSubmitted,
9031            ErrorCode::SubmittedIndeterminate,
9032            ErrorCode::ExpiredUnknown,
9033            ErrorCode::TemporarilyUnavailable,
9034            ErrorCode::Internal,
9035        ],
9036        limit_ids: &["request_bytes", "response_bytes"],
9037        effect_class: "durable_submit",
9038        risk_flags: &[],
9039        capability_family: "catalog",
9040        retry_safety: "pre_submit_only",
9041        identity_requirement: "caller_action_id",
9042        resolver: None,
9043        cancellation: "per_call_until_submission_then_resolve",
9044        side_effects: &["commits_authoritative_state"],
9045        recovery: "retry_if_not_submitted",
9046        collection_index_ref: "request_index",
9047    },
9048    CommandSemanticContract {
9049        command: Command::ApplyAdministrationMutation,
9050        admissible_errors: &[
9051            ErrorCode::Aborted,
9052            ErrorCode::DeadlineExceeded,
9053            ErrorCode::InvalidRequest,
9054            ErrorCode::UnsupportedVersion,
9055            ErrorCode::Unauthenticated,
9056            ErrorCode::PermissionDenied,
9057            ErrorCode::NotFound,
9058            ErrorCode::Conflict,
9059            ErrorCode::LimitExceeded,
9060            ErrorCode::CapabilityUnavailable,
9061            ErrorCode::NotSubmitted,
9062            ErrorCode::SubmittedIndeterminate,
9063            ErrorCode::ExpiredUnknown,
9064            ErrorCode::TemporarilyUnavailable,
9065            ErrorCode::Internal,
9066        ],
9067        limit_ids: &["request_bytes", "response_bytes"],
9068        effect_class: "control_write",
9069        risk_flags: &[],
9070        capability_family: "lifecycle",
9071        retry_safety: "pre_submit_only",
9072        identity_requirement: "caller_action_id",
9073        resolver: None,
9074        cancellation: "per_call_until_submission_then_resolve",
9075        side_effects: &["commits_authoritative_state"],
9076        recovery: "retry_if_not_submitted",
9077        collection_index_ref: "none",
9078    },
9079    CommandSemanticContract {
9080        command: Command::ListAliases,
9081        admissible_errors: &[
9082            ErrorCode::Aborted,
9083            ErrorCode::DeadlineExceeded,
9084            ErrorCode::InvalidRequest,
9085            ErrorCode::UnsupportedVersion,
9086            ErrorCode::Unauthenticated,
9087            ErrorCode::PermissionDenied,
9088            ErrorCode::NotFound,
9089            ErrorCode::StaleCursor,
9090            ErrorCode::RestartBudgetExhausted,
9091            ErrorCode::LimitExceeded,
9092            ErrorCode::CapabilityUnavailable,
9093            ErrorCode::TemporarilyUnavailable,
9094            ErrorCode::Internal,
9095        ],
9096        limit_ids: &[
9097            "request_bytes",
9098            "response_bytes",
9099            "page_size",
9100            "catalog_page_size",
9101            "catalog_restart_budget",
9102        ],
9103        effect_class: "read_only",
9104        risk_flags: &[],
9105        capability_family: "catalog",
9106        retry_safety: "safe",
9107        identity_requirement: "none",
9108        resolver: None,
9109        cancellation: "per_call",
9110        side_effects: &[],
9111        recovery: "retry",
9112        collection_index_ref: "none",
9113    },
9114    CommandSemanticContract {
9115        command: Command::GetAlias,
9116        admissible_errors: &[
9117            ErrorCode::Aborted,
9118            ErrorCode::DeadlineExceeded,
9119            ErrorCode::InvalidRequest,
9120            ErrorCode::UnsupportedVersion,
9121            ErrorCode::Unauthenticated,
9122            ErrorCode::PermissionDenied,
9123            ErrorCode::NotFound,
9124            ErrorCode::LimitExceeded,
9125            ErrorCode::CapabilityUnavailable,
9126            ErrorCode::TemporarilyUnavailable,
9127            ErrorCode::Internal,
9128        ],
9129        limit_ids: &["request_bytes", "response_bytes"],
9130        effect_class: "read_only",
9131        risk_flags: &[],
9132        capability_family: "catalog",
9133        retry_safety: "safe",
9134        identity_requirement: "none",
9135        resolver: None,
9136        cancellation: "per_call",
9137        side_effects: &[],
9138        recovery: "retry",
9139        collection_index_ref: "none",
9140    },
9141    CommandSemanticContract {
9142        command: Command::ListDataStreams,
9143        admissible_errors: &[
9144            ErrorCode::Aborted,
9145            ErrorCode::DeadlineExceeded,
9146            ErrorCode::InvalidRequest,
9147            ErrorCode::UnsupportedVersion,
9148            ErrorCode::Unauthenticated,
9149            ErrorCode::PermissionDenied,
9150            ErrorCode::NotFound,
9151            ErrorCode::StaleCursor,
9152            ErrorCode::RestartBudgetExhausted,
9153            ErrorCode::LimitExceeded,
9154            ErrorCode::CapabilityUnavailable,
9155            ErrorCode::TemporarilyUnavailable,
9156            ErrorCode::Internal,
9157        ],
9158        limit_ids: &[
9159            "request_bytes",
9160            "response_bytes",
9161            "page_size",
9162            "catalog_page_size",
9163            "catalog_restart_budget",
9164        ],
9165        effect_class: "read_only",
9166        risk_flags: &[],
9167        capability_family: "catalog",
9168        retry_safety: "safe",
9169        identity_requirement: "none",
9170        resolver: None,
9171        cancellation: "per_call",
9172        side_effects: &[],
9173        recovery: "retry",
9174        collection_index_ref: "none",
9175    },
9176    CommandSemanticContract {
9177        command: Command::GetDataStream,
9178        admissible_errors: &[
9179            ErrorCode::Aborted,
9180            ErrorCode::DeadlineExceeded,
9181            ErrorCode::InvalidRequest,
9182            ErrorCode::UnsupportedVersion,
9183            ErrorCode::Unauthenticated,
9184            ErrorCode::PermissionDenied,
9185            ErrorCode::NotFound,
9186            ErrorCode::LimitExceeded,
9187            ErrorCode::CapabilityUnavailable,
9188            ErrorCode::TemporarilyUnavailable,
9189            ErrorCode::Internal,
9190        ],
9191        limit_ids: &["request_bytes", "response_bytes"],
9192        effect_class: "read_only",
9193        risk_flags: &[],
9194        capability_family: "catalog",
9195        retry_safety: "safe",
9196        identity_requirement: "none",
9197        resolver: None,
9198        cancellation: "per_call",
9199        side_effects: &[],
9200        recovery: "retry",
9201        collection_index_ref: "none",
9202    },
9203    CommandSemanticContract {
9204        command: Command::ListComponentTemplates,
9205        admissible_errors: &[
9206            ErrorCode::Aborted,
9207            ErrorCode::DeadlineExceeded,
9208            ErrorCode::InvalidRequest,
9209            ErrorCode::UnsupportedVersion,
9210            ErrorCode::Unauthenticated,
9211            ErrorCode::PermissionDenied,
9212            ErrorCode::NotFound,
9213            ErrorCode::StaleCursor,
9214            ErrorCode::RestartBudgetExhausted,
9215            ErrorCode::LimitExceeded,
9216            ErrorCode::CapabilityUnavailable,
9217            ErrorCode::TemporarilyUnavailable,
9218            ErrorCode::Internal,
9219        ],
9220        limit_ids: &[
9221            "request_bytes",
9222            "response_bytes",
9223            "page_size",
9224            "catalog_page_size",
9225            "catalog_restart_budget",
9226        ],
9227        effect_class: "read_only",
9228        risk_flags: &[],
9229        capability_family: "catalog",
9230        retry_safety: "safe",
9231        identity_requirement: "none",
9232        resolver: None,
9233        cancellation: "per_call",
9234        side_effects: &[],
9235        recovery: "retry",
9236        collection_index_ref: "none",
9237    },
9238    CommandSemanticContract {
9239        command: Command::GetComponentTemplate,
9240        admissible_errors: &[
9241            ErrorCode::Aborted,
9242            ErrorCode::DeadlineExceeded,
9243            ErrorCode::InvalidRequest,
9244            ErrorCode::UnsupportedVersion,
9245            ErrorCode::Unauthenticated,
9246            ErrorCode::PermissionDenied,
9247            ErrorCode::NotFound,
9248            ErrorCode::LimitExceeded,
9249            ErrorCode::CapabilityUnavailable,
9250            ErrorCode::TemporarilyUnavailable,
9251            ErrorCode::Internal,
9252        ],
9253        limit_ids: &["request_bytes", "response_bytes"],
9254        effect_class: "read_only",
9255        risk_flags: &[],
9256        capability_family: "catalog",
9257        retry_safety: "safe",
9258        identity_requirement: "none",
9259        resolver: None,
9260        cancellation: "per_call",
9261        side_effects: &[],
9262        recovery: "retry",
9263        collection_index_ref: "none",
9264    },
9265    CommandSemanticContract {
9266        command: Command::ListIndexTemplates,
9267        admissible_errors: &[
9268            ErrorCode::Aborted,
9269            ErrorCode::DeadlineExceeded,
9270            ErrorCode::InvalidRequest,
9271            ErrorCode::UnsupportedVersion,
9272            ErrorCode::Unauthenticated,
9273            ErrorCode::PermissionDenied,
9274            ErrorCode::NotFound,
9275            ErrorCode::StaleCursor,
9276            ErrorCode::RestartBudgetExhausted,
9277            ErrorCode::LimitExceeded,
9278            ErrorCode::CapabilityUnavailable,
9279            ErrorCode::TemporarilyUnavailable,
9280            ErrorCode::Internal,
9281        ],
9282        limit_ids: &[
9283            "request_bytes",
9284            "response_bytes",
9285            "page_size",
9286            "catalog_page_size",
9287            "catalog_restart_budget",
9288        ],
9289        effect_class: "read_only",
9290        risk_flags: &[],
9291        capability_family: "catalog",
9292        retry_safety: "safe",
9293        identity_requirement: "none",
9294        resolver: None,
9295        cancellation: "per_call",
9296        side_effects: &[],
9297        recovery: "retry",
9298        collection_index_ref: "none",
9299    },
9300    CommandSemanticContract {
9301        command: Command::GetIndexTemplate,
9302        admissible_errors: &[
9303            ErrorCode::Aborted,
9304            ErrorCode::DeadlineExceeded,
9305            ErrorCode::InvalidRequest,
9306            ErrorCode::UnsupportedVersion,
9307            ErrorCode::Unauthenticated,
9308            ErrorCode::PermissionDenied,
9309            ErrorCode::NotFound,
9310            ErrorCode::LimitExceeded,
9311            ErrorCode::CapabilityUnavailable,
9312            ErrorCode::TemporarilyUnavailable,
9313            ErrorCode::Internal,
9314        ],
9315        limit_ids: &["request_bytes", "response_bytes"],
9316        effect_class: "read_only",
9317        risk_flags: &[],
9318        capability_family: "catalog",
9319        retry_safety: "safe",
9320        identity_requirement: "none",
9321        resolver: None,
9322        cancellation: "per_call",
9323        side_effects: &[],
9324        recovery: "retry",
9325        collection_index_ref: "none",
9326    },
9327    CommandSemanticContract {
9328        command: Command::ListIngestPipelines,
9329        admissible_errors: &[
9330            ErrorCode::Aborted,
9331            ErrorCode::DeadlineExceeded,
9332            ErrorCode::InvalidRequest,
9333            ErrorCode::UnsupportedVersion,
9334            ErrorCode::Unauthenticated,
9335            ErrorCode::PermissionDenied,
9336            ErrorCode::NotFound,
9337            ErrorCode::StaleCursor,
9338            ErrorCode::RestartBudgetExhausted,
9339            ErrorCode::LimitExceeded,
9340            ErrorCode::CapabilityUnavailable,
9341            ErrorCode::TemporarilyUnavailable,
9342            ErrorCode::Internal,
9343        ],
9344        limit_ids: &[
9345            "request_bytes",
9346            "response_bytes",
9347            "page_size",
9348            "catalog_page_size",
9349            "catalog_restart_budget",
9350        ],
9351        effect_class: "read_only",
9352        risk_flags: &[],
9353        capability_family: "lifecycle",
9354        retry_safety: "safe",
9355        identity_requirement: "none",
9356        resolver: None,
9357        cancellation: "per_call",
9358        side_effects: &[],
9359        recovery: "retry",
9360        collection_index_ref: "none",
9361    },
9362    CommandSemanticContract {
9363        command: Command::GetIngestPipeline,
9364        admissible_errors: &[
9365            ErrorCode::Aborted,
9366            ErrorCode::DeadlineExceeded,
9367            ErrorCode::InvalidRequest,
9368            ErrorCode::UnsupportedVersion,
9369            ErrorCode::Unauthenticated,
9370            ErrorCode::PermissionDenied,
9371            ErrorCode::NotFound,
9372            ErrorCode::LimitExceeded,
9373            ErrorCode::CapabilityUnavailable,
9374            ErrorCode::TemporarilyUnavailable,
9375            ErrorCode::Internal,
9376        ],
9377        limit_ids: &["request_bytes", "response_bytes"],
9378        effect_class: "read_only",
9379        risk_flags: &[],
9380        capability_family: "lifecycle",
9381        retry_safety: "safe",
9382        identity_requirement: "none",
9383        resolver: None,
9384        cancellation: "per_call",
9385        side_effects: &[],
9386        recovery: "retry",
9387        collection_index_ref: "none",
9388    },
9389    CommandSemanticContract {
9390        command: Command::SimulateIngestPipeline,
9391        admissible_errors: &[
9392            ErrorCode::Aborted,
9393            ErrorCode::DeadlineExceeded,
9394            ErrorCode::InvalidRequest,
9395            ErrorCode::UnsupportedVersion,
9396            ErrorCode::Unauthenticated,
9397            ErrorCode::PermissionDenied,
9398            ErrorCode::NotFound,
9399            ErrorCode::LimitExceeded,
9400            ErrorCode::CapabilityUnavailable,
9401            ErrorCode::TemporarilyUnavailable,
9402            ErrorCode::Internal,
9403        ],
9404        limit_ids: &["request_bytes", "response_bytes"],
9405        effect_class: "read_only",
9406        risk_flags: &[],
9407        capability_family: "lifecycle",
9408        retry_safety: "safe",
9409        identity_requirement: "none",
9410        resolver: None,
9411        cancellation: "per_call",
9412        side_effects: &[],
9413        recovery: "retry",
9414        collection_index_ref: "none",
9415    },
9416    CommandSemanticContract {
9417        command: Command::ReprocessByQuery,
9418        admissible_errors: &[
9419            ErrorCode::Aborted,
9420            ErrorCode::DeadlineExceeded,
9421            ErrorCode::InvalidRequest,
9422            ErrorCode::UnsupportedVersion,
9423            ErrorCode::Unauthenticated,
9424            ErrorCode::PermissionDenied,
9425            ErrorCode::NotFound,
9426            ErrorCode::Conflict,
9427            ErrorCode::LimitExceeded,
9428            ErrorCode::CapabilityUnavailable,
9429            ErrorCode::NotSubmitted,
9430            ErrorCode::SubmittedIndeterminate,
9431            ErrorCode::ExpiredUnknown,
9432            ErrorCode::TemporarilyUnavailable,
9433            ErrorCode::Internal,
9434        ],
9435        limit_ids: &["request_bytes", "response_bytes"],
9436        effect_class: "durable_submit",
9437        risk_flags: &[],
9438        capability_family: "data",
9439        retry_safety: "safe",
9440        identity_requirement: "caller_action_id",
9441        resolver: None,
9442        cancellation: "per_call_until_submission_then_resolve",
9443        side_effects: &["commits_authoritative_state"],
9444        recovery: "retry",
9445        collection_index_ref: "request_index",
9446    },
9447    CommandSemanticContract {
9448        command: Command::ListLifecyclePolicies,
9449        admissible_errors: &[
9450            ErrorCode::Aborted,
9451            ErrorCode::DeadlineExceeded,
9452            ErrorCode::InvalidRequest,
9453            ErrorCode::UnsupportedVersion,
9454            ErrorCode::Unauthenticated,
9455            ErrorCode::PermissionDenied,
9456            ErrorCode::NotFound,
9457            ErrorCode::StaleCursor,
9458            ErrorCode::RestartBudgetExhausted,
9459            ErrorCode::LimitExceeded,
9460            ErrorCode::CapabilityUnavailable,
9461            ErrorCode::TemporarilyUnavailable,
9462            ErrorCode::Internal,
9463        ],
9464        limit_ids: &[
9465            "request_bytes",
9466            "response_bytes",
9467            "page_size",
9468            "catalog_page_size",
9469            "catalog_restart_budget",
9470        ],
9471        effect_class: "read_only",
9472        risk_flags: &[],
9473        capability_family: "catalog",
9474        retry_safety: "safe",
9475        identity_requirement: "none",
9476        resolver: None,
9477        cancellation: "per_call",
9478        side_effects: &[],
9479        recovery: "retry",
9480        collection_index_ref: "none",
9481    },
9482    CommandSemanticContract {
9483        command: Command::GetLifecyclePolicy,
9484        admissible_errors: &[
9485            ErrorCode::Aborted,
9486            ErrorCode::DeadlineExceeded,
9487            ErrorCode::InvalidRequest,
9488            ErrorCode::UnsupportedVersion,
9489            ErrorCode::Unauthenticated,
9490            ErrorCode::PermissionDenied,
9491            ErrorCode::NotFound,
9492            ErrorCode::LimitExceeded,
9493            ErrorCode::CapabilityUnavailable,
9494            ErrorCode::TemporarilyUnavailable,
9495            ErrorCode::Internal,
9496        ],
9497        limit_ids: &["request_bytes", "response_bytes"],
9498        effect_class: "read_only",
9499        risk_flags: &[],
9500        capability_family: "catalog",
9501        retry_safety: "safe",
9502        identity_requirement: "none",
9503        resolver: None,
9504        cancellation: "per_call",
9505        side_effects: &[],
9506        recovery: "retry",
9507        collection_index_ref: "none",
9508    },
9509    CommandSemanticContract {
9510        command: Command::PrepareCreateIndex,
9511        admissible_errors: &[
9512            ErrorCode::Aborted,
9513            ErrorCode::DeadlineExceeded,
9514            ErrorCode::InvalidRequest,
9515            ErrorCode::UnsupportedVersion,
9516            ErrorCode::Unauthenticated,
9517            ErrorCode::PermissionDenied,
9518            ErrorCode::NotFound,
9519            ErrorCode::LimitExceeded,
9520            ErrorCode::CapabilityUnavailable,
9521            ErrorCode::TemporarilyUnavailable,
9522            ErrorCode::Internal,
9523        ],
9524        limit_ids: &[
9525            "request_bytes",
9526            "response_bytes",
9527            "resource_initial_shards",
9528            "resource_target_shard_bytes",
9529            "resource_admission_weight",
9530            "resource_ram_bytes",
9531            "resource_nvme_bytes",
9532            "resource_refresh_millis",
9533            "resource_memtable_bytes",
9534            "resource_parallelism",
9535        ],
9536        effect_class: "prepare",
9537        risk_flags: &[],
9538        capability_family: "catalog",
9539        retry_safety: "safe",
9540        identity_requirement: "server_locator",
9541        resolver: None,
9542        cancellation: "per_call",
9543        side_effects: &["creates_bounded_preparation"],
9544        recovery: "retry",
9545        collection_index_ref: "request_name",
9546    },
9547    CommandSemanticContract {
9548        command: Command::PrepareDeleteIndex,
9549        admissible_errors: &[
9550            ErrorCode::Aborted,
9551            ErrorCode::DeadlineExceeded,
9552            ErrorCode::InvalidRequest,
9553            ErrorCode::UnsupportedVersion,
9554            ErrorCode::Unauthenticated,
9555            ErrorCode::PermissionDenied,
9556            ErrorCode::NotFound,
9557            ErrorCode::LimitExceeded,
9558            ErrorCode::CapabilityUnavailable,
9559            ErrorCode::TemporarilyUnavailable,
9560            ErrorCode::Internal,
9561        ],
9562        limit_ids: &["request_bytes", "response_bytes"],
9563        effect_class: "prepare",
9564        risk_flags: &["destructive"],
9565        capability_family: "catalog",
9566        retry_safety: "safe",
9567        identity_requirement: "server_locator",
9568        resolver: None,
9569        cancellation: "per_call",
9570        side_effects: &["creates_bounded_preparation"],
9571        recovery: "retry",
9572        collection_index_ref: "request_name",
9573    },
9574    CommandSemanticContract {
9575        command: Command::SubmitCatalogAction,
9576        admissible_errors: &[
9577            ErrorCode::Aborted,
9578            ErrorCode::DeadlineExceeded,
9579            ErrorCode::InvalidRequest,
9580            ErrorCode::UnsupportedVersion,
9581            ErrorCode::Unauthenticated,
9582            ErrorCode::PermissionDenied,
9583            ErrorCode::NotFound,
9584            ErrorCode::Conflict,
9585            ErrorCode::LimitExceeded,
9586            ErrorCode::CapabilityUnavailable,
9587            ErrorCode::NotSubmitted,
9588            ErrorCode::SubmittedIndeterminate,
9589            ErrorCode::ExpiredUnknown,
9590            ErrorCode::TemporarilyUnavailable,
9591            ErrorCode::Internal,
9592        ],
9593        limit_ids: &[
9594            "request_bytes",
9595            "response_bytes",
9596            "resource_initial_shards",
9597            "resource_target_shard_bytes",
9598            "resource_admission_weight",
9599            "resource_ram_bytes",
9600            "resource_nvme_bytes",
9601            "resource_refresh_millis",
9602            "resource_memtable_bytes",
9603            "resource_parallelism",
9604        ],
9605        effect_class: "durable_submit",
9606        risk_flags: &[],
9607        capability_family: "catalog",
9608        retry_safety: "pre_submit_only",
9609        identity_requirement: "request_locator",
9610        resolver: Some(Command::ResolveCatalogAction),
9611        cancellation: "per_call_until_submission_then_resolve",
9612        side_effects: &["commits_authoritative_state"],
9613        recovery: "resolve_with_resolve_catalog_action",
9614        collection_index_ref: "request_name",
9615    },
9616    CommandSemanticContract {
9617        command: Command::ResolveCatalogAction,
9618        admissible_errors: &[
9619            ErrorCode::Aborted,
9620            ErrorCode::DeadlineExceeded,
9621            ErrorCode::InvalidRequest,
9622            ErrorCode::UnsupportedVersion,
9623            ErrorCode::Unauthenticated,
9624            ErrorCode::PermissionDenied,
9625            ErrorCode::NotFound,
9626            ErrorCode::LimitExceeded,
9627            ErrorCode::CapabilityUnavailable,
9628            ErrorCode::TemporarilyUnavailable,
9629            ErrorCode::Internal,
9630        ],
9631        limit_ids: &["request_bytes", "response_bytes"],
9632        effect_class: "read_only",
9633        risk_flags: &[],
9634        capability_family: "catalog",
9635        retry_safety: "safe",
9636        identity_requirement: "request_locator",
9637        resolver: None,
9638        cancellation: "per_call",
9639        side_effects: &[],
9640        recovery: "retry",
9641        collection_index_ref: "caller",
9642    },
9643    CommandSemanticContract {
9644        command: Command::PrepareReplayableSourceIndex,
9645        admissible_errors: &[
9646            ErrorCode::Aborted,
9647            ErrorCode::DeadlineExceeded,
9648            ErrorCode::InvalidRequest,
9649            ErrorCode::UnsupportedVersion,
9650            ErrorCode::Unauthenticated,
9651            ErrorCode::PermissionDenied,
9652            ErrorCode::NotFound,
9653            ErrorCode::LimitExceeded,
9654            ErrorCode::CapabilityUnavailable,
9655            ErrorCode::RetentionGap,
9656            ErrorCode::TemporarilyUnavailable,
9657            ErrorCode::Internal,
9658        ],
9659        limit_ids: &[
9660            "request_bytes",
9661            "response_bytes",
9662            "resource_initial_shards",
9663            "resource_target_shard_bytes",
9664            "resource_admission_weight",
9665            "resource_ram_bytes",
9666            "resource_nvme_bytes",
9667            "resource_refresh_millis",
9668            "resource_memtable_bytes",
9669            "resource_parallelism",
9670        ],
9671        effect_class: "prepare",
9672        risk_flags: &[],
9673        capability_family: "catalog",
9674        retry_safety: "safe",
9675        identity_requirement: "server_locator",
9676        resolver: None,
9677        cancellation: "per_call",
9678        side_effects: &["creates_bounded_preparation"],
9679        recovery: "retry",
9680        collection_index_ref: "request_name",
9681    },
9682    CommandSemanticContract {
9683        command: Command::SubmitReplayableSourceIndex,
9684        admissible_errors: &[
9685            ErrorCode::Aborted,
9686            ErrorCode::DeadlineExceeded,
9687            ErrorCode::InvalidRequest,
9688            ErrorCode::UnsupportedVersion,
9689            ErrorCode::Unauthenticated,
9690            ErrorCode::PermissionDenied,
9691            ErrorCode::NotFound,
9692            ErrorCode::Conflict,
9693            ErrorCode::LimitExceeded,
9694            ErrorCode::CapabilityUnavailable,
9695            ErrorCode::NotSubmitted,
9696            ErrorCode::SubmittedIndeterminate,
9697            ErrorCode::ExpiredUnknown,
9698            ErrorCode::RetentionGap,
9699            ErrorCode::TemporarilyUnavailable,
9700            ErrorCode::Internal,
9701        ],
9702        limit_ids: &[
9703            "request_bytes",
9704            "response_bytes",
9705            "resource_initial_shards",
9706            "resource_target_shard_bytes",
9707            "resource_admission_weight",
9708            "resource_ram_bytes",
9709            "resource_nvme_bytes",
9710            "resource_refresh_millis",
9711            "resource_memtable_bytes",
9712            "resource_parallelism",
9713        ],
9714        effect_class: "durable_submit",
9715        risk_flags: &[],
9716        capability_family: "catalog",
9717        retry_safety: "pre_submit_only",
9718        identity_requirement: "request_locator",
9719        resolver: Some(Command::ResolveCatalogAction),
9720        cancellation: "per_call_until_submission_then_resolve",
9721        side_effects: &["commits_authoritative_state"],
9722        recovery: "resolve_with_resolve_catalog_action",
9723        collection_index_ref: "request_name",
9724    },
9725    CommandSemanticContract {
9726        command: Command::GetReplayableSource,
9727        admissible_errors: &[
9728            ErrorCode::Aborted,
9729            ErrorCode::DeadlineExceeded,
9730            ErrorCode::InvalidRequest,
9731            ErrorCode::UnsupportedVersion,
9732            ErrorCode::Unauthenticated,
9733            ErrorCode::PermissionDenied,
9734            ErrorCode::NotFound,
9735            ErrorCode::LimitExceeded,
9736            ErrorCode::CapabilityUnavailable,
9737            ErrorCode::RetentionGap,
9738            ErrorCode::TemporarilyUnavailable,
9739            ErrorCode::Internal,
9740        ],
9741        limit_ids: &["request_bytes", "response_bytes"],
9742        effect_class: "read_only",
9743        risk_flags: &[],
9744        capability_family: "catalog",
9745        retry_safety: "safe",
9746        identity_requirement: "none",
9747        resolver: None,
9748        cancellation: "per_call",
9749        side_effects: &[],
9750        recovery: "retry",
9751        collection_index_ref: "none",
9752    },
9753    CommandSemanticContract {
9754        command: Command::ControlReplayableSource,
9755        admissible_errors: &[
9756            ErrorCode::Aborted,
9757            ErrorCode::DeadlineExceeded,
9758            ErrorCode::InvalidRequest,
9759            ErrorCode::UnsupportedVersion,
9760            ErrorCode::Unauthenticated,
9761            ErrorCode::PermissionDenied,
9762            ErrorCode::NotFound,
9763            ErrorCode::Conflict,
9764            ErrorCode::LimitExceeded,
9765            ErrorCode::CapabilityUnavailable,
9766            ErrorCode::NotSubmitted,
9767            ErrorCode::SubmittedIndeterminate,
9768            ErrorCode::ExpiredUnknown,
9769            ErrorCode::RetentionGap,
9770            ErrorCode::TemporarilyUnavailable,
9771            ErrorCode::Internal,
9772        ],
9773        limit_ids: &["request_bytes", "response_bytes"],
9774        effect_class: "durable_submit",
9775        risk_flags: &[],
9776        capability_family: "catalog",
9777        retry_safety: "pre_submit_only",
9778        identity_requirement: "none",
9779        resolver: None,
9780        cancellation: "per_call_until_submission_then_resolve",
9781        side_effects: &["commits_authoritative_state"],
9782        recovery: "retry_if_not_submitted",
9783        collection_index_ref: "request_index",
9784    },
9785    CommandSemanticContract {
9786        command: Command::CloneIndex,
9787        admissible_errors: &[
9788            ErrorCode::Aborted,
9789            ErrorCode::DeadlineExceeded,
9790            ErrorCode::InvalidRequest,
9791            ErrorCode::UnsupportedVersion,
9792            ErrorCode::Unauthenticated,
9793            ErrorCode::PermissionDenied,
9794            ErrorCode::NotFound,
9795            ErrorCode::Conflict,
9796            ErrorCode::LimitExceeded,
9797            ErrorCode::CapabilityUnavailable,
9798            ErrorCode::NotSubmitted,
9799            ErrorCode::SubmittedIndeterminate,
9800            ErrorCode::ExpiredUnknown,
9801            ErrorCode::TemporarilyUnavailable,
9802            ErrorCode::Internal,
9803        ],
9804        limit_ids: &["request_bytes", "response_bytes"],
9805        effect_class: "durable_submit",
9806        risk_flags: &[],
9807        capability_family: "catalog",
9808        retry_safety: "pre_submit_only",
9809        identity_requirement: "caller_action_id",
9810        resolver: Some(Command::CloneIndex),
9811        cancellation: "per_call_until_submission_then_resolve",
9812        side_effects: &["commits_authoritative_state"],
9813        recovery: "resolve_with_clone_index",
9814        collection_index_ref: "caller",
9815    },
9816    CommandSemanticContract {
9817        command: Command::ConfigureHistory,
9818        admissible_errors: &[
9819            ErrorCode::Aborted,
9820            ErrorCode::DeadlineExceeded,
9821            ErrorCode::InvalidRequest,
9822            ErrorCode::UnsupportedVersion,
9823            ErrorCode::Unauthenticated,
9824            ErrorCode::PermissionDenied,
9825            ErrorCode::NotFound,
9826            ErrorCode::Conflict,
9827            ErrorCode::LimitExceeded,
9828            ErrorCode::CapabilityUnavailable,
9829            ErrorCode::NotSubmitted,
9830            ErrorCode::SubmittedIndeterminate,
9831            ErrorCode::ExpiredUnknown,
9832            ErrorCode::TemporarilyUnavailable,
9833            ErrorCode::Internal,
9834        ],
9835        limit_ids: &["request_bytes", "response_bytes"],
9836        effect_class: "durable_submit",
9837        risk_flags: &[],
9838        capability_family: "catalog",
9839        retry_safety: "pre_submit_only",
9840        identity_requirement: "none",
9841        resolver: Some(Command::GetHistory),
9842        cancellation: "per_call_until_submission_then_resolve",
9843        side_effects: &["commits_authoritative_state"],
9844        recovery: "resolve_with_get_history",
9845        collection_index_ref: "request_index",
9846    },
9847    CommandSemanticContract {
9848        command: Command::GetHistory,
9849        admissible_errors: &[
9850            ErrorCode::Aborted,
9851            ErrorCode::DeadlineExceeded,
9852            ErrorCode::InvalidRequest,
9853            ErrorCode::UnsupportedVersion,
9854            ErrorCode::Unauthenticated,
9855            ErrorCode::PermissionDenied,
9856            ErrorCode::NotFound,
9857            ErrorCode::LimitExceeded,
9858            ErrorCode::CapabilityUnavailable,
9859            ErrorCode::TemporarilyUnavailable,
9860            ErrorCode::Internal,
9861        ],
9862        limit_ids: &["request_bytes", "response_bytes"],
9863        effect_class: "read_only",
9864        risk_flags: &[],
9865        capability_family: "catalog",
9866        retry_safety: "safe",
9867        identity_requirement: "none",
9868        resolver: None,
9869        cancellation: "per_call",
9870        side_effects: &[],
9871        recovery: "retry",
9872        collection_index_ref: "none",
9873    },
9874    CommandSemanticContract {
9875        command: Command::ResolveHistory,
9876        admissible_errors: &[
9877            ErrorCode::Aborted,
9878            ErrorCode::DeadlineExceeded,
9879            ErrorCode::InvalidRequest,
9880            ErrorCode::UnsupportedVersion,
9881            ErrorCode::Unauthenticated,
9882            ErrorCode::PermissionDenied,
9883            ErrorCode::NotFound,
9884            ErrorCode::LimitExceeded,
9885            ErrorCode::CapabilityUnavailable,
9886            ErrorCode::RetentionGap,
9887            ErrorCode::TemporarilyUnavailable,
9888            ErrorCode::Internal,
9889        ],
9890        limit_ids: &["request_bytes", "response_bytes"],
9891        effect_class: "read_only",
9892        risk_flags: &[],
9893        capability_family: "data",
9894        retry_safety: "safe",
9895        identity_requirement: "none",
9896        resolver: None,
9897        cancellation: "per_call",
9898        side_effects: &[],
9899        recovery: "retry",
9900        collection_index_ref: "request_index",
9901    },
9902    CommandSemanticContract {
9903        command: Command::PlaceHistoryHold,
9904        admissible_errors: &[
9905            ErrorCode::Aborted,
9906            ErrorCode::DeadlineExceeded,
9907            ErrorCode::InvalidRequest,
9908            ErrorCode::UnsupportedVersion,
9909            ErrorCode::Unauthenticated,
9910            ErrorCode::PermissionDenied,
9911            ErrorCode::NotFound,
9912            ErrorCode::Conflict,
9913            ErrorCode::LimitExceeded,
9914            ErrorCode::CapabilityUnavailable,
9915            ErrorCode::NotSubmitted,
9916            ErrorCode::SubmittedIndeterminate,
9917            ErrorCode::ExpiredUnknown,
9918            ErrorCode::TemporarilyUnavailable,
9919            ErrorCode::Internal,
9920        ],
9921        limit_ids: &["request_bytes", "response_bytes"],
9922        effect_class: "durable_submit",
9923        risk_flags: &[],
9924        capability_family: "catalog",
9925        retry_safety: "pre_submit_only",
9926        identity_requirement: "none",
9927        resolver: Some(Command::GetHistory),
9928        cancellation: "per_call_until_submission_then_resolve",
9929        side_effects: &["commits_authoritative_state"],
9930        recovery: "resolve_with_get_history",
9931        collection_index_ref: "request_index",
9932    },
9933    CommandSemanticContract {
9934        command: Command::ReleaseHistoryHold,
9935        admissible_errors: &[
9936            ErrorCode::Aborted,
9937            ErrorCode::DeadlineExceeded,
9938            ErrorCode::InvalidRequest,
9939            ErrorCode::UnsupportedVersion,
9940            ErrorCode::Unauthenticated,
9941            ErrorCode::PermissionDenied,
9942            ErrorCode::NotFound,
9943            ErrorCode::Conflict,
9944            ErrorCode::LimitExceeded,
9945            ErrorCode::CapabilityUnavailable,
9946            ErrorCode::NotSubmitted,
9947            ErrorCode::SubmittedIndeterminate,
9948            ErrorCode::ExpiredUnknown,
9949            ErrorCode::TemporarilyUnavailable,
9950            ErrorCode::Internal,
9951        ],
9952        limit_ids: &["request_bytes", "response_bytes"],
9953        effect_class: "durable_submit",
9954        risk_flags: &[],
9955        capability_family: "catalog",
9956        retry_safety: "pre_submit_only",
9957        identity_requirement: "none",
9958        resolver: Some(Command::GetHistory),
9959        cancellation: "per_call_until_submission_then_resolve",
9960        side_effects: &["commits_authoritative_state"],
9961        recovery: "resolve_with_get_history",
9962        collection_index_ref: "request_index",
9963    },
9964    CommandSemanticContract {
9965        command: Command::PrepareDocumentMutation,
9966        admissible_errors: &[
9967            ErrorCode::Aborted,
9968            ErrorCode::DeadlineExceeded,
9969            ErrorCode::InvalidRequest,
9970            ErrorCode::UnsupportedVersion,
9971            ErrorCode::Unauthenticated,
9972            ErrorCode::PermissionDenied,
9973            ErrorCode::NotFound,
9974            ErrorCode::LimitExceeded,
9975            ErrorCode::CapabilityUnavailable,
9976            ErrorCode::TemporarilyUnavailable,
9977            ErrorCode::Internal,
9978        ],
9979        limit_ids: &["request_bytes", "response_bytes"],
9980        effect_class: "prepare",
9981        risk_flags: &[],
9982        capability_family: "data",
9983        retry_safety: "safe",
9984        identity_requirement: "server_locator",
9985        resolver: None,
9986        cancellation: "per_call",
9987        side_effects: &["creates_bounded_preparation"],
9988        recovery: "retry",
9989        collection_index_ref: "request_index",
9990    },
9991    CommandSemanticContract {
9992        command: Command::SubmitDocumentMutation,
9993        admissible_errors: &[
9994            ErrorCode::Aborted,
9995            ErrorCode::DeadlineExceeded,
9996            ErrorCode::InvalidRequest,
9997            ErrorCode::UnsupportedVersion,
9998            ErrorCode::Unauthenticated,
9999            ErrorCode::PermissionDenied,
10000            ErrorCode::NotFound,
10001            ErrorCode::Conflict,
10002            ErrorCode::LimitExceeded,
10003            ErrorCode::CapabilityUnavailable,
10004            ErrorCode::NotSubmitted,
10005            ErrorCode::SubmittedIndeterminate,
10006            ErrorCode::ExpiredUnknown,
10007            ErrorCode::TemporarilyUnavailable,
10008            ErrorCode::Internal,
10009        ],
10010        limit_ids: &["request_bytes", "response_bytes"],
10011        effect_class: "durable_submit",
10012        risk_flags: &[],
10013        capability_family: "data",
10014        retry_safety: "pre_submit_only",
10015        identity_requirement: "request_locator",
10016        resolver: Some(Command::ResolveDocumentMutation),
10017        cancellation: "per_call_until_submission_then_resolve",
10018        side_effects: &["commits_authoritative_state"],
10019        recovery: "resolve_with_resolve_document_mutation",
10020        collection_index_ref: "request_index",
10021    },
10022    CommandSemanticContract {
10023        command: Command::PrepareDocumentBulk,
10024        admissible_errors: &[
10025            ErrorCode::Aborted,
10026            ErrorCode::DeadlineExceeded,
10027            ErrorCode::InvalidRequest,
10028            ErrorCode::UnsupportedVersion,
10029            ErrorCode::Unauthenticated,
10030            ErrorCode::PermissionDenied,
10031            ErrorCode::NotFound,
10032            ErrorCode::LimitExceeded,
10033            ErrorCode::CapabilityUnavailable,
10034            ErrorCode::TemporarilyUnavailable,
10035            ErrorCode::Internal,
10036        ],
10037        limit_ids: &[
10038            "request_bytes",
10039            "response_bytes",
10040            "bulk_document_items",
10041            "bulk_document_bytes",
10042        ],
10043        effect_class: "prepare",
10044        risk_flags: &[],
10045        capability_family: "data",
10046        retry_safety: "safe",
10047        identity_requirement: "caller_action_id",
10048        resolver: None,
10049        cancellation: "per_call",
10050        side_effects: &["creates_bounded_preparation"],
10051        recovery: "retry",
10052        collection_index_ref: "request_index",
10053    },
10054    CommandSemanticContract {
10055        command: Command::SubmitDocumentBulk,
10056        admissible_errors: &[
10057            ErrorCode::Aborted,
10058            ErrorCode::DeadlineExceeded,
10059            ErrorCode::InvalidRequest,
10060            ErrorCode::UnsupportedVersion,
10061            ErrorCode::Unauthenticated,
10062            ErrorCode::PermissionDenied,
10063            ErrorCode::NotFound,
10064            ErrorCode::Conflict,
10065            ErrorCode::LimitExceeded,
10066            ErrorCode::CapabilityUnavailable,
10067            ErrorCode::NotSubmitted,
10068            ErrorCode::SubmittedIndeterminate,
10069            ErrorCode::ExpiredUnknown,
10070            ErrorCode::TemporarilyUnavailable,
10071            ErrorCode::Internal,
10072        ],
10073        limit_ids: &[
10074            "request_bytes",
10075            "response_bytes",
10076            "bulk_document_items",
10077            "bulk_document_bytes",
10078        ],
10079        effect_class: "durable_submit",
10080        risk_flags: &[],
10081        capability_family: "data",
10082        retry_safety: "pre_submit_only",
10083        identity_requirement: "caller_action_id",
10084        resolver: Some(Command::ResolveDocumentBulk),
10085        cancellation: "per_call_until_submission_then_resolve",
10086        side_effects: &["commits_authoritative_state"],
10087        recovery: "resolve_with_resolve_document_bulk",
10088        collection_index_ref: "request_index",
10089    },
10090    CommandSemanticContract {
10091        command: Command::ResolveDocumentBulk,
10092        admissible_errors: &[
10093            ErrorCode::Aborted,
10094            ErrorCode::DeadlineExceeded,
10095            ErrorCode::InvalidRequest,
10096            ErrorCode::UnsupportedVersion,
10097            ErrorCode::Unauthenticated,
10098            ErrorCode::PermissionDenied,
10099            ErrorCode::NotFound,
10100            ErrorCode::LimitExceeded,
10101            ErrorCode::CapabilityUnavailable,
10102            ErrorCode::TemporarilyUnavailable,
10103            ErrorCode::Internal,
10104        ],
10105        limit_ids: &[
10106            "request_bytes",
10107            "response_bytes",
10108            "bulk_document_items",
10109            "bulk_document_bytes",
10110        ],
10111        effect_class: "read_only",
10112        risk_flags: &[],
10113        capability_family: "data",
10114        retry_safety: "safe",
10115        identity_requirement: "caller_action_id",
10116        resolver: None,
10117        cancellation: "per_call",
10118        side_effects: &[],
10119        recovery: "retry",
10120        collection_index_ref: "request_index",
10121    },
10122    CommandSemanticContract {
10123        command: Command::PrepareAppendBulk,
10124        admissible_errors: &[
10125            ErrorCode::Aborted,
10126            ErrorCode::DeadlineExceeded,
10127            ErrorCode::InvalidRequest,
10128            ErrorCode::UnsupportedVersion,
10129            ErrorCode::Unauthenticated,
10130            ErrorCode::PermissionDenied,
10131            ErrorCode::NotFound,
10132            ErrorCode::LimitExceeded,
10133            ErrorCode::CapabilityUnavailable,
10134            ErrorCode::TemporarilyUnavailable,
10135            ErrorCode::Internal,
10136        ],
10137        limit_ids: &[
10138            "request_bytes",
10139            "response_bytes",
10140            "bulk_document_items",
10141            "bulk_document_bytes",
10142        ],
10143        effect_class: "prepare",
10144        risk_flags: &[],
10145        capability_family: "data",
10146        retry_safety: "safe",
10147        identity_requirement: "caller_action_id",
10148        resolver: None,
10149        cancellation: "per_call",
10150        side_effects: &[],
10151        recovery: "retry",
10152        collection_index_ref: "request_index",
10153    },
10154    CommandSemanticContract {
10155        command: Command::SubmitAppendBulk,
10156        admissible_errors: &[
10157            ErrorCode::Aborted,
10158            ErrorCode::DeadlineExceeded,
10159            ErrorCode::InvalidRequest,
10160            ErrorCode::UnsupportedVersion,
10161            ErrorCode::Unauthenticated,
10162            ErrorCode::PermissionDenied,
10163            ErrorCode::NotFound,
10164            ErrorCode::Conflict,
10165            ErrorCode::LimitExceeded,
10166            ErrorCode::CapabilityUnavailable,
10167            ErrorCode::NotSubmitted,
10168            ErrorCode::SubmittedIndeterminate,
10169            ErrorCode::TemporarilyUnavailable,
10170            ErrorCode::Internal,
10171        ],
10172        limit_ids: &[
10173            "request_bytes",
10174            "response_bytes",
10175            "bulk_document_items",
10176            "bulk_document_bytes",
10177        ],
10178        effect_class: "durable_submit",
10179        risk_flags: &[],
10180        capability_family: "data",
10181        retry_safety: "pre_submit_only",
10182        identity_requirement: "request_locator",
10183        resolver: Some(Command::ResolveAppendBulk),
10184        cancellation: "per_call_until_submission_then_resolve",
10185        side_effects: &["commits_authoritative_state"],
10186        recovery: "resolve_with_resolve_append_bulk",
10187        collection_index_ref: "request_index",
10188    },
10189    CommandSemanticContract {
10190        command: Command::ResolveAppendBulk,
10191        admissible_errors: &[
10192            ErrorCode::Aborted,
10193            ErrorCode::DeadlineExceeded,
10194            ErrorCode::InvalidRequest,
10195            ErrorCode::UnsupportedVersion,
10196            ErrorCode::Unauthenticated,
10197            ErrorCode::PermissionDenied,
10198            ErrorCode::NotFound,
10199            ErrorCode::Conflict,
10200            ErrorCode::LimitExceeded,
10201            ErrorCode::CapabilityUnavailable,
10202            ErrorCode::TemporarilyUnavailable,
10203            ErrorCode::Internal,
10204        ],
10205        limit_ids: &[
10206            "request_bytes",
10207            "response_bytes",
10208            "bulk_document_items",
10209            "bulk_document_bytes",
10210        ],
10211        effect_class: "read_only",
10212        risk_flags: &[],
10213        capability_family: "data",
10214        retry_safety: "safe",
10215        identity_requirement: "request_locator",
10216        resolver: None,
10217        cancellation: "per_call",
10218        side_effects: &[],
10219        recovery: "retry",
10220        collection_index_ref: "request_index",
10221    },
10222    CommandSemanticContract {
10223        command: Command::ObserveAppendCommitted,
10224        admissible_errors: &[
10225            ErrorCode::Aborted,
10226            ErrorCode::DeadlineExceeded,
10227            ErrorCode::InvalidRequest,
10228            ErrorCode::UnsupportedVersion,
10229            ErrorCode::Unauthenticated,
10230            ErrorCode::PermissionDenied,
10231            ErrorCode::NotFound,
10232            ErrorCode::Conflict,
10233            ErrorCode::LimitExceeded,
10234            ErrorCode::CapabilityUnavailable,
10235            ErrorCode::TemporarilyUnavailable,
10236            ErrorCode::Internal,
10237        ],
10238        limit_ids: &["request_bytes", "response_bytes"],
10239        effect_class: "read_only",
10240        risk_flags: &[],
10241        capability_family: "data",
10242        retry_safety: "safe",
10243        identity_requirement: "request_locator",
10244        resolver: None,
10245        cancellation: "per_call",
10246        side_effects: &[],
10247        recovery: "retry",
10248        collection_index_ref: "request_index",
10249    },
10250    CommandSemanticContract {
10251        command: Command::ResolveDocumentMutation,
10252        admissible_errors: &[
10253            ErrorCode::Aborted,
10254            ErrorCode::DeadlineExceeded,
10255            ErrorCode::InvalidRequest,
10256            ErrorCode::UnsupportedVersion,
10257            ErrorCode::Unauthenticated,
10258            ErrorCode::PermissionDenied,
10259            ErrorCode::NotFound,
10260            ErrorCode::LimitExceeded,
10261            ErrorCode::CapabilityUnavailable,
10262            ErrorCode::TemporarilyUnavailable,
10263            ErrorCode::Internal,
10264        ],
10265        limit_ids: &["request_bytes", "response_bytes"],
10266        effect_class: "read_only",
10267        risk_flags: &[],
10268        capability_family: "data",
10269        retry_safety: "safe",
10270        identity_requirement: "request_locator",
10271        resolver: None,
10272        cancellation: "per_call",
10273        side_effects: &[],
10274        recovery: "retry",
10275        collection_index_ref: "caller",
10276    },
10277    CommandSemanticContract {
10278        command: Command::GetDocument,
10279        admissible_errors: &[
10280            ErrorCode::Aborted,
10281            ErrorCode::DeadlineExceeded,
10282            ErrorCode::InvalidRequest,
10283            ErrorCode::UnsupportedVersion,
10284            ErrorCode::Unauthenticated,
10285            ErrorCode::PermissionDenied,
10286            ErrorCode::NotFound,
10287            ErrorCode::LimitExceeded,
10288            ErrorCode::CapabilityUnavailable,
10289            ErrorCode::TemporarilyUnavailable,
10290            ErrorCode::Internal,
10291        ],
10292        limit_ids: &["request_bytes", "response_bytes"],
10293        effect_class: "read_only",
10294        risk_flags: &[],
10295        capability_family: "data",
10296        retry_safety: "safe",
10297        identity_requirement: "none",
10298        resolver: None,
10299        cancellation: "per_call",
10300        side_effects: &[],
10301        recovery: "retry",
10302        collection_index_ref: "request_index",
10303    },
10304    CommandSemanticContract {
10305        command: Command::Search,
10306        admissible_errors: &[
10307            ErrorCode::Aborted,
10308            ErrorCode::DeadlineExceeded,
10309            ErrorCode::InvalidRequest,
10310            ErrorCode::UnsupportedVersion,
10311            ErrorCode::Unauthenticated,
10312            ErrorCode::PermissionDenied,
10313            ErrorCode::NotFound,
10314            ErrorCode::StaleCursor,
10315            ErrorCode::RestartBudgetExhausted,
10316            ErrorCode::LimitExceeded,
10317            ErrorCode::CapabilityUnavailable,
10318            ErrorCode::TemporarilyUnavailable,
10319            ErrorCode::Internal,
10320        ],
10321        limit_ids: &[
10322            "request_bytes",
10323            "response_bytes",
10324            "page_size",
10325            "query_clauses",
10326            "aggregation_nodes",
10327            "aggregation_buckets",
10328            "routing_values",
10329            "routing_value_bytes",
10330            "query_recursion_depth",
10331            "text_query_bytes",
10332            "text_query_fields",
10333            "text_query_slop",
10334            "text_query_boost",
10335            "text_query_fuzzy_expansions",
10336            "text_query_fuzzy_distance",
10337            "text_query_dictionary_scan_terms",
10338            "text_query_dictionary_scan_bytes",
10339            "text_query_fuzzy_work_units",
10340            "vector_dimensions",
10341            "vector_query_bytes",
10342            "vector_request_bytes",
10343            "vector_candidates",
10344            "vector_set_query_vectors",
10345            "vector_set_query_bytes",
10346            "retrieval_branches",
10347            "retrieval_branch_name_bytes",
10348            "retrieval_window",
10349            "fragment_fields",
10350            "fragments_per_field",
10351            "fragment_bytes",
10352            "fragment_total_bytes",
10353            "result_feature_hits",
10354            "result_features",
10355            "diversification_fields",
10356            "diversification_per_group",
10357            "search_result_window",
10358        ],
10359        effect_class: "read_only",
10360        risk_flags: &[],
10361        capability_family: "data",
10362        retry_safety: "safe",
10363        identity_requirement: "none",
10364        resolver: None,
10365        cancellation: "per_call",
10366        side_effects: &[],
10367        recovery: "retry",
10368        collection_index_ref: "request_indexes_or_pit_authority",
10369    },
10370    CommandSemanticContract {
10371        command: Command::ValidateSearch,
10372        admissible_errors: &[
10373            ErrorCode::Aborted,
10374            ErrorCode::DeadlineExceeded,
10375            ErrorCode::InvalidRequest,
10376            ErrorCode::UnsupportedVersion,
10377            ErrorCode::Unauthenticated,
10378            ErrorCode::PermissionDenied,
10379            ErrorCode::NotFound,
10380            ErrorCode::LimitExceeded,
10381            ErrorCode::CapabilityUnavailable,
10382            ErrorCode::TemporarilyUnavailable,
10383            ErrorCode::Internal,
10384        ],
10385        limit_ids: &[
10386            "request_bytes",
10387            "response_bytes",
10388            "page_size",
10389            "query_clauses",
10390            "aggregation_nodes",
10391            "aggregation_buckets",
10392            "routing_values",
10393            "routing_value_bytes",
10394            "query_recursion_depth",
10395            "search_result_window",
10396        ],
10397        effect_class: "read_only",
10398        risk_flags: &[],
10399        capability_family: "data",
10400        retry_safety: "safe",
10401        identity_requirement: "none",
10402        resolver: None,
10403        cancellation: "per_call",
10404        side_effects: &[],
10405        recovery: "retry",
10406        collection_index_ref: "request_indexes_uniform",
10407    },
10408    CommandSemanticContract {
10409        command: Command::OpenPit,
10410        admissible_errors: &[
10411            ErrorCode::Aborted,
10412            ErrorCode::DeadlineExceeded,
10413            ErrorCode::InvalidRequest,
10414            ErrorCode::UnsupportedVersion,
10415            ErrorCode::Unauthenticated,
10416            ErrorCode::PermissionDenied,
10417            ErrorCode::NotFound,
10418            ErrorCode::Conflict,
10419            ErrorCode::LimitExceeded,
10420            ErrorCode::CapabilityUnavailable,
10421            ErrorCode::NotSubmitted,
10422            ErrorCode::SubmittedIndeterminate,
10423            ErrorCode::ExpiredUnknown,
10424            ErrorCode::TemporarilyUnavailable,
10425            ErrorCode::Internal,
10426        ],
10427        limit_ids: &["request_bytes", "response_bytes"],
10428        effect_class: "lease_renewing_read",
10429        risk_flags: &[],
10430        capability_family: "data",
10431        retry_safety: "pre_submit_only",
10432        identity_requirement: "none",
10433        resolver: None,
10434        cancellation: "per_call_until_submission_then_resolve",
10435        side_effects: &["renews_or_closes_existing_lease"],
10436        recovery: "retry_if_not_submitted",
10437        collection_index_ref: "request_indexes_uniform",
10438    },
10439    CommandSemanticContract {
10440        command: Command::RenewPit,
10441        admissible_errors: &[
10442            ErrorCode::Aborted,
10443            ErrorCode::DeadlineExceeded,
10444            ErrorCode::InvalidRequest,
10445            ErrorCode::UnsupportedVersion,
10446            ErrorCode::Unauthenticated,
10447            ErrorCode::PermissionDenied,
10448            ErrorCode::NotFound,
10449            ErrorCode::Conflict,
10450            ErrorCode::LimitExceeded,
10451            ErrorCode::CapabilityUnavailable,
10452            ErrorCode::NotSubmitted,
10453            ErrorCode::SubmittedIndeterminate,
10454            ErrorCode::ExpiredUnknown,
10455            ErrorCode::TemporarilyUnavailable,
10456            ErrorCode::Internal,
10457        ],
10458        limit_ids: &["request_bytes", "response_bytes"],
10459        effect_class: "lease_renewing_read",
10460        risk_flags: &[],
10461        capability_family: "data",
10462        retry_safety: "pre_submit_only",
10463        identity_requirement: "none",
10464        resolver: None,
10465        cancellation: "per_call_until_submission_then_resolve",
10466        side_effects: &["renews_or_closes_existing_lease"],
10467        recovery: "retry_if_not_submitted",
10468        collection_index_ref: "pit_authority",
10469    },
10470    CommandSemanticContract {
10471        command: Command::ClosePit,
10472        admissible_errors: &[
10473            ErrorCode::Aborted,
10474            ErrorCode::DeadlineExceeded,
10475            ErrorCode::InvalidRequest,
10476            ErrorCode::UnsupportedVersion,
10477            ErrorCode::Unauthenticated,
10478            ErrorCode::PermissionDenied,
10479            ErrorCode::NotFound,
10480            ErrorCode::Conflict,
10481            ErrorCode::LimitExceeded,
10482            ErrorCode::CapabilityUnavailable,
10483            ErrorCode::NotSubmitted,
10484            ErrorCode::SubmittedIndeterminate,
10485            ErrorCode::ExpiredUnknown,
10486            ErrorCode::TemporarilyUnavailable,
10487            ErrorCode::Internal,
10488        ],
10489        limit_ids: &["request_bytes", "response_bytes"],
10490        effect_class: "lease_renewing_read",
10491        risk_flags: &[],
10492        capability_family: "data",
10493        retry_safety: "pre_submit_only",
10494        identity_requirement: "none",
10495        resolver: None,
10496        cancellation: "per_call_until_submission_then_resolve",
10497        side_effects: &["renews_or_closes_existing_lease"],
10498        recovery: "retry_if_not_submitted",
10499        collection_index_ref: "pit_authority",
10500    },
10501    CommandSemanticContract {
10502        command: Command::ListOperations,
10503        admissible_errors: &[
10504            ErrorCode::Aborted,
10505            ErrorCode::DeadlineExceeded,
10506            ErrorCode::InvalidRequest,
10507            ErrorCode::UnsupportedVersion,
10508            ErrorCode::Unauthenticated,
10509            ErrorCode::PermissionDenied,
10510            ErrorCode::NotFound,
10511            ErrorCode::StaleCursor,
10512            ErrorCode::RestartBudgetExhausted,
10513            ErrorCode::LimitExceeded,
10514            ErrorCode::CapabilityUnavailable,
10515            ErrorCode::TemporarilyUnavailable,
10516            ErrorCode::Internal,
10517        ],
10518        limit_ids: &["request_bytes", "response_bytes", "page_size", "operation_page_size"],
10519        effect_class: "read_only",
10520        risk_flags: &[],
10521        capability_family: "operations",
10522        retry_safety: "safe",
10523        identity_requirement: "none",
10524        resolver: None,
10525        cancellation: "per_call",
10526        side_effects: &[],
10527        recovery: "retry",
10528        collection_index_ref: "none",
10529    },
10530    CommandSemanticContract {
10531        command: Command::GetOperation,
10532        admissible_errors: &[
10533            ErrorCode::Aborted,
10534            ErrorCode::DeadlineExceeded,
10535            ErrorCode::InvalidRequest,
10536            ErrorCode::UnsupportedVersion,
10537            ErrorCode::Unauthenticated,
10538            ErrorCode::PermissionDenied,
10539            ErrorCode::NotFound,
10540            ErrorCode::LimitExceeded,
10541            ErrorCode::CapabilityUnavailable,
10542            ErrorCode::TemporarilyUnavailable,
10543            ErrorCode::Internal,
10544        ],
10545        limit_ids: &["request_bytes", "response_bytes"],
10546        effect_class: "read_only",
10547        risk_flags: &[],
10548        capability_family: "operations",
10549        retry_safety: "safe",
10550        identity_requirement: "request_locator",
10551        resolver: None,
10552        cancellation: "per_call",
10553        side_effects: &[],
10554        recovery: "retry",
10555        collection_index_ref: "none",
10556    },
10557    CommandSemanticContract {
10558        command: Command::WaitOperation,
10559        admissible_errors: &[
10560            ErrorCode::Aborted,
10561            ErrorCode::DeadlineExceeded,
10562            ErrorCode::InvalidRequest,
10563            ErrorCode::UnsupportedVersion,
10564            ErrorCode::Unauthenticated,
10565            ErrorCode::PermissionDenied,
10566            ErrorCode::NotFound,
10567            ErrorCode::Conflict,
10568            ErrorCode::LimitExceeded,
10569            ErrorCode::CapabilityUnavailable,
10570            ErrorCode::TemporarilyUnavailable,
10571            ErrorCode::Internal,
10572        ],
10573        limit_ids: &[
10574            "request_bytes",
10575            "response_bytes",
10576            "operation_wait_attempts",
10577            "operation_wait_interval_millis",
10578        ],
10579        effect_class: "read_only",
10580        risk_flags: &[],
10581        capability_family: "operations",
10582        retry_safety: "safe",
10583        identity_requirement: "request_locator",
10584        resolver: None,
10585        cancellation: "per_call",
10586        side_effects: &[],
10587        recovery: "retry",
10588        collection_index_ref: "none",
10589    },
10590    CommandSemanticContract {
10591        command: Command::CancelOperation,
10592        admissible_errors: &[
10593            ErrorCode::Aborted,
10594            ErrorCode::DeadlineExceeded,
10595            ErrorCode::InvalidRequest,
10596            ErrorCode::UnsupportedVersion,
10597            ErrorCode::Unauthenticated,
10598            ErrorCode::PermissionDenied,
10599            ErrorCode::NotFound,
10600            ErrorCode::Conflict,
10601            ErrorCode::LimitExceeded,
10602            ErrorCode::CapabilityUnavailable,
10603            ErrorCode::NotSubmitted,
10604            ErrorCode::SubmittedIndeterminate,
10605            ErrorCode::ExpiredUnknown,
10606            ErrorCode::TemporarilyUnavailable,
10607            ErrorCode::Internal,
10608        ],
10609        limit_ids: &["request_bytes", "response_bytes"],
10610        effect_class: "control_write",
10611        risk_flags: &[],
10612        capability_family: "operations",
10613        retry_safety: "pre_submit_only",
10614        identity_requirement: "request_locator",
10615        resolver: None,
10616        cancellation: "per_call_until_submission_then_resolve",
10617        side_effects: &["commits_authoritative_state"],
10618        recovery: "retry_if_not_submitted",
10619        collection_index_ref: "none",
10620    },
10621    CommandSemanticContract {
10622        command: Command::ListAuditEvents,
10623        admissible_errors: &[
10624            ErrorCode::Aborted,
10625            ErrorCode::DeadlineExceeded,
10626            ErrorCode::InvalidRequest,
10627            ErrorCode::UnsupportedVersion,
10628            ErrorCode::Unauthenticated,
10629            ErrorCode::PermissionDenied,
10630            ErrorCode::NotFound,
10631            ErrorCode::StaleCursor,
10632            ErrorCode::RestartBudgetExhausted,
10633            ErrorCode::LimitExceeded,
10634            ErrorCode::CapabilityUnavailable,
10635            ErrorCode::TemporarilyUnavailable,
10636            ErrorCode::Internal,
10637        ],
10638        limit_ids: &["request_bytes", "response_bytes", "page_size"],
10639        effect_class: "read_only",
10640        risk_flags: &[],
10641        capability_family: "audit",
10642        retry_safety: "safe",
10643        identity_requirement: "none",
10644        resolver: None,
10645        cancellation: "per_call",
10646        side_effects: &[],
10647        recovery: "retry",
10648        collection_index_ref: "none",
10649    },
10650    CommandSemanticContract {
10651        command: Command::ExportAuditEvents,
10652        admissible_errors: &[
10653            ErrorCode::Aborted,
10654            ErrorCode::DeadlineExceeded,
10655            ErrorCode::InvalidRequest,
10656            ErrorCode::UnsupportedVersion,
10657            ErrorCode::Unauthenticated,
10658            ErrorCode::PermissionDenied,
10659            ErrorCode::NotFound,
10660            ErrorCode::StaleCursor,
10661            ErrorCode::RestartBudgetExhausted,
10662            ErrorCode::LimitExceeded,
10663            ErrorCode::CapabilityUnavailable,
10664            ErrorCode::TemporarilyUnavailable,
10665            ErrorCode::Internal,
10666        ],
10667        limit_ids: &["request_bytes", "response_bytes", "page_size"],
10668        effect_class: "read_only",
10669        risk_flags: &[],
10670        capability_family: "audit",
10671        retry_safety: "safe",
10672        identity_requirement: "none",
10673        resolver: None,
10674        cancellation: "per_call",
10675        side_effects: &[],
10676        recovery: "retry",
10677        collection_index_ref: "none",
10678    },
10679    CommandSemanticContract {
10680        command: Command::ReserveServiceCredential,
10681        admissible_errors: &[
10682            ErrorCode::Aborted,
10683            ErrorCode::DeadlineExceeded,
10684            ErrorCode::InvalidRequest,
10685            ErrorCode::UnsupportedVersion,
10686            ErrorCode::Unauthenticated,
10687            ErrorCode::PermissionDenied,
10688            ErrorCode::NotFound,
10689            ErrorCode::Conflict,
10690            ErrorCode::LimitExceeded,
10691            ErrorCode::CapabilityUnavailable,
10692            ErrorCode::NotSubmitted,
10693            ErrorCode::SubmittedIndeterminate,
10694            ErrorCode::ExpiredUnknown,
10695            ErrorCode::SecretNotEscrowed,
10696            ErrorCode::TemporarilyUnavailable,
10697            ErrorCode::Internal,
10698        ],
10699        limit_ids: &["request_bytes", "response_bytes"],
10700        effect_class: "durable_submit",
10701        risk_flags: &["credential_sensitive"],
10702        capability_family: "security",
10703        retry_safety: "pre_submit_only",
10704        identity_requirement: "caller_action_id",
10705        resolver: Some(Command::ResolveServiceCredentialReservation),
10706        cancellation: "per_call_until_submission_then_resolve",
10707        side_effects: &["commits_authoritative_state"],
10708        recovery: "resolve_with_resolve_service_credential_reservation",
10709        collection_index_ref: "none",
10710    },
10711    CommandSemanticContract {
10712        command: Command::ReserveServiceCredentialRotation,
10713        admissible_errors: &[
10714            ErrorCode::Aborted,
10715            ErrorCode::DeadlineExceeded,
10716            ErrorCode::InvalidRequest,
10717            ErrorCode::UnsupportedVersion,
10718            ErrorCode::Unauthenticated,
10719            ErrorCode::PermissionDenied,
10720            ErrorCode::NotFound,
10721            ErrorCode::Conflict,
10722            ErrorCode::LimitExceeded,
10723            ErrorCode::CapabilityUnavailable,
10724            ErrorCode::NotSubmitted,
10725            ErrorCode::SubmittedIndeterminate,
10726            ErrorCode::ExpiredUnknown,
10727            ErrorCode::SecretNotEscrowed,
10728            ErrorCode::TemporarilyUnavailable,
10729            ErrorCode::Internal,
10730        ],
10731        limit_ids: &["request_bytes", "response_bytes"],
10732        effect_class: "durable_submit",
10733        risk_flags: &["credential_sensitive"],
10734        capability_family: "security",
10735        retry_safety: "pre_submit_only",
10736        identity_requirement: "caller_action_id",
10737        resolver: Some(Command::ResolveServiceCredentialReservation),
10738        cancellation: "per_call_until_submission_then_resolve",
10739        side_effects: &["commits_authoritative_state"],
10740        recovery: "resolve_with_resolve_service_credential_reservation",
10741        collection_index_ref: "none",
10742    },
10743    CommandSemanticContract {
10744        command: Command::ActivateServiceCredential,
10745        admissible_errors: &[
10746            ErrorCode::Aborted,
10747            ErrorCode::DeadlineExceeded,
10748            ErrorCode::InvalidRequest,
10749            ErrorCode::UnsupportedVersion,
10750            ErrorCode::Unauthenticated,
10751            ErrorCode::PermissionDenied,
10752            ErrorCode::NotFound,
10753            ErrorCode::Conflict,
10754            ErrorCode::LimitExceeded,
10755            ErrorCode::CapabilityUnavailable,
10756            ErrorCode::NotSubmitted,
10757            ErrorCode::SubmittedIndeterminate,
10758            ErrorCode::ExpiredUnknown,
10759            ErrorCode::SecretNotEscrowed,
10760            ErrorCode::TemporarilyUnavailable,
10761            ErrorCode::Internal,
10762        ],
10763        limit_ids: &["request_bytes", "response_bytes"],
10764        effect_class: "durable_submit",
10765        risk_flags: &["credential_sensitive"],
10766        capability_family: "security",
10767        retry_safety: "pre_submit_only",
10768        identity_requirement: "server_locator",
10769        resolver: Some(Command::ResolveServiceCredentialReservation),
10770        cancellation: "per_call_until_submission_then_resolve",
10771        side_effects: &["commits_authoritative_state"],
10772        recovery: "resolve_with_resolve_service_credential_reservation",
10773        collection_index_ref: "none",
10774    },
10775    CommandSemanticContract {
10776        command: Command::ResolveServiceCredentialReservation,
10777        admissible_errors: &[
10778            ErrorCode::Aborted,
10779            ErrorCode::DeadlineExceeded,
10780            ErrorCode::InvalidRequest,
10781            ErrorCode::UnsupportedVersion,
10782            ErrorCode::Unauthenticated,
10783            ErrorCode::PermissionDenied,
10784            ErrorCode::NotFound,
10785            ErrorCode::LimitExceeded,
10786            ErrorCode::CapabilityUnavailable,
10787            ErrorCode::SecretNotEscrowed,
10788            ErrorCode::TemporarilyUnavailable,
10789            ErrorCode::Internal,
10790        ],
10791        limit_ids: &["request_bytes", "response_bytes"],
10792        effect_class: "read_only",
10793        risk_flags: &["credential_sensitive"],
10794        capability_family: "security",
10795        retry_safety: "safe",
10796        identity_requirement: "caller_action_id",
10797        resolver: None,
10798        cancellation: "per_call",
10799        side_effects: &[],
10800        recovery: "retry",
10801        collection_index_ref: "none",
10802    },
10803    CommandSemanticContract {
10804        command: Command::PrepareRevokeServiceCredential,
10805        admissible_errors: &[
10806            ErrorCode::Aborted,
10807            ErrorCode::DeadlineExceeded,
10808            ErrorCode::InvalidRequest,
10809            ErrorCode::UnsupportedVersion,
10810            ErrorCode::Unauthenticated,
10811            ErrorCode::PermissionDenied,
10812            ErrorCode::NotFound,
10813            ErrorCode::LimitExceeded,
10814            ErrorCode::CapabilityUnavailable,
10815            ErrorCode::SecretNotEscrowed,
10816            ErrorCode::TemporarilyUnavailable,
10817            ErrorCode::Internal,
10818        ],
10819        limit_ids: &["request_bytes", "response_bytes"],
10820        effect_class: "prepare",
10821        risk_flags: &["destructive", "credential_sensitive"],
10822        capability_family: "security",
10823        retry_safety: "safe",
10824        identity_requirement: "server_locator",
10825        resolver: None,
10826        cancellation: "per_call",
10827        side_effects: &["creates_bounded_preparation"],
10828        recovery: "retry",
10829        collection_index_ref: "none",
10830    },
10831    CommandSemanticContract {
10832        command: Command::RevokeServiceCredential,
10833        admissible_errors: &[
10834            ErrorCode::Aborted,
10835            ErrorCode::DeadlineExceeded,
10836            ErrorCode::InvalidRequest,
10837            ErrorCode::UnsupportedVersion,
10838            ErrorCode::Unauthenticated,
10839            ErrorCode::PermissionDenied,
10840            ErrorCode::NotFound,
10841            ErrorCode::Conflict,
10842            ErrorCode::LimitExceeded,
10843            ErrorCode::CapabilityUnavailable,
10844            ErrorCode::NotSubmitted,
10845            ErrorCode::SubmittedIndeterminate,
10846            ErrorCode::ExpiredUnknown,
10847            ErrorCode::SecretNotEscrowed,
10848            ErrorCode::TemporarilyUnavailable,
10849            ErrorCode::Internal,
10850        ],
10851        limit_ids: &["request_bytes", "response_bytes"],
10852        effect_class: "durable_submit",
10853        risk_flags: &["destructive", "credential_sensitive"],
10854        capability_family: "security",
10855        retry_safety: "pre_submit_only",
10856        identity_requirement: "request_locator",
10857        resolver: Some(Command::ResolveSecurityAction),
10858        cancellation: "per_call_until_submission_then_resolve",
10859        side_effects: &["commits_authoritative_state"],
10860        recovery: "resolve_with_resolve_security_action",
10861        collection_index_ref: "none",
10862    },
10863    CommandSemanticContract {
10864        command: Command::ResolveSecurityAction,
10865        admissible_errors: &[
10866            ErrorCode::Aborted,
10867            ErrorCode::DeadlineExceeded,
10868            ErrorCode::InvalidRequest,
10869            ErrorCode::UnsupportedVersion,
10870            ErrorCode::Unauthenticated,
10871            ErrorCode::PermissionDenied,
10872            ErrorCode::NotFound,
10873            ErrorCode::LimitExceeded,
10874            ErrorCode::CapabilityUnavailable,
10875            ErrorCode::SecretNotEscrowed,
10876            ErrorCode::TemporarilyUnavailable,
10877            ErrorCode::Internal,
10878        ],
10879        limit_ids: &["request_bytes", "response_bytes"],
10880        effect_class: "read_only",
10881        risk_flags: &[],
10882        capability_family: "security",
10883        retry_safety: "safe",
10884        identity_requirement: "request_locator",
10885        resolver: None,
10886        cancellation: "per_call",
10887        side_effects: &[],
10888        recovery: "retry",
10889        collection_index_ref: "none",
10890    },
10891    CommandSemanticContract {
10892        command: Command::GetSecurityRole,
10893        admissible_errors: &[
10894            ErrorCode::Aborted,
10895            ErrorCode::DeadlineExceeded,
10896            ErrorCode::InvalidRequest,
10897            ErrorCode::UnsupportedVersion,
10898            ErrorCode::Unauthenticated,
10899            ErrorCode::PermissionDenied,
10900            ErrorCode::NotFound,
10901            ErrorCode::LimitExceeded,
10902            ErrorCode::CapabilityUnavailable,
10903            ErrorCode::TemporarilyUnavailable,
10904            ErrorCode::Internal,
10905        ],
10906        limit_ids: &["request_bytes", "response_bytes"],
10907        effect_class: "read_only",
10908        risk_flags: &[],
10909        capability_family: "security",
10910        retry_safety: "safe",
10911        identity_requirement: "none",
10912        resolver: None,
10913        cancellation: "per_call",
10914        side_effects: &[],
10915        recovery: "retry",
10916        collection_index_ref: "none",
10917    },
10918    CommandSemanticContract {
10919        command: Command::PrepareRoleAppendAccessChange,
10920        admissible_errors: &[
10921            ErrorCode::Aborted,
10922            ErrorCode::DeadlineExceeded,
10923            ErrorCode::InvalidRequest,
10924            ErrorCode::UnsupportedVersion,
10925            ErrorCode::Unauthenticated,
10926            ErrorCode::PermissionDenied,
10927            ErrorCode::NotFound,
10928            ErrorCode::Conflict,
10929            ErrorCode::LimitExceeded,
10930            ErrorCode::CapabilityUnavailable,
10931            ErrorCode::TemporarilyUnavailable,
10932            ErrorCode::Internal,
10933        ],
10934        limit_ids: &["request_bytes", "response_bytes"],
10935        effect_class: "prepare",
10936        risk_flags: &["destructive"],
10937        capability_family: "security",
10938        retry_safety: "safe",
10939        identity_requirement: "server_locator",
10940        resolver: None,
10941        cancellation: "per_call",
10942        side_effects: &["creates_bounded_preparation"],
10943        recovery: "retry",
10944        collection_index_ref: "none",
10945    },
10946    CommandSemanticContract {
10947        command: Command::SubmitRoleAppendAccessChange,
10948        admissible_errors: &[
10949            ErrorCode::Aborted,
10950            ErrorCode::DeadlineExceeded,
10951            ErrorCode::InvalidRequest,
10952            ErrorCode::UnsupportedVersion,
10953            ErrorCode::Unauthenticated,
10954            ErrorCode::PermissionDenied,
10955            ErrorCode::NotFound,
10956            ErrorCode::Conflict,
10957            ErrorCode::LimitExceeded,
10958            ErrorCode::CapabilityUnavailable,
10959            ErrorCode::NotSubmitted,
10960            ErrorCode::SubmittedIndeterminate,
10961            ErrorCode::ExpiredUnknown,
10962            ErrorCode::TemporarilyUnavailable,
10963            ErrorCode::Internal,
10964        ],
10965        limit_ids: &["request_bytes", "response_bytes"],
10966        effect_class: "durable_submit",
10967        risk_flags: &["destructive"],
10968        capability_family: "security",
10969        retry_safety: "pre_submit_only",
10970        identity_requirement: "request_locator",
10971        resolver: Some(Command::ResolveSecurityAction),
10972        cancellation: "per_call_until_submission_then_resolve",
10973        side_effects: &["commits_authoritative_state"],
10974        recovery: "resolve_with_resolve_security_action",
10975        collection_index_ref: "none",
10976    },
10977    CommandSemanticContract {
10978        command: Command::ListServiceCredentials,
10979        admissible_errors: &[
10980            ErrorCode::Aborted,
10981            ErrorCode::DeadlineExceeded,
10982            ErrorCode::InvalidRequest,
10983            ErrorCode::UnsupportedVersion,
10984            ErrorCode::Unauthenticated,
10985            ErrorCode::PermissionDenied,
10986            ErrorCode::NotFound,
10987            ErrorCode::StaleCursor,
10988            ErrorCode::RestartBudgetExhausted,
10989            ErrorCode::LimitExceeded,
10990            ErrorCode::CapabilityUnavailable,
10991            ErrorCode::SecretNotEscrowed,
10992            ErrorCode::TemporarilyUnavailable,
10993            ErrorCode::Internal,
10994        ],
10995        limit_ids: &["request_bytes", "response_bytes", "page_size"],
10996        effect_class: "read_only",
10997        risk_flags: &["credential_sensitive"],
10998        capability_family: "security",
10999        retry_safety: "safe",
11000        identity_requirement: "none",
11001        resolver: None,
11002        cancellation: "per_call",
11003        side_effects: &[],
11004        recovery: "retry",
11005        collection_index_ref: "none",
11006    },
11007    CommandSemanticContract {
11008        command: Command::GetRuntimeStatus,
11009        admissible_errors: &[
11010            ErrorCode::Aborted,
11011            ErrorCode::DeadlineExceeded,
11012            ErrorCode::InvalidRequest,
11013            ErrorCode::UnsupportedVersion,
11014            ErrorCode::Unauthenticated,
11015            ErrorCode::PermissionDenied,
11016            ErrorCode::NotFound,
11017            ErrorCode::LimitExceeded,
11018            ErrorCode::CapabilityUnavailable,
11019            ErrorCode::TemporarilyUnavailable,
11020            ErrorCode::Internal,
11021        ],
11022        limit_ids: &["request_bytes", "response_bytes"],
11023        effect_class: "read_only",
11024        risk_flags: &[],
11025        capability_family: "catalog",
11026        retry_safety: "safe",
11027        identity_requirement: "none",
11028        resolver: None,
11029        cancellation: "per_call",
11030        side_effects: &[],
11031        recovery: "retry",
11032        collection_index_ref: "none",
11033    },
11034    CommandSemanticContract {
11035        command: Command::GetResultCacheStatus,
11036        admissible_errors: &[
11037            ErrorCode::Aborted,
11038            ErrorCode::DeadlineExceeded,
11039            ErrorCode::InvalidRequest,
11040            ErrorCode::UnsupportedVersion,
11041            ErrorCode::Unauthenticated,
11042            ErrorCode::PermissionDenied,
11043            ErrorCode::NotFound,
11044            ErrorCode::LimitExceeded,
11045            ErrorCode::CapabilityUnavailable,
11046            ErrorCode::TemporarilyUnavailable,
11047            ErrorCode::Internal,
11048        ],
11049        limit_ids: &["request_bytes", "response_bytes"],
11050        effect_class: "read_only",
11051        risk_flags: &[],
11052        capability_family: "catalog",
11053        retry_safety: "safe",
11054        identity_requirement: "none",
11055        resolver: None,
11056        cancellation: "per_call",
11057        side_effects: &[],
11058        recovery: "retry",
11059        collection_index_ref: "none",
11060    },
11061    CommandSemanticContract {
11062        command: Command::GetFieldPromotionStatus,
11063        admissible_errors: &[
11064            ErrorCode::Aborted,
11065            ErrorCode::DeadlineExceeded,
11066            ErrorCode::InvalidRequest,
11067            ErrorCode::UnsupportedVersion,
11068            ErrorCode::Unauthenticated,
11069            ErrorCode::PermissionDenied,
11070            ErrorCode::NotFound,
11071            ErrorCode::LimitExceeded,
11072            ErrorCode::CapabilityUnavailable,
11073            ErrorCode::TemporarilyUnavailable,
11074            ErrorCode::Internal,
11075        ],
11076        limit_ids: &["request_bytes", "response_bytes"],
11077        effect_class: "read_only",
11078        risk_flags: &[],
11079        capability_family: "catalog",
11080        retry_safety: "safe",
11081        identity_requirement: "none",
11082        resolver: None,
11083        cancellation: "per_call",
11084        side_effects: &[],
11085        recovery: "retry",
11086        collection_index_ref: "none",
11087    },
11088    CommandSemanticContract {
11089        command: Command::GetOverloadStatus,
11090        admissible_errors: &[
11091            ErrorCode::Aborted,
11092            ErrorCode::DeadlineExceeded,
11093            ErrorCode::InvalidRequest,
11094            ErrorCode::UnsupportedVersion,
11095            ErrorCode::Unauthenticated,
11096            ErrorCode::PermissionDenied,
11097            ErrorCode::NotFound,
11098            ErrorCode::LimitExceeded,
11099            ErrorCode::CapabilityUnavailable,
11100            ErrorCode::TemporarilyUnavailable,
11101            ErrorCode::Internal,
11102        ],
11103        limit_ids: &["request_bytes", "response_bytes"],
11104        effect_class: "read_only",
11105        risk_flags: &[],
11106        capability_family: "catalog",
11107        retry_safety: "safe",
11108        identity_requirement: "none",
11109        resolver: None,
11110        cancellation: "per_call",
11111        side_effects: &[],
11112        recovery: "retry",
11113        collection_index_ref: "none",
11114    },
11115    CommandSemanticContract {
11116        command: Command::ConfigureExternalKey,
11117        admissible_errors: &[
11118            ErrorCode::Aborted,
11119            ErrorCode::DeadlineExceeded,
11120            ErrorCode::InvalidRequest,
11121            ErrorCode::UnsupportedVersion,
11122            ErrorCode::Unauthenticated,
11123            ErrorCode::PermissionDenied,
11124            ErrorCode::NotFound,
11125            ErrorCode::Conflict,
11126            ErrorCode::LimitExceeded,
11127            ErrorCode::CapabilityUnavailable,
11128            ErrorCode::NotSubmitted,
11129            ErrorCode::SubmittedIndeterminate,
11130            ErrorCode::ExpiredUnknown,
11131            ErrorCode::TemporarilyUnavailable,
11132            ErrorCode::Internal,
11133        ],
11134        limit_ids: &["request_bytes", "response_bytes"],
11135        effect_class: "control_write",
11136        risk_flags: &[],
11137        capability_family: "lifecycle",
11138        retry_safety: "pre_submit_only",
11139        identity_requirement: "none",
11140        resolver: None,
11141        cancellation: "per_call_until_submission_then_resolve",
11142        side_effects: &["commits_authoritative_state"],
11143        recovery: "retry_if_not_submitted",
11144        collection_index_ref: "request_index",
11145    },
11146    CommandSemanticContract {
11147        command: Command::RotateExternalKeyBinding,
11148        admissible_errors: &[
11149            ErrorCode::Aborted,
11150            ErrorCode::DeadlineExceeded,
11151            ErrorCode::InvalidRequest,
11152            ErrorCode::UnsupportedVersion,
11153            ErrorCode::Unauthenticated,
11154            ErrorCode::PermissionDenied,
11155            ErrorCode::NotFound,
11156            ErrorCode::Conflict,
11157            ErrorCode::LimitExceeded,
11158            ErrorCode::CapabilityUnavailable,
11159            ErrorCode::NotSubmitted,
11160            ErrorCode::SubmittedIndeterminate,
11161            ErrorCode::ExpiredUnknown,
11162            ErrorCode::TemporarilyUnavailable,
11163            ErrorCode::Internal,
11164        ],
11165        limit_ids: &["request_bytes", "response_bytes"],
11166        effect_class: "control_write",
11167        risk_flags: &[],
11168        capability_family: "lifecycle",
11169        retry_safety: "pre_submit_only",
11170        identity_requirement: "none",
11171        resolver: None,
11172        cancellation: "per_call_until_submission_then_resolve",
11173        side_effects: &["commits_authoritative_state"],
11174        recovery: "retry_if_not_submitted",
11175        collection_index_ref: "request_index",
11176    },
11177    CommandSemanticContract {
11178        command: Command::ConfigureAggregateThenDelete,
11179        admissible_errors: &[
11180            ErrorCode::Aborted,
11181            ErrorCode::DeadlineExceeded,
11182            ErrorCode::InvalidRequest,
11183            ErrorCode::UnsupportedVersion,
11184            ErrorCode::Unauthenticated,
11185            ErrorCode::PermissionDenied,
11186            ErrorCode::NotFound,
11187            ErrorCode::Conflict,
11188            ErrorCode::LimitExceeded,
11189            ErrorCode::CapabilityUnavailable,
11190            ErrorCode::NotSubmitted,
11191            ErrorCode::SubmittedIndeterminate,
11192            ErrorCode::ExpiredUnknown,
11193            ErrorCode::TemporarilyUnavailable,
11194            ErrorCode::Internal,
11195        ],
11196        limit_ids: &["request_bytes", "response_bytes"],
11197        effect_class: "control_write",
11198        risk_flags: &["destructive"],
11199        capability_family: "lifecycle",
11200        retry_safety: "pre_submit_only",
11201        identity_requirement: "none",
11202        resolver: None,
11203        cancellation: "per_call_until_submission_then_resolve",
11204        side_effects: &["commits_authoritative_state"],
11205        recovery: "retry_if_not_submitted",
11206        collection_index_ref: "request_index",
11207    },
11208    CommandSemanticContract {
11209        command: Command::GetLifecycleStatus,
11210        admissible_errors: &[
11211            ErrorCode::Aborted,
11212            ErrorCode::DeadlineExceeded,
11213            ErrorCode::InvalidRequest,
11214            ErrorCode::UnsupportedVersion,
11215            ErrorCode::Unauthenticated,
11216            ErrorCode::PermissionDenied,
11217            ErrorCode::NotFound,
11218            ErrorCode::LimitExceeded,
11219            ErrorCode::CapabilityUnavailable,
11220            ErrorCode::TemporarilyUnavailable,
11221            ErrorCode::Internal,
11222        ],
11223        limit_ids: &["request_bytes", "response_bytes"],
11224        effect_class: "read_only",
11225        risk_flags: &[],
11226        capability_family: "catalog",
11227        retry_safety: "safe",
11228        identity_requirement: "none",
11229        resolver: None,
11230        cancellation: "per_call",
11231        side_effects: &[],
11232        recovery: "retry",
11233        collection_index_ref: "none",
11234    },
11235    CommandSemanticContract {
11236        command: Command::GetQuota,
11237        admissible_errors: &[
11238            ErrorCode::Aborted,
11239            ErrorCode::DeadlineExceeded,
11240            ErrorCode::InvalidRequest,
11241            ErrorCode::UnsupportedVersion,
11242            ErrorCode::Unauthenticated,
11243            ErrorCode::PermissionDenied,
11244            ErrorCode::NotFound,
11245            ErrorCode::LimitExceeded,
11246            ErrorCode::CapabilityUnavailable,
11247            ErrorCode::TemporarilyUnavailable,
11248            ErrorCode::Internal,
11249        ],
11250        limit_ids: &["request_bytes", "response_bytes"],
11251        effect_class: "read_only",
11252        risk_flags: &[],
11253        capability_family: "quota",
11254        retry_safety: "safe",
11255        identity_requirement: "none",
11256        resolver: None,
11257        cancellation: "per_call",
11258        side_effects: &[],
11259        recovery: "retry",
11260        collection_index_ref: "none",
11261    },
11262    CommandSemanticContract {
11263        command: Command::UpdateQuota,
11264        admissible_errors: &[
11265            ErrorCode::Aborted,
11266            ErrorCode::DeadlineExceeded,
11267            ErrorCode::InvalidRequest,
11268            ErrorCode::UnsupportedVersion,
11269            ErrorCode::Unauthenticated,
11270            ErrorCode::PermissionDenied,
11271            ErrorCode::NotFound,
11272            ErrorCode::Conflict,
11273            ErrorCode::LimitExceeded,
11274            ErrorCode::CapabilityUnavailable,
11275            ErrorCode::NotSubmitted,
11276            ErrorCode::SubmittedIndeterminate,
11277            ErrorCode::ExpiredUnknown,
11278            ErrorCode::TemporarilyUnavailable,
11279            ErrorCode::Internal,
11280        ],
11281        limit_ids: &["request_bytes", "response_bytes"],
11282        effect_class: "control_write",
11283        risk_flags: &[],
11284        capability_family: "quota",
11285        retry_safety: "pre_submit_only",
11286        identity_requirement: "none",
11287        resolver: None,
11288        cancellation: "per_call_until_submission_then_resolve",
11289        side_effects: &["commits_authoritative_state"],
11290        recovery: "retry_if_not_submitted",
11291        collection_index_ref: "none",
11292    },
11293    CommandSemanticContract {
11294        command: Command::GetBinding,
11295        admissible_errors: &[
11296            ErrorCode::Aborted,
11297            ErrorCode::DeadlineExceeded,
11298            ErrorCode::InvalidRequest,
11299            ErrorCode::UnsupportedVersion,
11300            ErrorCode::Unauthenticated,
11301            ErrorCode::PermissionDenied,
11302            ErrorCode::NotFound,
11303            ErrorCode::LimitExceeded,
11304            ErrorCode::CapabilityUnavailable,
11305            ErrorCode::TemporarilyUnavailable,
11306            ErrorCode::Internal,
11307        ],
11308        limit_ids: &["request_bytes", "response_bytes"],
11309        effect_class: "read_only",
11310        risk_flags: &[],
11311        capability_family: "runtime_control",
11312        retry_safety: "safe",
11313        identity_requirement: "none",
11314        resolver: None,
11315        cancellation: "per_call",
11316        side_effects: &[],
11317        recovery: "retry",
11318        collection_index_ref: "none",
11319    },
11320    CommandSemanticContract {
11321        command: Command::GetAdmissionStatus,
11322        admissible_errors: &[
11323            ErrorCode::Aborted,
11324            ErrorCode::DeadlineExceeded,
11325            ErrorCode::InvalidRequest,
11326            ErrorCode::UnsupportedVersion,
11327            ErrorCode::Unauthenticated,
11328            ErrorCode::PermissionDenied,
11329            ErrorCode::NotFound,
11330            ErrorCode::LimitExceeded,
11331            ErrorCode::CapabilityUnavailable,
11332            ErrorCode::TemporarilyUnavailable,
11333            ErrorCode::Internal,
11334        ],
11335        limit_ids: &["request_bytes", "response_bytes"],
11336        effect_class: "read_only",
11337        risk_flags: &[],
11338        capability_family: "runtime_control",
11339        retry_safety: "safe",
11340        identity_requirement: "none",
11341        resolver: None,
11342        cancellation: "per_call",
11343        side_effects: &[],
11344        recovery: "retry",
11345        collection_index_ref: "none",
11346    },
11347    CommandSemanticContract {
11348        command: Command::SetAdmission,
11349        admissible_errors: &[
11350            ErrorCode::Aborted,
11351            ErrorCode::DeadlineExceeded,
11352            ErrorCode::InvalidRequest,
11353            ErrorCode::UnsupportedVersion,
11354            ErrorCode::Unauthenticated,
11355            ErrorCode::PermissionDenied,
11356            ErrorCode::NotFound,
11357            ErrorCode::Conflict,
11358            ErrorCode::LimitExceeded,
11359            ErrorCode::CapabilityUnavailable,
11360            ErrorCode::NotSubmitted,
11361            ErrorCode::SubmittedIndeterminate,
11362            ErrorCode::ExpiredUnknown,
11363            ErrorCode::TemporarilyUnavailable,
11364            ErrorCode::Internal,
11365        ],
11366        limit_ids: &["request_bytes", "response_bytes"],
11367        effect_class: "control_write",
11368        risk_flags: &[],
11369        capability_family: "runtime_control",
11370        retry_safety: "pre_submit_only",
11371        identity_requirement: "none",
11372        resolver: None,
11373        cancellation: "per_call_until_submission_then_resolve",
11374        side_effects: &["commits_authoritative_state"],
11375        recovery: "retry_if_not_submitted",
11376        collection_index_ref: "none",
11377    },
11378    CommandSemanticContract {
11379        command: Command::GetQuiesceStatus,
11380        admissible_errors: &[
11381            ErrorCode::Aborted,
11382            ErrorCode::DeadlineExceeded,
11383            ErrorCode::InvalidRequest,
11384            ErrorCode::UnsupportedVersion,
11385            ErrorCode::Unauthenticated,
11386            ErrorCode::PermissionDenied,
11387            ErrorCode::NotFound,
11388            ErrorCode::LimitExceeded,
11389            ErrorCode::CapabilityUnavailable,
11390            ErrorCode::TemporarilyUnavailable,
11391            ErrorCode::Internal,
11392        ],
11393        limit_ids: &["request_bytes", "response_bytes"],
11394        effect_class: "read_only",
11395        risk_flags: &[],
11396        capability_family: "runtime_control",
11397        retry_safety: "safe",
11398        identity_requirement: "none",
11399        resolver: None,
11400        cancellation: "per_call",
11401        side_effects: &[],
11402        recovery: "retry",
11403        collection_index_ref: "none",
11404    },
11405    CommandSemanticContract {
11406        command: Command::GetDecommissionReadiness,
11407        admissible_errors: &[
11408            ErrorCode::Aborted,
11409            ErrorCode::DeadlineExceeded,
11410            ErrorCode::InvalidRequest,
11411            ErrorCode::UnsupportedVersion,
11412            ErrorCode::Unauthenticated,
11413            ErrorCode::PermissionDenied,
11414            ErrorCode::NotFound,
11415            ErrorCode::LimitExceeded,
11416            ErrorCode::CapabilityUnavailable,
11417            ErrorCode::TemporarilyUnavailable,
11418            ErrorCode::Internal,
11419        ],
11420        limit_ids: &["request_bytes", "response_bytes"],
11421        effect_class: "read_only",
11422        risk_flags: &[],
11423        capability_family: "runtime_control",
11424        retry_safety: "safe",
11425        identity_requirement: "none",
11426        resolver: None,
11427        cancellation: "per_call",
11428        side_effects: &[],
11429        recovery: "retry",
11430        collection_index_ref: "none",
11431    },
11432    CommandSemanticContract {
11433        command: Command::GetUpgradeReadiness,
11434        admissible_errors: &[
11435            ErrorCode::Aborted,
11436            ErrorCode::DeadlineExceeded,
11437            ErrorCode::InvalidRequest,
11438            ErrorCode::UnsupportedVersion,
11439            ErrorCode::Unauthenticated,
11440            ErrorCode::PermissionDenied,
11441            ErrorCode::NotFound,
11442            ErrorCode::LimitExceeded,
11443            ErrorCode::CapabilityUnavailable,
11444            ErrorCode::TemporarilyUnavailable,
11445            ErrorCode::Internal,
11446        ],
11447        limit_ids: &["request_bytes", "response_bytes"],
11448        effect_class: "read_only",
11449        risk_flags: &[],
11450        capability_family: "operations",
11451        retry_safety: "safe",
11452        identity_requirement: "none",
11453        resolver: None,
11454        cancellation: "per_call",
11455        side_effects: &[],
11456        recovery: "retry",
11457        collection_index_ref: "none",
11458    },
11459    CommandSemanticContract {
11460        command: Command::GetMaintenanceStatus,
11461        admissible_errors: &[
11462            ErrorCode::Aborted,
11463            ErrorCode::DeadlineExceeded,
11464            ErrorCode::InvalidRequest,
11465            ErrorCode::UnsupportedVersion,
11466            ErrorCode::Unauthenticated,
11467            ErrorCode::PermissionDenied,
11468            ErrorCode::NotFound,
11469            ErrorCode::StaleCursor,
11470            ErrorCode::LimitExceeded,
11471            ErrorCode::CapabilityUnavailable,
11472            ErrorCode::TemporarilyUnavailable,
11473            ErrorCode::Internal,
11474        ],
11475        limit_ids: &["request_bytes", "response_bytes", "page_size", "operation_page_size"],
11476        effect_class: "read_only",
11477        risk_flags: &[],
11478        capability_family: "operations",
11479        retry_safety: "safe",
11480        identity_requirement: "none",
11481        resolver: None,
11482        cancellation: "per_call",
11483        side_effects: &[],
11484        recovery: "retry",
11485        collection_index_ref: "optional_request_index",
11486    },
11487    CommandSemanticContract {
11488        command: Command::WarmVectorIndex,
11489        admissible_errors: &[
11490            ErrorCode::Aborted,
11491            ErrorCode::DeadlineExceeded,
11492            ErrorCode::InvalidRequest,
11493            ErrorCode::UnsupportedVersion,
11494            ErrorCode::Unauthenticated,
11495            ErrorCode::PermissionDenied,
11496            ErrorCode::NotFound,
11497            ErrorCode::Conflict,
11498            ErrorCode::LimitExceeded,
11499            ErrorCode::CapabilityUnavailable,
11500            ErrorCode::TemporarilyUnavailable,
11501            ErrorCode::Internal,
11502        ],
11503        limit_ids: &[
11504            "request_bytes",
11505            "response_bytes",
11506            "vector_warm_components",
11507            "vector_warm_requests",
11508            "vector_warm_bytes",
11509            "vector_warm_achievements",
11510            "vector_warm_ttl_millis",
11511        ],
11512        effect_class: "read_only",
11513        risk_flags: &[],
11514        capability_family: "data",
11515        retry_safety: "safe",
11516        identity_requirement: "exact_root",
11517        resolver: None,
11518        cancellation: "per_call",
11519        side_effects: &["populates_reconstructible_cache"],
11520        recovery: "retry",
11521        collection_index_ref: "request_index",
11522    },
11523    CommandSemanticContract {
11524        command: Command::EvaluateVectorRecall,
11525        admissible_errors: &[
11526            ErrorCode::Aborted,
11527            ErrorCode::DeadlineExceeded,
11528            ErrorCode::InvalidRequest,
11529            ErrorCode::UnsupportedVersion,
11530            ErrorCode::Unauthenticated,
11531            ErrorCode::PermissionDenied,
11532            ErrorCode::NotFound,
11533            ErrorCode::Conflict,
11534            ErrorCode::LimitExceeded,
11535            ErrorCode::CapabilityUnavailable,
11536            ErrorCode::NotSubmitted,
11537            ErrorCode::SubmittedIndeterminate,
11538            ErrorCode::ExpiredUnknown,
11539            ErrorCode::TemporarilyUnavailable,
11540            ErrorCode::Internal,
11541        ],
11542        limit_ids: &[
11543            "request_bytes",
11544            "response_bytes",
11545            "vector_dimensions",
11546            "vector_query_bytes",
11547            "vector_request_bytes",
11548            "vector_candidates",
11549            "vector_evaluation_queries",
11550            "vector_evaluation_k",
11551            "vector_evaluation_artifact_bytes",
11552        ],
11553        effect_class: "durable_submit",
11554        risk_flags: &[],
11555        capability_family: "diagnostics",
11556        retry_safety: "pre_submit_only",
11557        identity_requirement: "caller_action_id",
11558        resolver: None,
11559        cancellation: "per_call_until_submission_then_resolve",
11560        side_effects: &["commits_authoritative_state"],
11561        recovery: "retry_if_not_submitted",
11562        collection_index_ref: "request_index",
11563    },
11564    CommandSemanticContract {
11565        command: Command::CalibrateVectorStrategy,
11566        admissible_errors: &[
11567            ErrorCode::Aborted,
11568            ErrorCode::DeadlineExceeded,
11569            ErrorCode::InvalidRequest,
11570            ErrorCode::UnsupportedVersion,
11571            ErrorCode::Unauthenticated,
11572            ErrorCode::PermissionDenied,
11573            ErrorCode::NotFound,
11574            ErrorCode::Conflict,
11575            ErrorCode::LimitExceeded,
11576            ErrorCode::CapabilityUnavailable,
11577            ErrorCode::NotSubmitted,
11578            ErrorCode::SubmittedIndeterminate,
11579            ErrorCode::ExpiredUnknown,
11580            ErrorCode::TemporarilyUnavailable,
11581            ErrorCode::Internal,
11582        ],
11583        limit_ids: &[
11584            "request_bytes",
11585            "response_bytes",
11586            "vector_dimensions",
11587            "vector_query_bytes",
11588            "vector_request_bytes",
11589            "vector_candidates",
11590            "vector_evaluation_queries",
11591            "vector_evaluation_k",
11592            "vector_evaluation_profiles",
11593            "vector_evaluation_artifact_bytes",
11594        ],
11595        effect_class: "durable_submit",
11596        risk_flags: &[],
11597        capability_family: "diagnostics",
11598        retry_safety: "pre_submit_only",
11599        identity_requirement: "caller_action_id",
11600        resolver: None,
11601        cancellation: "per_call_until_submission_then_resolve",
11602        side_effects: &["commits_authoritative_state"],
11603        recovery: "retry_if_not_submitted",
11604        collection_index_ref: "request_index",
11605    },
11606    CommandSemanticContract {
11607        command: Command::GetVectorDiagnostic,
11608        admissible_errors: &[
11609            ErrorCode::Aborted,
11610            ErrorCode::DeadlineExceeded,
11611            ErrorCode::InvalidRequest,
11612            ErrorCode::UnsupportedVersion,
11613            ErrorCode::Unauthenticated,
11614            ErrorCode::PermissionDenied,
11615            ErrorCode::NotFound,
11616            ErrorCode::LimitExceeded,
11617            ErrorCode::CapabilityUnavailable,
11618            ErrorCode::TemporarilyUnavailable,
11619            ErrorCode::Internal,
11620        ],
11621        limit_ids: &["request_bytes", "response_bytes"],
11622        effect_class: "read_only",
11623        risk_flags: &[],
11624        capability_family: "diagnostics",
11625        retry_safety: "safe",
11626        identity_requirement: "request_locator",
11627        resolver: None,
11628        cancellation: "per_call",
11629        side_effects: &[],
11630        recovery: "retry",
11631        collection_index_ref: "none",
11632    },
11633    CommandSemanticContract {
11634        command: Command::CreateDiagnostic,
11635        admissible_errors: &[
11636            ErrorCode::Aborted,
11637            ErrorCode::DeadlineExceeded,
11638            ErrorCode::InvalidRequest,
11639            ErrorCode::UnsupportedVersion,
11640            ErrorCode::Unauthenticated,
11641            ErrorCode::PermissionDenied,
11642            ErrorCode::NotFound,
11643            ErrorCode::Conflict,
11644            ErrorCode::LimitExceeded,
11645            ErrorCode::CapabilityUnavailable,
11646            ErrorCode::NotSubmitted,
11647            ErrorCode::SubmittedIndeterminate,
11648            ErrorCode::ExpiredUnknown,
11649            ErrorCode::TemporarilyUnavailable,
11650            ErrorCode::Internal,
11651        ],
11652        limit_ids: &["request_bytes", "response_bytes"],
11653        effect_class: "durable_submit",
11654        risk_flags: &[],
11655        capability_family: "diagnostics",
11656        retry_safety: "pre_submit_only",
11657        identity_requirement: "none",
11658        resolver: None,
11659        cancellation: "per_call_until_submission_then_resolve",
11660        side_effects: &["commits_authoritative_state"],
11661        recovery: "retry_if_not_submitted",
11662        collection_index_ref: "none",
11663    },
11664    CommandSemanticContract {
11665        command: Command::GetDiagnostic,
11666        admissible_errors: &[
11667            ErrorCode::Aborted,
11668            ErrorCode::DeadlineExceeded,
11669            ErrorCode::InvalidRequest,
11670            ErrorCode::UnsupportedVersion,
11671            ErrorCode::Unauthenticated,
11672            ErrorCode::PermissionDenied,
11673            ErrorCode::NotFound,
11674            ErrorCode::LimitExceeded,
11675            ErrorCode::CapabilityUnavailable,
11676            ErrorCode::TemporarilyUnavailable,
11677            ErrorCode::Internal,
11678        ],
11679        limit_ids: &["request_bytes", "response_bytes"],
11680        effect_class: "read_only",
11681        risk_flags: &[],
11682        capability_family: "diagnostics",
11683        retry_safety: "safe",
11684        identity_requirement: "request_locator",
11685        resolver: None,
11686        cancellation: "per_call",
11687        side_effects: &[],
11688        recovery: "retry",
11689        collection_index_ref: "none",
11690    },
11691    CommandSemanticContract {
11692        command: Command::PrepareCollectionExport,
11693        admissible_errors: &[
11694            ErrorCode::Aborted,
11695            ErrorCode::DeadlineExceeded,
11696            ErrorCode::InvalidRequest,
11697            ErrorCode::UnsupportedVersion,
11698            ErrorCode::Unauthenticated,
11699            ErrorCode::PermissionDenied,
11700            ErrorCode::NotFound,
11701            ErrorCode::LimitExceeded,
11702            ErrorCode::CapabilityUnavailable,
11703            ErrorCode::TemporarilyUnavailable,
11704            ErrorCode::Internal,
11705        ],
11706        limit_ids: &[
11707            "request_bytes",
11708            "response_bytes",
11709            "collection_export_bytes",
11710            "portability_prefix_bytes",
11711        ],
11712        effect_class: "prepare",
11713        risk_flags: &[],
11714        capability_family: "portability",
11715        retry_safety: "safe",
11716        identity_requirement: "caller_action_id",
11717        resolver: None,
11718        cancellation: "per_call",
11719        side_effects: &[],
11720        recovery: "retry",
11721        collection_index_ref: "none",
11722    },
11723    CommandSemanticContract {
11724        command: Command::StartCollectionExport,
11725        admissible_errors: &[
11726            ErrorCode::Aborted,
11727            ErrorCode::DeadlineExceeded,
11728            ErrorCode::InvalidRequest,
11729            ErrorCode::UnsupportedVersion,
11730            ErrorCode::Unauthenticated,
11731            ErrorCode::PermissionDenied,
11732            ErrorCode::NotFound,
11733            ErrorCode::Conflict,
11734            ErrorCode::LimitExceeded,
11735            ErrorCode::CapabilityUnavailable,
11736            ErrorCode::NotSubmitted,
11737            ErrorCode::SubmittedIndeterminate,
11738            ErrorCode::ExpiredUnknown,
11739            ErrorCode::TemporarilyUnavailable,
11740            ErrorCode::Internal,
11741        ],
11742        limit_ids: &[
11743            "request_bytes",
11744            "response_bytes",
11745            "collection_export_bytes",
11746            "collection_export_documents",
11747            "portability_prefix_bytes",
11748        ],
11749        effect_class: "durable_submit",
11750        risk_flags: &[],
11751        capability_family: "portability",
11752        retry_safety: "pre_submit_only",
11753        identity_requirement: "caller_action_id",
11754        resolver: Some(Command::ResolveCollectionExport),
11755        cancellation: "per_call_until_submission_then_resolve",
11756        side_effects: &["commits_authoritative_state", "writes_external_artifact"],
11757        recovery: "resolve_with_resolve_collection_export",
11758        collection_index_ref: "none",
11759    },
11760    CommandSemanticContract {
11761        command: Command::ResolveCollectionExport,
11762        admissible_errors: &[
11763            ErrorCode::Aborted,
11764            ErrorCode::DeadlineExceeded,
11765            ErrorCode::InvalidRequest,
11766            ErrorCode::UnsupportedVersion,
11767            ErrorCode::Unauthenticated,
11768            ErrorCode::PermissionDenied,
11769            ErrorCode::NotFound,
11770            ErrorCode::LimitExceeded,
11771            ErrorCode::CapabilityUnavailable,
11772            ErrorCode::TemporarilyUnavailable,
11773            ErrorCode::Internal,
11774        ],
11775        limit_ids: &["request_bytes", "response_bytes", "portability_prefix_bytes"],
11776        effect_class: "read_only",
11777        risk_flags: &[],
11778        capability_family: "portability",
11779        retry_safety: "safe",
11780        identity_requirement: "caller_action_id",
11781        resolver: None,
11782        cancellation: "per_call",
11783        side_effects: &[],
11784        recovery: "retry",
11785        collection_index_ref: "none",
11786    },
11787    CommandSemanticContract {
11788        command: Command::VerifyCollectionExport,
11789        admissible_errors: &[
11790            ErrorCode::Aborted,
11791            ErrorCode::DeadlineExceeded,
11792            ErrorCode::InvalidRequest,
11793            ErrorCode::UnsupportedVersion,
11794            ErrorCode::Unauthenticated,
11795            ErrorCode::PermissionDenied,
11796            ErrorCode::NotFound,
11797            ErrorCode::LimitExceeded,
11798            ErrorCode::CapabilityUnavailable,
11799            ErrorCode::ChecksumMismatch,
11800            ErrorCode::TemporarilyUnavailable,
11801            ErrorCode::Internal,
11802        ],
11803        limit_ids: &[
11804            "request_bytes",
11805            "response_bytes",
11806            "collection_export_bytes",
11807            "portability_prefix_bytes",
11808        ],
11809        effect_class: "read_only",
11810        risk_flags: &[],
11811        capability_family: "portability",
11812        retry_safety: "safe",
11813        identity_requirement: "request_locator",
11814        resolver: None,
11815        cancellation: "per_call",
11816        side_effects: &[],
11817        recovery: "retry",
11818        collection_index_ref: "none",
11819    },
11820    CommandSemanticContract {
11821        command: Command::PrepareCollectionRestore,
11822        admissible_errors: &[
11823            ErrorCode::Aborted,
11824            ErrorCode::DeadlineExceeded,
11825            ErrorCode::InvalidRequest,
11826            ErrorCode::UnsupportedVersion,
11827            ErrorCode::Unauthenticated,
11828            ErrorCode::PermissionDenied,
11829            ErrorCode::NotFound,
11830            ErrorCode::Conflict,
11831            ErrorCode::LimitExceeded,
11832            ErrorCode::CapabilityUnavailable,
11833            ErrorCode::ChecksumMismatch,
11834            ErrorCode::TemporarilyUnavailable,
11835            ErrorCode::Internal,
11836        ],
11837        limit_ids: &[
11838            "request_bytes",
11839            "response_bytes",
11840            "collection_export_bytes",
11841            "portability_prefix_bytes",
11842        ],
11843        effect_class: "prepare",
11844        risk_flags: &[],
11845        capability_family: "portability",
11846        retry_safety: "safe",
11847        identity_requirement: "caller_action_id",
11848        resolver: None,
11849        cancellation: "per_call",
11850        side_effects: &[],
11851        recovery: "retry",
11852        collection_index_ref: "none",
11853    },
11854    CommandSemanticContract {
11855        command: Command::StartCollectionRestore,
11856        admissible_errors: &[
11857            ErrorCode::Aborted,
11858            ErrorCode::DeadlineExceeded,
11859            ErrorCode::InvalidRequest,
11860            ErrorCode::UnsupportedVersion,
11861            ErrorCode::Unauthenticated,
11862            ErrorCode::PermissionDenied,
11863            ErrorCode::NotFound,
11864            ErrorCode::Conflict,
11865            ErrorCode::LimitExceeded,
11866            ErrorCode::CapabilityUnavailable,
11867            ErrorCode::NotSubmitted,
11868            ErrorCode::SubmittedIndeterminate,
11869            ErrorCode::ExpiredUnknown,
11870            ErrorCode::ChecksumMismatch,
11871            ErrorCode::TemporarilyUnavailable,
11872            ErrorCode::Internal,
11873        ],
11874        limit_ids: &[
11875            "request_bytes",
11876            "response_bytes",
11877            "collection_export_bytes",
11878            "collection_export_documents",
11879            "portability_prefix_bytes",
11880        ],
11881        effect_class: "durable_submit",
11882        risk_flags: &[],
11883        capability_family: "portability",
11884        retry_safety: "pre_submit_only",
11885        identity_requirement: "caller_action_id",
11886        resolver: Some(Command::ResolveCollectionRestore),
11887        cancellation: "per_call_until_submission_then_resolve",
11888        side_effects: &["commits_authoritative_state", "creates_destination_owned_data"],
11889        recovery: "resolve_with_resolve_collection_restore",
11890        collection_index_ref: "none",
11891    },
11892    CommandSemanticContract {
11893        command: Command::ResolveCollectionRestore,
11894        admissible_errors: &[
11895            ErrorCode::Aborted,
11896            ErrorCode::DeadlineExceeded,
11897            ErrorCode::InvalidRequest,
11898            ErrorCode::UnsupportedVersion,
11899            ErrorCode::Unauthenticated,
11900            ErrorCode::PermissionDenied,
11901            ErrorCode::NotFound,
11902            ErrorCode::LimitExceeded,
11903            ErrorCode::CapabilityUnavailable,
11904            ErrorCode::TemporarilyUnavailable,
11905            ErrorCode::Internal,
11906        ],
11907        limit_ids: &["request_bytes", "response_bytes", "portability_prefix_bytes"],
11908        effect_class: "read_only",
11909        risk_flags: &[],
11910        capability_family: "portability",
11911        retry_safety: "safe",
11912        identity_requirement: "caller_action_id",
11913        resolver: None,
11914        cancellation: "per_call",
11915        side_effects: &[],
11916        recovery: "retry",
11917        collection_index_ref: "none",
11918    },
11919    CommandSemanticContract {
11920        command: Command::ReadArtifactChunk,
11921        admissible_errors: &[
11922            ErrorCode::Aborted,
11923            ErrorCode::DeadlineExceeded,
11924            ErrorCode::InvalidRequest,
11925            ErrorCode::UnsupportedVersion,
11926            ErrorCode::Unauthenticated,
11927            ErrorCode::PermissionDenied,
11928            ErrorCode::NotFound,
11929            ErrorCode::LimitExceeded,
11930            ErrorCode::CapabilityUnavailable,
11931            ErrorCode::ArtifactRangeInvalid,
11932            ErrorCode::ChecksumMismatch,
11933            ErrorCode::TemporarilyUnavailable,
11934            ErrorCode::Internal,
11935        ],
11936        limit_ids: &["request_bytes", "response_bytes", "artifact_chunk_bytes"],
11937        effect_class: "read_only",
11938        risk_flags: &[],
11939        capability_family: "operations",
11940        retry_safety: "safe",
11941        identity_requirement: "none",
11942        resolver: None,
11943        cancellation: "per_call",
11944        side_effects: &[],
11945        recovery: "retry",
11946        collection_index_ref: "none",
11947    },
11948    CommandSemanticContract {
11949        command: Command::ExportUsage,
11950        admissible_errors: &[
11951            ErrorCode::Aborted,
11952            ErrorCode::DeadlineExceeded,
11953            ErrorCode::InvalidRequest,
11954            ErrorCode::UnsupportedVersion,
11955            ErrorCode::Unauthenticated,
11956            ErrorCode::PermissionDenied,
11957            ErrorCode::NotFound,
11958            ErrorCode::StaleCursor,
11959            ErrorCode::RestartBudgetExhausted,
11960            ErrorCode::LimitExceeded,
11961            ErrorCode::CapabilityUnavailable,
11962            ErrorCode::TemporarilyUnavailable,
11963            ErrorCode::Internal,
11964        ],
11965        limit_ids: &["request_bytes", "response_bytes", "page_size"],
11966        effect_class: "read_only",
11967        risk_flags: &[],
11968        capability_family: "usage",
11969        retry_safety: "safe",
11970        identity_requirement: "none",
11971        resolver: None,
11972        cancellation: "per_call",
11973        side_effects: &[],
11974        recovery: "retry",
11975        collection_index_ref: "none",
11976    },
11977    CommandSemanticContract {
11978        command: Command::ExecuteStateRead,
11979        admissible_errors: &[
11980            ErrorCode::Aborted,
11981            ErrorCode::DeadlineExceeded,
11982            ErrorCode::InvalidRequest,
11983            ErrorCode::UnsupportedVersion,
11984            ErrorCode::Unauthenticated,
11985            ErrorCode::PermissionDenied,
11986            ErrorCode::NotFound,
11987            ErrorCode::LimitExceeded,
11988            ErrorCode::CapabilityUnavailable,
11989            ErrorCode::TemporarilyUnavailable,
11990            ErrorCode::Internal,
11991        ],
11992        limit_ids: &[
11993            "request_bytes",
11994            "response_bytes",
11995            "state_command_keys",
11996            "state_command_value_bytes",
11997        ],
11998        effect_class: "read_only",
11999        risk_flags: &[],
12000        capability_family: "data",
12001        retry_safety: "safe",
12002        identity_requirement: "none",
12003        resolver: None,
12004        cancellation: "per_call",
12005        side_effects: &[],
12006        recovery: "retry",
12007        collection_index_ref: "request_index",
12008    },
12009    CommandSemanticContract {
12010        command: Command::PrepareStateWrite,
12011        admissible_errors: &[
12012            ErrorCode::Aborted,
12013            ErrorCode::DeadlineExceeded,
12014            ErrorCode::InvalidRequest,
12015            ErrorCode::UnsupportedVersion,
12016            ErrorCode::Unauthenticated,
12017            ErrorCode::PermissionDenied,
12018            ErrorCode::NotFound,
12019            ErrorCode::LimitExceeded,
12020            ErrorCode::CapabilityUnavailable,
12021            ErrorCode::TemporarilyUnavailable,
12022            ErrorCode::Internal,
12023        ],
12024        limit_ids: &[
12025            "request_bytes",
12026            "response_bytes",
12027            "state_command_keys",
12028            "state_command_value_bytes",
12029        ],
12030        effect_class: "prepare",
12031        risk_flags: &[],
12032        capability_family: "data",
12033        retry_safety: "safe",
12034        identity_requirement: "caller_action_id",
12035        resolver: None,
12036        cancellation: "per_call",
12037        side_effects: &["creates_bounded_preparation"],
12038        recovery: "retry",
12039        collection_index_ref: "request_index",
12040    },
12041    CommandSemanticContract {
12042        command: Command::SubmitStateWrite,
12043        admissible_errors: &[
12044            ErrorCode::Aborted,
12045            ErrorCode::DeadlineExceeded,
12046            ErrorCode::InvalidRequest,
12047            ErrorCode::UnsupportedVersion,
12048            ErrorCode::Unauthenticated,
12049            ErrorCode::PermissionDenied,
12050            ErrorCode::NotFound,
12051            ErrorCode::Conflict,
12052            ErrorCode::LimitExceeded,
12053            ErrorCode::CapabilityUnavailable,
12054            ErrorCode::NotSubmitted,
12055            ErrorCode::SubmittedIndeterminate,
12056            ErrorCode::ExpiredUnknown,
12057            ErrorCode::TemporarilyUnavailable,
12058            ErrorCode::Internal,
12059        ],
12060        limit_ids: &[
12061            "request_bytes",
12062            "response_bytes",
12063            "state_command_keys",
12064            "state_command_value_bytes",
12065        ],
12066        effect_class: "durable_submit",
12067        risk_flags: &[],
12068        capability_family: "data",
12069        retry_safety: "pre_submit_only",
12070        identity_requirement: "request_locator",
12071        resolver: Some(Command::ResolveStateWrite),
12072        cancellation: "per_call_until_submission_then_resolve",
12073        side_effects: &["commits_authoritative_state"],
12074        recovery: "resolve_with_resolve_state_write",
12075        collection_index_ref: "request_index",
12076    },
12077    CommandSemanticContract {
12078        command: Command::ResolveStateWrite,
12079        admissible_errors: &[
12080            ErrorCode::Aborted,
12081            ErrorCode::DeadlineExceeded,
12082            ErrorCode::InvalidRequest,
12083            ErrorCode::UnsupportedVersion,
12084            ErrorCode::Unauthenticated,
12085            ErrorCode::PermissionDenied,
12086            ErrorCode::NotFound,
12087            ErrorCode::LimitExceeded,
12088            ErrorCode::CapabilityUnavailable,
12089            ErrorCode::TemporarilyUnavailable,
12090            ErrorCode::Internal,
12091        ],
12092        limit_ids: &[
12093            "request_bytes",
12094            "response_bytes",
12095            "state_command_keys",
12096            "state_command_value_bytes",
12097        ],
12098        effect_class: "read_only",
12099        risk_flags: &[],
12100        capability_family: "data",
12101        retry_safety: "safe",
12102        identity_requirement: "request_locator",
12103        resolver: None,
12104        cancellation: "per_call",
12105        side_effects: &[],
12106        recovery: "retry",
12107        collection_index_ref: "request_index",
12108    },
12109];
12110#[derive(Clone, Copy, Debug, Eq, PartialEq)]
12111pub struct CommandOutcomeContract {
12112    pub command: Command,
12113    pub possible_submission_states: &'static [&'static str],
12114    pub identity_requirement: &'static str,
12115    pub resolver_command: Option<Command>,
12116    pub cancellation: &'static str,
12117}
12118pub const LODESTONE_API_COMMAND_OUTCOMES: &[CommandOutcomeContract] = &[
12119    CommandOutcomeContract {
12120        command: Command::Discover,
12121        possible_submission_states: &["not_submitted", "resolved"],
12122        identity_requirement: "none",
12123        resolver_command: None,
12124        cancellation: "per_call",
12125    },
12126    CommandOutcomeContract {
12127        command: Command::ListIndexes,
12128        possible_submission_states: &["not_submitted", "resolved"],
12129        identity_requirement: "none",
12130        resolver_command: None,
12131        cancellation: "per_call",
12132    },
12133    CommandOutcomeContract {
12134        command: Command::GetIndex,
12135        possible_submission_states: &["not_submitted", "resolved"],
12136        identity_requirement: "none",
12137        resolver_command: None,
12138        cancellation: "per_call",
12139    },
12140    CommandOutcomeContract {
12141        command: Command::ValidateIndexChange,
12142        possible_submission_states: &["not_submitted", "resolved"],
12143        identity_requirement: "none",
12144        resolver_command: None,
12145        cancellation: "per_call",
12146    },
12147    CommandOutcomeContract {
12148        command: Command::ApplyIndexChange,
12149        possible_submission_states: &["not_submitted", "submitted", "indeterminate", "resolved"],
12150        identity_requirement: "caller_action_id",
12151        resolver_command: None,
12152        cancellation: "per_call_until_submission_then_resolve",
12153    },
12154    CommandOutcomeContract {
12155        command: Command::ApplyAdministrationMutation,
12156        possible_submission_states: &["not_submitted", "submitted", "indeterminate", "resolved"],
12157        identity_requirement: "caller_action_id",
12158        resolver_command: None,
12159        cancellation: "per_call_until_submission_then_resolve",
12160    },
12161    CommandOutcomeContract {
12162        command: Command::ListAliases,
12163        possible_submission_states: &["not_submitted", "resolved"],
12164        identity_requirement: "none",
12165        resolver_command: None,
12166        cancellation: "per_call",
12167    },
12168    CommandOutcomeContract {
12169        command: Command::GetAlias,
12170        possible_submission_states: &["not_submitted", "resolved"],
12171        identity_requirement: "none",
12172        resolver_command: None,
12173        cancellation: "per_call",
12174    },
12175    CommandOutcomeContract {
12176        command: Command::ListDataStreams,
12177        possible_submission_states: &["not_submitted", "resolved"],
12178        identity_requirement: "none",
12179        resolver_command: None,
12180        cancellation: "per_call",
12181    },
12182    CommandOutcomeContract {
12183        command: Command::GetDataStream,
12184        possible_submission_states: &["not_submitted", "resolved"],
12185        identity_requirement: "none",
12186        resolver_command: None,
12187        cancellation: "per_call",
12188    },
12189    CommandOutcomeContract {
12190        command: Command::ListComponentTemplates,
12191        possible_submission_states: &["not_submitted", "resolved"],
12192        identity_requirement: "none",
12193        resolver_command: None,
12194        cancellation: "per_call",
12195    },
12196    CommandOutcomeContract {
12197        command: Command::GetComponentTemplate,
12198        possible_submission_states: &["not_submitted", "resolved"],
12199        identity_requirement: "none",
12200        resolver_command: None,
12201        cancellation: "per_call",
12202    },
12203    CommandOutcomeContract {
12204        command: Command::ListIndexTemplates,
12205        possible_submission_states: &["not_submitted", "resolved"],
12206        identity_requirement: "none",
12207        resolver_command: None,
12208        cancellation: "per_call",
12209    },
12210    CommandOutcomeContract {
12211        command: Command::GetIndexTemplate,
12212        possible_submission_states: &["not_submitted", "resolved"],
12213        identity_requirement: "none",
12214        resolver_command: None,
12215        cancellation: "per_call",
12216    },
12217    CommandOutcomeContract {
12218        command: Command::ListIngestPipelines,
12219        possible_submission_states: &["not_submitted", "resolved"],
12220        identity_requirement: "none",
12221        resolver_command: None,
12222        cancellation: "per_call",
12223    },
12224    CommandOutcomeContract {
12225        command: Command::GetIngestPipeline,
12226        possible_submission_states: &["not_submitted", "resolved"],
12227        identity_requirement: "none",
12228        resolver_command: None,
12229        cancellation: "per_call",
12230    },
12231    CommandOutcomeContract {
12232        command: Command::SimulateIngestPipeline,
12233        possible_submission_states: &["not_submitted", "resolved"],
12234        identity_requirement: "none",
12235        resolver_command: None,
12236        cancellation: "per_call",
12237    },
12238    CommandOutcomeContract {
12239        command: Command::ReprocessByQuery,
12240        possible_submission_states: &[
12241            "not_submitted",
12242            "submitted",
12243            "known_retired",
12244            "indeterminate",
12245            "resolved",
12246        ],
12247        identity_requirement: "caller_action_id",
12248        resolver_command: None,
12249        cancellation: "per_call_until_submission_then_resolve",
12250    },
12251    CommandOutcomeContract {
12252        command: Command::ListLifecyclePolicies,
12253        possible_submission_states: &["not_submitted", "resolved"],
12254        identity_requirement: "none",
12255        resolver_command: None,
12256        cancellation: "per_call",
12257    },
12258    CommandOutcomeContract {
12259        command: Command::GetLifecyclePolicy,
12260        possible_submission_states: &["not_submitted", "resolved"],
12261        identity_requirement: "none",
12262        resolver_command: None,
12263        cancellation: "per_call",
12264    },
12265    CommandOutcomeContract {
12266        command: Command::PrepareCreateIndex,
12267        possible_submission_states: &["not_submitted", "resolved"],
12268        identity_requirement: "server_locator",
12269        resolver_command: None,
12270        cancellation: "per_call",
12271    },
12272    CommandOutcomeContract {
12273        command: Command::PrepareDeleteIndex,
12274        possible_submission_states: &["not_submitted", "resolved"],
12275        identity_requirement: "server_locator",
12276        resolver_command: None,
12277        cancellation: "per_call",
12278    },
12279    CommandOutcomeContract {
12280        command: Command::SubmitCatalogAction,
12281        possible_submission_states: &[
12282            "not_submitted",
12283            "submitted",
12284            "known_retired",
12285            "indeterminate",
12286            "resolved",
12287        ],
12288        identity_requirement: "request_locator",
12289        resolver_command: Some(Command::ResolveCatalogAction),
12290        cancellation: "per_call_until_submission_then_resolve",
12291    },
12292    CommandOutcomeContract {
12293        command: Command::ResolveCatalogAction,
12294        possible_submission_states: &["not_submitted", "resolved"],
12295        identity_requirement: "request_locator",
12296        resolver_command: None,
12297        cancellation: "per_call",
12298    },
12299    CommandOutcomeContract {
12300        command: Command::PrepareReplayableSourceIndex,
12301        possible_submission_states: &["not_submitted", "resolved"],
12302        identity_requirement: "server_locator",
12303        resolver_command: None,
12304        cancellation: "per_call",
12305    },
12306    CommandOutcomeContract {
12307        command: Command::SubmitReplayableSourceIndex,
12308        possible_submission_states: &[
12309            "not_submitted",
12310            "submitted",
12311            "known_retired",
12312            "indeterminate",
12313            "resolved",
12314        ],
12315        identity_requirement: "request_locator",
12316        resolver_command: Some(Command::ResolveCatalogAction),
12317        cancellation: "per_call_until_submission_then_resolve",
12318    },
12319    CommandOutcomeContract {
12320        command: Command::GetReplayableSource,
12321        possible_submission_states: &["not_submitted", "resolved"],
12322        identity_requirement: "none",
12323        resolver_command: None,
12324        cancellation: "per_call",
12325    },
12326    CommandOutcomeContract {
12327        command: Command::ControlReplayableSource,
12328        possible_submission_states: &["not_submitted", "submitted", "indeterminate", "resolved"],
12329        identity_requirement: "none",
12330        resolver_command: None,
12331        cancellation: "per_call_until_submission_then_resolve",
12332    },
12333    CommandOutcomeContract {
12334        command: Command::CloneIndex,
12335        possible_submission_states: &[
12336            "not_submitted",
12337            "submitted",
12338            "known_retired",
12339            "indeterminate",
12340            "resolved",
12341        ],
12342        identity_requirement: "caller_action_id",
12343        resolver_command: Some(Command::CloneIndex),
12344        cancellation: "per_call_until_submission_then_resolve",
12345    },
12346    CommandOutcomeContract {
12347        command: Command::ConfigureHistory,
12348        possible_submission_states: &[
12349            "not_submitted",
12350            "submitted",
12351            "known_retired",
12352            "indeterminate",
12353            "resolved",
12354        ],
12355        identity_requirement: "none",
12356        resolver_command: Some(Command::GetHistory),
12357        cancellation: "per_call_until_submission_then_resolve",
12358    },
12359    CommandOutcomeContract {
12360        command: Command::GetHistory,
12361        possible_submission_states: &["not_submitted", "resolved"],
12362        identity_requirement: "none",
12363        resolver_command: None,
12364        cancellation: "per_call",
12365    },
12366    CommandOutcomeContract {
12367        command: Command::ResolveHistory,
12368        possible_submission_states: &["not_submitted", "resolved"],
12369        identity_requirement: "none",
12370        resolver_command: None,
12371        cancellation: "per_call",
12372    },
12373    CommandOutcomeContract {
12374        command: Command::PlaceHistoryHold,
12375        possible_submission_states: &[
12376            "not_submitted",
12377            "submitted",
12378            "known_retired",
12379            "indeterminate",
12380            "resolved",
12381        ],
12382        identity_requirement: "none",
12383        resolver_command: Some(Command::GetHistory),
12384        cancellation: "per_call_until_submission_then_resolve",
12385    },
12386    CommandOutcomeContract {
12387        command: Command::ReleaseHistoryHold,
12388        possible_submission_states: &[
12389            "not_submitted",
12390            "submitted",
12391            "known_retired",
12392            "indeterminate",
12393            "resolved",
12394        ],
12395        identity_requirement: "none",
12396        resolver_command: Some(Command::GetHistory),
12397        cancellation: "per_call_until_submission_then_resolve",
12398    },
12399    CommandOutcomeContract {
12400        command: Command::PrepareDocumentMutation,
12401        possible_submission_states: &["not_submitted", "resolved"],
12402        identity_requirement: "server_locator",
12403        resolver_command: None,
12404        cancellation: "per_call",
12405    },
12406    CommandOutcomeContract {
12407        command: Command::SubmitDocumentMutation,
12408        possible_submission_states: &[
12409            "not_submitted",
12410            "submitted",
12411            "known_retired",
12412            "indeterminate",
12413            "resolved",
12414        ],
12415        identity_requirement: "request_locator",
12416        resolver_command: Some(Command::ResolveDocumentMutation),
12417        cancellation: "per_call_until_submission_then_resolve",
12418    },
12419    CommandOutcomeContract {
12420        command: Command::PrepareDocumentBulk,
12421        possible_submission_states: &["not_submitted", "resolved"],
12422        identity_requirement: "caller_action_id",
12423        resolver_command: None,
12424        cancellation: "per_call",
12425    },
12426    CommandOutcomeContract {
12427        command: Command::SubmitDocumentBulk,
12428        possible_submission_states: &[
12429            "not_submitted",
12430            "submitted",
12431            "known_retired",
12432            "indeterminate",
12433            "resolved",
12434        ],
12435        identity_requirement: "caller_action_id",
12436        resolver_command: Some(Command::ResolveDocumentBulk),
12437        cancellation: "per_call_until_submission_then_resolve",
12438    },
12439    CommandOutcomeContract {
12440        command: Command::ResolveDocumentBulk,
12441        possible_submission_states: &["not_submitted", "resolved"],
12442        identity_requirement: "caller_action_id",
12443        resolver_command: None,
12444        cancellation: "per_call",
12445    },
12446    CommandOutcomeContract {
12447        command: Command::PrepareAppendBulk,
12448        possible_submission_states: &["not_submitted", "resolved"],
12449        identity_requirement: "caller_action_id",
12450        resolver_command: None,
12451        cancellation: "per_call",
12452    },
12453    CommandOutcomeContract {
12454        command: Command::SubmitAppendBulk,
12455        possible_submission_states: &["not_submitted", "submitted", "indeterminate", "resolved"],
12456        identity_requirement: "request_locator",
12457        resolver_command: Some(Command::ResolveAppendBulk),
12458        cancellation: "per_call_until_submission_then_resolve",
12459    },
12460    CommandOutcomeContract {
12461        command: Command::ResolveAppendBulk,
12462        possible_submission_states: &["not_submitted", "resolved"],
12463        identity_requirement: "request_locator",
12464        resolver_command: None,
12465        cancellation: "per_call",
12466    },
12467    CommandOutcomeContract {
12468        command: Command::ObserveAppendCommitted,
12469        possible_submission_states: &["not_submitted", "resolved"],
12470        identity_requirement: "request_locator",
12471        resolver_command: None,
12472        cancellation: "per_call",
12473    },
12474    CommandOutcomeContract {
12475        command: Command::ResolveDocumentMutation,
12476        possible_submission_states: &["not_submitted", "resolved"],
12477        identity_requirement: "request_locator",
12478        resolver_command: None,
12479        cancellation: "per_call",
12480    },
12481    CommandOutcomeContract {
12482        command: Command::GetDocument,
12483        possible_submission_states: &["not_submitted", "resolved"],
12484        identity_requirement: "none",
12485        resolver_command: None,
12486        cancellation: "per_call",
12487    },
12488    CommandOutcomeContract {
12489        command: Command::Search,
12490        possible_submission_states: &["not_submitted", "resolved"],
12491        identity_requirement: "none",
12492        resolver_command: None,
12493        cancellation: "per_call",
12494    },
12495    CommandOutcomeContract {
12496        command: Command::ValidateSearch,
12497        possible_submission_states: &["not_submitted", "resolved"],
12498        identity_requirement: "none",
12499        resolver_command: None,
12500        cancellation: "per_call",
12501    },
12502    CommandOutcomeContract {
12503        command: Command::OpenPit,
12504        possible_submission_states: &["not_submitted", "submitted", "indeterminate", "resolved"],
12505        identity_requirement: "none",
12506        resolver_command: None,
12507        cancellation: "per_call_until_submission_then_resolve",
12508    },
12509    CommandOutcomeContract {
12510        command: Command::RenewPit,
12511        possible_submission_states: &["not_submitted", "submitted", "indeterminate", "resolved"],
12512        identity_requirement: "none",
12513        resolver_command: None,
12514        cancellation: "per_call_until_submission_then_resolve",
12515    },
12516    CommandOutcomeContract {
12517        command: Command::ClosePit,
12518        possible_submission_states: &["not_submitted", "submitted", "indeterminate", "resolved"],
12519        identity_requirement: "none",
12520        resolver_command: None,
12521        cancellation: "per_call_until_submission_then_resolve",
12522    },
12523    CommandOutcomeContract {
12524        command: Command::ListOperations,
12525        possible_submission_states: &["not_submitted", "resolved"],
12526        identity_requirement: "none",
12527        resolver_command: None,
12528        cancellation: "per_call",
12529    },
12530    CommandOutcomeContract {
12531        command: Command::GetOperation,
12532        possible_submission_states: &["not_submitted", "resolved"],
12533        identity_requirement: "request_locator",
12534        resolver_command: None,
12535        cancellation: "per_call",
12536    },
12537    CommandOutcomeContract {
12538        command: Command::WaitOperation,
12539        possible_submission_states: &["not_submitted", "resolved"],
12540        identity_requirement: "request_locator",
12541        resolver_command: None,
12542        cancellation: "per_call",
12543    },
12544    CommandOutcomeContract {
12545        command: Command::CancelOperation,
12546        possible_submission_states: &["not_submitted", "submitted", "indeterminate", "resolved"],
12547        identity_requirement: "request_locator",
12548        resolver_command: None,
12549        cancellation: "per_call_until_submission_then_resolve",
12550    },
12551    CommandOutcomeContract {
12552        command: Command::ListAuditEvents,
12553        possible_submission_states: &["not_submitted", "resolved"],
12554        identity_requirement: "none",
12555        resolver_command: None,
12556        cancellation: "per_call",
12557    },
12558    CommandOutcomeContract {
12559        command: Command::ExportAuditEvents,
12560        possible_submission_states: &["not_submitted", "resolved"],
12561        identity_requirement: "none",
12562        resolver_command: None,
12563        cancellation: "per_call",
12564    },
12565    CommandOutcomeContract {
12566        command: Command::ReserveServiceCredential,
12567        possible_submission_states: &[
12568            "not_submitted",
12569            "submitted",
12570            "known_retired",
12571            "indeterminate",
12572            "resolved",
12573        ],
12574        identity_requirement: "caller_action_id",
12575        resolver_command: Some(Command::ResolveServiceCredentialReservation),
12576        cancellation: "per_call_until_submission_then_resolve",
12577    },
12578    CommandOutcomeContract {
12579        command: Command::ReserveServiceCredentialRotation,
12580        possible_submission_states: &[
12581            "not_submitted",
12582            "submitted",
12583            "known_retired",
12584            "indeterminate",
12585            "resolved",
12586        ],
12587        identity_requirement: "caller_action_id",
12588        resolver_command: Some(Command::ResolveServiceCredentialReservation),
12589        cancellation: "per_call_until_submission_then_resolve",
12590    },
12591    CommandOutcomeContract {
12592        command: Command::ActivateServiceCredential,
12593        possible_submission_states: &[
12594            "not_submitted",
12595            "submitted",
12596            "known_retired",
12597            "indeterminate",
12598            "resolved",
12599        ],
12600        identity_requirement: "server_locator",
12601        resolver_command: Some(Command::ResolveServiceCredentialReservation),
12602        cancellation: "per_call_until_submission_then_resolve",
12603    },
12604    CommandOutcomeContract {
12605        command: Command::ResolveServiceCredentialReservation,
12606        possible_submission_states: &["not_submitted", "resolved"],
12607        identity_requirement: "caller_action_id",
12608        resolver_command: None,
12609        cancellation: "per_call",
12610    },
12611    CommandOutcomeContract {
12612        command: Command::PrepareRevokeServiceCredential,
12613        possible_submission_states: &["not_submitted", "resolved"],
12614        identity_requirement: "server_locator",
12615        resolver_command: None,
12616        cancellation: "per_call",
12617    },
12618    CommandOutcomeContract {
12619        command: Command::RevokeServiceCredential,
12620        possible_submission_states: &[
12621            "not_submitted",
12622            "submitted",
12623            "known_retired",
12624            "indeterminate",
12625            "resolved",
12626        ],
12627        identity_requirement: "request_locator",
12628        resolver_command: Some(Command::ResolveSecurityAction),
12629        cancellation: "per_call_until_submission_then_resolve",
12630    },
12631    CommandOutcomeContract {
12632        command: Command::ResolveSecurityAction,
12633        possible_submission_states: &["not_submitted", "resolved"],
12634        identity_requirement: "request_locator",
12635        resolver_command: None,
12636        cancellation: "per_call",
12637    },
12638    CommandOutcomeContract {
12639        command: Command::GetSecurityRole,
12640        possible_submission_states: &["not_submitted", "resolved"],
12641        identity_requirement: "none",
12642        resolver_command: None,
12643        cancellation: "per_call",
12644    },
12645    CommandOutcomeContract {
12646        command: Command::PrepareRoleAppendAccessChange,
12647        possible_submission_states: &["not_submitted", "resolved"],
12648        identity_requirement: "server_locator",
12649        resolver_command: None,
12650        cancellation: "per_call",
12651    },
12652    CommandOutcomeContract {
12653        command: Command::SubmitRoleAppendAccessChange,
12654        possible_submission_states: &[
12655            "not_submitted",
12656            "submitted",
12657            "known_retired",
12658            "indeterminate",
12659            "resolved",
12660        ],
12661        identity_requirement: "request_locator",
12662        resolver_command: Some(Command::ResolveSecurityAction),
12663        cancellation: "per_call_until_submission_then_resolve",
12664    },
12665    CommandOutcomeContract {
12666        command: Command::ListServiceCredentials,
12667        possible_submission_states: &["not_submitted", "resolved"],
12668        identity_requirement: "none",
12669        resolver_command: None,
12670        cancellation: "per_call",
12671    },
12672    CommandOutcomeContract {
12673        command: Command::GetRuntimeStatus,
12674        possible_submission_states: &["not_submitted", "resolved"],
12675        identity_requirement: "none",
12676        resolver_command: None,
12677        cancellation: "per_call",
12678    },
12679    CommandOutcomeContract {
12680        command: Command::GetResultCacheStatus,
12681        possible_submission_states: &["not_submitted", "resolved"],
12682        identity_requirement: "none",
12683        resolver_command: None,
12684        cancellation: "per_call",
12685    },
12686    CommandOutcomeContract {
12687        command: Command::GetFieldPromotionStatus,
12688        possible_submission_states: &["not_submitted", "resolved"],
12689        identity_requirement: "none",
12690        resolver_command: None,
12691        cancellation: "per_call",
12692    },
12693    CommandOutcomeContract {
12694        command: Command::GetOverloadStatus,
12695        possible_submission_states: &["not_submitted", "resolved"],
12696        identity_requirement: "none",
12697        resolver_command: None,
12698        cancellation: "per_call",
12699    },
12700    CommandOutcomeContract {
12701        command: Command::ConfigureExternalKey,
12702        possible_submission_states: &["not_submitted", "submitted", "indeterminate", "resolved"],
12703        identity_requirement: "none",
12704        resolver_command: None,
12705        cancellation: "per_call_until_submission_then_resolve",
12706    },
12707    CommandOutcomeContract {
12708        command: Command::RotateExternalKeyBinding,
12709        possible_submission_states: &["not_submitted", "submitted", "indeterminate", "resolved"],
12710        identity_requirement: "none",
12711        resolver_command: None,
12712        cancellation: "per_call_until_submission_then_resolve",
12713    },
12714    CommandOutcomeContract {
12715        command: Command::ConfigureAggregateThenDelete,
12716        possible_submission_states: &["not_submitted", "submitted", "indeterminate", "resolved"],
12717        identity_requirement: "none",
12718        resolver_command: None,
12719        cancellation: "per_call_until_submission_then_resolve",
12720    },
12721    CommandOutcomeContract {
12722        command: Command::GetLifecycleStatus,
12723        possible_submission_states: &["not_submitted", "resolved"],
12724        identity_requirement: "none",
12725        resolver_command: None,
12726        cancellation: "per_call",
12727    },
12728    CommandOutcomeContract {
12729        command: Command::GetQuota,
12730        possible_submission_states: &["not_submitted", "resolved"],
12731        identity_requirement: "none",
12732        resolver_command: None,
12733        cancellation: "per_call",
12734    },
12735    CommandOutcomeContract {
12736        command: Command::UpdateQuota,
12737        possible_submission_states: &["not_submitted", "submitted", "indeterminate", "resolved"],
12738        identity_requirement: "none",
12739        resolver_command: None,
12740        cancellation: "per_call_until_submission_then_resolve",
12741    },
12742    CommandOutcomeContract {
12743        command: Command::GetBinding,
12744        possible_submission_states: &["not_submitted", "resolved"],
12745        identity_requirement: "none",
12746        resolver_command: None,
12747        cancellation: "per_call",
12748    },
12749    CommandOutcomeContract {
12750        command: Command::GetAdmissionStatus,
12751        possible_submission_states: &["not_submitted", "resolved"],
12752        identity_requirement: "none",
12753        resolver_command: None,
12754        cancellation: "per_call",
12755    },
12756    CommandOutcomeContract {
12757        command: Command::SetAdmission,
12758        possible_submission_states: &["not_submitted", "submitted", "indeterminate", "resolved"],
12759        identity_requirement: "none",
12760        resolver_command: None,
12761        cancellation: "per_call_until_submission_then_resolve",
12762    },
12763    CommandOutcomeContract {
12764        command: Command::GetQuiesceStatus,
12765        possible_submission_states: &["not_submitted", "resolved"],
12766        identity_requirement: "none",
12767        resolver_command: None,
12768        cancellation: "per_call",
12769    },
12770    CommandOutcomeContract {
12771        command: Command::GetDecommissionReadiness,
12772        possible_submission_states: &["not_submitted", "resolved"],
12773        identity_requirement: "none",
12774        resolver_command: None,
12775        cancellation: "per_call",
12776    },
12777    CommandOutcomeContract {
12778        command: Command::GetUpgradeReadiness,
12779        possible_submission_states: &["not_submitted", "resolved"],
12780        identity_requirement: "none",
12781        resolver_command: None,
12782        cancellation: "per_call",
12783    },
12784    CommandOutcomeContract {
12785        command: Command::GetMaintenanceStatus,
12786        possible_submission_states: &["not_submitted", "resolved"],
12787        identity_requirement: "none",
12788        resolver_command: None,
12789        cancellation: "per_call",
12790    },
12791    CommandOutcomeContract {
12792        command: Command::WarmVectorIndex,
12793        possible_submission_states: &["not_submitted", "resolved"],
12794        identity_requirement: "exact_root",
12795        resolver_command: None,
12796        cancellation: "per_call",
12797    },
12798    CommandOutcomeContract {
12799        command: Command::EvaluateVectorRecall,
12800        possible_submission_states: &["not_submitted", "submitted", "indeterminate", "resolved"],
12801        identity_requirement: "caller_action_id",
12802        resolver_command: None,
12803        cancellation: "per_call_until_submission_then_resolve",
12804    },
12805    CommandOutcomeContract {
12806        command: Command::CalibrateVectorStrategy,
12807        possible_submission_states: &["not_submitted", "submitted", "indeterminate", "resolved"],
12808        identity_requirement: "caller_action_id",
12809        resolver_command: None,
12810        cancellation: "per_call_until_submission_then_resolve",
12811    },
12812    CommandOutcomeContract {
12813        command: Command::GetVectorDiagnostic,
12814        possible_submission_states: &["not_submitted", "resolved"],
12815        identity_requirement: "request_locator",
12816        resolver_command: None,
12817        cancellation: "per_call",
12818    },
12819    CommandOutcomeContract {
12820        command: Command::CreateDiagnostic,
12821        possible_submission_states: &["not_submitted", "submitted", "indeterminate", "resolved"],
12822        identity_requirement: "none",
12823        resolver_command: None,
12824        cancellation: "per_call_until_submission_then_resolve",
12825    },
12826    CommandOutcomeContract {
12827        command: Command::GetDiagnostic,
12828        possible_submission_states: &["not_submitted", "resolved"],
12829        identity_requirement: "request_locator",
12830        resolver_command: None,
12831        cancellation: "per_call",
12832    },
12833    CommandOutcomeContract {
12834        command: Command::PrepareCollectionExport,
12835        possible_submission_states: &["not_submitted", "resolved"],
12836        identity_requirement: "caller_action_id",
12837        resolver_command: None,
12838        cancellation: "per_call",
12839    },
12840    CommandOutcomeContract {
12841        command: Command::StartCollectionExport,
12842        possible_submission_states: &["not_submitted", "submitted", "indeterminate", "resolved"],
12843        identity_requirement: "caller_action_id",
12844        resolver_command: Some(Command::ResolveCollectionExport),
12845        cancellation: "per_call_until_submission_then_resolve",
12846    },
12847    CommandOutcomeContract {
12848        command: Command::ResolveCollectionExport,
12849        possible_submission_states: &["not_submitted", "resolved", "known_retired"],
12850        identity_requirement: "caller_action_id",
12851        resolver_command: None,
12852        cancellation: "per_call",
12853    },
12854    CommandOutcomeContract {
12855        command: Command::VerifyCollectionExport,
12856        possible_submission_states: &["not_submitted", "resolved"],
12857        identity_requirement: "request_locator",
12858        resolver_command: None,
12859        cancellation: "per_call",
12860    },
12861    CommandOutcomeContract {
12862        command: Command::PrepareCollectionRestore,
12863        possible_submission_states: &["not_submitted", "resolved"],
12864        identity_requirement: "caller_action_id",
12865        resolver_command: None,
12866        cancellation: "per_call",
12867    },
12868    CommandOutcomeContract {
12869        command: Command::StartCollectionRestore,
12870        possible_submission_states: &["not_submitted", "submitted", "indeterminate", "resolved"],
12871        identity_requirement: "caller_action_id",
12872        resolver_command: Some(Command::ResolveCollectionRestore),
12873        cancellation: "per_call_until_submission_then_resolve",
12874    },
12875    CommandOutcomeContract {
12876        command: Command::ResolveCollectionRestore,
12877        possible_submission_states: &["not_submitted", "resolved", "known_retired"],
12878        identity_requirement: "caller_action_id",
12879        resolver_command: None,
12880        cancellation: "per_call",
12881    },
12882    CommandOutcomeContract {
12883        command: Command::ReadArtifactChunk,
12884        possible_submission_states: &["not_submitted", "resolved"],
12885        identity_requirement: "none",
12886        resolver_command: None,
12887        cancellation: "per_call",
12888    },
12889    CommandOutcomeContract {
12890        command: Command::ExportUsage,
12891        possible_submission_states: &["not_submitted", "resolved"],
12892        identity_requirement: "none",
12893        resolver_command: None,
12894        cancellation: "per_call",
12895    },
12896    CommandOutcomeContract {
12897        command: Command::ExecuteStateRead,
12898        possible_submission_states: &["not_submitted", "resolved"],
12899        identity_requirement: "none",
12900        resolver_command: None,
12901        cancellation: "per_call",
12902    },
12903    CommandOutcomeContract {
12904        command: Command::PrepareStateWrite,
12905        possible_submission_states: &["not_submitted", "resolved"],
12906        identity_requirement: "caller_action_id",
12907        resolver_command: None,
12908        cancellation: "per_call",
12909    },
12910    CommandOutcomeContract {
12911        command: Command::SubmitStateWrite,
12912        possible_submission_states: &[
12913            "not_submitted",
12914            "submitted",
12915            "known_retired",
12916            "indeterminate",
12917            "resolved",
12918        ],
12919        identity_requirement: "request_locator",
12920        resolver_command: Some(Command::ResolveStateWrite),
12921        cancellation: "per_call_until_submission_then_resolve",
12922    },
12923    CommandOutcomeContract {
12924        command: Command::ResolveStateWrite,
12925        possible_submission_states: &["not_submitted", "resolved"],
12926        identity_requirement: "request_locator",
12927        resolver_command: None,
12928        cancellation: "per_call",
12929    },
12930];
12931#[derive(Clone, Copy, Debug, Eq, PartialEq)]
12932pub struct ErrorOutcomeContract {
12933    pub code: ErrorCode,
12934    pub disposition: ErrorDisposition,
12935    pub recovery: RecoveryAction,
12936    pub retry_after_limit_id: Option<&'static str>,
12937    pub recovery_identity: &'static str,
12938}
12939pub const LODESTONE_API_ERROR_OUTCOMES: &[ErrorOutcomeContract] = &[
12940    ErrorOutcomeContract {
12941        code: ErrorCode::Aborted,
12942        disposition: ErrorDisposition::NotSubmitted,
12943        recovery: RecoveryAction::Retry,
12944        retry_after_limit_id: None,
12945        recovery_identity: "request_identity",
12946    },
12947    ErrorOutcomeContract {
12948        code: ErrorCode::Aborted,
12949        disposition: ErrorDisposition::Indeterminate,
12950        recovery: RecoveryAction::Resolve,
12951        retry_after_limit_id: None,
12952        recovery_identity: "request_identity",
12953    },
12954    ErrorOutcomeContract {
12955        code: ErrorCode::DeadlineExceeded,
12956        disposition: ErrorDisposition::NotSubmitted,
12957        recovery: RecoveryAction::Retry,
12958        retry_after_limit_id: None,
12959        recovery_identity: "request_identity",
12960    },
12961    ErrorOutcomeContract {
12962        code: ErrorCode::DeadlineExceeded,
12963        disposition: ErrorDisposition::Indeterminate,
12964        recovery: RecoveryAction::Resolve,
12965        retry_after_limit_id: None,
12966        recovery_identity: "request_identity",
12967    },
12968    ErrorOutcomeContract {
12969        code: ErrorCode::InvalidRequest,
12970        disposition: ErrorDisposition::NotSubmitted,
12971        recovery: RecoveryAction::Stop,
12972        retry_after_limit_id: None,
12973        recovery_identity: "none",
12974    },
12975    ErrorOutcomeContract {
12976        code: ErrorCode::UnsupportedVersion,
12977        disposition: ErrorDisposition::NotSubmitted,
12978        recovery: RecoveryAction::Stop,
12979        retry_after_limit_id: None,
12980        recovery_identity: "none",
12981    },
12982    ErrorOutcomeContract {
12983        code: ErrorCode::Unauthenticated,
12984        disposition: ErrorDisposition::NotSubmitted,
12985        recovery: RecoveryAction::RefreshCredential,
12986        retry_after_limit_id: None,
12987        recovery_identity: "none",
12988    },
12989    ErrorOutcomeContract {
12990        code: ErrorCode::PermissionDenied,
12991        disposition: ErrorDisposition::NotSubmitted,
12992        recovery: RecoveryAction::Stop,
12993        retry_after_limit_id: None,
12994        recovery_identity: "none",
12995    },
12996    ErrorOutcomeContract {
12997        code: ErrorCode::NotFound,
12998        disposition: ErrorDisposition::NotSubmitted,
12999        recovery: RecoveryAction::Stop,
13000        retry_after_limit_id: None,
13001        recovery_identity: "request_identity",
13002    },
13003    ErrorOutcomeContract {
13004        code: ErrorCode::NotFound,
13005        disposition: ErrorDisposition::Resolved,
13006        recovery: RecoveryAction::Stop,
13007        retry_after_limit_id: None,
13008        recovery_identity: "request_identity",
13009    },
13010    ErrorOutcomeContract {
13011        code: ErrorCode::Conflict,
13012        disposition: ErrorDisposition::NotSubmitted,
13013        recovery: RecoveryAction::RefreshPrecondition,
13014        retry_after_limit_id: None,
13015        recovery_identity: "request_identity",
13016    },
13017    ErrorOutcomeContract {
13018        code: ErrorCode::Conflict,
13019        disposition: ErrorDisposition::Resolved,
13020        recovery: RecoveryAction::Stop,
13021        retry_after_limit_id: None,
13022        recovery_identity: "request_identity",
13023    },
13024    ErrorOutcomeContract {
13025        code: ErrorCode::StaleCursor,
13026        disposition: ErrorDisposition::NotSubmitted,
13027        recovery: RecoveryAction::RestartPage,
13028        retry_after_limit_id: None,
13029        recovery_identity: "cursor",
13030    },
13031    ErrorOutcomeContract {
13032        code: ErrorCode::RestartBudgetExhausted,
13033        disposition: ErrorDisposition::NotSubmitted,
13034        recovery: RecoveryAction::Stop,
13035        retry_after_limit_id: None,
13036        recovery_identity: "cursor",
13037    },
13038    ErrorOutcomeContract {
13039        code: ErrorCode::LimitExceeded,
13040        disposition: ErrorDisposition::NotSubmitted,
13041        recovery: RecoveryAction::ReduceRequest,
13042        retry_after_limit_id: None,
13043        recovery_identity: "none",
13044    },
13045    ErrorOutcomeContract {
13046        code: ErrorCode::CapabilityUnavailable,
13047        disposition: ErrorDisposition::NotSubmitted,
13048        recovery: RecoveryAction::Stop,
13049        retry_after_limit_id: None,
13050        recovery_identity: "none",
13051    },
13052    ErrorOutcomeContract {
13053        code: ErrorCode::NotSubmitted,
13054        disposition: ErrorDisposition::NotSubmitted,
13055        recovery: RecoveryAction::RetryAfter,
13056        retry_after_limit_id: Some("retry_after_millis"),
13057        recovery_identity: "request_identity",
13058    },
13059    ErrorOutcomeContract {
13060        code: ErrorCode::SubmittedIndeterminate,
13061        disposition: ErrorDisposition::Indeterminate,
13062        recovery: RecoveryAction::Resolve,
13063        retry_after_limit_id: None,
13064        recovery_identity: "locator_or_caller_action_id",
13065    },
13066    ErrorOutcomeContract {
13067        code: ErrorCode::ExpiredUnknown,
13068        disposition: ErrorDisposition::KnownRetired,
13069        recovery: RecoveryAction::Stop,
13070        retry_after_limit_id: None,
13071        recovery_identity: "locator_or_caller_action_id",
13072    },
13073    ErrorOutcomeContract {
13074        code: ErrorCode::SecretNotEscrowed,
13075        disposition: ErrorDisposition::Resolved,
13076        recovery: RecoveryAction::Resolve,
13077        retry_after_limit_id: None,
13078        recovery_identity: "reservation_action_id",
13079    },
13080    ErrorOutcomeContract {
13081        code: ErrorCode::RetentionGap,
13082        disposition: ErrorDisposition::KnownRetired,
13083        recovery: RecoveryAction::Stop,
13084        retry_after_limit_id: None,
13085        recovery_identity: "cursor_or_locator",
13086    },
13087    ErrorOutcomeContract {
13088        code: ErrorCode::ArtifactRangeInvalid,
13089        disposition: ErrorDisposition::NotSubmitted,
13090        recovery: RecoveryAction::CorrectRange,
13091        retry_after_limit_id: None,
13092        recovery_identity: "artifact_identity",
13093    },
13094    ErrorOutcomeContract {
13095        code: ErrorCode::ChecksumMismatch,
13096        disposition: ErrorDisposition::Resolved,
13097        recovery: RecoveryAction::Stop,
13098        retry_after_limit_id: None,
13099        recovery_identity: "artifact_identity",
13100    },
13101    ErrorOutcomeContract {
13102        code: ErrorCode::TemporarilyUnavailable,
13103        disposition: ErrorDisposition::NotSubmitted,
13104        recovery: RecoveryAction::RetryAfter,
13105        retry_after_limit_id: Some("retry_after_millis"),
13106        recovery_identity: "request_identity",
13107    },
13108    ErrorOutcomeContract {
13109        code: ErrorCode::TemporarilyUnavailable,
13110        disposition: ErrorDisposition::Indeterminate,
13111        recovery: RecoveryAction::Resolve,
13112        retry_after_limit_id: Some("retry_after_millis"),
13113        recovery_identity: "request_identity",
13114    },
13115    ErrorOutcomeContract {
13116        code: ErrorCode::Internal,
13117        disposition: ErrorDisposition::NotSubmitted,
13118        recovery: RecoveryAction::Stop,
13119        retry_after_limit_id: None,
13120        recovery_identity: "request_identity",
13121    },
13122    ErrorOutcomeContract {
13123        code: ErrorCode::Internal,
13124        disposition: ErrorDisposition::Resolved,
13125        recovery: RecoveryAction::Stop,
13126        retry_after_limit_id: None,
13127        recovery_identity: "request_identity",
13128    },
13129    ErrorOutcomeContract {
13130        code: ErrorCode::Internal,
13131        disposition: ErrorDisposition::Indeterminate,
13132        recovery: RecoveryAction::Resolve,
13133        retry_after_limit_id: None,
13134        recovery_identity: "request_identity",
13135    },
13136];
13137#[derive(Clone, Copy, Debug, Eq, PartialEq)]
13138pub struct Limit {
13139    pub id: &'static str,
13140    pub default: u64,
13141    pub maximum: u64,
13142    pub unit: &'static str,
13143}
13144pub const LODESTONE_API_LIMITS: &[Limit] = &[
13145    Limit {
13146        id: "request_bytes",
13147        default: 2097152,
13148        maximum: 2097152,
13149        unit: "bytes",
13150    },
13151    Limit {
13152        id: "response_bytes",
13153        default: 2097152,
13154        maximum: 2097152,
13155        unit: "bytes",
13156    },
13157    Limit {
13158        id: "page_size",
13159        default: 100,
13160        maximum: 1000,
13161        unit: "items",
13162    },
13163    Limit {
13164        id: "catalog_page_size",
13165        default: 100,
13166        maximum: 100,
13167        unit: "items",
13168    },
13169    Limit {
13170        id: "catalog_restart_budget",
13171        default: 8,
13172        maximum: 8,
13173        unit: "restarts",
13174    },
13175    Limit {
13176        id: "query_clauses",
13177        default: 256,
13178        maximum: 1024,
13179        unit: "clauses",
13180    },
13181    Limit {
13182        id: "text_query_bytes",
13183        default: 16384,
13184        maximum: 16384,
13185        unit: "bytes",
13186    },
13187    Limit {
13188        id: "text_query_fields",
13189        default: 64,
13190        maximum: 64,
13191        unit: "fields",
13192    },
13193    Limit {
13194        id: "text_query_slop",
13195        default: 64,
13196        maximum: 64,
13197        unit: "positions",
13198    },
13199    Limit {
13200        id: "text_query_boost",
13201        default: 1024,
13202        maximum: 1024,
13203        unit: "multiplier",
13204    },
13205    Limit {
13206        id: "text_query_fuzzy_expansions",
13207        default: 1024,
13208        maximum: 1024,
13209        unit: "terms",
13210    },
13211    Limit {
13212        id: "text_query_fuzzy_distance",
13213        default: 2,
13214        maximum: 2,
13215        unit: "edits",
13216    },
13217    Limit {
13218        id: "text_query_dictionary_scan_terms",
13219        default: 65536,
13220        maximum: 65536,
13221        unit: "terms",
13222    },
13223    Limit {
13224        id: "text_query_dictionary_scan_bytes",
13225        default: 16777216,
13226        maximum: 16777216,
13227        unit: "bytes",
13228    },
13229    Limit {
13230        id: "text_query_fuzzy_work_units",
13231        default: 2000000,
13232        maximum: 2000000,
13233        unit: "distance_cells",
13234    },
13235    Limit {
13236        id: "aggregation_nodes",
13237        default: 64,
13238        maximum: 256,
13239        unit: "nodes",
13240    },
13241    Limit {
13242        id: "aggregation_buckets",
13243        default: 65536,
13244        maximum: 65536,
13245        unit: "buckets",
13246    },
13247    Limit {
13248        id: "approximate_cardinality_precision",
13249        default: 12,
13250        maximum: 16,
13251        unit: "index_bits",
13252    },
13253    Limit {
13254        id: "approximate_percentile_precision",
13255        default: 10,
13256        maximum: 12,
13257        unit: "index_bits",
13258    },
13259    Limit {
13260        id: "operation_page_authorities",
13261        default: 7,
13262        maximum: 7,
13263        unit: "authorities",
13264    },
13265    Limit {
13266        id: "artifact_chunk_bytes",
13267        default: 262144,
13268        maximum: 1048576,
13269        unit: "bytes",
13270    },
13271    Limit {
13272        id: "bulk_document_items",
13273        default: 128,
13274        maximum: 1024,
13275        unit: "items",
13276    },
13277    Limit {
13278        id: "bulk_document_bytes",
13279        default: 2097152,
13280        maximum: 2097152,
13281        unit: "bytes",
13282    },
13283    Limit {
13284        id: "state_command_keys",
13285        default: 128,
13286        maximum: 128,
13287        unit: "keys",
13288    },
13289    Limit {
13290        id: "state_command_value_bytes",
13291        default: 1048576,
13292        maximum: 1048576,
13293        unit: "bytes",
13294    },
13295    Limit {
13296        id: "state_write_outcomes",
13297        default: 4096,
13298        maximum: 4096,
13299        unit: "entries",
13300    },
13301    Limit {
13302        id: "exact_decimal_scale",
13303        default: 18,
13304        maximum: 1024,
13305        unit: "decimal_places",
13306    },
13307    Limit {
13308        id: "retry_after_millis",
13309        default: 1000,
13310        maximum: 60000,
13311        unit: "milliseconds",
13312    },
13313    Limit {
13314        id: "mapping_fields",
13315        default: 16384,
13316        maximum: 16384,
13317        unit: "fields",
13318    },
13319    Limit {
13320        id: "search_result_window",
13321        default: 10000,
13322        maximum: 10000,
13323        unit: "items",
13324    },
13325    Limit {
13326        id: "routing_values",
13327        default: 1024,
13328        maximum: 1024,
13329        unit: "items",
13330    },
13331    Limit {
13332        id: "routing_value_bytes",
13333        default: 4096,
13334        maximum: 4096,
13335        unit: "bytes",
13336    },
13337    Limit {
13338        id: "query_recursion_depth",
13339        default: 64,
13340        maximum: 64,
13341        unit: "levels",
13342    },
13343    Limit {
13344        id: "vector_dimensions",
13345        default: 16384,
13346        maximum: 16384,
13347        unit: "dimensions",
13348    },
13349    Limit {
13350        id: "vector_query_bytes",
13351        default: 65536,
13352        maximum: 65536,
13353        unit: "bytes",
13354    },
13355    Limit {
13356        id: "vector_request_bytes",
13357        default: 1048576,
13358        maximum: 1048576,
13359        unit: "bytes",
13360    },
13361    Limit {
13362        id: "vector_candidates",
13363        default: 10000,
13364        maximum: 10000,
13365        unit: "items",
13366    },
13367    Limit {
13368        id: "vector_set_document_vectors",
13369        default: 128,
13370        maximum: 128,
13371        unit: "vectors",
13372    },
13373    Limit {
13374        id: "vector_set_document_bytes",
13375        default: 65536,
13376        maximum: 65536,
13377        unit: "bytes",
13378    },
13379    Limit {
13380        id: "vector_set_query_vectors",
13381        default: 32,
13382        maximum: 32,
13383        unit: "vectors",
13384    },
13385    Limit {
13386        id: "vector_set_query_bytes",
13387        default: 65536,
13388        maximum: 65536,
13389        unit: "bytes",
13390    },
13391    Limit {
13392        id: "retrieval_branches",
13393        default: 16,
13394        maximum: 16,
13395        unit: "branches",
13396    },
13397    Limit {
13398        id: "retrieval_branch_name_bytes",
13399        default: 64,
13400        maximum: 64,
13401        unit: "bytes",
13402    },
13403    Limit {
13404        id: "retrieval_window",
13405        default: 10000,
13406        maximum: 10000,
13407        unit: "items",
13408    },
13409    Limit {
13410        id: "fragment_fields",
13411        default: 4,
13412        maximum: 16,
13413        unit: "fields",
13414    },
13415    Limit {
13416        id: "fragments_per_field",
13417        default: 1,
13418        maximum: 8,
13419        unit: "items",
13420    },
13421    Limit {
13422        id: "fragment_bytes",
13423        default: 150,
13424        maximum: 8192,
13425        unit: "bytes",
13426    },
13427    Limit {
13428        id: "fragment_total_bytes",
13429        default: 65536,
13430        maximum: 65536,
13431        unit: "bytes",
13432    },
13433    Limit {
13434        id: "result_feature_hits",
13435        default: 10,
13436        maximum: 100,
13437        unit: "items",
13438    },
13439    Limit {
13440        id: "result_features",
13441        default: 4,
13442        maximum: 16,
13443        unit: "features",
13444    },
13445    Limit {
13446        id: "diversification_fields",
13447        default: 1,
13448        maximum: 4,
13449        unit: "fields",
13450    },
13451    Limit {
13452        id: "diversification_per_group",
13453        default: 1,
13454        maximum: 64,
13455        unit: "items",
13456    },
13457    Limit {
13458        id: "vector_evaluation_queries",
13459        default: 64,
13460        maximum: 256,
13461        unit: "queries",
13462    },
13463    Limit {
13464        id: "vector_evaluation_k",
13465        default: 10,
13466        maximum: 1000,
13467        unit: "items",
13468    },
13469    Limit {
13470        id: "vector_evaluation_profiles",
13471        default: 3,
13472        maximum: 3,
13473        unit: "profiles",
13474    },
13475    Limit {
13476        id: "vector_evaluation_artifact_bytes",
13477        default: 1048576,
13478        maximum: 1048576,
13479        unit: "bytes",
13480    },
13481    Limit {
13482        id: "vector_warm_components",
13483        default: 2,
13484        maximum: 3,
13485        unit: "components",
13486    },
13487    Limit {
13488        id: "vector_warm_requests",
13489        default: 1024,
13490        maximum: 65536,
13491        unit: "requests",
13492    },
13493    Limit {
13494        id: "vector_warm_bytes",
13495        default: 268435456,
13496        maximum: 1073741824,
13497        unit: "bytes",
13498    },
13499    Limit {
13500        id: "vector_warm_achievements",
13501        default: 1024,
13502        maximum: 10000,
13503        unit: "items",
13504    },
13505    Limit {
13506        id: "vector_warm_ttl_millis",
13507        default: 300000,
13508        maximum: 900000,
13509        unit: "milliseconds",
13510    },
13511    Limit {
13512        id: "operation_page_size",
13513        default: 100,
13514        maximum: 100,
13515        unit: "items",
13516    },
13517    Limit {
13518        id: "operation_wait_attempts",
13519        default: 20,
13520        maximum: 100,
13521        unit: "attempts",
13522    },
13523    Limit {
13524        id: "operation_wait_interval_millis",
13525        default: 100,
13526        maximum: 60000,
13527        unit: "milliseconds",
13528    },
13529    Limit {
13530        id: "resource_initial_shards",
13531        default: 1,
13532        maximum: 4096,
13533        unit: "shards",
13534    },
13535    Limit {
13536        id: "resource_target_shard_bytes",
13537        default: 536870912,
13538        maximum: 1125899906842624,
13539        unit: "bytes",
13540    },
13541    Limit {
13542        id: "resource_admission_weight",
13543        default: 1,
13544        maximum: 1000000,
13545        unit: "weight",
13546    },
13547    Limit {
13548        id: "resource_ram_bytes",
13549        default: 1073741824,
13550        maximum: 1125899906842624,
13551        unit: "bytes",
13552    },
13553    Limit {
13554        id: "resource_nvme_bytes",
13555        default: 2147483648,
13556        maximum: 1125899906842624,
13557        unit: "bytes",
13558    },
13559    Limit {
13560        id: "resource_refresh_millis",
13561        default: 200,
13562        maximum: 604800000,
13563        unit: "milliseconds",
13564    },
13565    Limit {
13566        id: "resource_memtable_bytes",
13567        default: 268435456,
13568        maximum: 1125899906842624,
13569        unit: "bytes",
13570    },
13571    Limit {
13572        id: "resource_parallelism",
13573        default: 1,
13574        maximum: 4096,
13575        unit: "workers",
13576    },
13577    Limit {
13578        id: "collection_export_bytes",
13579        default: 268435456,
13580        maximum: 268435456,
13581        unit: "bytes",
13582    },
13583    Limit {
13584        id: "collection_export_documents",
13585        default: 10000,
13586        maximum: 10000,
13587        unit: "documents",
13588    },
13589    Limit {
13590        id: "portability_prefix_bytes",
13591        default: 512,
13592        maximum: 512,
13593        unit: "bytes",
13594    },
13595];
13596#[derive(Clone, Copy, Debug, Eq, PartialEq)]
13597pub enum JsonError {
13598    DuplicateObjectField,
13599    InvalidScalar,
13600}
13601pub fn validate_semantic_json(value: &JsonValue) -> Result<(), JsonError> {
13602    match value {
13603        JsonValue::I64(item) => item.validate().map_err(|_| JsonError::InvalidScalar),
13604        JsonValue::U64(item) => item.validate().map_err(|_| JsonError::InvalidScalar),
13605        JsonValue::ExactDecimal(item) => item.validate().map_err(|_| JsonError::InvalidScalar),
13606        JsonValue::Approximate(item) => item.validate().map_err(|_| JsonError::InvalidScalar),
13607        JsonValue::Array(items) => items.iter().try_for_each(validate_semantic_json),
13608        JsonValue::Object(fields) => {
13609            let mut names = std::collections::BTreeSet::new();
13610            for field in fields {
13611                if !names.insert(field.name.as_str()) {
13612                    return Err(JsonError::DuplicateObjectField);
13613                }
13614                validate_semantic_json(&field.value)?;
13615            }
13616            Ok(())
13617        }
13618        JsonValue::Null | JsonValue::Bool(_) | JsonValue::String(_) => Ok(()),
13619    }
13620}
13621#[cfg(test)]
13622mod tests {
13623    use super::*;
13624    fn assert_fixture<T>(value: &serde_json::Value) -> Result<(), Box<dyn std::error::Error>>
13625    where
13626        T: serde::de::DeserializeOwned + Serialize,
13627    {
13628        let decoded: T = serde_json::from_value(value.clone())?;
13629        assert_eq!(serde_json::to_value(decoded)?, *value);
13630        Ok(())
13631    }
13632    #[test]
13633    fn every_named_type_has_a_canonical_round_trip_fixture() -> Result<(), Box<dyn std::error::Error>> {
13634        let document: serde_json::Value =
13635            serde_json::from_str(include_str!("../../../tests/native-api/closed-schema.json"))?;
13636        assert_eq!(document["spec_sha256"], LODESTONE_API_SPEC_SHA256);
13637        let fixtures = document["named_types"]
13638            .as_object()
13639            .ok_or("named type fixtures are not an object")?;
13640        assert_eq!(fixtures.len(), LODESTONE_API_TYPE_CONTRACTS.len());
13641        for (name, value) in fixtures {
13642            match name.as_str() {
13643                "cursor" => assert_fixture::<Cursor>(value)?,
13644                "locator" => assert_fixture::<Locator>(value)?,
13645                "resource" => assert_fixture::<Resource>(value)?,
13646                "field_promotion_configuration" => assert_fixture::<FieldPromotionConfiguration>(value)?,
13647                "overload_configuration" => assert_fixture::<OverloadConfiguration>(value)?,
13648                "index_policies" => assert_fixture::<IndexPolicies>(value)?,
13649                "maintenance_budgets" => assert_fixture::<MaintenanceBudgets>(value)?,
13650                "resource_durability_class" => assert_fixture::<ResourceDurabilityClass>(value)?,
13651                "resource_storage_class" => assert_fixture::<ResourceStorageClass>(value)?,
13652                "vector_quality_objective" => assert_fixture::<VectorQualityObjective>(value)?,
13653                "vector_indexing_objective" => assert_fixture::<VectorIndexingObjective>(value)?,
13654                "vector_residency_intent" => assert_fixture::<VectorResidencyIntent>(value)?,
13655                "vector_calibration_binding" => assert_fixture::<VectorCalibrationBinding>(value)?,
13656                "vector_resource_policy" => assert_fixture::<VectorResourcePolicy>(value)?,
13657                "workload_class" => assert_fixture::<WorkloadClass>(value)?,
13658                "index_resource_spec" => assert_fixture::<IndexResourceSpec>(value)?,
13659                "index_summary" => assert_fixture::<IndexSummary>(value)?,
13660                "mapping_mode" => assert_fixture::<MappingMode>(value)?,
13661                "dynamic_mapping_policy" => assert_fixture::<DynamicMappingPolicy>(value)?,
13662                "mapping_analyzer" => assert_fixture::<MappingAnalyzer>(value)?,
13663                "keyword_normalizer" => assert_fixture::<KeywordNormalizer>(value)?,
13664                "vector_metric" => assert_fixture::<VectorMetric>(value)?,
13665                "mapping_scalar" => assert_fixture::<MappingScalar>(value)?,
13666                "sparse_vector_weight_type" => assert_fixture::<SparseVectorWeightType>(value)?,
13667                "mapping_field_type" => assert_fixture::<MappingFieldType>(value)?,
13668                "mapping_field" => assert_fixture::<MappingField>(value)?,
13669                "multi_field_projection" => assert_fixture::<MultiFieldProjection>(value)?,
13670                "analyzer_identity" => assert_fixture::<AnalyzerIdentity>(value)?,
13671                "keyword_limit" => assert_fixture::<KeywordLimit>(value)?,
13672                "mapping" => assert_fixture::<Mapping>(value)?,
13673                "index_detail" => assert_fixture::<IndexDetail>(value)?,
13674                "source_provider" => assert_fixture::<SourceProvider>(value)?,
13675                "source_decoder" => assert_fixture::<SourceDecoder>(value)?,
13676                "source_replay_guarantees" => assert_fixture::<SourceReplayGuarantees>(value)?,
13677                "source_partition_configuration" => assert_fixture::<SourcePartitionConfiguration>(value)?,
13678                "replayable_source_configuration" => assert_fixture::<ReplayableSourceConfiguration>(value)?,
13679                "source_partition_status" => assert_fixture::<SourcePartitionStatus>(value)?,
13680                "replayable_source_status" => assert_fixture::<ReplayableSourceStatus>(value)?,
13681                "source_control_transition" => assert_fixture::<SourceControlTransition>(value)?,
13682                "history_ledger_precondition" => assert_fixture::<HistoryLedgerPrecondition>(value)?,
13683                "history_retention_policy" => assert_fixture::<HistoryRetentionPolicy>(value)?,
13684                "history_selector" => assert_fixture::<HistorySelector>(value)?,
13685                "history_hold" => assert_fixture::<HistoryHold>(value)?,
13686                "history_status" => assert_fixture::<HistoryStatus>(value)?,
13687                "history_resolution" => assert_fixture::<HistoryResolution>(value)?,
13688                "index_reference" => assert_fixture::<IndexReference>(value)?,
13689                "alias_target" => assert_fixture::<AliasTarget>(value)?,
13690                "alias_summary" => assert_fixture::<AliasSummary>(value)?,
13691                "alias_detail" => assert_fixture::<AliasDetail>(value)?,
13692                "data_stream_summary" => assert_fixture::<DataStreamSummary>(value)?,
13693                "component_template_binding" => assert_fixture::<ComponentTemplateBinding>(value)?,
13694                "index_template_binding" => assert_fixture::<IndexTemplateBinding>(value)?,
13695                "lifecycle_policy_binding" => assert_fixture::<LifecyclePolicyBinding>(value)?,
13696                "data_stream_detail" => assert_fixture::<DataStreamDetail>(value)?,
13697                "component_template_summary" => assert_fixture::<ComponentTemplateSummary>(value)?,
13698                "component_template_detail" => assert_fixture::<ComponentTemplateDetail>(value)?,
13699                "index_template_summary" => assert_fixture::<IndexTemplateSummary>(value)?,
13700                "index_template_detail" => assert_fixture::<IndexTemplateDetail>(value)?,
13701                "ingest_pipeline_summary" => assert_fixture::<IngestPipelineSummary>(value)?,
13702                "ingest_pipeline_detail" => assert_fixture::<IngestPipelineDetail>(value)?,
13703                "ingest_pipeline_selection" => assert_fixture::<IngestPipelineSelection>(value)?,
13704                "lifecycle_policy_summary" => assert_fixture::<LifecyclePolicySummary>(value)?,
13705                "rollover_thresholds" => assert_fixture::<RolloverThresholds>(value)?,
13706                "retention_policy" => assert_fixture::<RetentionPolicy>(value)?,
13707                "lifecycle_policy_detail" => assert_fixture::<LifecyclePolicyDetail>(value)?,
13708                "text_query_operator" => assert_fixture::<TextQueryOperator>(value)?,
13709                "text_query_analyzer" => assert_fixture::<TextQueryAnalyzer>(value)?,
13710                "zero_terms_query" => assert_fixture::<ZeroTermsQuery>(value)?,
13711                "text_query_options" => assert_fixture::<TextQueryOptions>(value)?,
13712                "multi_match_mode" => assert_fixture::<MultiMatchMode>(value)?,
13713                "multi_match_field" => assert_fixture::<MultiMatchField>(value)?,
13714                "multi_match_options" => assert_fixture::<MultiMatchOptions>(value)?,
13715                "sort_order" => assert_fixture::<SortOrder>(value)?,
13716                "sort_mode" => assert_fixture::<SortMode>(value)?,
13717                "missing_order" => assert_fixture::<MissingOrder>(value)?,
13718                "nested_score_mode" => assert_fixture::<NestedScoreMode>(value)?,
13719                "nested_inner_hits" => assert_fixture::<NestedInnerHits>(value)?,
13720                "sort_spec" => assert_fixture::<SortSpec>(value)?,
13721                "query" => assert_fixture::<Query>(value)?,
13722                "dense_retrieval_mode" => assert_fixture::<DenseRetrievalMode>(value)?,
13723                "vector_achieved_mode" => assert_fixture::<VectorAchievedMode>(value)?,
13724                "vector_branch_diagnostics" => assert_fixture::<VectorBranchDiagnostics>(value)?,
13725                "dense_vector_element_type" => assert_fixture::<DenseVectorElementType>(value)?,
13726                "dense_vector_byte_order" => assert_fixture::<DenseVectorByteOrder>(value)?,
13727                "vector_value" => assert_fixture::<VectorValue>(value)?,
13728                "sparse_vector_entry" => assert_fixture::<SparseVectorEntry>(value)?,
13729                "sparse_vector_value" => assert_fixture::<SparseVectorValue>(value)?,
13730                "vector_set_value" => assert_fixture::<VectorSetValue>(value)?,
13731                "vector_evaluation_snapshot" => assert_fixture::<VectorEvaluationSnapshot>(value)?,
13732                "vector_evaluation_query_set" => assert_fixture::<VectorEvaluationQuerySet>(value)?,
13733                "vector_evaluation_budget" => assert_fixture::<VectorEvaluationBudget>(value)?,
13734                "vector_candidate_policy" => assert_fixture::<VectorCandidatePolicy>(value)?,
13735                "vector_calibration_objective" => assert_fixture::<VectorCalibrationObjective>(value)?,
13736                "vector_strategy_profile" => assert_fixture::<VectorStrategyProfile>(value)?,
13737                "vector_evaluation_work" => assert_fixture::<VectorEvaluationWork>(value)?,
13738                "vector_evaluation_error_code" => assert_fixture::<VectorEvaluationErrorCode>(value)?,
13739                "vector_evaluation_error" => assert_fixture::<VectorEvaluationError>(value)?,
13740                "vector_recall_result" => assert_fixture::<VectorRecallResult>(value)?,
13741                "vector_calibration_candidate" => assert_fixture::<VectorCalibrationCandidate>(value)?,
13742                "vector_calibration_result" => assert_fixture::<VectorCalibrationResult>(value)?,
13743                "vector_diagnostic_result" => assert_fixture::<VectorDiagnosticResult>(value)?,
13744                "vector_warm_component" => assert_fixture::<VectorWarmComponent>(value)?,
13745                "vector_warm_state" => assert_fixture::<VectorWarmState>(value)?,
13746                "vector_warm_achievement" => assert_fixture::<VectorWarmAchievement>(value)?,
13747                "vector_warm_result" => assert_fixture::<VectorWarmResult>(value)?,
13748                "dense_retrieval_threshold" => assert_fixture::<DenseRetrievalThreshold>(value)?,
13749                "retrieval_branch" => assert_fixture::<RetrievalBranch>(value)?,
13750                "weighted_rrf_fusion" => assert_fixture::<WeightedRrfFusion>(value)?,
13751                "retrieval_plan" => assert_fixture::<RetrievalPlan>(value)?,
13752                "histogram_bounds" => assert_fixture::<HistogramBounds>(value)?,
13753                "date_histogram_bounds" => assert_fixture::<DateHistogramBounds>(value)?,
13754                "approximation_algorithm" => assert_fixture::<ApproximationAlgorithm>(value)?,
13755                "approximation" => assert_fixture::<Approximation>(value)?,
13756                "percentile_value" => assert_fixture::<PercentileValue>(value)?,
13757                "approximate_percentile_value" => assert_fixture::<ApproximatePercentileValue>(value)?,
13758                "composite_order" => assert_fixture::<CompositeOrder>(value)?,
13759                "composite_source" => assert_fixture::<CompositeSource>(value)?,
13760                "aggregation" => assert_fixture::<Aggregation>(value)?,
13761                "nested_search_hit" => assert_fixture::<NestedSearchHit>(value)?,
13762                "named_nested_inner_hits_result" => assert_fixture::<NamedNestedInnerHitsResult>(value)?,
13763                "fragment_boundary" => assert_fixture::<FragmentBoundary>(value)?,
13764                "fragment_offset_encoding" => assert_fixture::<FragmentOffsetEncoding>(value)?,
13765                "fragment_ranker" => assert_fixture::<FragmentRanker>(value)?,
13766                "fragment_request" => assert_fixture::<FragmentRequest>(value)?,
13767                "search_fragment" => assert_fixture::<SearchFragment>(value)?,
13768                "numeric_feature_transform" => assert_fixture::<NumericFeatureTransform>(value)?,
13769                "numeric_result_feature" => assert_fixture::<NumericResultFeature>(value)?,
13770                "result_feature_request" => assert_fixture::<ResultFeatureRequest>(value)?,
13771                "result_diversification" => assert_fixture::<ResultDiversification>(value)?,
13772                "branch_score_kind" => assert_fixture::<BranchScoreKind>(value)?,
13773                "result_feature" => assert_fixture::<ResultFeature>(value)?,
13774                "search_hit" => assert_fixture::<SearchHit>(value)?,
13775                "aggregation_bucket" => assert_fixture::<AggregationBucket>(value)?,
13776                "aggregation_result" => assert_fixture::<AggregationResult>(value)?,
13777                "shard_counts" => assert_fixture::<ShardCounts>(value)?,
13778                "total_hits_relation" => assert_fixture::<TotalHitsRelation>(value)?,
13779                "search_total" => assert_fixture::<SearchTotal>(value)?,
13780                "search_execution_freshness" => assert_fixture::<SearchExecutionFreshness>(value)?,
13781                "search_freshness" => assert_fixture::<SearchFreshness>(value)?,
13782                "search_degradation_reason" => assert_fixture::<SearchDegradationReason>(value)?,
13783                "search_achievement" => assert_fixture::<SearchAchievement>(value)?,
13784                "search_failure_stage" => assert_fixture::<SearchFailureStage>(value)?,
13785                "search_failure_reason" => assert_fixture::<SearchFailureReason>(value)?,
13786                "collection_shard" => assert_fixture::<CollectionShard>(value)?,
13787                "search_partial_failure" => assert_fixture::<SearchPartialFailure>(value)?,
13788                "artifact" => assert_fixture::<Artifact>(value)?,
13789                "portability_storage_capability" => assert_fixture::<PortabilityStorageCapability>(value)?,
13790                "collection_export_artifact" => assert_fixture::<CollectionExportArtifact>(value)?,
13791                "search_validation_bound" => assert_fixture::<SearchValidationBound>(value)?,
13792                "search_validation_estimates" => assert_fixture::<SearchValidationEstimates>(value)?,
13793                "search_validation_limit" => assert_fixture::<SearchValidationLimit>(value)?,
13794                "operation_kind" => assert_fixture::<OperationKind>(value)?,
13795                "operation_authority" => assert_fixture::<OperationAuthority>(value)?,
13796                "operation_target" => assert_fixture::<OperationTarget>(value)?,
13797                "operation_state" => assert_fixture::<OperationState>(value)?,
13798                "operation_pending_state" => assert_fixture::<OperationPendingState>(value)?,
13799                "operation_progress_unit" => assert_fixture::<OperationProgressUnit>(value)?,
13800                "operation_progress" => assert_fixture::<OperationProgress>(value)?,
13801                "operation_result" => assert_fixture::<OperationResult>(value)?,
13802                "operation_failure" => assert_fixture::<OperationFailure>(value)?,
13803                "operation_cancellation" => assert_fixture::<OperationCancellation>(value)?,
13804                "operation_retention_state" => assert_fixture::<OperationRetentionState>(value)?,
13805                "operation_retention" => assert_fixture::<OperationRetention>(value)?,
13806                "operation" => assert_fixture::<Operation>(value)?,
13807                "write_durability_boundary" => assert_fixture::<WriteDurabilityBoundary>(value)?,
13808                "write_visibility_mode" => assert_fixture::<WriteVisibilityMode>(value)?,
13809                "write_response_stage" => assert_fixture::<WriteResponseStage>(value)?,
13810                "write_achievement" => assert_fixture::<WriteAchievement>(value)?,
13811                "mutation_resolver" => assert_fixture::<MutationResolver>(value)?,
13812                "mutation_outcome" => assert_fixture::<MutationOutcome>(value)?,
13813                "submission_state" => assert_fixture::<SubmissionState>(value)?,
13814                "expected_binding" => assert_fixture::<ExpectedBinding>(value)?,
13815                "administration_alias_action" => assert_fixture::<AdministrationAliasAction>(value)?,
13816                "administration_mutation" => assert_fixture::<AdministrationMutation>(value)?,
13817                "administration_outcome" => assert_fixture::<AdministrationOutcome>(value)?,
13818                "index_change_apply_receipt" => assert_fixture::<IndexChangeApplyReceipt>(value)?,
13819                "bulk_document_item" => assert_fixture::<BulkDocumentItem>(value)?,
13820                "bulk_document_item_outcome" => assert_fixture::<BulkDocumentItemOutcome>(value)?,
13821                "bulk_document_outcome" => assert_fixture::<BulkDocumentOutcome>(value)?,
13822                "retained_append_item" => assert_fixture::<RetainedAppendItem>(value)?,
13823                "retained_append_state" => assert_fixture::<RetainedAppendState>(value)?,
13824                "retained_append_retry_safety" => assert_fixture::<RetainedAppendRetrySafety>(value)?,
13825                "retained_append_item_outcome" => assert_fixture::<RetainedAppendItemOutcome>(value)?,
13826                "retained_append_bulk_outcome" => assert_fixture::<RetainedAppendBulkOutcome>(value)?,
13827                "retained_append_observation_state" => assert_fixture::<RetainedAppendObservationState>(value)?,
13828                "retained_append_observation_outcome" => assert_fixture::<RetainedAppendObservationOutcome>(value)?,
13829                "binary_value" => assert_fixture::<BinaryValue>(value)?,
13830                "state_hash_field" => assert_fixture::<StateHashField>(value)?,
13831                "state_set_entry" => assert_fixture::<StateSetEntry>(value)?,
13832                "state_set_condition" => assert_fixture::<StateSetCondition>(value)?,
13833                "state_operation" => assert_fixture::<StateOperation>(value)?,
13834                "state_optional_value" => assert_fixture::<StateOptionalValue>(value)?,
13835                "state_command_result" => assert_fixture::<StateCommandResult>(value)?,
13836                "state_write_resolution" => assert_fixture::<StateWriteResolution>(value)?,
13837                "service_credential_reservation" => assert_fixture::<ServiceCredentialReservation>(value)?,
13838                "subscription_metadata_field" => assert_fixture::<SubscriptionMetadataField>(value)?,
13839                "subscription_field" => assert_fixture::<SubscriptionField>(value)?,
13840                "subscription_filter" => assert_fixture::<SubscriptionFilter>(value)?,
13841                "subscription_cursor_entry" => assert_fixture::<SubscriptionCursorEntry>(value)?,
13842                "subscription_route" => assert_fixture::<SubscriptionRoute>(value)?,
13843                "subscription_start_position" => assert_fixture::<SubscriptionStartPosition>(value)?,
13844                "subscription_start" => assert_fixture::<SubscriptionStart>(value)?,
13845                "subscription_accepted" => assert_fixture::<SubscriptionAccepted>(value)?,
13846                "subscription_writer_fence" => assert_fixture::<SubscriptionWriterFence>(value)?,
13847                "subscription_event" => assert_fixture::<SubscriptionEvent>(value)?,
13848                "subscription_heartbeat" => assert_fixture::<SubscriptionHeartbeat>(value)?,
13849                "subscription_gap" => assert_fixture::<SubscriptionGap>(value)?,
13850                "subscription_terminal_reason" => assert_fixture::<SubscriptionTerminalReason>(value)?,
13851                "subscription_terminal" => assert_fixture::<SubscriptionTerminal>(value)?,
13852                "subscription_frame" => assert_fixture::<SubscriptionFrame>(value)?,
13853                "stream_binding" => assert_fixture::<StreamBinding>(value)?,
13854                "capability_grant" => assert_fixture::<CapabilityGrant>(value)?,
13855                "protocol_limit" => assert_fixture::<ProtocolLimit>(value)?,
13856                "document_mutation_condition" => assert_fixture::<DocumentMutationCondition>(value)?,
13857                "audit_adapter" => assert_fixture::<AuditAdapter>(value)?,
13858                "audit_decision" => assert_fixture::<AuditDecision>(value)?,
13859                "audit_outcome" => assert_fixture::<AuditOutcome>(value)?,
13860                "audit_detail" => assert_fixture::<AuditDetail>(value)?,
13861                "audit_gap_reason" => assert_fixture::<AuditGapReason>(value)?,
13862                "audit_event" => assert_fixture::<AuditEvent>(value)?,
13863                "audit_gap" => assert_fixture::<AuditGap>(value)?,
13864                "audit_stream_state" => assert_fixture::<AuditStreamState>(value)?,
13865                "service_credential_grant" => assert_fixture::<ServiceCredentialGrant>(value)?,
13866                "service_credential_summary" => assert_fixture::<ServiceCredentialSummary>(value)?,
13867                "security_role" => assert_fixture::<SecurityRole>(value)?,
13868                "role_append_scope_change" => assert_fixture::<RoleAppendScopeChange>(value)?,
13869                "role_append_access_preparation" => assert_fixture::<RoleAppendAccessPreparation>(value)?,
13870                "security_action_outcome" => assert_fixture::<SecurityActionOutcome>(value)?,
13871                "maintenance_work_state" => assert_fixture::<MaintenanceWorkState>(value)?,
13872                "maintenance_attempt_state" => assert_fixture::<MaintenanceAttemptState>(value)?,
13873                "maintenance_failure_class" => assert_fixture::<MaintenanceFailureClass>(value)?,
13874                "maintenance_failure_class_count" => assert_fixture::<MaintenanceFailureClassCount>(value)?,
13875                "maintenance_attempt_observation" => assert_fixture::<MaintenanceAttemptObservation>(value)?,
13876                "maintenance_task_scope" => assert_fixture::<MaintenanceTaskScope>(value)?,
13877                "maintenance_task_status" => assert_fixture::<MaintenanceTaskStatus>(value)?,
13878                "maintenance_status_aggregate" => assert_fixture::<MaintenanceStatusAggregate>(value)?,
13879                "runtime_status_detail" => assert_fixture::<RuntimeStatusDetail>(value)?,
13880                "result_cache_status" => assert_fixture::<ResultCacheStatus>(value)?,
13881                "field_promotion_status" => assert_fixture::<FieldPromotionStatus>(value)?,
13882                "overload_shard_status" => assert_fixture::<OverloadShardStatus>(value)?,
13883                "external_key_binding" => assert_fixture::<ExternalKeyBinding>(value)?,
13884                "rollup_measure" => assert_fixture::<RollupMeasure>(value)?,
13885                "aggregate_then_delete_policy" => assert_fixture::<AggregateThenDeletePolicy>(value)?,
13886                "lifecycle_binding_status" => assert_fixture::<LifecycleBindingStatus>(value)?,
13887                "lifecycle_rollup_status" => assert_fixture::<LifecycleRollupStatus>(value)?,
13888                "lifecycle_status" => assert_fixture::<LifecycleStatus>(value)?,
13889                "quota_limit" => assert_fixture::<QuotaLimit>(value)?,
13890                "quota_consumption" => assert_fixture::<QuotaConsumption>(value)?,
13891                "quota_update" => assert_fixture::<QuotaUpdate>(value)?,
13892                "core_binding" => assert_fixture::<CoreBinding>(value)?,
13893                "readiness_observation" => assert_fixture::<ReadinessObservation>(value)?,
13894                "usage_dimension" => assert_fixture::<UsageDimension>(value)?,
13895                "physical_usage_value" => assert_fixture::<PhysicalUsageValue>(value)?,
13896                "core_usage_units" => assert_fixture::<CoreUsageUnits>(value)?,
13897                "core_usage_correction" => assert_fixture::<CoreUsageCorrection>(value)?,
13898                "response_meta" => assert_fixture::<ResponseMeta>(value)?,
13899                "error_disposition" => assert_fixture::<ErrorDisposition>(value)?,
13900                "recovery_action" => assert_fixture::<RecoveryAction>(value)?,
13901                "limit_class" => assert_fixture::<LimitClass>(value)?,
13902                "error_detail" => assert_fixture::<ErrorDetail>(value)?,
13903                "connection_profile" => assert_fixture::<ConnectionProfile>(value)?,
13904                _ => return Err("fixture names an unknown generated type".into()),
13905            }
13906        }
13907        Ok(())
13908    }
13909    #[test]
13910    fn every_aggregation_variant_has_a_canonical_fixture() -> Result<(), Box<dyn std::error::Error>> {
13911        let document: serde_json::Value =
13912            serde_json::from_str(include_str!("../../../tests/native-api/closed-schema.json"))?;
13913        let fixtures = document["aggregation_variants"]
13914            .as_object()
13915            .ok_or("aggregation fixtures are not an object")?;
13916        assert_eq!(fixtures.len(), 16);
13917        for value in fixtures.values() {
13918            assert_fixture::<Aggregation>(value)?;
13919        }
13920        Ok(())
13921    }
13922    #[test]
13923    fn exact_scalar_canonicality_is_closed() {
13924        assert_eq!(
13925            U64 {
13926                value: u64::MAX.to_string()
13927            }
13928            .validate(),
13929            Ok(())
13930        );
13931        assert_eq!(
13932            I64 {
13933                value: i64::MIN.to_string()
13934            }
13935            .validate(),
13936            Ok(())
13937        );
13938        assert_eq!(U64 { value: "01".to_owned() }.validate(), Err(ScalarError::InvalidU64));
13939        assert_eq!(
13940            ExactDecimal {
13941                coefficient: "12345".to_owned(),
13942                scale: 2
13943            }
13944            .validate(),
13945            Ok(())
13946        );
13947        assert_eq!(
13948            ExactDecimal {
13949                coefficient: "123450".to_owned(),
13950                scale: 3
13951            }
13952            .validate(),
13953            Err(ScalarError::InvalidDecimal)
13954        );
13955        assert_eq!(
13956            ExactDecimal {
13957                coefficient: "1".to_owned(),
13958                scale: 1_025
13959            }
13960            .validate(),
13961            Err(ScalarError::InvalidDecimal)
13962        );
13963    }
13964    #[test]
13965    fn scalar_decoders_refuse_numbers_and_noncanonical_strings() {
13966        assert!(serde_json::from_str::<U64>("9007199254740993").is_err());
13967        assert!(serde_json::from_str::<U64>(r#""01""#).is_err());
13968        assert!(serde_json::from_str::<Identity>(r#""0123456789ABCDEF0123456789ABCDEF""#).is_err());
13969        assert!(serde_json::from_str::<Digest>(r#""0123456789abcdef0123456789abcdef""#).is_err());
13970        assert!(serde_json::from_str::<ExactDecimal>(r#"{"coefficient":"123450","scale":3}"#).is_err());
13971        assert!(serde_json::from_str::<ApproximateNumber>(r#""1.0""#).is_err());
13972    }
13973    #[test]
13974    fn semantic_json_rejects_duplicate_fields() {
13975        let value = JsonValue::Object(vec![
13976            JsonField {
13977                name: "x".to_owned(),
13978                value: JsonValue::Null,
13979            },
13980            JsonField {
13981                name: "x".to_owned(),
13982                value: JsonValue::Bool(true),
13983            },
13984        ]);
13985        assert_eq!(validate_semantic_json(&value), Err(JsonError::DuplicateObjectField));
13986    }
13987    #[test]
13988    fn strict_generated_shapes_refuse_malformed_duplicate_unknown_field_and_tag() {
13989        assert!(serde_json::from_str::<DiscoverRequest>(r#"{"unexpected":true}"#).is_err());
13990        assert!(serde_json::from_str::<Cursor>(r#"{"value":"a","value":"b"}"#).is_err());
13991        assert!(serde_json::from_str::<Query>(r#"{"kind":"future_query"}"#).is_err());
13992        assert!(serde_json::from_str::<Cursor>(r#"{"value":1}"#).is_err());
13993    }
13994    fn admitted_error_detail(code: ErrorCode) -> ErrorDetail {
13995        match code {
13996            ErrorCode::Aborted => ErrorDetail::Aborted {
13997                reason: "test".to_owned(),
13998            },
13999            ErrorCode::DeadlineExceeded => ErrorDetail::DeadlineExceeded,
14000            ErrorCode::InvalidRequest => ErrorDetail::InvalidRequest {
14001                field: None,
14002                reason: "test".to_owned(),
14003            },
14004            ErrorCode::UnsupportedVersion => ErrorDetail::UnsupportedVersion {
14005                observed: 1,
14006                maximum_supported: 1,
14007            },
14008            ErrorCode::Unauthenticated => ErrorDetail::Unauthenticated,
14009            ErrorCode::PermissionDenied => ErrorDetail::PermissionDenied {
14010                action: None,
14011                workload_class: None,
14012            },
14013            ErrorCode::NotFound => ErrorDetail::NotFound { resource: None },
14014            ErrorCode::Conflict => ErrorDetail::Conflict {
14015                expected_revision: None,
14016                observed_revision: None,
14017            },
14018            ErrorCode::StaleCursor => ErrorDetail::StaleCursor { restart_count: 0 },
14019            ErrorCode::RestartBudgetExhausted => ErrorDetail::RestartBudgetExhausted { maximum_restarts: 0 },
14020            ErrorCode::LimitExceeded => ErrorDetail::LimitExceeded {
14021                class: LimitClass::RequestBound,
14022                limit_id: "test".to_owned(),
14023                maximum: U64 { value: "0".to_owned() },
14024            },
14025            ErrorCode::CapabilityUnavailable => ErrorDetail::CapabilityUnavailable { capability: None },
14026            ErrorCode::NotSubmitted => ErrorDetail::NotSubmitted {
14027                retry_after_millis: None,
14028            },
14029            ErrorCode::SubmittedIndeterminate => ErrorDetail::SubmittedIndeterminate { locator: None },
14030            ErrorCode::ExpiredUnknown => ErrorDetail::ExpiredUnknown { locator: None },
14031            ErrorCode::SecretNotEscrowed => ErrorDetail::SecretNotEscrowed,
14032            ErrorCode::RetentionGap => ErrorDetail::RetentionGap {
14033                retired_through: U64 { value: "0".to_owned() },
14034            },
14035            ErrorCode::ArtifactRangeInvalid => ErrorDetail::ArtifactRangeInvalid {
14036                maximum_bytes: U64 { value: "0".to_owned() },
14037            },
14038            ErrorCode::ChecksumMismatch => ErrorDetail::ChecksumMismatch {
14039                expected: Digest { value: "0".repeat(64) },
14040                observed: Digest { value: "0".repeat(64) },
14041            },
14042            ErrorCode::TemporarilyUnavailable => ErrorDetail::TemporarilyUnavailable {
14043                retry_after_millis: None,
14044            },
14045            ErrorCode::Internal => ErrorDetail::Internal,
14046        }
14047    }
14048    #[test]
14049    fn every_admitted_error_outcome_is_constructible_and_invalid_combinations_fail_closed() {
14050        let mut codes = std::collections::BTreeSet::new();
14051        for contract in LODESTONE_API_ERROR_OUTCOMES {
14052            codes.insert(format!("{:?}", contract.code));
14053            assert_eq!(
14054                ErrorBody::try_new(
14055                    contract.code,
14056                    "test".to_owned(),
14057                    contract.disposition,
14058                    contract.recovery,
14059                    admitted_error_detail(contract.code)
14060                ),
14061                Ok(ErrorBody {
14062                    code: contract.code,
14063                    message: "test".to_owned(),
14064                    disposition: contract.disposition,
14065                    recovery: contract.recovery,
14066                    details: admitted_error_detail(contract.code)
14067                })
14068            );
14069        }
14070        assert_eq!(codes.len(), 21);
14071        assert_eq!(
14072            ErrorBody::try_new(
14073                ErrorCode::Aborted,
14074                "test".to_owned(),
14075                ErrorDisposition::NotSubmitted,
14076                RecoveryAction::Stop,
14077                admitted_error_detail(ErrorCode::Aborted)
14078            ),
14079            Err(ErrorShapeError::OutcomeMismatch)
14080        );
14081        assert_eq!(
14082            ErrorBody::try_new(
14083                ErrorCode::Aborted,
14084                "test".to_owned(),
14085                ErrorDisposition::NotSubmitted,
14086                RecoveryAction::Retry,
14087                ErrorDetail::Internal
14088            ),
14089            Err(ErrorShapeError::DetailCodeMismatch)
14090        );
14091        assert_eq!(
14092            ErrorBody::try_new(
14093                ErrorCode::TemporarilyUnavailable,
14094                "test".to_owned(),
14095                ErrorDisposition::NotSubmitted,
14096                RecoveryAction::RetryAfter,
14097                ErrorDetail::TemporarilyUnavailable {
14098                    retry_after_millis: Some(U64 {
14099                        value: "60001".to_owned()
14100                    })
14101                }
14102            ),
14103            Err(ErrorShapeError::RetryAfterOutOfRange)
14104        );
14105    }
14106    #[test]
14107    fn registries_match_the_idl() {
14108        assert_eq!(LODESTONE_API_COMMAND_CONTRACTS.len(), 103);
14109        assert_eq!(LODESTONE_API_COMMAND_SEMANTICS.len(), 103);
14110        assert_eq!(LODESTONE_API_COMMAND_OUTCOMES.len(), 103);
14111        assert_eq!(LODESTONE_API_ERROR_CODES.len(), 21);
14112        assert_eq!(LODESTONE_API_ERROR_OUTCOMES.len(), 28);
14113        assert_eq!(LODESTONE_API_TYPE_CONTRACTS.len(), 261);
14114        assert_eq!(LODESTONE_API_STREAM_CONTRACTS.len(), 1);
14115        assert_eq!(LODESTONE_API_LIMITS.len(), 75);
14116        assert_eq!(LODESTONE_API_CLUSTER_CONTROL_ACTIONS.len(), 21);
14117        assert_eq!(LODESTONE_API_CLUSTER_CONTROL_TYPES.len(), 10);
14118    }
14119    #[test]
14120    fn mutation_outcome_metadata_matches_submission_boundaries() {
14121        for (command, outcome) in LODESTONE_API_COMMAND_CONTRACTS
14122            .iter()
14123            .zip(LODESTONE_API_COMMAND_OUTCOMES)
14124        {
14125            assert_eq!(command.command, outcome.command);
14126            let submits = !matches!(command.mutation, "read_only" | "read_only_prepare" | "catalog_prepare");
14127            assert_eq!(outcome.possible_submission_states.contains(&"submitted"), submits);
14128            assert_eq!(outcome.possible_submission_states.contains(&"indeterminate"), submits);
14129            assert_eq!(
14130                outcome.cancellation == "per_call_until_submission_then_resolve",
14131                submits
14132            );
14133        }
14134        for command in [
14135            Command::ReserveServiceCredential,
14136            Command::ReserveServiceCredentialRotation,
14137        ] {
14138            let outcome = LODESTONE_API_COMMAND_OUTCOMES
14139                .iter()
14140                .find(|outcome| outcome.command == command);
14141            assert!(
14142                matches!(outcome, Some(value) if value.identity_requirement == "caller_action_id" && value.resolver_command == Some(Command::ResolveServiceCredentialReservation))
14143            );
14144        }
14145    }
14146}