use serde::{Deserialize, Serialize};
mod bulk_batch_id;
pub use bulk_batch_id::{BulkBatchIdError, bulk_batch_id};
pub const LODESTONE_API_SCHEMA_ID: &str = "lodestone-api";
pub const LODESTONE_API_SPEC_SHA256: &str = "d4570e5f66dd0b6571091c95156196e0c02944e9dd3e205797402c82a3e4516b";
pub const LODESTONE_API_FORMAT_VERSION: u16 = 2;
pub const LODESTONE_API_ALPN: &str = "lodestone";
pub const BULK_BATCH_ID_FORMAT_VERSION: u16 = 2;
pub const BULK_BATCH_ID_DOMAIN: &[u8] = b"lodestone/bulk-batch\0";
#[derive(Clone, Debug, Eq, PartialEq, Serialize)]
#[serde(transparent)]
pub struct I64 {
pub value: String,
}
#[derive(Clone, Debug, Eq, PartialEq, Serialize)]
#[serde(transparent)]
pub struct U64 {
pub value: String,
}
#[derive(Clone, Debug, Eq, PartialEq, Serialize)]
#[serde(transparent)]
pub struct Identity {
pub value: String,
}
#[derive(Clone, Debug, Eq, PartialEq, Serialize)]
#[serde(transparent)]
pub struct Digest {
pub value: String,
}
#[derive(Clone, Debug, Eq, PartialEq, Serialize)]
pub struct ExactDecimal {
pub coefficient: String,
pub scale: u32,
}
#[derive(Clone, Debug, Eq, PartialEq, Serialize)]
#[serde(transparent)]
pub struct ApproximateNumber {
pub canonical_value: String,
}
#[derive(Clone, Debug, Deserialize, Eq, PartialEq, Serialize)]
#[serde(deny_unknown_fields)]
pub struct RawJson {
pub bytes_base64: String,
}
#[derive(Clone, Copy, Debug, Eq, PartialEq)]
pub enum ScalarError {
InvalidI64,
InvalidU64,
InvalidIdentity,
InvalidDigest,
InvalidDecimal,
InvalidApproximateNumber,
}
impl std::fmt::Display for ScalarError {
fn fmt(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(formatter, "invalid Lodestone API scalar: {self:?}")
}
}
impl I64 {
pub fn validate(&self) -> Result<(), ScalarError> {
self.value
.parse::<i64>()
.ok()
.filter(|parsed| parsed.to_string() == self.value)
.map(|_| ())
.ok_or(ScalarError::InvalidI64)
}
}
impl U64 {
pub fn validate(&self) -> Result<(), ScalarError> {
self.value
.parse::<u64>()
.ok()
.filter(|parsed| parsed.to_string() == self.value)
.map(|_| ())
.ok_or(ScalarError::InvalidU64)
}
}
impl Identity {
pub fn validate(&self) -> Result<(), ScalarError> {
(self.value.len() == 32
&& self
.value
.bytes()
.all(|byte| byte.is_ascii_digit() || (b'a'..=b'f').contains(&byte)))
.then_some(())
.ok_or(ScalarError::InvalidIdentity)
}
}
impl Digest {
pub fn validate(&self) -> Result<(), ScalarError> {
(self.value.len() == 64
&& self
.value
.bytes()
.all(|byte| byte.is_ascii_digit() || (b'a'..=b'f').contains(&byte)))
.then_some(())
.ok_or(ScalarError::InvalidDigest)
}
}
impl ExactDecimal {
pub fn validate(&self) -> Result<(), ScalarError> {
let unsigned = self.coefficient.strip_prefix('-').unwrap_or(&self.coefficient);
let canonical = self.coefficient == "0"
|| (!unsigned.is_empty()
&& !unsigned.starts_with('0')
&& unsigned.bytes().all(|byte| byte.is_ascii_digit()));
(canonical
&& self.coefficient != "-0"
&& self.scale <= 1024
&& (self.scale == 0 || !self.coefficient.ends_with('0')))
.then_some(())
.ok_or(ScalarError::InvalidDecimal)
}
}
impl ApproximateNumber {
pub fn validate(&self) -> Result<(), ScalarError> {
self.canonical_value
.parse::<f64>()
.ok()
.filter(|parsed| {
parsed.is_finite() && self.canonical_value != "-0" && parsed.to_string() == self.canonical_value
})
.map(|_| ())
.ok_or(ScalarError::InvalidApproximateNumber)
}
}
macro_rules! deserialize_validated_string_scalar {
($type:ty) => {
impl<'de> Deserialize<'de> for $type {
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
let value = String::deserialize(deserializer)?;
let scalar = Self { value };
scalar.validate().map_err(serde::de::Error::custom)?;
Ok(scalar)
}
}
};
}
deserialize_validated_string_scalar!(I64);
deserialize_validated_string_scalar!(U64);
deserialize_validated_string_scalar!(Identity);
deserialize_validated_string_scalar!(Digest);
impl<'de> Deserialize<'de> for ExactDecimal {
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
#[derive(Deserialize)]
#[serde(deny_unknown_fields)]
struct Wire {
coefficient: String,
scale: u32,
}
let wire = Wire::deserialize(deserializer)?;
let scalar = Self {
coefficient: wire.coefficient,
scale: wire.scale,
};
scalar.validate().map_err(serde::de::Error::custom)?;
Ok(scalar)
}
}
impl<'de> Deserialize<'de> for ApproximateNumber {
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
let canonical_value = String::deserialize(deserializer)?;
let scalar = Self { canonical_value };
scalar.validate().map_err(serde::de::Error::custom)?;
Ok(scalar)
}
}
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(tag = "kind", content = "value", rename_all = "snake_case")]
pub enum JsonValue {
Null,
Bool(bool),
String(String),
I64(I64),
U64(U64),
ExactDecimal(ExactDecimal),
Approximate(ApproximateNumber),
Array(Vec<JsonValue>),
Object(Vec<JsonField>),
}
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(deny_unknown_fields)]
pub struct JsonField {
pub name: String,
pub value: JsonValue,
}
#[derive(Clone, Copy, Debug, Deserialize, Eq, PartialEq, Serialize)]
#[serde(rename_all = "snake_case")]
pub enum Action {
IdentityDiscovery,
DataRead,
DataWrite,
Append,
ResolveAppend,
IndexAdmin,
CatalogRead,
TaskRead,
SubscriptionRead,
DiagnosticsRead,
DiagnosticsCreate,
BackupRead,
BackupAdmin,
SecurityRead,
SecurityAdmin,
AuditRead,
QuotaRead,
QuotaAdmin,
BindingRead,
LifecycleAdmin,
AdmissionRead,
AdmissionAdmin,
UsageRead,
OperationRead,
OperationCancel,
}
#[derive(Clone, Copy, Debug, Deserialize, Eq, PartialEq, Serialize)]
#[serde(rename_all = "snake_case")]
pub enum ErrorCode {
Aborted,
DeadlineExceeded,
InvalidRequest,
UnsupportedVersion,
Unauthenticated,
PermissionDenied,
NotFound,
Conflict,
StaleCursor,
RestartBudgetExhausted,
LimitExceeded,
CapabilityUnavailable,
NotSubmitted,
SubmittedIndeterminate,
ExpiredUnknown,
SecretNotEscrowed,
RetentionGap,
ArtifactRangeInvalid,
ChecksumMismatch,
TemporarilyUnavailable,
Internal,
}
#[derive(Clone, Copy, Debug, Deserialize, Eq, PartialEq, Serialize)]
#[serde(rename_all = "snake_case")]
pub enum Command {
Discover,
ListIndexes,
GetIndex,
ValidateIndexChange,
ApplyIndexChange,
ApplyAdministrationMutation,
ListAliases,
GetAlias,
ListDataStreams,
GetDataStream,
ListComponentTemplates,
GetComponentTemplate,
ListIndexTemplates,
GetIndexTemplate,
ListIngestPipelines,
GetIngestPipeline,
SimulateIngestPipeline,
ReprocessByQuery,
ListLifecyclePolicies,
GetLifecyclePolicy,
PrepareCreateIndex,
PrepareDeleteIndex,
SubmitCatalogAction,
ResolveCatalogAction,
PrepareReplayableSourceIndex,
SubmitReplayableSourceIndex,
GetReplayableSource,
ControlReplayableSource,
CloneIndex,
ConfigureHistory,
GetHistory,
ResolveHistory,
PlaceHistoryHold,
ReleaseHistoryHold,
PrepareDocumentMutation,
SubmitDocumentMutation,
PrepareDocumentBulk,
SubmitDocumentBulk,
ResolveDocumentBulk,
PrepareAppendBulk,
SubmitAppendBulk,
ResolveAppendBulk,
ObserveAppendCommitted,
ResolveDocumentMutation,
GetDocument,
Search,
OpenPit,
RenewPit,
ClosePit,
ListOperations,
GetOperation,
CancelOperation,
ListAuditEvents,
ExportAuditEvents,
ReserveServiceCredential,
ReserveServiceCredentialRotation,
ActivateServiceCredential,
ResolveServiceCredentialReservation,
PrepareRevokeServiceCredential,
RevokeServiceCredential,
ResolveSecurityAction,
GetSecurityRole,
PrepareRoleAppendAccessChange,
SubmitRoleAppendAccessChange,
ListServiceCredentials,
ListBackups,
GetBackup,
CreateBackup,
ResolveBackupAction,
GetRuntimeStatus,
GetResultCacheStatus,
GetFieldPromotionStatus,
GetOverloadStatus,
ConfigureExternalKey,
RotateExternalKeyBinding,
ConfigureAggregateThenDelete,
GetLifecycleStatus,
GetQuota,
UpdateQuota,
GetBinding,
GetAdmissionStatus,
SetAdmission,
GetQuiesceStatus,
GetDecommissionReadiness,
GetUpgradeReadiness,
GetMaintenanceStatus,
GetRestoreReadiness,
WarmVectorIndex,
EvaluateVectorRecall,
CalibrateVectorStrategy,
GetVectorDiagnostic,
CreateDiagnostic,
GetDiagnostic,
ReadArtifactChunk,
ExportUsage,
ExecuteStateRead,
PrepareStateWrite,
SubmitStateWrite,
ResolveStateWrite,
}
#[derive(Clone, Copy, Debug, Eq, PartialEq)]
pub struct ActionAuthorizationContract {
pub action: Action,
pub any_of_permission_ids: &'static [&'static str],
}
pub const LODESTONE_API_ACTION_AUTHORIZATION: &[ActionAuthorizationContract] = &[
ActionAuthorizationContract {
action: Action::IdentityDiscovery,
any_of_permission_ids: &["security_read"],
},
ActionAuthorizationContract {
action: Action::DataRead,
any_of_permission_ids: &["data_read"],
},
ActionAuthorizationContract {
action: Action::DataWrite,
any_of_permission_ids: &["data_write"],
},
ActionAuthorizationContract {
action: Action::Append,
any_of_permission_ids: &["append"],
},
ActionAuthorizationContract {
action: Action::ResolveAppend,
any_of_permission_ids: &["resolve_append"],
},
ActionAuthorizationContract {
action: Action::IndexAdmin,
any_of_permission_ids: &["index_admin"],
},
ActionAuthorizationContract {
action: Action::CatalogRead,
any_of_permission_ids: &["catalog_read"],
},
ActionAuthorizationContract {
action: Action::TaskRead,
any_of_permission_ids: &["task_read"],
},
ActionAuthorizationContract {
action: Action::SubscriptionRead,
any_of_permission_ids: &["subscription_read"],
},
ActionAuthorizationContract {
action: Action::DiagnosticsRead,
any_of_permission_ids: &["diagnostics_read"],
},
ActionAuthorizationContract {
action: Action::DiagnosticsCreate,
any_of_permission_ids: &["diagnostics_create"],
},
ActionAuthorizationContract {
action: Action::BackupRead,
any_of_permission_ids: &["backup_read"],
},
ActionAuthorizationContract {
action: Action::BackupAdmin,
any_of_permission_ids: &["backup_admin"],
},
ActionAuthorizationContract {
action: Action::SecurityRead,
any_of_permission_ids: &["security_read"],
},
ActionAuthorizationContract {
action: Action::SecurityAdmin,
any_of_permission_ids: &["security_admin"],
},
ActionAuthorizationContract {
action: Action::AuditRead,
any_of_permission_ids: &["audit_read"],
},
ActionAuthorizationContract {
action: Action::QuotaRead,
any_of_permission_ids: &["quota_read"],
},
ActionAuthorizationContract {
action: Action::QuotaAdmin,
any_of_permission_ids: &["quota_admin"],
},
ActionAuthorizationContract {
action: Action::BindingRead,
any_of_permission_ids: &["binding_read"],
},
ActionAuthorizationContract {
action: Action::LifecycleAdmin,
any_of_permission_ids: &["lifecycle_admin"],
},
ActionAuthorizationContract {
action: Action::AdmissionRead,
any_of_permission_ids: &["admission_read"],
},
ActionAuthorizationContract {
action: Action::AdmissionAdmin,
any_of_permission_ids: &["admission_admin"],
},
ActionAuthorizationContract {
action: Action::UsageRead,
any_of_permission_ids: &["usage_read"],
},
ActionAuthorizationContract {
action: Action::OperationRead,
any_of_permission_ids: &[
"catalog_read",
"task_read",
"security_read",
"backup_read",
"diagnostics_read",
],
},
ActionAuthorizationContract {
action: Action::OperationCancel,
any_of_permission_ids: &[
"index_admin",
"task_admin",
"security_admin",
"backup_admin",
"diagnostics_create",
],
},
];
pub fn action_authorization(action: Action) -> Option<&'static ActionAuthorizationContract> {
LODESTONE_API_ACTION_AUTHORIZATION
.iter()
.find(|contract| contract.action == action)
}
#[derive(Clone, Copy, Debug, Eq, PartialEq)]
pub struct RuntimeCapabilityAuthorizationContract {
pub capability_id: &'static str,
pub required_permission_ids: &'static [&'static str],
}
pub const LODESTONE_API_RUNTIME_CAPABILITY_AUTHORIZATION: &[RuntimeCapabilityAuthorizationContract] = &[
RuntimeCapabilityAuthorizationContract {
capability_id: "search_and_append_log",
required_permission_ids: &["data_read", "data_write"],
},
RuntimeCapabilityAuthorizationContract {
capability_id: "committed_vector_and_hybrid",
required_permission_ids: &["data_read"],
},
RuntimeCapabilityAuthorizationContract {
capability_id: "realtime_or_pit_vector",
required_permission_ids: &["data_read"],
},
RuntimeCapabilityAuthorizationContract {
capability_id: "state_standard_express_ephemeral",
required_permission_ids: &["data_read", "data_write"],
},
RuntimeCapabilityAuthorizationContract {
capability_id: "state_relaxed",
required_permission_ids: &[],
},
RuntimeCapabilityAuthorizationContract {
capability_id: "bounded_resp",
required_permission_ids: &["data_read", "data_write"],
},
RuntimeCapabilityAuthorizationContract {
capability_id: "lodestone_rust_client",
required_permission_ids: &[],
},
RuntimeCapabilityAuthorizationContract {
capability_id: "replayable_source_indexes",
required_permission_ids: &["index_admin"],
},
RuntimeCapabilityAuthorizationContract {
capability_id: "zero_copy_clones",
required_permission_ids: &["index_admin"],
},
RuntimeCapabilityAuthorizationContract {
capability_id: "retained_history",
required_permission_ids: &["data_read"],
},
RuntimeCapabilityAuthorizationContract {
capability_id: "generation_result_cache",
required_permission_ids: &["data_read"],
},
RuntimeCapabilityAuthorizationContract {
capability_id: "adaptive_field_promotion",
required_permission_ids: &["index_admin"],
},
RuntimeCapabilityAuthorizationContract {
capability_id: "durable_overload_buffering",
required_permission_ids: &["data_read", "data_write"],
},
RuntimeCapabilityAuthorizationContract {
capability_id: "current_table_reader",
required_permission_ids: &["data_read"],
},
RuntimeCapabilityAuthorizationContract {
capability_id: "crypto_shred_and_rollup_lifecycle",
required_permission_ids: &["lifecycle_admin"],
},
];
pub fn runtime_capability_authorization(
capability_id: &str,
) -> Option<&'static RuntimeCapabilityAuthorizationContract> {
LODESTONE_API_RUNTIME_CAPABILITY_AUTHORIZATION
.iter()
.find(|contract| contract.capability_id == capability_id)
}
pub const LODESTONE_API_CURSOR_FORMAT_VERSION: u16 = 1;
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(deny_unknown_fields)]
pub struct Cursor {
pub value: String,
}
pub const LODESTONE_API_LOCATOR_FORMAT_VERSION: u16 = 1;
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(deny_unknown_fields)]
pub struct Locator {
pub authority: String,
pub value: String,
}
pub const LODESTONE_API_RESOURCE_FORMAT_VERSION: u16 = 1;
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(deny_unknown_fields)]
pub struct Resource {
pub kind: String,
pub name: String,
pub incarnation: Identity,
}
pub const LODESTONE_API_FIELD_PROMOTION_CONFIGURATION_FORMAT_VERSION: u16 = 1;
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(deny_unknown_fields)]
pub struct FieldPromotionConfiguration {
pub format_version: u32,
pub enabled: bool,
pub minimum_query_count: u32,
pub maximum_promoted_fields: u32,
pub maximum_cardinality: U64,
pub maximum_extra_bytes: U64,
pub allow_sensitive: bool,
}
pub const LODESTONE_API_OVERLOAD_CONFIGURATION_FORMAT_VERSION: u16 = 2;
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(deny_unknown_fields)]
pub struct OverloadConfiguration {
pub format_version: u32,
pub mode: String,
pub maximum_backlog_bytes: U64,
pub maximum_backlog_age_millis: U64,
pub maximum_collection_share_bytes: U64,
pub maximum_recovery_ops_per_pass: u32,
pub maximum_pending_overlay_documents: U64,
}
pub const LODESTONE_API_INDEX_POLICIES_FORMAT_VERSION: u16 = 1;
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(deny_unknown_fields)]
pub struct IndexPolicies {
pub durability: String,
pub storage: String,
pub cache: String,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub default_visibility: Option<String>,
pub field_promotion: FieldPromotionConfiguration,
pub overload: OverloadConfiguration,
}
pub const LODESTONE_API_MAINTENANCE_BUDGETS_FORMAT_VERSION: u16 = 1;
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(deny_unknown_fields)]
pub struct MaintenanceBudgets {
pub memtable_max_bytes: U64,
pub refresh_max_millis: U64,
pub seal_max_bytes: U64,
pub seal_max_millis: U64,
pub merge_max_bytes: U64,
pub delete_resolution_max_bytes: U64,
pub wal_retention_max_bytes: U64,
pub gc_max_keys: u32,
pub fsck_max_objects: u32,
pub deleted_tombstone_retention_millis: U64,
}
pub const LODESTONE_API_RESOURCE_DURABILITY_CLASS_FORMAT_VERSION: u16 = 1;
#[derive(Clone, Copy, Debug, Deserialize, Eq, PartialEq, Serialize)]
#[serde(rename_all = "snake_case")]
pub enum ResourceDurabilityClass {
RegionalObject,
ZonalLowLatency,
Relaxed,
Ephemeral,
}
pub const LODESTONE_API_RESOURCE_STORAGE_CLASS_FORMAT_VERSION: u16 = 1;
#[derive(Clone, Copy, Debug, Deserialize, Eq, PartialEq, Serialize)]
#[serde(rename_all = "snake_case")]
pub enum ResourceStorageClass {
Standard,
Cold,
}
pub const LODESTONE_API_VECTOR_QUALITY_OBJECTIVE_FORMAT_VERSION: u16 = 1;
#[derive(Clone, Copy, Debug, Deserialize, Eq, PartialEq, Serialize)]
#[serde(rename_all = "snake_case")]
pub enum VectorQualityObjective {
Balanced,
HighRecall,
MemoryEfficient,
}
pub const LODESTONE_API_VECTOR_INDEXING_OBJECTIVE_FORMAT_VERSION: u16 = 1;
#[derive(Clone, Copy, Debug, Deserialize, Eq, PartialEq, Serialize)]
#[serde(rename_all = "snake_case")]
pub enum VectorIndexingObjective {
FastBuild,
Balanced,
Compact,
}
pub const LODESTONE_API_VECTOR_RESIDENCY_INTENT_FORMAT_VERSION: u16 = 1;
#[derive(Clone, Copy, Debug, Deserialize, Eq, PartialEq, Serialize)]
#[serde(rename_all = "snake_case")]
pub enum VectorResidencyIntent {
Automatic,
PreferResident,
RequireResident,
}
pub const LODESTONE_API_VECTOR_CALIBRATION_BINDING_FORMAT_VERSION: u16 = 1;
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(deny_unknown_fields)]
pub struct VectorCalibrationBinding {
pub profile: VectorStrategyProfile,
pub evidence_digest: Digest,
}
pub const LODESTONE_API_VECTOR_RESOURCE_POLICY_FORMAT_VERSION: u16 = 2;
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(deny_unknown_fields)]
pub struct VectorResourcePolicy {
pub quality: VectorQualityObjective,
pub indexing: VectorIndexingObjective,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub residency: Option<VectorResidencyIntent>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub calibration: Option<VectorCalibrationBinding>,
}
pub const LODESTONE_API_WORKLOAD_CLASS_FORMAT_VERSION: u16 = 1;
#[derive(Clone, Copy, Debug, Deserialize, Eq, PartialEq, Serialize)]
#[serde(rename_all = "snake_case")]
pub enum WorkloadClass {
InteractiveSearch,
BatchAnalytics,
StreamingIngest,
BulkBackfill,
InternalMaintenance,
}
pub const LODESTONE_API_INDEX_RESOURCE_SPEC_FORMAT_VERSION: u16 = 3;
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(deny_unknown_fields)]
pub struct IndexResourceSpec {
pub format_version: u32,
pub revision: U64,
pub initial_shards: u32,
pub target_shard_bytes: U64,
pub durability: ResourceDurabilityClass,
pub storage_class: ResourceStorageClass,
pub ram_admission_weight: u32,
pub ram_hard_max_bytes: U64,
pub nvme_admission_weight: u32,
pub nvme_hard_max_bytes: U64,
pub refresh_objective_millis: u32,
pub memtable_hard_max_bytes: U64,
pub seal_parallelism: u32,
pub merge_parallelism: u32,
pub vector: VectorResourcePolicy,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub lifecycle_binding: Option<Identity>,
pub encryption_required: bool,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub resolver_capability: Option<Identity>,
}
pub const LODESTONE_API_INDEX_SUMMARY_FORMAT_VERSION: u16 = 1;
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(deny_unknown_fields)]
pub struct IndexSummary {
pub name: String,
pub incarnation: Identity,
pub revision: U64,
pub mode: String,
pub retained_event_identity: bool,
pub state: String,
pub schema_generation: U64,
pub routing_revision: U64,
pub shard_count: u32,
pub policies: IndexPolicies,
pub management_mode: String,
}
pub const LODESTONE_API_MAPPING_MODE_FORMAT_VERSION: u16 = 1;
#[derive(Clone, Copy, Debug, Deserialize, Eq, PartialEq, Serialize)]
#[serde(rename_all = "snake_case")]
pub enum MappingMode {
Mutable,
AppendLog,
State,
}
pub const LODESTONE_API_DYNAMIC_MAPPING_POLICY_FORMAT_VERSION: u16 = 1;
#[derive(Clone, Copy, Debug, Deserialize, Eq, PartialEq, Serialize)]
#[serde(rename_all = "snake_case")]
pub enum DynamicMappingPolicy {
True,
False,
Strict,
}
pub const LODESTONE_API_MAPPING_ANALYZER_FORMAT_VERSION: u16 = 1;
#[derive(Clone, Copy, Debug, Deserialize, Eq, PartialEq, Serialize)]
#[serde(rename_all = "snake_case")]
pub enum MappingAnalyzer {
Keyword,
Simple,
Standard,
Whitespace,
}
pub const LODESTONE_API_KEYWORD_NORMALIZER_FORMAT_VERSION: u16 = 1;
#[derive(Clone, Copy, Debug, Deserialize, Eq, PartialEq, Serialize)]
#[serde(rename_all = "snake_case")]
pub enum KeywordNormalizer {
Keyword,
Lowercase,
}
pub const LODESTONE_API_VECTOR_METRIC_FORMAT_VERSION: u16 = 1;
#[derive(Clone, Copy, Debug, Deserialize, Eq, PartialEq, Serialize)]
#[serde(rename_all = "snake_case")]
pub enum VectorMetric {
Cosine,
DotProduct,
SquaredL2,
}
pub const LODESTONE_API_MAPPING_SCALAR_FORMAT_VERSION: u16 = 1;
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(tag = "kind", rename_all = "snake_case", deny_unknown_fields)]
pub enum MappingScalar {
Boolean { value: bool },
I64 { value: I64 },
U64 { value: U64 },
F64Bits { value: U64 },
Keyword { value: String },
}
pub const LODESTONE_API_SPARSE_VECTOR_WEIGHT_TYPE_FORMAT_VERSION: u16 = 1;
#[derive(Clone, Copy, Debug, Deserialize, Eq, PartialEq, Serialize)]
#[serde(rename_all = "snake_case")]
pub enum SparseVectorWeightType {
F32,
F16,
}
pub const LODESTONE_API_MAPPING_FIELD_TYPE_FORMAT_VERSION: u16 = 3;
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(tag = "kind", rename_all = "snake_case", deny_unknown_fields)]
pub enum MappingFieldType {
Text,
Keyword,
U64,
Date,
I64,
F64,
Bool,
Nested,
Vector {
format_version: u32,
field_id: u32,
dimensions: u32,
metric: VectorMetric,
element_type: DenseVectorElementType,
#[serde(default, skip_serializing_if = "Option::is_none")]
quantization_scale: Option<ApproximateNumber>,
},
SparseVector {
format_version: u32,
field_id: u32,
maximum_dimension: u32,
weight_type: SparseVectorWeightType,
},
VectorSet {
format_version: u32,
field_id: u32,
dimensions: u32,
metric: VectorMetric,
element_type: DenseVectorElementType,
#[serde(default, skip_serializing_if = "Option::is_none")]
quantization_scale: Option<ApproximateNumber>,
maximum_vectors: u32,
},
}
pub const LODESTONE_API_MAPPING_FIELD_FORMAT_VERSION: u16 = 1;
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(deny_unknown_fields)]
pub struct MappingField {
pub path: String,
pub field_type: MappingFieldType,
pub stored: bool,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub null_value: Option<MappingScalar>,
}
pub const LODESTONE_API_MULTI_FIELD_PROJECTION_FORMAT_VERSION: u16 = 1;
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(deny_unknown_fields)]
pub struct MultiFieldProjection {
pub parent: String,
pub child: String,
}
pub const LODESTONE_API_ANALYZER_IDENTITY_FORMAT_VERSION: u16 = 1;
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(deny_unknown_fields)]
pub struct AnalyzerIdentity {
pub field: String,
pub index_analyzer: MappingAnalyzer,
pub search_analyzer: MappingAnalyzer,
}
pub const LODESTONE_API_KEYWORD_LIMIT_FORMAT_VERSION: u16 = 1;
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(deny_unknown_fields)]
pub struct KeywordLimit {
pub field: String,
pub max_bytes: u32,
pub normalizer: KeywordNormalizer,
}
pub const LODESTONE_API_MAPPING_FORMAT_VERSION: u16 = 1;
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(deny_unknown_fields)]
pub struct Mapping {
pub format_version: u32,
pub generation: U64,
pub mode: MappingMode,
pub dynamic_policy: DynamicMappingPolicy,
pub fields: Vec<MappingField>,
pub multi_field_projections: Vec<MultiFieldProjection>,
pub analyzer_identities: Vec<AnalyzerIdentity>,
pub keyword_limits: Vec<KeywordLimit>,
pub nested_paths: Vec<String>,
}
pub const LODESTONE_API_INDEX_DETAIL_FORMAT_VERSION: u16 = 1;
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(deny_unknown_fields)]
pub struct IndexDetail {
pub summary: IndexSummary,
pub current_mapping: Mapping,
pub budgets: MaintenanceBudgets,
pub resource_spec: IndexResourceSpec,
pub aliases: Vec<String>,
pub data_streams: Vec<String>,
}
pub const LODESTONE_API_SOURCE_PROVIDER_FORMAT_VERSION: u16 = 1;
#[derive(Clone, Copy, Debug, Deserialize, Eq, PartialEq, Serialize)]
#[serde(rename_all = "snake_case")]
pub enum SourceProvider {
Kafka,
ObjectLog,
HttpReplay,
GrpcReplay,
}
pub const LODESTONE_API_SOURCE_DECODER_FORMAT_VERSION: u16 = 1;
#[derive(Clone, Copy, Debug, Deserialize, Eq, PartialEq, Serialize)]
#[serde(rename_all = "snake_case")]
pub enum SourceDecoder {
LodestoneDocumentJson,
DebeziumPostgresJson,
}
pub const LODESTONE_API_SOURCE_REPLAY_GUARANTEES_FORMAT_VERSION: u16 = 1;
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(deny_unknown_fields)]
pub struct SourceReplayGuarantees {
pub durable_replay: bool,
pub stable_partition_identity: bool,
pub stable_operation_identity: bool,
pub ordered_positions: bool,
pub bounded_reads: bool,
pub explicit_retention: bool,
pub explicit_rewind: bool,
pub minimum_replay_window_millis: U64,
}
pub const LODESTONE_API_SOURCE_PARTITION_CONFIGURATION_FORMAT_VERSION: u16 = 1;
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(deny_unknown_fields)]
pub struct SourcePartitionConfiguration {
pub partition_id: u32,
pub partition_incarnation: U64,
pub initial_next_ordinal: U64,
pub initial_resume_token_base64: String,
}
pub const LODESTONE_API_REPLAYABLE_SOURCE_CONFIGURATION_FORMAT_VERSION: u16 = 1;
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(deny_unknown_fields)]
pub struct ReplayableSourceConfiguration {
pub source_incarnation: U64,
pub source_identity_digest: Digest,
pub provider: SourceProvider,
pub decoder: SourceDecoder,
pub partitions: Vec<SourcePartitionConfiguration>,
pub guarantees: SourceReplayGuarantees,
}
pub const LODESTONE_API_SOURCE_PARTITION_STATUS_FORMAT_VERSION: u16 = 1;
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(deny_unknown_fields)]
pub struct SourcePartitionStatus {
pub partition_id: u32,
pub partition_incarnation: U64,
pub indexed_next_ordinal: U64,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub provider_high_watermark_next_ordinal: Option<U64>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub retention_floor_next_ordinal: Option<U64>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub lag_records: Option<U64>,
}
pub const LODESTONE_API_REPLAYABLE_SOURCE_STATUS_FORMAT_VERSION: u16 = 1;
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(deny_unknown_fields)]
pub struct ReplayableSourceStatus {
pub index: Resource,
pub provider: SourceProvider,
pub decoder: SourceDecoder,
pub source_incarnation: U64,
pub source_identity_digest: Digest,
pub lifecycle: String,
pub lifecycle_generation: U64,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub pause_reason: Option<String>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub rebuild_reason: Option<String>,
pub retry_state: String,
pub retention_risk: String,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub last_batch_identity: Option<Identity>,
pub partitions: Vec<SourcePartitionStatus>,
}
pub const LODESTONE_API_SOURCE_CONTROL_TRANSITION_FORMAT_VERSION: u16 = 1;
#[derive(Clone, Copy, Debug, Deserialize, Eq, PartialEq, Serialize)]
#[serde(rename_all = "snake_case")]
pub enum SourceControlTransition {
Pause,
Resume,
RequireRebuild,
}
pub const LODESTONE_API_HISTORY_LEDGER_PRECONDITION_FORMAT_VERSION: u16 = 1;
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(tag = "kind", rename_all = "snake_case", deny_unknown_fields)]
pub enum HistoryLedgerPrecondition {
Absent,
Exact { revision: U64 },
}
pub const LODESTONE_API_HISTORY_RETENTION_POLICY_FORMAT_VERSION: u16 = 1;
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(deny_unknown_fields)]
pub struct HistoryRetentionPolicy {
pub keep_for_millis: U64,
pub capture_interval_millis: U64,
pub maximum_cuts: u32,
pub privacy_overlay_identity_limit: u32,
}
pub const LODESTONE_API_HISTORY_SELECTOR_FORMAT_VERSION: u16 = 1;
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(tag = "kind", rename_all = "snake_case", deny_unknown_fields)]
pub enum HistorySelector {
ExactCut { cut_id: Identity },
AtOrBeforeCommitTime { unix_millis: U64 },
}
pub const LODESTONE_API_HISTORY_HOLD_FORMAT_VERSION: u16 = 1;
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(deny_unknown_fields)]
pub struct HistoryHold {
pub hold_id: Identity,
pub cut_ids: Vec<Identity>,
}
pub const LODESTONE_API_HISTORY_STATUS_FORMAT_VERSION: u16 = 1;
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(deny_unknown_fields)]
pub struct HistoryStatus {
pub index: Resource,
pub revision: U64,
pub policy: HistoryRetentionPolicy,
pub page_count: u32,
pub cut_count: u32,
pub holds: Vec<HistoryHold>,
}
pub const LODESTONE_API_HISTORY_RESOLUTION_FORMAT_VERSION: u16 = 1;
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(deny_unknown_fields)]
pub struct HistoryResolution {
pub index: Resource,
pub selector: HistorySelector,
pub cut_id: Identity,
pub committed_at_unix_millis: U64,
pub uncertainty_millis: U64,
pub shard_count: u32,
pub security_policy_revision: U64,
}
pub const LODESTONE_API_INDEX_REFERENCE_FORMAT_VERSION: u16 = 1;
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(deny_unknown_fields)]
pub struct IndexReference {
pub name: String,
pub incarnation: Identity,
}
pub const LODESTONE_API_ALIAS_TARGET_FORMAT_VERSION: u16 = 1;
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(deny_unknown_fields)]
pub struct AliasTarget {
pub index: IndexReference,
pub write_index: bool,
}
pub const LODESTONE_API_ALIAS_SUMMARY_FORMAT_VERSION: u16 = 1;
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(deny_unknown_fields)]
pub struct AliasSummary {
pub name: String,
pub revision: U64,
pub visible_target_count: u32,
}
pub const LODESTONE_API_ALIAS_DETAIL_FORMAT_VERSION: u16 = 1;
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(deny_unknown_fields)]
pub struct AliasDetail {
pub summary: AliasSummary,
pub visible_targets: Vec<AliasTarget>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub filter: Option<RawJson>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub index_routing: Option<String>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub search_routing: Option<String>,
}
pub const LODESTONE_API_DATA_STREAM_SUMMARY_FORMAT_VERSION: u16 = 1;
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(deny_unknown_fields)]
pub struct DataStreamSummary {
pub name: String,
pub incarnation: Identity,
pub revision: U64,
pub generation: U64,
pub state: String,
pub visible_backing_count: u32,
}
pub const LODESTONE_API_COMPONENT_TEMPLATE_BINDING_FORMAT_VERSION: u16 = 1;
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(deny_unknown_fields)]
pub struct ComponentTemplateBinding {
pub name: String,
pub incarnation: Identity,
pub revision: U64,
}
pub const LODESTONE_API_INDEX_TEMPLATE_BINDING_FORMAT_VERSION: u16 = 1;
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(deny_unknown_fields)]
pub struct IndexTemplateBinding {
pub name: String,
pub incarnation: Identity,
pub revision: U64,
}
pub const LODESTONE_API_LIFECYCLE_POLICY_BINDING_FORMAT_VERSION: u16 = 1;
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(deny_unknown_fields)]
pub struct LifecyclePolicyBinding {
pub name: String,
pub incarnation: Identity,
pub revision: U64,
}
pub const LODESTONE_API_DATA_STREAM_DETAIL_FORMAT_VERSION: u16 = 1;
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(deny_unknown_fields)]
pub struct DataStreamDetail {
pub summary: DataStreamSummary,
pub visible_backing_indices: Vec<IndexReference>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub write_index: Option<IndexReference>,
pub timestamp_field: String,
pub index_template: IndexTemplateBinding,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub lifecycle_policy: Option<LifecyclePolicyBinding>,
}
pub const LODESTONE_API_COMPONENT_TEMPLATE_SUMMARY_FORMAT_VERSION: u16 = 1;
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(deny_unknown_fields)]
pub struct ComponentTemplateSummary {
pub name: String,
pub incarnation: Identity,
pub revision: U64,
}
pub const LODESTONE_API_COMPONENT_TEMPLATE_DETAIL_FORMAT_VERSION: u16 = 1;
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(deny_unknown_fields)]
pub struct ComponentTemplateDetail {
pub summary: ComponentTemplateSummary,
pub mapping: Mapping,
pub settings: RawJson,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub resource_spec: Option<IndexResourceSpec>,
}
pub const LODESTONE_API_INDEX_TEMPLATE_SUMMARY_FORMAT_VERSION: u16 = 1;
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(deny_unknown_fields)]
pub struct IndexTemplateSummary {
pub name: String,
pub incarnation: Identity,
pub revision: U64,
pub priority: i32,
pub data_stream: bool,
}
pub const LODESTONE_API_INDEX_TEMPLATE_DETAIL_FORMAT_VERSION: u16 = 1;
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(deny_unknown_fields)]
pub struct IndexTemplateDetail {
pub summary: IndexTemplateSummary,
pub index_patterns: Vec<String>,
pub components: Vec<ComponentTemplateBinding>,
pub mapping: Mapping,
pub settings: RawJson,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub resource_spec: Option<IndexResourceSpec>,
}
pub const LODESTONE_API_INGEST_PIPELINE_SUMMARY_FORMAT_VERSION: u16 = 1;
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(deny_unknown_fields)]
pub struct IngestPipelineSummary {
pub name: String,
pub incarnation: Identity,
pub revision: U64,
pub digest: Digest,
}
pub const LODESTONE_API_INGEST_PIPELINE_DETAIL_FORMAT_VERSION: u16 = 1;
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(deny_unknown_fields)]
pub struct IngestPipelineDetail {
pub summary: IngestPipelineSummary,
pub definition: RawJson,
}
pub const LODESTONE_API_INGEST_PIPELINE_SELECTION_FORMAT_VERSION: u16 = 1;
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(deny_unknown_fields)]
pub struct IngestPipelineSelection {
pub name: String,
pub expected: ExpectedBinding,
}
pub const LODESTONE_API_LIFECYCLE_POLICY_SUMMARY_FORMAT_VERSION: u16 = 1;
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(deny_unknown_fields)]
pub struct LifecyclePolicySummary {
pub name: String,
pub incarnation: Identity,
pub revision: U64,
}
pub const LODESTONE_API_ROLLOVER_THRESHOLDS_FORMAT_VERSION: u16 = 1;
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(deny_unknown_fields)]
pub struct RolloverThresholds {
#[serde(default, skip_serializing_if = "Option::is_none")]
pub max_primary_docs: Option<U64>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub max_primary_bytes: Option<U64>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub max_age_millis: Option<U64>,
}
pub const LODESTONE_API_RETENTION_POLICY_FORMAT_VERSION: u16 = 1;
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(deny_unknown_fields)]
pub struct RetentionPolicy {
#[serde(default, skip_serializing_if = "Option::is_none")]
pub document_max_age_millis: Option<U64>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub backing_index_max_age_millis: Option<U64>,
}
pub const LODESTONE_API_LIFECYCLE_POLICY_DETAIL_FORMAT_VERSION: u16 = 1;
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(deny_unknown_fields)]
pub struct LifecyclePolicyDetail {
pub summary: LifecyclePolicySummary,
pub rollover: RolloverThresholds,
pub retention: RetentionPolicy,
pub merge_hint: bool,
pub freeze_hint: bool,
pub delete_expired: bool,
}
pub const LODESTONE_API_TEXT_QUERY_OPERATOR_FORMAT_VERSION: u16 = 1;
#[derive(Clone, Copy, Debug, Deserialize, Eq, PartialEq, Serialize)]
#[serde(rename_all = "snake_case")]
pub enum TextQueryOperator {
Or,
And,
}
pub const LODESTONE_API_TEXT_QUERY_ANALYZER_FORMAT_VERSION: u16 = 1;
#[derive(Clone, Copy, Debug, Deserialize, Eq, PartialEq, Serialize)]
#[serde(rename_all = "snake_case")]
pub enum TextQueryAnalyzer {
Mapping,
Standard,
Simple,
Whitespace,
Keyword,
}
pub const LODESTONE_API_ZERO_TERMS_QUERY_FORMAT_VERSION: u16 = 1;
#[derive(Clone, Copy, Debug, Deserialize, Eq, PartialEq, Serialize)]
#[serde(rename_all = "snake_case")]
pub enum ZeroTermsQuery {
None,
All,
}
pub const LODESTONE_API_TEXT_QUERY_OPTIONS_FORMAT_VERSION: u16 = 1;
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(deny_unknown_fields)]
pub struct TextQueryOptions {
pub operator: TextQueryOperator,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub minimum_should_match: Option<u32>,
pub analyzer: TextQueryAnalyzer,
pub zero_terms_query: ZeroTermsQuery,
}
pub const LODESTONE_API_MULTI_MATCH_MODE_FORMAT_VERSION: u16 = 1;
#[derive(Clone, Copy, Debug, Deserialize, Eq, PartialEq, Serialize)]
#[serde(rename_all = "snake_case")]
pub enum MultiMatchMode {
BestFields,
MostFields,
Phrase,
PhrasePrefix,
CrossFields,
}
pub const LODESTONE_API_MULTI_MATCH_FIELD_FORMAT_VERSION: u16 = 1;
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(deny_unknown_fields)]
pub struct MultiMatchField {
pub field: String,
pub boost: ApproximateNumber,
}
pub const LODESTONE_API_MULTI_MATCH_OPTIONS_FORMAT_VERSION: u16 = 1;
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(deny_unknown_fields)]
pub struct MultiMatchOptions {
pub mode: MultiMatchMode,
pub operator: TextQueryOperator,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub minimum_should_match: Option<u32>,
pub analyzer: TextQueryAnalyzer,
pub zero_terms_query: ZeroTermsQuery,
pub slop: u32,
}
pub const LODESTONE_API_SORT_ORDER_FORMAT_VERSION: u16 = 1;
#[derive(Clone, Copy, Debug, Deserialize, Eq, PartialEq, Serialize)]
#[serde(rename_all = "snake_case")]
pub enum SortOrder {
Asc,
Desc,
}
pub const LODESTONE_API_SORT_MODE_FORMAT_VERSION: u16 = 1;
#[derive(Clone, Copy, Debug, Deserialize, Eq, PartialEq, Serialize)]
#[serde(rename_all = "snake_case")]
pub enum SortMode {
Auto,
Min,
Max,
}
pub const LODESTONE_API_MISSING_ORDER_FORMAT_VERSION: u16 = 1;
#[derive(Clone, Copy, Debug, Deserialize, Eq, PartialEq, Serialize)]
#[serde(rename_all = "snake_case")]
pub enum MissingOrder {
First,
Last,
}
pub const LODESTONE_API_NESTED_SCORE_MODE_FORMAT_VERSION: u16 = 1;
#[derive(Clone, Copy, Debug, Deserialize, Eq, PartialEq, Serialize)]
#[serde(rename_all = "snake_case")]
pub enum NestedScoreMode {
Avg,
Max,
Min,
None,
Sum,
}
pub const LODESTONE_API_NESTED_INNER_HITS_FORMAT_VERSION: u16 = 1;
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(deny_unknown_fields)]
pub struct NestedInnerHits {
#[serde(default, skip_serializing_if = "Option::is_none")]
pub name: Option<String>,
pub from: u32,
pub size: u32,
pub sort: Vec<SortSpec>,
}
pub const LODESTONE_API_SORT_SPEC_FORMAT_VERSION: u16 = 1;
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(tag = "kind", rename_all = "snake_case", deny_unknown_fields)]
pub enum SortSpec {
Score {
order: SortOrder,
},
Field {
field: String,
order: SortOrder,
#[serde(default, skip_serializing_if = "Option::is_none")]
missing: Option<MissingOrder>,
mode: SortMode,
},
NestedField {
path: String,
field: String,
#[serde(default, skip_serializing_if = "Option::is_none")]
filter: Option<Box<Query>>,
order: SortOrder,
#[serde(default, skip_serializing_if = "Option::is_none")]
missing: Option<MissingOrder>,
mode: SortMode,
},
}
pub const LODESTONE_API_QUERY_FORMAT_VERSION: u16 = 1;
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(tag = "kind", rename_all = "snake_case", deny_unknown_fields)]
pub enum Query {
MatchAll,
Term {
field: String,
value: JsonValue,
},
Terms {
field: String,
values: Vec<JsonValue>,
},
Range {
field: String,
#[serde(default, skip_serializing_if = "Option::is_none")]
lower: Option<JsonValue>,
#[serde(default, skip_serializing_if = "Option::is_none")]
upper: Option<JsonValue>,
include_lower: bool,
include_upper: bool,
},
Text {
field: String,
text: String,
#[serde(default, skip_serializing_if = "Option::is_none")]
options: Option<TextQueryOptions>,
},
MultiMatch {
fields: Vec<MultiMatchField>,
text: String,
#[serde(default, skip_serializing_if = "Option::is_none")]
options: Option<MultiMatchOptions>,
},
Exists {
field: String,
},
Prefix {
field: String,
prefix: String,
#[serde(default, skip_serializing_if = "Option::is_none")]
analyzer: Option<TextQueryAnalyzer>,
analyze_wildcard: bool,
},
Fuzzy {
field: String,
value: String,
distance: u32,
#[serde(default, skip_serializing_if = "Option::is_none")]
analyzer: Option<TextQueryAnalyzer>,
},
Boost {
query: Box<Query>,
boost: ApproximateNumber,
},
Bool {
must: Vec<Query>,
filter: Vec<Query>,
should: Vec<Query>,
must_not: Vec<Query>,
minimum_should_match: u32,
},
Nested {
path: String,
query: Box<Query>,
score_mode: NestedScoreMode,
ignore_unmapped: bool,
#[serde(default, skip_serializing_if = "Option::is_none")]
inner_hits: Option<NestedInnerHits>,
},
}
pub const LODESTONE_API_DENSE_RETRIEVAL_MODE_FORMAT_VERSION: u16 = 1;
#[derive(Clone, Copy, Debug, Deserialize, Eq, PartialEq, Serialize)]
#[serde(rename_all = "snake_case")]
pub enum DenseRetrievalMode {
Auto,
Ann,
Exact,
}
pub const LODESTONE_API_VECTOR_ACHIEVED_MODE_FORMAT_VERSION: u16 = 1;
#[derive(Clone, Copy, Debug, Deserialize, Eq, PartialEq, Serialize)]
#[serde(rename_all = "snake_case")]
pub enum VectorAchievedMode {
Exact,
Ann,
Mixed,
}
pub const LODESTONE_API_VECTOR_BRANCH_DIAGNOSTICS_FORMAT_VERSION: u16 = 2;
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(deny_unknown_fields)]
pub struct VectorBranchDiagnostics {
pub name: String,
pub requested_mode: DenseRetrievalMode,
pub achieved_mode: VectorAchievedMode,
pub result_count: U64,
pub exact_segments: U64,
pub ann_segments: U64,
pub exact_fallback_segments: U64,
pub distance_evaluations: U64,
pub peak_scratch_bytes: U64,
pub fresh_vectors_scanned: U64,
pub realtime_overlay_queries: U64,
pub realtime_overlay_candidates: U64,
pub bundle_roots: U64,
pub object_read_requests: U64,
pub object_bytes_read: U64,
pub cache_hits: U64,
pub cache_misses: U64,
pub snapshot_digests: Vec<Digest>,
}
pub const LODESTONE_API_DENSE_VECTOR_ELEMENT_TYPE_FORMAT_VERSION: u16 = 1;
#[derive(Clone, Copy, Debug, Deserialize, Eq, PartialEq, Serialize)]
#[serde(rename_all = "snake_case")]
pub enum DenseVectorElementType {
F32,
F16,
I8,
}
pub const LODESTONE_API_DENSE_VECTOR_BYTE_ORDER_FORMAT_VERSION: u16 = 1;
#[derive(Clone, Copy, Debug, Deserialize, Eq, PartialEq, Serialize)]
#[serde(rename_all = "snake_case")]
pub enum DenseVectorByteOrder {
LittleEndian,
}
pub const LODESTONE_API_VECTOR_VALUE_FORMAT_VERSION: u16 = 1;
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(tag = "kind", rename_all = "snake_case", deny_unknown_fields)]
pub enum VectorValue {
Numeric {
values: Vec<ApproximateNumber>,
},
Binary {
element_type: DenseVectorElementType,
byte_order: DenseVectorByteOrder,
data_base64: String,
#[serde(default, skip_serializing_if = "Option::is_none")]
quantization_scale: Option<ApproximateNumber>,
},
}
pub const LODESTONE_API_SPARSE_VECTOR_ENTRY_FORMAT_VERSION: u16 = 1;
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(deny_unknown_fields)]
pub struct SparseVectorEntry {
pub dimension: u32,
pub weight: ApproximateNumber,
}
pub const LODESTONE_API_SPARSE_VECTOR_VALUE_FORMAT_VERSION: u16 = 1;
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(deny_unknown_fields)]
pub struct SparseVectorValue {
pub entries: Vec<SparseVectorEntry>,
}
pub const LODESTONE_API_VECTOR_SET_VALUE_FORMAT_VERSION: u16 = 1;
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(deny_unknown_fields)]
pub struct VectorSetValue {
pub vectors: Vec<VectorValue>,
}
pub const LODESTONE_API_VECTOR_EVALUATION_SNAPSHOT_FORMAT_VERSION: u16 = 1;
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(tag = "kind", rename_all = "snake_case", deny_unknown_fields)]
pub enum VectorEvaluationSnapshot {
CommittedCut { digest: Digest },
Pit { pit: Cursor },
}
pub const LODESTONE_API_VECTOR_EVALUATION_QUERY_SET_FORMAT_VERSION: u16 = 1;
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(tag = "kind", rename_all = "snake_case", deny_unknown_fields)]
pub enum VectorEvaluationQuerySet {
Sample { seed: U64, sample_count: u32 },
Supplied { digest: Digest, queries: Vec<VectorValue> },
}
pub const LODESTONE_API_VECTOR_EVALUATION_BUDGET_FORMAT_VERSION: u16 = 1;
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(deny_unknown_fields)]
pub struct VectorEvaluationBudget {
pub maximum_distance_evaluations: U64,
pub maximum_elapsed_work_units: U64,
pub maximum_peak_memory_bytes: U64,
pub maximum_object_reads: U64,
pub maximum_object_bytes: U64,
pub maximum_build_scratch_bytes: U64,
pub maximum_profile_comparisons: u32,
}
pub const LODESTONE_API_VECTOR_CANDIDATE_POLICY_FORMAT_VERSION: u16 = 1;
#[derive(Clone, Copy, Debug, Deserialize, Eq, PartialEq, Serialize)]
#[serde(rename_all = "snake_case")]
pub enum VectorCandidatePolicy {
Balanced,
HighRecall,
MemoryEfficient,
}
pub const LODESTONE_API_VECTOR_CALIBRATION_OBJECTIVE_FORMAT_VERSION: u16 = 1;
#[derive(Clone, Copy, Debug, Deserialize, Eq, PartialEq, Serialize)]
#[serde(rename_all = "snake_case")]
pub enum VectorCalibrationObjective {
Balanced,
HighRecall,
MemoryEfficient,
}
pub const LODESTONE_API_VECTOR_STRATEGY_PROFILE_FORMAT_VERSION: u16 = 1;
#[derive(Clone, Copy, Debug, Deserialize, Eq, PartialEq, Serialize)]
#[serde(rename_all = "snake_case")]
pub enum VectorStrategyProfile {
BalancedV1,
HighRecallV1,
MemoryEfficientV1,
}
pub const LODESTONE_API_VECTOR_EVALUATION_WORK_FORMAT_VERSION: u16 = 1;
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(deny_unknown_fields)]
pub struct VectorEvaluationWork {
pub distance_evaluations: U64,
pub elapsed_work_units: U64,
pub peak_memory_bytes: U64,
pub object_reads: U64,
pub object_bytes: U64,
}
pub const LODESTONE_API_VECTOR_EVALUATION_ERROR_CODE_FORMAT_VERSION: u16 = 1;
#[derive(Clone, Copy, Debug, Deserialize, Eq, PartialEq, Serialize)]
#[serde(rename_all = "snake_case")]
pub enum VectorEvaluationErrorCode {
AnnRefused,
ExhaustiveRefused,
TimedOut,
Cancelled,
Internal,
}
pub const LODESTONE_API_VECTOR_EVALUATION_ERROR_FORMAT_VERSION: u16 = 1;
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(deny_unknown_fields)]
pub struct VectorEvaluationError {
pub sample_ordinal: u32,
pub code: VectorEvaluationErrorCode,
}
pub const LODESTONE_API_VECTOR_RECALL_RESULT_FORMAT_VERSION: u16 = 1;
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(deny_unknown_fields)]
pub struct VectorRecallResult {
pub format_version: u32,
pub index: Resource,
pub field: String,
pub mapping_generation: U64,
pub snapshot_digest: Digest,
pub query_set_digest: Digest,
pub metric: VectorMetric,
pub k: u32,
pub candidate_policy: VectorCandidatePolicy,
pub strategy_identity: String,
pub completed_samples: u32,
pub ann_result_count: U64,
pub exhaustive_result_count: U64,
pub mean_recall_basis_points: u32,
pub minimum_recall_basis_points: u32,
pub p05_recall_basis_points: u32,
pub p50_recall_basis_points: u32,
pub p90_recall_basis_points: u32,
pub p99_recall_basis_points: u32,
pub ann_work: VectorEvaluationWork,
pub exhaustive_work: VectorEvaluationWork,
pub errors: Vec<VectorEvaluationError>,
}
pub const LODESTONE_API_VECTOR_CALIBRATION_CANDIDATE_FORMAT_VERSION: u16 = 1;
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(deny_unknown_fields)]
pub struct VectorCalibrationCandidate {
pub profile: VectorStrategyProfile,
pub recall: VectorRecallResult,
pub build_scratch_bytes: U64,
pub resident_bytes: U64,
pub evidence_digest: Digest,
}
pub const LODESTONE_API_VECTOR_CALIBRATION_RESULT_FORMAT_VERSION: u16 = 1;
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(deny_unknown_fields)]
pub struct VectorCalibrationResult {
pub format_version: u32,
pub objective: VectorCalibrationObjective,
pub candidates: Vec<VectorCalibrationCandidate>,
pub recommended_profile: VectorStrategyProfile,
pub recommended_evidence_digest: Digest,
pub requires_explicit_resource_revision_and_rebuild: bool,
}
pub const LODESTONE_API_VECTOR_DIAGNOSTIC_RESULT_FORMAT_VERSION: u16 = 1;
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(tag = "kind", rename_all = "snake_case", deny_unknown_fields)]
pub enum VectorDiagnosticResult {
Recall { result: Box<VectorRecallResult> },
Calibration { result: Box<VectorCalibrationResult> },
}
pub const LODESTONE_API_VECTOR_WARM_COMPONENT_FORMAT_VERSION: u16 = 1;
#[derive(Clone, Copy, Debug, Deserialize, Eq, PartialEq, Serialize)]
#[serde(rename_all = "snake_case")]
pub enum VectorWarmComponent {
Directory,
Approximate,
Exact,
}
pub const LODESTONE_API_VECTOR_WARM_STATE_FORMAT_VERSION: u16 = 1;
#[derive(Clone, Copy, Debug, Deserialize, Eq, PartialEq, Serialize)]
#[serde(rename_all = "snake_case")]
pub enum VectorWarmState {
Warmed,
Partial,
Stale,
}
pub const LODESTONE_API_VECTOR_WARM_ACHIEVEMENT_FORMAT_VERSION: u16 = 1;
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(deny_unknown_fields)]
pub struct VectorWarmAchievement {
pub component: VectorWarmComponent,
pub cache_identity: Digest,
pub resident_bytes: U64,
}
pub const LODESTONE_API_VECTOR_WARM_RESULT_FORMAT_VERSION: u16 = 1;
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(deny_unknown_fields)]
pub struct VectorWarmResult {
pub format_version: u32,
pub operation_identity: Digest,
pub index: Resource,
pub root_digest: Digest,
pub state: VectorWarmState,
pub progress: ExactDecimal,
pub achieved: Vec<VectorWarmAchievement>,
pub object_requests: U64,
pub object_bytes: U64,
pub cache_hits: U64,
pub cache_misses: U64,
pub started_at: U64,
pub completed_at: U64,
pub expires_at: U64,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub residency_intent: Option<VectorResidencyIntent>,
}
pub const LODESTONE_API_DENSE_RETRIEVAL_THRESHOLD_FORMAT_VERSION: u16 = 1;
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(tag = "kind", rename_all = "snake_case", deny_unknown_fields)]
pub enum DenseRetrievalThreshold {
MinimumScore { value: ApproximateNumber },
MaximumDistance { value: ApproximateNumber },
}
pub const LODESTONE_API_RETRIEVAL_BRANCH_FORMAT_VERSION: u16 = 3;
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(tag = "kind", rename_all = "snake_case", deny_unknown_fields)]
pub enum RetrievalBranch {
Lexical {
name: String,
query: Box<Query>,
#[serde(default, skip_serializing_if = "Option::is_none")]
filter: Option<Box<Query>>,
window: u32,
weight: ApproximateNumber,
},
Dense {
name: String,
field: String,
query_vector: VectorValue,
#[serde(default, skip_serializing_if = "Option::is_none")]
filter: Option<Box<Query>>,
window: u32,
#[serde(default, skip_serializing_if = "Option::is_none")]
candidates: Option<u32>,
weight: ApproximateNumber,
mode: DenseRetrievalMode,
#[serde(default, skip_serializing_if = "Option::is_none")]
threshold: Option<DenseRetrievalThreshold>,
},
Sparse {
name: String,
field: String,
query_vector: SparseVectorValue,
#[serde(default, skip_serializing_if = "Option::is_none")]
filter: Option<Box<Query>>,
window: u32,
weight: ApproximateNumber,
},
LateInteraction {
name: String,
field: String,
query_vectors: VectorSetValue,
#[serde(default, skip_serializing_if = "Option::is_none")]
filter: Option<Box<Query>>,
window: u32,
candidates: u32,
weight: ApproximateNumber,
},
}
pub const LODESTONE_API_WEIGHTED_RRF_FUSION_FORMAT_VERSION: u16 = 1;
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(deny_unknown_fields)]
pub struct WeightedRrfFusion {
pub rank_constant: u32,
}
pub const LODESTONE_API_RETRIEVAL_PLAN_FORMAT_VERSION: u16 = 1;
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(deny_unknown_fields)]
pub struct RetrievalPlan {
pub format_version: u32,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub global_filter: Option<Box<Query>>,
pub branches: Vec<RetrievalBranch>,
pub fusion: WeightedRrfFusion,
pub result_window: u32,
}
pub const LODESTONE_API_HISTOGRAM_BOUNDS_FORMAT_VERSION: u16 = 1;
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(deny_unknown_fields)]
pub struct HistogramBounds {
#[serde(default, skip_serializing_if = "Option::is_none")]
pub min: Option<ApproximateNumber>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub max: Option<ApproximateNumber>,
}
pub const LODESTONE_API_DATE_HISTOGRAM_BOUNDS_FORMAT_VERSION: u16 = 1;
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(deny_unknown_fields)]
pub struct DateHistogramBounds {
#[serde(default, skip_serializing_if = "Option::is_none")]
pub min: Option<I64>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub max: Option<I64>,
}
pub const LODESTONE_API_APPROXIMATION_ALGORITHM_FORMAT_VERSION: u16 = 1;
#[derive(Clone, Copy, Debug, Deserialize, Eq, PartialEq, Serialize)]
#[serde(rename_all = "snake_case")]
pub enum ApproximationAlgorithm {
HyperloglogV1,
FloatPrefixHistogramV1,
}
pub const LODESTONE_API_APPROXIMATION_FORMAT_VERSION: u16 = 1;
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(deny_unknown_fields)]
pub struct Approximation {
pub algorithm: ApproximationAlgorithm,
pub algorithm_version: u32,
pub precision: u32,
pub state_bytes: U64,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub relative_standard_error: Option<ApproximateNumber>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub maximum_rank_error: Option<ApproximateNumber>,
}
pub const LODESTONE_API_PERCENTILE_VALUE_FORMAT_VERSION: u16 = 1;
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(deny_unknown_fields)]
pub struct PercentileValue {
pub percent: ApproximateNumber,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub value: Option<ApproximateNumber>,
}
pub const LODESTONE_API_APPROXIMATE_PERCENTILE_VALUE_FORMAT_VERSION: u16 = 1;
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(deny_unknown_fields)]
pub struct ApproximatePercentileValue {
pub percent: ApproximateNumber,
pub value: ApproximateNumber,
pub lower_bound: ApproximateNumber,
pub upper_bound: ApproximateNumber,
pub maximum_rank_error: ApproximateNumber,
}
pub const LODESTONE_API_AGGREGATION_FORMAT_VERSION: u16 = 1;
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(tag = "kind", rename_all = "snake_case", deny_unknown_fields)]
pub enum Aggregation {
Terms {
name: String,
field: String,
size: u32,
sub_aggregations: Vec<Aggregation>,
},
Histogram {
name: String,
field: String,
interval: ApproximateNumber,
min_doc_count: U64,
#[serde(default, skip_serializing_if = "Option::is_none")]
extended_bounds: Option<HistogramBounds>,
#[serde(default, skip_serializing_if = "Option::is_none")]
hard_bounds: Option<HistogramBounds>,
offset: ApproximateNumber,
#[serde(default, skip_serializing_if = "Option::is_none")]
missing: Option<ApproximateNumber>,
sub_aggregations: Vec<Aggregation>,
},
Cardinality {
name: String,
field: String,
},
Percentiles {
name: String,
field: String,
percents: Vec<ApproximateNumber>,
},
ApproximateCardinality {
name: String,
field: String,
precision: u32,
},
ApproximatePercentiles {
name: String,
field: String,
percents: Vec<ApproximateNumber>,
precision: u32,
},
Sum {
name: String,
field: String,
},
Avg {
name: String,
field: String,
},
Min {
name: String,
field: String,
},
Max {
name: String,
field: String,
},
Stats {
name: String,
field: String,
},
DateHistogram {
name: String,
field: String,
#[serde(default, skip_serializing_if = "Option::is_none")]
fixed_interval_millis: Option<U64>,
#[serde(default, skip_serializing_if = "Option::is_none")]
calendar_interval: Option<String>,
#[serde(default, skip_serializing_if = "Option::is_none")]
time_zone: Option<String>,
min_doc_count: U64,
#[serde(default, skip_serializing_if = "Option::is_none")]
extended_bounds: Option<DateHistogramBounds>,
#[serde(default, skip_serializing_if = "Option::is_none")]
hard_bounds: Option<DateHistogramBounds>,
offset_millis: I64,
#[serde(default, skip_serializing_if = "Option::is_none")]
missing: Option<I64>,
sub_aggregations: Vec<Aggregation>,
},
Composite {
name: String,
size: u32,
sources: Vec<String>,
#[serde(default, skip_serializing_if = "Option::is_none")]
after: Option<Cursor>,
sub_aggregations: Vec<Aggregation>,
},
Filter {
name: String,
query: Box<Query>,
sub_aggregations: Vec<Aggregation>,
},
Nested {
name: String,
path: String,
sub_aggregations: Vec<Aggregation>,
},
ReverseNested {
name: String,
#[serde(default, skip_serializing_if = "Option::is_none")]
path: Option<String>,
sub_aggregations: Vec<Aggregation>,
},
}
pub const LODESTONE_API_NESTED_SEARCH_HIT_FORMAT_VERSION: u16 = 1;
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(deny_unknown_fields)]
pub struct NestedSearchHit {
pub path: String,
pub ordinal: u32,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub score: Option<ApproximateNumber>,
pub source: RawJson,
pub sort: Vec<JsonValue>,
}
pub const LODESTONE_API_NAMED_NESTED_INNER_HITS_RESULT_FORMAT_VERSION: u16 = 1;
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(deny_unknown_fields)]
pub struct NamedNestedInnerHitsResult {
pub name: String,
pub total: U64,
pub hits: Vec<NestedSearchHit>,
}
pub const LODESTONE_API_FRAGMENT_BOUNDARY_FORMAT_VERSION: u16 = 1;
#[derive(Clone, Copy, Debug, Deserialize, Eq, PartialEq, Serialize)]
#[serde(rename_all = "snake_case")]
pub enum FragmentBoundary {
Word,
Sentence,
Paragraph,
WholeField,
}
pub const LODESTONE_API_FRAGMENT_OFFSET_ENCODING_FORMAT_VERSION: u16 = 1;
#[derive(Clone, Copy, Debug, Deserialize, Eq, PartialEq, Serialize)]
#[serde(rename_all = "snake_case")]
pub enum FragmentOffsetEncoding {
Utf8Bytes,
Utf16CodeUnits,
UnicodeCodepoints,
}
pub const LODESTONE_API_FRAGMENT_RANKER_FORMAT_VERSION: u16 = 1;
#[derive(Clone, Copy, Debug, Deserialize, Eq, PartialEq, Serialize)]
#[serde(rename_all = "snake_case")]
pub enum FragmentRanker {
LexicalMatchCountV1,
}
pub const LODESTONE_API_FRAGMENT_REQUEST_FORMAT_VERSION: u16 = 1;
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(deny_unknown_fields)]
pub struct FragmentRequest {
pub fields: Vec<String>,
pub max_fragment_bytes: u32,
pub max_fragments: u32,
pub boundary: FragmentBoundary,
pub offset_encoding: FragmentOffsetEncoding,
pub ranker: FragmentRanker,
}
pub const LODESTONE_API_SEARCH_FRAGMENT_FORMAT_VERSION: u16 = 1;
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(deny_unknown_fields)]
pub struct SearchFragment {
pub field: String,
pub text: String,
pub start: u32,
pub end: u32,
pub offset_encoding: FragmentOffsetEncoding,
pub rank: u32,
pub match_count: u32,
pub truncated: bool,
pub partial: bool,
}
pub const LODESTONE_API_NUMERIC_FEATURE_TRANSFORM_FORMAT_VERSION: u16 = 1;
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(tag = "kind", rename_all = "snake_case", deny_unknown_fields)]
pub enum NumericFeatureTransform {
Identity,
Log1p,
Clamp {
minimum: ApproximateNumber,
maximum: ApproximateNumber,
},
}
pub const LODESTONE_API_NUMERIC_RESULT_FEATURE_FORMAT_VERSION: u16 = 1;
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(deny_unknown_fields)]
pub struct NumericResultFeature {
pub name: String,
pub field: String,
pub transform: NumericFeatureTransform,
}
pub const LODESTONE_API_RESULT_FEATURE_REQUEST_FORMAT_VERSION: u16 = 1;
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(deny_unknown_fields)]
pub struct ResultFeatureRequest {
pub top_n: u32,
pub include_branch_components: bool,
pub numeric: Vec<NumericResultFeature>,
}
pub const LODESTONE_API_RESULT_DIVERSIFICATION_FORMAT_VERSION: u16 = 1;
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(deny_unknown_fields)]
pub struct ResultDiversification {
pub fields: Vec<String>,
pub max_per_group: u32,
}
pub const LODESTONE_API_BRANCH_SCORE_KIND_FORMAT_VERSION: u16 = 2;
#[derive(Clone, Copy, Debug, Deserialize, Eq, PartialEq, Serialize)]
#[serde(rename_all = "snake_case")]
pub enum BranchScoreKind {
LexicalScore,
DenseSimilarity,
SparseDotProduct,
LateInteractionMaxsim,
}
pub const LODESTONE_API_RESULT_FEATURE_FORMAT_VERSION: u16 = 1;
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(tag = "kind", rename_all = "snake_case", deny_unknown_fields)]
pub enum ResultFeature {
Branch {
branch: String,
score_kind: BranchScoreKind,
rank: u32,
score: ApproximateNumber,
},
Numeric {
name: String,
field: String,
value: ApproximateNumber,
},
}
pub const LODESTONE_API_SEARCH_HIT_FORMAT_VERSION: u16 = 2;
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(deny_unknown_fields)]
pub struct SearchHit {
pub index: Resource,
pub document_id: String,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub score: Option<ApproximateNumber>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub source: Option<RawJson>,
pub sort: Vec<JsonValue>,
pub fragments: Vec<SearchFragment>,
pub features: Vec<ResultFeature>,
pub group_values: Vec<JsonValue>,
pub inner_hits: Vec<NamedNestedInnerHitsResult>,
}
pub const LODESTONE_API_AGGREGATION_BUCKET_FORMAT_VERSION: u16 = 1;
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(deny_unknown_fields)]
pub struct AggregationBucket {
pub key: JsonValue,
pub document_count: U64,
pub sub_aggregations: Vec<AggregationResult>,
}
pub const LODESTONE_API_AGGREGATION_RESULT_FORMAT_VERSION: u16 = 1;
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(tag = "kind", rename_all = "snake_case", deny_unknown_fields)]
pub enum AggregationResult {
Terms {
name: String,
buckets: Vec<AggregationBucket>,
partial: bool,
},
Histogram {
name: String,
buckets: Vec<AggregationBucket>,
partial: bool,
},
DateHistogram {
name: String,
buckets: Vec<AggregationBucket>,
partial: bool,
},
Composite {
name: String,
buckets: Vec<AggregationBucket>,
partial: bool,
},
Filter {
name: String,
buckets: Vec<AggregationBucket>,
partial: bool,
},
SingleBucket {
name: String,
document_count: U64,
sub_aggregations: Vec<AggregationResult>,
partial: bool,
},
Cardinality {
name: String,
#[serde(default, skip_serializing_if = "Option::is_none")]
value: Option<ApproximateNumber>,
partial: bool,
},
Percentiles {
name: String,
values: Vec<PercentileValue>,
partial: bool,
},
ApproximateCardinality {
name: String,
value: ApproximateNumber,
approximation: Approximation,
partial: bool,
},
ApproximatePercentiles {
name: String,
values: Vec<ApproximatePercentileValue>,
approximation: Approximation,
partial: bool,
},
Sum {
name: String,
#[serde(default, skip_serializing_if = "Option::is_none")]
value: Option<ApproximateNumber>,
partial: bool,
},
Avg {
name: String,
#[serde(default, skip_serializing_if = "Option::is_none")]
value: Option<ApproximateNumber>,
partial: bool,
},
Min {
name: String,
#[serde(default, skip_serializing_if = "Option::is_none")]
value: Option<ApproximateNumber>,
partial: bool,
},
Max {
name: String,
#[serde(default, skip_serializing_if = "Option::is_none")]
value: Option<ApproximateNumber>,
partial: bool,
},
Stats {
name: String,
count: U64,
#[serde(default, skip_serializing_if = "Option::is_none")]
min: Option<ApproximateNumber>,
#[serde(default, skip_serializing_if = "Option::is_none")]
max: Option<ApproximateNumber>,
#[serde(default, skip_serializing_if = "Option::is_none")]
avg: Option<ApproximateNumber>,
sum: ApproximateNumber,
partial: bool,
},
}
pub const LODESTONE_API_SHARD_COUNTS_FORMAT_VERSION: u16 = 1;
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(deny_unknown_fields)]
pub struct ShardCounts {
pub total: u32,
pub successful: u32,
pub skipped: u32,
pub failed: u32,
}
pub const LODESTONE_API_TOTAL_HITS_RELATION_FORMAT_VERSION: u16 = 1;
#[derive(Clone, Copy, Debug, Deserialize, Eq, PartialEq, Serialize)]
#[serde(rename_all = "snake_case")]
pub enum TotalHitsRelation {
Exact,
LowerBound,
Incomplete,
}
pub const LODESTONE_API_SEARCH_TOTAL_FORMAT_VERSION: u16 = 1;
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(deny_unknown_fields)]
pub struct SearchTotal {
pub value: U64,
pub relation: TotalHitsRelation,
pub partial: bool,
}
pub const LODESTONE_API_ARTIFACT_FORMAT_VERSION: u16 = 1;
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(deny_unknown_fields)]
pub struct Artifact {
pub locator: Locator,
pub bytes: U64,
pub sha256: Digest,
pub expires_at: U64,
}
pub const LODESTONE_API_OPERATION_FORMAT_VERSION: u16 = 1;
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(deny_unknown_fields)]
pub struct Operation {
pub locator: Locator,
pub authority: String,
pub state: String,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub progress: Option<ExactDecimal>,
pub cancellable: bool,
pub submitted_at: U64,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub terminal_at: Option<U64>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub retire_after: Option<U64>,
pub artifacts: Vec<Artifact>,
}
pub const LODESTONE_API_SUBMISSION_STATE_FORMAT_VERSION: u16 = 1;
#[derive(Clone, Copy, Debug, Deserialize, Eq, PartialEq, Serialize)]
#[serde(rename_all = "snake_case")]
pub enum SubmissionState {
NotSubmitted,
Submitted,
Resolved,
KnownRetired,
Indeterminate,
}
pub const LODESTONE_API_EXPECTED_BINDING_FORMAT_VERSION: u16 = 1;
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(deny_unknown_fields)]
pub struct ExpectedBinding {
pub incarnation: Identity,
pub revision: U64,
}
pub const LODESTONE_API_ADMINISTRATION_ALIAS_ACTION_FORMAT_VERSION: u16 = 1;
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(tag = "kind", rename_all = "snake_case", deny_unknown_fields)]
pub enum AdministrationAliasAction {
Put {
name: String,
#[serde(default, skip_serializing_if = "Option::is_none")]
expected_revision: Option<U64>,
targets: Vec<AliasTarget>,
#[serde(default, skip_serializing_if = "Option::is_none")]
filter: Option<RawJson>,
#[serde(default, skip_serializing_if = "Option::is_none")]
index_routing: Option<String>,
#[serde(default, skip_serializing_if = "Option::is_none")]
search_routing: Option<String>,
},
Delete {
name: String,
expected_revision: U64,
},
}
pub const LODESTONE_API_ADMINISTRATION_MUTATION_FORMAT_VERSION: u16 = 1;
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(tag = "kind", rename_all = "snake_case", deny_unknown_fields)]
pub enum AdministrationMutation {
ApplyAliasActions {
actions: Vec<AdministrationAliasAction>,
},
PutComponentTemplate {
name: String,
#[serde(default, skip_serializing_if = "Option::is_none")]
expected: Option<ExpectedBinding>,
mapping: Mapping,
settings: RawJson,
#[serde(default, skip_serializing_if = "Option::is_none")]
resource_spec: Option<IndexResourceSpec>,
},
DeleteComponentTemplate {
name: String,
expected: ExpectedBinding,
},
PutIndexTemplate {
name: String,
#[serde(default, skip_serializing_if = "Option::is_none")]
expected: Option<ExpectedBinding>,
priority: i32,
data_stream: bool,
index_patterns: Vec<String>,
components: Vec<ExpectedBinding>,
mapping: Mapping,
settings: RawJson,
#[serde(default, skip_serializing_if = "Option::is_none")]
resource_spec: Option<IndexResourceSpec>,
},
DeleteIndexTemplate {
name: String,
expected: ExpectedBinding,
},
PutIngestPipeline {
name: String,
#[serde(default, skip_serializing_if = "Option::is_none")]
expected: Option<ExpectedBinding>,
definition: RawJson,
},
DeleteIngestPipeline {
name: String,
expected: ExpectedBinding,
},
PutLifecyclePolicy {
name: String,
#[serde(default, skip_serializing_if = "Option::is_none")]
expected: Option<ExpectedBinding>,
rollover: RolloverThresholds,
retention: RetentionPolicy,
merge_hint: bool,
freeze_hint: bool,
delete_expired: bool,
},
DeleteLifecyclePolicy {
name: String,
expected: ExpectedBinding,
},
CreateDataStream {
name: String,
timestamp_field: String,
index_template: ExpectedBinding,
#[serde(default, skip_serializing_if = "Option::is_none")]
lifecycle_policy: Option<ExpectedBinding>,
},
DeleteDataStream {
name: String,
expected_revision: U64,
},
RolloverDataStream {
name: String,
expected_revision: U64,
},
}
pub const LODESTONE_API_ADMINISTRATION_OUTCOME_FORMAT_VERSION: u16 = 1;
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(deny_unknown_fields)]
pub struct AdministrationOutcome {
pub action_id: Digest,
pub authority_revision: U64,
pub state: String,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub resource: Option<Resource>,
}
pub const LODESTONE_API_INDEX_CHANGE_APPLY_RECEIPT_FORMAT_VERSION: u16 = 1;
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(deny_unknown_fields)]
pub struct IndexChangeApplyReceipt {
pub action_id: Digest,
pub semantic_digest: Digest,
pub index: Resource,
pub revision: U64,
pub schema_generation: U64,
pub state: String,
}
pub const LODESTONE_API_BACKUP_ENCRYPTION_POLICY_FORMAT_VERSION: u16 = 1;
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(deny_unknown_fields)]
pub struct BackupEncryptionPolicy {
pub backend_authority: String,
pub policy_id: String,
pub key_digest: Digest,
pub encrypted: bool,
}
pub const LODESTONE_API_BACKUP_CREATE_OUTCOME_FORMAT_VERSION: u16 = 1;
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(deny_unknown_fields)]
pub struct BackupCreateOutcome {
pub action_id: Digest,
pub backup_id: Identity,
pub operation: Operation,
pub submitted: bool,
}
pub const LODESTONE_API_BULK_DOCUMENT_ITEM_FORMAT_VERSION: u16 = 1;
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(deny_unknown_fields)]
pub struct BulkDocumentItem {
pub item_action_id: Digest,
pub document_id: String,
pub operation: String,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub source: Option<RawJson>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub routing: Option<String>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub condition: Option<DocumentMutationCondition>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub pipeline: Option<IngestPipelineSelection>,
pub semantic_digest: Digest,
}
pub const LODESTONE_API_BULK_DOCUMENT_ITEM_OUTCOME_FORMAT_VERSION: u16 = 1;
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(deny_unknown_fields)]
pub struct BulkDocumentItemOutcome {
pub item_action_id: Digest,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub locator: Option<Locator>,
pub state: SubmissionState,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub sequence: Option<U64>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub mapping_generation: Option<U64>,
pub mapping_adopted: bool,
pub no_document_effect: bool,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub error: Option<ErrorBody>,
}
pub const LODESTONE_API_BULK_DOCUMENT_OUTCOME_FORMAT_VERSION: u16 = 1;
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(deny_unknown_fields)]
pub struct BulkDocumentOutcome {
pub batch_id: Digest,
pub index: Resource,
pub items: Vec<BulkDocumentItemOutcome>,
pub complete: bool,
}
pub const LODESTONE_API_RETAINED_APPEND_ITEM_FORMAT_VERSION: u16 = 1;
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(deny_unknown_fields)]
pub struct RetainedAppendItem {
pub item_action_id: Digest,
pub document_id: String,
pub source: RawJson,
}
pub const LODESTONE_API_RETAINED_APPEND_STATE_FORMAT_VERSION: u16 = 1;
#[derive(Clone, Copy, Debug, Deserialize, Eq, PartialEq, Serialize)]
#[serde(rename_all = "snake_case")]
pub enum RetainedAppendState {
Prepared,
Committed,
Replayed,
Conflict,
NotSubmittedRetryable,
NotSubmittedTerminal,
SubmittedIndeterminate,
Retired,
}
pub const LODESTONE_API_RETAINED_APPEND_RETRY_SAFETY_FORMAT_VERSION: u16 = 1;
#[derive(Clone, Copy, Debug, Deserialize, Eq, PartialEq, Serialize)]
#[serde(rename_all = "snake_case")]
pub enum RetainedAppendRetrySafety {
Safe,
ResolveOnly,
Terminal,
}
pub const LODESTONE_API_RETAINED_APPEND_ITEM_OUTCOME_FORMAT_VERSION: u16 = 1;
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(deny_unknown_fields)]
pub struct RetainedAppendItemOutcome {
pub item_action_id: Digest,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub locator: Option<Locator>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub semantic_digest: Option<Digest>,
pub state: RetainedAppendState,
pub retry_safety: RetainedAppendRetrySafety,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub sequence: Option<U64>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub primary_term: Option<U64>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub error: Option<ErrorBody>,
}
pub const LODESTONE_API_RETAINED_APPEND_BULK_OUTCOME_FORMAT_VERSION: u16 = 1;
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(deny_unknown_fields)]
pub struct RetainedAppendBulkOutcome {
pub batch_id: Digest,
pub index: Resource,
pub items: Vec<RetainedAppendItemOutcome>,
pub complete: bool,
}
pub const LODESTONE_API_RETAINED_APPEND_OBSERVATION_STATE_FORMAT_VERSION: u16 = 1;
#[derive(Clone, Copy, Debug, Deserialize, Eq, PartialEq, Serialize)]
#[serde(rename_all = "snake_case")]
pub enum RetainedAppendObservationState {
Visible,
Pending,
SubmittedIndeterminate,
Conflict,
Retired,
}
pub const LODESTONE_API_RETAINED_APPEND_OBSERVATION_OUTCOME_FORMAT_VERSION: u16 = 1;
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(deny_unknown_fields)]
pub struct RetainedAppendObservationOutcome {
pub index: Resource,
pub locator: Locator,
pub state: RetainedAppendObservationState,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub sequence: Option<U64>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub primary_term: Option<U64>,
}
pub const LODESTONE_API_BINARY_VALUE_FORMAT_VERSION: u16 = 1;
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(deny_unknown_fields)]
pub struct BinaryValue {
pub bytes_base64: String,
}
pub const LODESTONE_API_STATE_HASH_FIELD_FORMAT_VERSION: u16 = 1;
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(deny_unknown_fields)]
pub struct StateHashField {
pub field: BinaryValue,
pub value: BinaryValue,
}
pub const LODESTONE_API_STATE_SET_ENTRY_FORMAT_VERSION: u16 = 1;
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(deny_unknown_fields)]
pub struct StateSetEntry {
pub key: BinaryValue,
pub value: BinaryValue,
}
pub const LODESTONE_API_STATE_SET_CONDITION_FORMAT_VERSION: u16 = 1;
#[derive(Clone, Copy, Debug, Deserialize, Eq, PartialEq, Serialize)]
#[serde(rename_all = "snake_case")]
pub enum StateSetCondition {
Always,
IfAbsent,
IfPresent,
}
pub const LODESTONE_API_STATE_OPERATION_FORMAT_VERSION: u16 = 1;
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(tag = "kind", rename_all = "snake_case", deny_unknown_fields)]
pub enum StateOperation {
Get {
key: BinaryValue,
},
Set {
key: BinaryValue,
value: BinaryValue,
condition: StateSetCondition,
#[serde(default, skip_serializing_if = "Option::is_none")]
expires_at_millis: Option<U64>,
},
Delete {
keys: Vec<BinaryValue>,
},
Exists {
keys: Vec<BinaryValue>,
},
ExpireAt {
key: BinaryValue,
absolute_millis: U64,
},
TtlStatus {
key: BinaryValue,
},
Persist {
key: BinaryValue,
},
MultiGet {
keys: Vec<BinaryValue>,
},
MultiSet {
entries: Vec<StateSetEntry>,
},
Increment {
key: BinaryValue,
delta: I64,
},
HashGet {
key: BinaryValue,
field: BinaryValue,
},
HashSet {
key: BinaryValue,
fields: Vec<StateHashField>,
},
HashGetAll {
key: BinaryValue,
},
}
pub const LODESTONE_API_STATE_OPTIONAL_VALUE_FORMAT_VERSION: u16 = 1;
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(tag = "state", rename_all = "snake_case", deny_unknown_fields)]
pub enum StateOptionalValue {
Missing,
Value { value: BinaryValue },
}
pub const LODESTONE_API_STATE_COMMAND_RESULT_FORMAT_VERSION: u16 = 1;
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(tag = "kind", rename_all = "snake_case", deny_unknown_fields)]
pub enum StateCommandResult {
Get {
value: StateOptionalValue,
},
Set {
applied: bool,
},
Delete {
removed: u32,
},
Exists {
count: u32,
},
Expire {
changed: bool,
},
TtlStatus {
state: String,
#[serde(default, skip_serializing_if = "Option::is_none")]
remaining_millis: Option<U64>,
},
Persist {
changed: bool,
},
MultiGet {
values: Vec<StateOptionalValue>,
},
MultiSet {
written: u32,
},
Increment {
value: I64,
},
HashGet {
value: StateOptionalValue,
},
HashSet {
fields_added: u32,
},
HashGetAll {
fields: Vec<StateHashField>,
},
}
pub const LODESTONE_API_STATE_WRITE_RESOLUTION_FORMAT_VERSION: u16 = 1;
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(tag = "state", rename_all = "snake_case", deny_unknown_fields)]
pub enum StateWriteResolution {
NotSubmitted,
Resolved {
result: StateCommandResult,
sequence: U64,
},
KnownRetired {
retired_through: U64,
},
StateReset {
submitted_reset_epoch: U64,
current_reset_epoch: U64,
},
Indeterminate {
#[serde(default, skip_serializing_if = "Option::is_none")]
observed_high_water: Option<U64>,
#[serde(default, skip_serializing_if = "Option::is_none")]
current_high_water: Option<U64>,
#[serde(default, skip_serializing_if = "Option::is_none")]
retired_through: Option<U64>,
},
}
pub const LODESTONE_API_SERVICE_CREDENTIAL_RESERVATION_FORMAT_VERSION: u16 = 1;
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(deny_unknown_fields)]
pub struct ServiceCredentialReservation {
pub locator: Locator,
pub reservation_action_id: Digest,
pub activation_action_id: Digest,
pub principal_id: Identity,
pub api_key_id: Identity,
pub generation: U64,
pub reservation_expires_at: U64,
pub credential_expires_at: U64,
pub verifier_algorithm: String,
pub verifier_algorithm_version: u32,
pub required_secret_bytes: u32,
}
pub const LODESTONE_API_SUBSCRIPTION_METADATA_FIELD_FORMAT_VERSION: u16 = 1;
#[derive(Clone, Copy, Debug, Deserialize, Eq, PartialEq, Serialize)]
#[serde(rename_all = "snake_case")]
pub enum SubscriptionMetadataField {
Id,
RoutingHash,
Operation,
Shard,
Sequence,
}
pub const LODESTONE_API_SUBSCRIPTION_FIELD_FORMAT_VERSION: u16 = 1;
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(tag = "kind", rename_all = "snake_case", deny_unknown_fields)]
pub enum SubscriptionField {
Source { path: String },
Metadata { field: SubscriptionMetadataField },
}
pub const LODESTONE_API_SUBSCRIPTION_FILTER_FORMAT_VERSION: u16 = 1;
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(tag = "kind", rename_all = "snake_case", deny_unknown_fields)]
pub enum SubscriptionFilter {
All,
Bool {
must: Vec<SubscriptionFilter>,
should: Vec<SubscriptionFilter>,
must_not: Vec<SubscriptionFilter>,
minimum_should_match: u32,
},
Term {
field: SubscriptionField,
value: JsonValue,
},
Terms {
field: SubscriptionField,
values: Vec<JsonValue>,
},
Range {
field: SubscriptionField,
#[serde(default, skip_serializing_if = "Option::is_none")]
gt: Option<JsonValue>,
#[serde(default, skip_serializing_if = "Option::is_none")]
gte: Option<JsonValue>,
#[serde(default, skip_serializing_if = "Option::is_none")]
lt: Option<JsonValue>,
#[serde(default, skip_serializing_if = "Option::is_none")]
lte: Option<JsonValue>,
},
Exists {
field: SubscriptionField,
},
Prefix {
field: SubscriptionField,
value: String,
},
}
pub const LODESTONE_API_SUBSCRIPTION_CURSOR_ENTRY_FORMAT_VERSION: u16 = 1;
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(deny_unknown_fields)]
pub struct SubscriptionCursorEntry {
pub index: Resource,
pub routing_revision: U64,
pub recovery_era: Identity,
pub shard_id: U64,
pub sequence: U64,
}
pub const LODESTONE_API_SUBSCRIPTION_ROUTE_FORMAT_VERSION: u16 = 1;
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(deny_unknown_fields)]
pub struct SubscriptionRoute {
pub index: Resource,
pub routing_revision: U64,
pub shard_ids: Vec<U64>,
}
pub const LODESTONE_API_SUBSCRIPTION_START_POSITION_FORMAT_VERSION: u16 = 1;
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(tag = "kind", rename_all = "snake_case", deny_unknown_fields)]
pub enum SubscriptionStartPosition {
FromNow,
Resume {
routes: Vec<SubscriptionRoute>,
cut: Vec<SubscriptionCursorEntry>,
},
}
pub const LODESTONE_API_SUBSCRIPTION_START_FORMAT_VERSION: u16 = 1;
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(deny_unknown_fields)]
pub struct SubscriptionStart {
pub format_version: u32,
pub request_id: String,
pub index: Resource,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub filter: Option<SubscriptionFilter>,
pub include_deletes: bool,
pub source_projection: Vec<String>,
pub reconnect_attempt: u32,
pub start: SubscriptionStartPosition,
pub heartbeat_millis: U64,
pub schema_digest: Digest,
}
pub const LODESTONE_API_SUBSCRIPTION_ACCEPTED_FORMAT_VERSION: u16 = 1;
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(deny_unknown_fields)]
pub struct SubscriptionAccepted {
pub format_version: u32,
pub routes: Vec<SubscriptionRoute>,
pub accepted_cut: Vec<SubscriptionCursorEntry>,
pub schema_digest: Digest,
}
pub const LODESTONE_API_SUBSCRIPTION_WRITER_FENCE_FORMAT_VERSION: u16 = 1;
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(deny_unknown_fields)]
pub struct SubscriptionWriterFence {
pub recovery_era: Identity,
pub epoch: u32,
}
pub const LODESTONE_API_SUBSCRIPTION_EVENT_FORMAT_VERSION: u16 = 1;
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(deny_unknown_fields)]
pub struct SubscriptionEvent {
pub format_version: u32,
pub event_id: Digest,
pub index: Resource,
pub shard_id: U64,
pub recovery_era: Identity,
pub writer_fence: SubscriptionWriterFence,
pub routing_revision: U64,
pub sequence: U64,
pub operation: String,
pub document_id: String,
pub routing_hash: u32,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub source: Option<RawJson>,
}
pub const LODESTONE_API_SUBSCRIPTION_HEARTBEAT_FORMAT_VERSION: u16 = 1;
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(deny_unknown_fields)]
pub struct SubscriptionHeartbeat {
pub format_version: u32,
pub confirmed_cut: Vec<SubscriptionCursorEntry>,
pub route_revision: U64,
pub authorization_revision: U64,
pub authorization_valid_until_millis: U64,
}
pub const LODESTONE_API_SUBSCRIPTION_GAP_FORMAT_VERSION: u16 = 1;
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(deny_unknown_fields)]
pub struct SubscriptionGap {
pub format_version: u32,
pub affected: Vec<SubscriptionCursorEntry>,
pub last_confirmed: Vec<SubscriptionCursorEntry>,
pub earliest_available: Vec<SubscriptionCursorEntry>,
pub reason: String,
pub terminal: bool,
}
pub const LODESTONE_API_SUBSCRIPTION_TERMINAL_FORMAT_VERSION: u16 = 1;
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(deny_unknown_fields)]
pub struct SubscriptionTerminal {
pub format_version: u32,
pub reason: String,
pub retry_safe: bool,
}
pub const LODESTONE_API_SUBSCRIPTION_FRAME_FORMAT_VERSION: u16 = 1;
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(tag = "frame", rename_all = "snake_case", deny_unknown_fields)]
pub enum SubscriptionFrame {
Accepted { body: SubscriptionAccepted },
Event { body: SubscriptionEvent },
Heartbeat { body: SubscriptionHeartbeat },
Gap { body: SubscriptionGap },
Terminal { body: SubscriptionTerminal },
}
pub const LODESTONE_API_STREAM_BINDING_FORMAT_VERSION: u16 = 1;
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(deny_unknown_fields)]
pub struct StreamBinding {
pub name: String,
pub transport: String,
pub service: String,
pub method: String,
pub endpoint: String,
pub auth_metadata: String,
pub auth_scheme: String,
pub semantic_format_version: u32,
pub schema_digest: Digest,
}
pub const LODESTONE_API_CAPABILITY_GRANT_FORMAT_VERSION: u16 = 1;
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(deny_unknown_fields)]
pub struct CapabilityGrant {
pub command: String,
pub action: String,
pub state: String,
pub reason: String,
pub mutation_class: String,
pub cancellable: bool,
pub workload_classes: Vec<WorkloadClass>,
pub possible_submission_states: Vec<String>,
pub capability_family: String,
pub effect_class: String,
pub risk_flags: Vec<String>,
pub admissible_errors: Vec<String>,
pub referenced_limits: Vec<String>,
pub retry_safety: String,
pub identity_requirement: String,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub resolver_command: Option<String>,
pub cancellation: String,
pub side_effects: Vec<String>,
pub recovery: String,
pub index_patterns: Vec<String>,
pub exact_index_incarnations: Vec<Identity>,
}
pub const LODESTONE_API_PROTOCOL_LIMIT_FORMAT_VERSION: u16 = 1;
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(deny_unknown_fields)]
pub struct ProtocolLimit {
pub id: String,
pub default: U64,
pub maximum: U64,
pub unit: String,
}
pub const LODESTONE_API_DOCUMENT_MUTATION_CONDITION_FORMAT_VERSION: u16 = 1;
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(tag = "kind", rename_all = "snake_case", deny_unknown_fields)]
pub enum DocumentMutationCondition {
Any,
MustNotExist,
IfSeqNo { seq_no: U64 },
IfSeqNoAndPrimaryTerm { seq_no: U64, primary_term: U64 },
}
pub const LODESTONE_API_AUDIT_EVENT_FORMAT_VERSION: u16 = 1;
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(deny_unknown_fields)]
pub struct AuditEvent {
pub sequence: U64,
pub server_time: U64,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub principal_id: Option<Identity>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub api_key_id: Option<Identity>,
pub policy_revision: U64,
pub action: String,
pub outcome: String,
pub detail: String,
}
pub const LODESTONE_API_AUDIT_GAP_FORMAT_VERSION: u16 = 1;
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(deny_unknown_fields)]
pub struct AuditGap {
pub first_sequence: U64,
pub last_sequence: U64,
pub reason: String,
}
pub const LODESTONE_API_SERVICE_CREDENTIAL_GRANT_FORMAT_VERSION: u16 = 1;
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(deny_unknown_fields)]
pub struct ServiceCredentialGrant {
pub role_name: String,
pub role_version: U64,
}
pub const LODESTONE_API_SERVICE_CREDENTIAL_SUMMARY_FORMAT_VERSION: u16 = 1;
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(deny_unknown_fields)]
pub struct ServiceCredentialSummary {
pub principal_id: Identity,
pub api_key_id: Identity,
pub generation: U64,
pub state: String,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub expires_at: Option<U64>,
pub grants: Vec<ServiceCredentialGrant>,
}
pub const LODESTONE_API_SECURITY_ROLE_FORMAT_VERSION: u16 = 1;
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(deny_unknown_fields)]
pub struct SecurityRole {
pub role_name: String,
pub version: U64,
pub permissions: Vec<String>,
pub delegable_permissions: Vec<String>,
pub allowed_workload_classes: Vec<WorkloadClass>,
pub index_patterns: Vec<String>,
pub append_index_incarnations: Vec<Identity>,
}
pub const LODESTONE_API_ROLE_APPEND_SCOPE_CHANGE_FORMAT_VERSION: u16 = 1;
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(tag = "kind", rename_all = "snake_case", deny_unknown_fields)]
pub enum RoleAppendScopeChange {
Add { index: Resource },
Remove { index_incarnation: Identity },
}
pub const LODESTONE_API_ROLE_APPEND_ACCESS_PREPARATION_FORMAT_VERSION: u16 = 1;
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(tag = "state", rename_all = "snake_case", deny_unknown_fields)]
pub enum RoleAppendAccessPreparation {
Prepared {
locator: Locator,
semantic_digest: Digest,
expires_at: U64,
predecessor_role_version: U64,
successor_role_version: U64,
},
AlreadySatisfied {
role: SecurityRole,
},
}
pub const LODESTONE_API_SECURITY_ACTION_OUTCOME_FORMAT_VERSION: u16 = 1;
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(tag = "kind", rename_all = "snake_case", deny_unknown_fields)]
pub enum SecurityActionOutcome {
Reserved {
principal_id: Identity,
api_key_id: Identity,
generation: U64,
},
Activated {
principal_id: Identity,
api_key_id: Identity,
generation: U64,
},
Revoked {
principal_id: Identity,
api_key_id: Identity,
generation: U64,
},
Retired {
principal_id: Identity,
api_key_id: Identity,
generation: U64,
},
}
pub const LODESTONE_API_MAINTENANCE_WORK_STATE_FORMAT_VERSION: u16 = 1;
#[derive(Clone, Copy, Debug, Deserialize, Eq, PartialEq, Serialize)]
#[serde(rename_all = "snake_case")]
pub enum MaintenanceWorkState {
ParkedOperatorRequired,
RetryWait,
RetryReady,
Leased,
Deferred,
Runnable,
}
pub const LODESTONE_API_MAINTENANCE_ATTEMPT_STATE_FORMAT_VERSION: u16 = 1;
#[derive(Clone, Copy, Debug, Deserialize, Eq, PartialEq, Serialize)]
#[serde(rename_all = "snake_case")]
pub enum MaintenanceAttemptState {
Running,
DeadlineExceededDraining,
DeadlineExceededReclaimPending,
CancellationDraining,
ClaimRecoveryPending,
}
pub const LODESTONE_API_MAINTENANCE_FAILURE_CLASS_FORMAT_VERSION: u16 = 1;
#[derive(Clone, Copy, Debug, Deserialize, Eq, PartialEq, Serialize)]
#[serde(rename_all = "snake_case")]
pub enum MaintenanceFailureClass {
Corruption,
AttemptBudget,
StructuralLimit,
Execution,
Other,
}
pub const LODESTONE_API_MAINTENANCE_FAILURE_CLASS_COUNT_FORMAT_VERSION: u16 = 1;
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(deny_unknown_fields)]
pub struct MaintenanceFailureClassCount {
pub class: MaintenanceFailureClass,
pub count: U64,
}
pub const LODESTONE_API_MAINTENANCE_ATTEMPT_OBSERVATION_FORMAT_VERSION: u16 = 1;
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(deny_unknown_fields)]
pub struct MaintenanceAttemptObservation {
pub state: MaintenanceAttemptState,
pub lease_epoch: U64,
pub lease_expires_at: U64,
pub observed_at_millis: U64,
}
pub const LODESTONE_API_MAINTENANCE_TASK_SCOPE_FORMAT_VERSION: u16 = 1;
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(deny_unknown_fields)]
pub struct MaintenanceTaskScope {
pub kind: String,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub index: Option<Resource>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub shard_id: Option<u32>,
}
pub const LODESTONE_API_MAINTENANCE_TASK_STATUS_FORMAT_VERSION: u16 = 1;
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(deny_unknown_fields)]
pub struct MaintenanceTaskStatus {
pub task_id: Identity,
pub kind: String,
pub scope: MaintenanceTaskScope,
pub checkpoint_generation: U64,
pub attempt_count: u32,
pub admitted_at: U64,
pub last_transition_at: U64,
pub last_progress_at: U64,
pub work_state: MaintenanceWorkState,
pub state_since: U64,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub defer_reason: Option<String>,
pub cancellation_requested: bool,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub retry_not_before: Option<U64>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub failure_at: Option<U64>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub lease_acquired_at: Option<U64>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub lease_expires_at: Option<U64>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub failure_class: Option<MaintenanceFailureClass>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub failure_code: Option<String>,
pub operator_action_required: bool,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub local_attempt: Option<MaintenanceAttemptObservation>,
}
pub const LODESTONE_API_MAINTENANCE_STATUS_AGGREGATE_FORMAT_VERSION: u16 = 1;
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(deny_unknown_fields)]
pub struct MaintenanceStatusAggregate {
pub format_version: u32,
pub recovery_era: Identity,
pub source_revision: U64,
pub root_revision: U64,
pub logical_observation_time: U64,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub local_observation_millis: Option<U64>,
pub total_incomplete: U64,
pub parked_operator_required: U64,
pub retry_wait: U64,
pub retry_ready: U64,
pub leased: U64,
pub deferred: U64,
pub runnable: U64,
pub eligible_backlog: U64,
pub cancellation_requested: U64,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub oldest_backlog_age: Option<U64>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub oldest_runnable_age: Option<U64>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub oldest_retry_wait_age: Option<U64>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub oldest_parked_age: Option<U64>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub oldest_no_progress_age: Option<U64>,
pub current_action_capacity: u32,
pub maximum_action_capacity: u32,
pub active_passes: U64,
pub local_in_flight: U64,
pub deadline_draining: U64,
pub cancellation_draining: U64,
pub claim_recovery_pending: U64,
pub projection_refresh_pending: bool,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub durable_last_progress_at: Option<U64>,
pub tasks_claimed_total: U64,
pub tasks_progressed_total: U64,
pub tasks_completed_total: U64,
pub task_retries_total: U64,
pub task_failures_total: U64,
pub deadline_failures_total: U64,
pub cancellations_total: U64,
pub overlay_capacity_exhaustions_total: U64,
pub failure_classes: Vec<MaintenanceFailureClassCount>,
}
pub const LODESTONE_API_RUNTIME_STATUS_DETAIL_FORMAT_VERSION: u16 = 1;
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(deny_unknown_fields)]
pub struct RuntimeStatusDetail {
pub metastore_revision: U64,
pub root_revision: U64,
pub logical_time: U64,
pub degraded_dependencies: Vec<String>,
}
pub const LODESTONE_API_RESULT_CACHE_STATUS_FORMAT_VERSION: u16 = 2;
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(deny_unknown_fields)]
pub struct ResultCacheStatus {
pub format_version: u32,
pub hits: U64,
pub misses: U64,
pub admissions: U64,
pub bypasses: U64,
pub evictions: U64,
pub collection_bytes: U64,
pub collection_entries: u32,
}
pub const LODESTONE_API_FIELD_PROMOTION_STATUS_FORMAT_VERSION: u16 = 1;
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(deny_unknown_fields)]
pub struct FieldPromotionStatus {
pub format_version: u32,
pub index: Resource,
pub mapping_generation: U64,
pub policy_generation: U64,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub last_decision_generation: Option<U64>,
pub heat_records: u32,
pub promoted_fields: u32,
pub extra_bytes: U64,
pub enabled: bool,
}
pub const LODESTONE_API_OVERLOAD_SHARD_STATUS_FORMAT_VERSION: u16 = 2;
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(deny_unknown_fields)]
pub struct OverloadShardStatus {
pub format_version: u32,
pub shard_id: u32,
pub writer_epoch: U64,
pub configured_mode: String,
pub effective_disposition: String,
pub registered_through: U64,
pub indexed_through: U64,
pub lag_operations: U64,
pub backlog_bytes: U64,
pub oldest_age_millis: U64,
pub collection_share_bytes: U64,
pub recovery_ops_this_pass: u32,
pub pending_overlay_documents: U64,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub shed_reason: Option<String>,
}
pub const LODESTONE_API_EXTERNAL_KEY_BINDING_FORMAT_VERSION: u16 = 1;
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(deny_unknown_fields)]
pub struct ExternalKeyBinding {
pub content_key_id: Identity,
pub content_key_generation: U64,
pub binding_id: Identity,
pub binding_generation: U64,
pub access_generation: U64,
pub opaque_binding_base64: String,
pub object_context_digest: Digest,
}
pub const LODESTONE_API_ROLLUP_MEASURE_FORMAT_VERSION: u16 = 1;
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(tag = "kind", rename_all = "snake_case", deny_unknown_fields)]
pub enum RollupMeasure {
Count,
Sum { field_path_digest: Digest },
Min { field_path_digest: Digest },
Max { field_path_digest: Digest },
}
pub const LODESTONE_API_AGGREGATE_THEN_DELETE_POLICY_FORMAT_VERSION: u16 = 1;
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(deny_unknown_fields)]
pub struct AggregateThenDeletePolicy {
pub policy_id: Identity,
pub policy_generation: U64,
pub detail_retirement_acknowledged: bool,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub expected_policy_generation: Option<U64>,
pub timestamp_field_digest: Digest,
pub bucket_width_millis: U64,
pub bucket_alignment_millis: U64,
pub dimensions: Vec<Digest>,
pub measures: Vec<RollupMeasure>,
}
pub const LODESTONE_API_LIFECYCLE_BINDING_STATUS_FORMAT_VERSION: u16 = 1;
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(deny_unknown_fields)]
pub struct LifecycleBindingStatus {
pub content_key_id: Identity,
pub content_key_generation: U64,
pub binding_id: Identity,
pub binding_generation: U64,
pub access_generation: U64,
}
pub const LODESTONE_API_LIFECYCLE_ROLLUP_STATUS_FORMAT_VERSION: u16 = 1;
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(deny_unknown_fields)]
pub struct LifecycleRollupStatus {
pub policy_id: Identity,
pub policy_generation: U64,
pub ledger_revision: U64,
pub coverages: u32,
pub raw_retired_coverages: u32,
pub detail_retirement_acknowledged: bool,
pub query_contract_version: u32,
pub timestamp_field_digest: Digest,
pub bucket_width_millis: U64,
pub bucket_alignment_millis: U64,
pub dimensions: Vec<Digest>,
pub measures: Vec<RollupMeasure>,
}
pub const LODESTONE_API_LIFECYCLE_STATUS_FORMAT_VERSION: u16 = 2;
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(deny_unknown_fields)]
pub struct LifecycleStatus {
pub format_version: u32,
pub index: Resource,
pub authority_revision: U64,
pub active_bindings: Vec<LifecycleBindingStatus>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub rollup: Option<LifecycleRollupStatus>,
}
pub const LODESTONE_API_QUOTA_LIMIT_FORMAT_VERSION: u16 = 1;
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(deny_unknown_fields)]
pub struct QuotaLimit {
pub dimension: String,
pub maximum: U64,
pub window_millis: U64,
}
pub const LODESTONE_API_QUOTA_CONSUMPTION_FORMAT_VERSION: u16 = 1;
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(deny_unknown_fields)]
pub struct QuotaConsumption {
pub dimension: String,
pub consumed: U64,
pub window_millis: U64,
}
pub const LODESTONE_API_QUOTA_UPDATE_FORMAT_VERSION: u16 = 1;
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(deny_unknown_fields)]
pub struct QuotaUpdate {
pub revision: U64,
pub state: String,
}
pub const LODESTONE_API_CORE_BINDING_FORMAT_VERSION: u16 = 2;
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(deny_unknown_fields)]
pub struct CoreBinding {
pub cluster_id: Identity,
pub collection_id: Identity,
pub configuration_generation: U64,
pub native_endpoints: Vec<String>,
pub selected_stream_endpoint: String,
pub schema_id: String,
pub schema_digest: Digest,
}
pub const LODESTONE_API_READINESS_OBSERVATION_FORMAT_VERSION: u16 = 1;
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(deny_unknown_fields)]
pub struct ReadinessObservation {
pub subject: String,
pub state: String,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub reason: Option<String>,
pub revision: U64,
pub observed_cut: U64,
}
pub const LODESTONE_API_USAGE_DIMENSION_FORMAT_VERSION: u16 = 1;
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(deny_unknown_fields)]
pub struct UsageDimension {
pub name: String,
pub value: String,
}
pub const LODESTONE_API_PHYSICAL_USAGE_VALUE_FORMAT_VERSION: u16 = 2;
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(deny_unknown_fields)]
pub struct PhysicalUsageValue {
pub meter: String,
pub unit: String,
pub value: ExactDecimal,
}
pub const LODESTONE_API_CORE_USAGE_UNITS_FORMAT_VERSION: u16 = 2;
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(deny_unknown_fields)]
pub struct CoreUsageUnits {
pub sequence: U64,
pub record_identity: Digest,
pub index_id: Identity,
pub workload_class: WorkloadClass,
pub window_start: U64,
pub window_end: U64,
pub meter_set_version: u32,
pub dimensions: Vec<UsageDimension>,
pub values: Vec<PhysicalUsageValue>,
pub authority_revision: U64,
pub source_digest: Digest,
}
pub const LODESTONE_API_CORE_USAGE_CORRECTION_FORMAT_VERSION: u16 = 2;
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(deny_unknown_fields)]
pub struct CoreUsageCorrection {
pub sequence: U64,
pub correction_sequence: U64,
pub correction_identity: Digest,
pub target_record_identity: Digest,
pub index_id: Identity,
pub workload_class: WorkloadClass,
pub window_start: U64,
pub window_end: U64,
pub meter_set_version: u32,
pub dimensions: Vec<UsageDimension>,
pub values: Vec<PhysicalUsageValue>,
pub reason_digest: Digest,
pub authority_revision: U64,
pub source_digest: Digest,
}
pub const LODESTONE_API_ERROR_DETAIL_FORMAT_VERSION: u16 = 1;
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(tag = "code", rename_all = "snake_case", deny_unknown_fields)]
pub enum ErrorDetail {
Aborted {
reason: String,
},
DeadlineExceeded {
submitted: bool,
},
InvalidRequest {
#[serde(default, skip_serializing_if = "Option::is_none")]
field: Option<String>,
reason: String,
},
UnsupportedVersion {
observed: u32,
maximum_supported: u32,
},
Unauthenticated,
PermissionDenied {
#[serde(default, skip_serializing_if = "Option::is_none")]
action: Option<String>,
#[serde(default, skip_serializing_if = "Option::is_none")]
workload_class: Option<WorkloadClass>,
},
NotFound {
#[serde(default, skip_serializing_if = "Option::is_none")]
resource: Option<String>,
},
Conflict {
#[serde(default, skip_serializing_if = "Option::is_none")]
expected_revision: Option<U64>,
#[serde(default, skip_serializing_if = "Option::is_none")]
observed_revision: Option<U64>,
},
StaleCursor {
restart_count: u32,
},
RestartBudgetExhausted {
maximum_restarts: u32,
},
LimitExceeded {
limit_id: String,
maximum: U64,
},
CapabilityUnavailable {
#[serde(default, skip_serializing_if = "Option::is_none")]
capability: Option<String>,
},
NotSubmitted {
#[serde(default, skip_serializing_if = "Option::is_none")]
retry_after_millis: Option<U64>,
},
SubmittedIndeterminate {
#[serde(default, skip_serializing_if = "Option::is_none")]
locator: Option<Locator>,
},
ExpiredUnknown {
#[serde(default, skip_serializing_if = "Option::is_none")]
locator: Option<Locator>,
},
SecretNotEscrowed,
RetentionGap {
retired_through: U64,
},
ArtifactRangeInvalid {
maximum_bytes: U64,
},
ChecksumMismatch {
expected: Digest,
observed: Digest,
},
TemporarilyUnavailable {
#[serde(default, skip_serializing_if = "Option::is_none")]
retry_after_millis: Option<U64>,
},
Internal,
}
pub const LODESTONE_API_CONNECTION_PROFILE_FORMAT_VERSION: u16 = 3;
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(deny_unknown_fields)]
pub struct ConnectionProfile {
pub format_version: u32,
pub profile_generation: U64,
pub native_endpoints: Vec<String>,
pub selected_stream_endpoint: String,
pub tls_server_name: String,
pub tls_trust_sha256: Digest,
pub expected_cluster_id: Identity,
pub expected_collection_id: Identity,
pub expected_principal_id: Identity,
pub schema_id: String,
pub schema_digest: Digest,
pub credential_id: Identity,
pub credential_generation: U64,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub credential_expires_at: Option<U64>,
pub secret_reference: String,
}
#[derive(Clone, Copy, Debug, Eq, PartialEq)]
pub enum TypeKind {
Enum,
Struct,
TaggedUnion,
}
#[derive(Clone, Copy, Debug, Eq, PartialEq)]
pub struct TypeContract {
pub name: &'static str,
pub format_version: u16,
pub kind: TypeKind,
pub wire: bool,
}
pub const LODESTONE_API_TYPE_CONTRACTS: &[TypeContract] = &[
TypeContract {
name: "cursor",
format_version: 1,
kind: TypeKind::Struct,
wire: true,
},
TypeContract {
name: "locator",
format_version: 1,
kind: TypeKind::Struct,
wire: true,
},
TypeContract {
name: "resource",
format_version: 1,
kind: TypeKind::Struct,
wire: true,
},
TypeContract {
name: "field_promotion_configuration",
format_version: 1,
kind: TypeKind::Struct,
wire: true,
},
TypeContract {
name: "overload_configuration",
format_version: 2,
kind: TypeKind::Struct,
wire: true,
},
TypeContract {
name: "index_policies",
format_version: 1,
kind: TypeKind::Struct,
wire: true,
},
TypeContract {
name: "maintenance_budgets",
format_version: 1,
kind: TypeKind::Struct,
wire: true,
},
TypeContract {
name: "resource_durability_class",
format_version: 1,
kind: TypeKind::Enum,
wire: true,
},
TypeContract {
name: "resource_storage_class",
format_version: 1,
kind: TypeKind::Enum,
wire: true,
},
TypeContract {
name: "vector_quality_objective",
format_version: 1,
kind: TypeKind::Enum,
wire: true,
},
TypeContract {
name: "vector_indexing_objective",
format_version: 1,
kind: TypeKind::Enum,
wire: true,
},
TypeContract {
name: "vector_residency_intent",
format_version: 1,
kind: TypeKind::Enum,
wire: true,
},
TypeContract {
name: "vector_calibration_binding",
format_version: 1,
kind: TypeKind::Struct,
wire: true,
},
TypeContract {
name: "vector_resource_policy",
format_version: 2,
kind: TypeKind::Struct,
wire: true,
},
TypeContract {
name: "workload_class",
format_version: 1,
kind: TypeKind::Enum,
wire: true,
},
TypeContract {
name: "index_resource_spec",
format_version: 3,
kind: TypeKind::Struct,
wire: true,
},
TypeContract {
name: "index_summary",
format_version: 1,
kind: TypeKind::Struct,
wire: true,
},
TypeContract {
name: "mapping_mode",
format_version: 1,
kind: TypeKind::Enum,
wire: true,
},
TypeContract {
name: "dynamic_mapping_policy",
format_version: 1,
kind: TypeKind::Enum,
wire: true,
},
TypeContract {
name: "mapping_analyzer",
format_version: 1,
kind: TypeKind::Enum,
wire: true,
},
TypeContract {
name: "keyword_normalizer",
format_version: 1,
kind: TypeKind::Enum,
wire: true,
},
TypeContract {
name: "vector_metric",
format_version: 1,
kind: TypeKind::Enum,
wire: true,
},
TypeContract {
name: "mapping_scalar",
format_version: 1,
kind: TypeKind::TaggedUnion,
wire: true,
},
TypeContract {
name: "sparse_vector_weight_type",
format_version: 1,
kind: TypeKind::Enum,
wire: true,
},
TypeContract {
name: "mapping_field_type",
format_version: 3,
kind: TypeKind::TaggedUnion,
wire: true,
},
TypeContract {
name: "mapping_field",
format_version: 1,
kind: TypeKind::Struct,
wire: true,
},
TypeContract {
name: "multi_field_projection",
format_version: 1,
kind: TypeKind::Struct,
wire: true,
},
TypeContract {
name: "analyzer_identity",
format_version: 1,
kind: TypeKind::Struct,
wire: true,
},
TypeContract {
name: "keyword_limit",
format_version: 1,
kind: TypeKind::Struct,
wire: true,
},
TypeContract {
name: "mapping",
format_version: 1,
kind: TypeKind::Struct,
wire: true,
},
TypeContract {
name: "index_detail",
format_version: 1,
kind: TypeKind::Struct,
wire: true,
},
TypeContract {
name: "source_provider",
format_version: 1,
kind: TypeKind::Enum,
wire: true,
},
TypeContract {
name: "source_decoder",
format_version: 1,
kind: TypeKind::Enum,
wire: true,
},
TypeContract {
name: "source_replay_guarantees",
format_version: 1,
kind: TypeKind::Struct,
wire: true,
},
TypeContract {
name: "source_partition_configuration",
format_version: 1,
kind: TypeKind::Struct,
wire: true,
},
TypeContract {
name: "replayable_source_configuration",
format_version: 1,
kind: TypeKind::Struct,
wire: true,
},
TypeContract {
name: "source_partition_status",
format_version: 1,
kind: TypeKind::Struct,
wire: true,
},
TypeContract {
name: "replayable_source_status",
format_version: 1,
kind: TypeKind::Struct,
wire: true,
},
TypeContract {
name: "source_control_transition",
format_version: 1,
kind: TypeKind::Enum,
wire: true,
},
TypeContract {
name: "history_ledger_precondition",
format_version: 1,
kind: TypeKind::TaggedUnion,
wire: true,
},
TypeContract {
name: "history_retention_policy",
format_version: 1,
kind: TypeKind::Struct,
wire: true,
},
TypeContract {
name: "history_selector",
format_version: 1,
kind: TypeKind::TaggedUnion,
wire: true,
},
TypeContract {
name: "history_hold",
format_version: 1,
kind: TypeKind::Struct,
wire: true,
},
TypeContract {
name: "history_status",
format_version: 1,
kind: TypeKind::Struct,
wire: true,
},
TypeContract {
name: "history_resolution",
format_version: 1,
kind: TypeKind::Struct,
wire: true,
},
TypeContract {
name: "index_reference",
format_version: 1,
kind: TypeKind::Struct,
wire: true,
},
TypeContract {
name: "alias_target",
format_version: 1,
kind: TypeKind::Struct,
wire: true,
},
TypeContract {
name: "alias_summary",
format_version: 1,
kind: TypeKind::Struct,
wire: true,
},
TypeContract {
name: "alias_detail",
format_version: 1,
kind: TypeKind::Struct,
wire: true,
},
TypeContract {
name: "data_stream_summary",
format_version: 1,
kind: TypeKind::Struct,
wire: true,
},
TypeContract {
name: "component_template_binding",
format_version: 1,
kind: TypeKind::Struct,
wire: true,
},
TypeContract {
name: "index_template_binding",
format_version: 1,
kind: TypeKind::Struct,
wire: true,
},
TypeContract {
name: "lifecycle_policy_binding",
format_version: 1,
kind: TypeKind::Struct,
wire: true,
},
TypeContract {
name: "data_stream_detail",
format_version: 1,
kind: TypeKind::Struct,
wire: true,
},
TypeContract {
name: "component_template_summary",
format_version: 1,
kind: TypeKind::Struct,
wire: true,
},
TypeContract {
name: "component_template_detail",
format_version: 1,
kind: TypeKind::Struct,
wire: true,
},
TypeContract {
name: "index_template_summary",
format_version: 1,
kind: TypeKind::Struct,
wire: true,
},
TypeContract {
name: "index_template_detail",
format_version: 1,
kind: TypeKind::Struct,
wire: true,
},
TypeContract {
name: "ingest_pipeline_summary",
format_version: 1,
kind: TypeKind::Struct,
wire: true,
},
TypeContract {
name: "ingest_pipeline_detail",
format_version: 1,
kind: TypeKind::Struct,
wire: true,
},
TypeContract {
name: "ingest_pipeline_selection",
format_version: 1,
kind: TypeKind::Struct,
wire: true,
},
TypeContract {
name: "lifecycle_policy_summary",
format_version: 1,
kind: TypeKind::Struct,
wire: true,
},
TypeContract {
name: "rollover_thresholds",
format_version: 1,
kind: TypeKind::Struct,
wire: true,
},
TypeContract {
name: "retention_policy",
format_version: 1,
kind: TypeKind::Struct,
wire: true,
},
TypeContract {
name: "lifecycle_policy_detail",
format_version: 1,
kind: TypeKind::Struct,
wire: true,
},
TypeContract {
name: "text_query_operator",
format_version: 1,
kind: TypeKind::Enum,
wire: true,
},
TypeContract {
name: "text_query_analyzer",
format_version: 1,
kind: TypeKind::Enum,
wire: true,
},
TypeContract {
name: "zero_terms_query",
format_version: 1,
kind: TypeKind::Enum,
wire: true,
},
TypeContract {
name: "text_query_options",
format_version: 1,
kind: TypeKind::Struct,
wire: true,
},
TypeContract {
name: "multi_match_mode",
format_version: 1,
kind: TypeKind::Enum,
wire: true,
},
TypeContract {
name: "multi_match_field",
format_version: 1,
kind: TypeKind::Struct,
wire: true,
},
TypeContract {
name: "multi_match_options",
format_version: 1,
kind: TypeKind::Struct,
wire: true,
},
TypeContract {
name: "sort_order",
format_version: 1,
kind: TypeKind::Enum,
wire: true,
},
TypeContract {
name: "sort_mode",
format_version: 1,
kind: TypeKind::Enum,
wire: true,
},
TypeContract {
name: "missing_order",
format_version: 1,
kind: TypeKind::Enum,
wire: true,
},
TypeContract {
name: "nested_score_mode",
format_version: 1,
kind: TypeKind::Enum,
wire: true,
},
TypeContract {
name: "nested_inner_hits",
format_version: 1,
kind: TypeKind::Struct,
wire: true,
},
TypeContract {
name: "sort_spec",
format_version: 1,
kind: TypeKind::TaggedUnion,
wire: true,
},
TypeContract {
name: "query",
format_version: 1,
kind: TypeKind::TaggedUnion,
wire: true,
},
TypeContract {
name: "dense_retrieval_mode",
format_version: 1,
kind: TypeKind::Enum,
wire: true,
},
TypeContract {
name: "vector_achieved_mode",
format_version: 1,
kind: TypeKind::Enum,
wire: true,
},
TypeContract {
name: "vector_branch_diagnostics",
format_version: 2,
kind: TypeKind::Struct,
wire: true,
},
TypeContract {
name: "dense_vector_element_type",
format_version: 1,
kind: TypeKind::Enum,
wire: true,
},
TypeContract {
name: "dense_vector_byte_order",
format_version: 1,
kind: TypeKind::Enum,
wire: true,
},
TypeContract {
name: "vector_value",
format_version: 1,
kind: TypeKind::TaggedUnion,
wire: true,
},
TypeContract {
name: "sparse_vector_entry",
format_version: 1,
kind: TypeKind::Struct,
wire: true,
},
TypeContract {
name: "sparse_vector_value",
format_version: 1,
kind: TypeKind::Struct,
wire: true,
},
TypeContract {
name: "vector_set_value",
format_version: 1,
kind: TypeKind::Struct,
wire: true,
},
TypeContract {
name: "vector_evaluation_snapshot",
format_version: 1,
kind: TypeKind::TaggedUnion,
wire: true,
},
TypeContract {
name: "vector_evaluation_query_set",
format_version: 1,
kind: TypeKind::TaggedUnion,
wire: true,
},
TypeContract {
name: "vector_evaluation_budget",
format_version: 1,
kind: TypeKind::Struct,
wire: true,
},
TypeContract {
name: "vector_candidate_policy",
format_version: 1,
kind: TypeKind::Enum,
wire: true,
},
TypeContract {
name: "vector_calibration_objective",
format_version: 1,
kind: TypeKind::Enum,
wire: true,
},
TypeContract {
name: "vector_strategy_profile",
format_version: 1,
kind: TypeKind::Enum,
wire: true,
},
TypeContract {
name: "vector_evaluation_work",
format_version: 1,
kind: TypeKind::Struct,
wire: true,
},
TypeContract {
name: "vector_evaluation_error_code",
format_version: 1,
kind: TypeKind::Enum,
wire: true,
},
TypeContract {
name: "vector_evaluation_error",
format_version: 1,
kind: TypeKind::Struct,
wire: true,
},
TypeContract {
name: "vector_recall_result",
format_version: 1,
kind: TypeKind::Struct,
wire: true,
},
TypeContract {
name: "vector_calibration_candidate",
format_version: 1,
kind: TypeKind::Struct,
wire: true,
},
TypeContract {
name: "vector_calibration_result",
format_version: 1,
kind: TypeKind::Struct,
wire: true,
},
TypeContract {
name: "vector_diagnostic_result",
format_version: 1,
kind: TypeKind::TaggedUnion,
wire: true,
},
TypeContract {
name: "vector_warm_component",
format_version: 1,
kind: TypeKind::Enum,
wire: true,
},
TypeContract {
name: "vector_warm_state",
format_version: 1,
kind: TypeKind::Enum,
wire: true,
},
TypeContract {
name: "vector_warm_achievement",
format_version: 1,
kind: TypeKind::Struct,
wire: true,
},
TypeContract {
name: "vector_warm_result",
format_version: 1,
kind: TypeKind::Struct,
wire: true,
},
TypeContract {
name: "dense_retrieval_threshold",
format_version: 1,
kind: TypeKind::TaggedUnion,
wire: true,
},
TypeContract {
name: "retrieval_branch",
format_version: 3,
kind: TypeKind::TaggedUnion,
wire: true,
},
TypeContract {
name: "weighted_rrf_fusion",
format_version: 1,
kind: TypeKind::Struct,
wire: true,
},
TypeContract {
name: "retrieval_plan",
format_version: 1,
kind: TypeKind::Struct,
wire: true,
},
TypeContract {
name: "histogram_bounds",
format_version: 1,
kind: TypeKind::Struct,
wire: true,
},
TypeContract {
name: "date_histogram_bounds",
format_version: 1,
kind: TypeKind::Struct,
wire: true,
},
TypeContract {
name: "approximation_algorithm",
format_version: 1,
kind: TypeKind::Enum,
wire: true,
},
TypeContract {
name: "approximation",
format_version: 1,
kind: TypeKind::Struct,
wire: true,
},
TypeContract {
name: "percentile_value",
format_version: 1,
kind: TypeKind::Struct,
wire: true,
},
TypeContract {
name: "approximate_percentile_value",
format_version: 1,
kind: TypeKind::Struct,
wire: true,
},
TypeContract {
name: "aggregation",
format_version: 1,
kind: TypeKind::TaggedUnion,
wire: true,
},
TypeContract {
name: "nested_search_hit",
format_version: 1,
kind: TypeKind::Struct,
wire: true,
},
TypeContract {
name: "named_nested_inner_hits_result",
format_version: 1,
kind: TypeKind::Struct,
wire: true,
},
TypeContract {
name: "fragment_boundary",
format_version: 1,
kind: TypeKind::Enum,
wire: true,
},
TypeContract {
name: "fragment_offset_encoding",
format_version: 1,
kind: TypeKind::Enum,
wire: true,
},
TypeContract {
name: "fragment_ranker",
format_version: 1,
kind: TypeKind::Enum,
wire: true,
},
TypeContract {
name: "fragment_request",
format_version: 1,
kind: TypeKind::Struct,
wire: true,
},
TypeContract {
name: "search_fragment",
format_version: 1,
kind: TypeKind::Struct,
wire: true,
},
TypeContract {
name: "numeric_feature_transform",
format_version: 1,
kind: TypeKind::TaggedUnion,
wire: true,
},
TypeContract {
name: "numeric_result_feature",
format_version: 1,
kind: TypeKind::Struct,
wire: true,
},
TypeContract {
name: "result_feature_request",
format_version: 1,
kind: TypeKind::Struct,
wire: true,
},
TypeContract {
name: "result_diversification",
format_version: 1,
kind: TypeKind::Struct,
wire: true,
},
TypeContract {
name: "branch_score_kind",
format_version: 2,
kind: TypeKind::Enum,
wire: true,
},
TypeContract {
name: "result_feature",
format_version: 1,
kind: TypeKind::TaggedUnion,
wire: true,
},
TypeContract {
name: "search_hit",
format_version: 2,
kind: TypeKind::Struct,
wire: true,
},
TypeContract {
name: "aggregation_bucket",
format_version: 1,
kind: TypeKind::Struct,
wire: true,
},
TypeContract {
name: "aggregation_result",
format_version: 1,
kind: TypeKind::TaggedUnion,
wire: true,
},
TypeContract {
name: "shard_counts",
format_version: 1,
kind: TypeKind::Struct,
wire: true,
},
TypeContract {
name: "total_hits_relation",
format_version: 1,
kind: TypeKind::Enum,
wire: true,
},
TypeContract {
name: "search_total",
format_version: 1,
kind: TypeKind::Struct,
wire: true,
},
TypeContract {
name: "artifact",
format_version: 1,
kind: TypeKind::Struct,
wire: true,
},
TypeContract {
name: "operation",
format_version: 1,
kind: TypeKind::Struct,
wire: true,
},
TypeContract {
name: "submission_state",
format_version: 1,
kind: TypeKind::Enum,
wire: true,
},
TypeContract {
name: "expected_binding",
format_version: 1,
kind: TypeKind::Struct,
wire: true,
},
TypeContract {
name: "administration_alias_action",
format_version: 1,
kind: TypeKind::TaggedUnion,
wire: true,
},
TypeContract {
name: "administration_mutation",
format_version: 1,
kind: TypeKind::TaggedUnion,
wire: true,
},
TypeContract {
name: "administration_outcome",
format_version: 1,
kind: TypeKind::Struct,
wire: true,
},
TypeContract {
name: "index_change_apply_receipt",
format_version: 1,
kind: TypeKind::Struct,
wire: true,
},
TypeContract {
name: "backup_encryption_policy",
format_version: 1,
kind: TypeKind::Struct,
wire: true,
},
TypeContract {
name: "backup_create_outcome",
format_version: 1,
kind: TypeKind::Struct,
wire: true,
},
TypeContract {
name: "bulk_document_item",
format_version: 1,
kind: TypeKind::Struct,
wire: true,
},
TypeContract {
name: "bulk_document_item_outcome",
format_version: 1,
kind: TypeKind::Struct,
wire: true,
},
TypeContract {
name: "bulk_document_outcome",
format_version: 1,
kind: TypeKind::Struct,
wire: true,
},
TypeContract {
name: "retained_append_item",
format_version: 1,
kind: TypeKind::Struct,
wire: true,
},
TypeContract {
name: "retained_append_state",
format_version: 1,
kind: TypeKind::Enum,
wire: true,
},
TypeContract {
name: "retained_append_retry_safety",
format_version: 1,
kind: TypeKind::Enum,
wire: true,
},
TypeContract {
name: "retained_append_item_outcome",
format_version: 1,
kind: TypeKind::Struct,
wire: true,
},
TypeContract {
name: "retained_append_bulk_outcome",
format_version: 1,
kind: TypeKind::Struct,
wire: true,
},
TypeContract {
name: "retained_append_observation_state",
format_version: 1,
kind: TypeKind::Enum,
wire: true,
},
TypeContract {
name: "retained_append_observation_outcome",
format_version: 1,
kind: TypeKind::Struct,
wire: true,
},
TypeContract {
name: "binary_value",
format_version: 1,
kind: TypeKind::Struct,
wire: true,
},
TypeContract {
name: "state_hash_field",
format_version: 1,
kind: TypeKind::Struct,
wire: true,
},
TypeContract {
name: "state_set_entry",
format_version: 1,
kind: TypeKind::Struct,
wire: true,
},
TypeContract {
name: "state_set_condition",
format_version: 1,
kind: TypeKind::Enum,
wire: true,
},
TypeContract {
name: "state_operation",
format_version: 1,
kind: TypeKind::TaggedUnion,
wire: true,
},
TypeContract {
name: "state_optional_value",
format_version: 1,
kind: TypeKind::TaggedUnion,
wire: true,
},
TypeContract {
name: "state_command_result",
format_version: 1,
kind: TypeKind::TaggedUnion,
wire: true,
},
TypeContract {
name: "state_write_resolution",
format_version: 1,
kind: TypeKind::TaggedUnion,
wire: true,
},
TypeContract {
name: "service_credential_reservation",
format_version: 1,
kind: TypeKind::Struct,
wire: true,
},
TypeContract {
name: "subscription_metadata_field",
format_version: 1,
kind: TypeKind::Enum,
wire: true,
},
TypeContract {
name: "subscription_field",
format_version: 1,
kind: TypeKind::TaggedUnion,
wire: true,
},
TypeContract {
name: "subscription_filter",
format_version: 1,
kind: TypeKind::TaggedUnion,
wire: true,
},
TypeContract {
name: "subscription_cursor_entry",
format_version: 1,
kind: TypeKind::Struct,
wire: true,
},
TypeContract {
name: "subscription_route",
format_version: 1,
kind: TypeKind::Struct,
wire: true,
},
TypeContract {
name: "subscription_start_position",
format_version: 1,
kind: TypeKind::TaggedUnion,
wire: true,
},
TypeContract {
name: "subscription_start",
format_version: 1,
kind: TypeKind::Struct,
wire: true,
},
TypeContract {
name: "subscription_accepted",
format_version: 1,
kind: TypeKind::Struct,
wire: true,
},
TypeContract {
name: "subscription_writer_fence",
format_version: 1,
kind: TypeKind::Struct,
wire: true,
},
TypeContract {
name: "subscription_event",
format_version: 1,
kind: TypeKind::Struct,
wire: true,
},
TypeContract {
name: "subscription_heartbeat",
format_version: 1,
kind: TypeKind::Struct,
wire: true,
},
TypeContract {
name: "subscription_gap",
format_version: 1,
kind: TypeKind::Struct,
wire: true,
},
TypeContract {
name: "subscription_terminal",
format_version: 1,
kind: TypeKind::Struct,
wire: true,
},
TypeContract {
name: "subscription_frame",
format_version: 1,
kind: TypeKind::TaggedUnion,
wire: true,
},
TypeContract {
name: "stream_binding",
format_version: 1,
kind: TypeKind::Struct,
wire: true,
},
TypeContract {
name: "capability_grant",
format_version: 1,
kind: TypeKind::Struct,
wire: true,
},
TypeContract {
name: "protocol_limit",
format_version: 1,
kind: TypeKind::Struct,
wire: true,
},
TypeContract {
name: "document_mutation_condition",
format_version: 1,
kind: TypeKind::TaggedUnion,
wire: true,
},
TypeContract {
name: "audit_event",
format_version: 1,
kind: TypeKind::Struct,
wire: true,
},
TypeContract {
name: "audit_gap",
format_version: 1,
kind: TypeKind::Struct,
wire: true,
},
TypeContract {
name: "service_credential_grant",
format_version: 1,
kind: TypeKind::Struct,
wire: true,
},
TypeContract {
name: "service_credential_summary",
format_version: 1,
kind: TypeKind::Struct,
wire: true,
},
TypeContract {
name: "security_role",
format_version: 1,
kind: TypeKind::Struct,
wire: true,
},
TypeContract {
name: "role_append_scope_change",
format_version: 1,
kind: TypeKind::TaggedUnion,
wire: true,
},
TypeContract {
name: "role_append_access_preparation",
format_version: 1,
kind: TypeKind::TaggedUnion,
wire: true,
},
TypeContract {
name: "security_action_outcome",
format_version: 1,
kind: TypeKind::TaggedUnion,
wire: true,
},
TypeContract {
name: "maintenance_work_state",
format_version: 1,
kind: TypeKind::Enum,
wire: true,
},
TypeContract {
name: "maintenance_attempt_state",
format_version: 1,
kind: TypeKind::Enum,
wire: true,
},
TypeContract {
name: "maintenance_failure_class",
format_version: 1,
kind: TypeKind::Enum,
wire: true,
},
TypeContract {
name: "maintenance_failure_class_count",
format_version: 1,
kind: TypeKind::Struct,
wire: true,
},
TypeContract {
name: "maintenance_attempt_observation",
format_version: 1,
kind: TypeKind::Struct,
wire: true,
},
TypeContract {
name: "maintenance_task_scope",
format_version: 1,
kind: TypeKind::Struct,
wire: true,
},
TypeContract {
name: "maintenance_task_status",
format_version: 1,
kind: TypeKind::Struct,
wire: true,
},
TypeContract {
name: "maintenance_status_aggregate",
format_version: 1,
kind: TypeKind::Struct,
wire: true,
},
TypeContract {
name: "runtime_status_detail",
format_version: 1,
kind: TypeKind::Struct,
wire: true,
},
TypeContract {
name: "result_cache_status",
format_version: 2,
kind: TypeKind::Struct,
wire: true,
},
TypeContract {
name: "field_promotion_status",
format_version: 1,
kind: TypeKind::Struct,
wire: true,
},
TypeContract {
name: "overload_shard_status",
format_version: 2,
kind: TypeKind::Struct,
wire: true,
},
TypeContract {
name: "external_key_binding",
format_version: 1,
kind: TypeKind::Struct,
wire: true,
},
TypeContract {
name: "rollup_measure",
format_version: 1,
kind: TypeKind::TaggedUnion,
wire: true,
},
TypeContract {
name: "aggregate_then_delete_policy",
format_version: 1,
kind: TypeKind::Struct,
wire: true,
},
TypeContract {
name: "lifecycle_binding_status",
format_version: 1,
kind: TypeKind::Struct,
wire: true,
},
TypeContract {
name: "lifecycle_rollup_status",
format_version: 1,
kind: TypeKind::Struct,
wire: true,
},
TypeContract {
name: "lifecycle_status",
format_version: 2,
kind: TypeKind::Struct,
wire: true,
},
TypeContract {
name: "quota_limit",
format_version: 1,
kind: TypeKind::Struct,
wire: true,
},
TypeContract {
name: "quota_consumption",
format_version: 1,
kind: TypeKind::Struct,
wire: true,
},
TypeContract {
name: "quota_update",
format_version: 1,
kind: TypeKind::Struct,
wire: true,
},
TypeContract {
name: "core_binding",
format_version: 2,
kind: TypeKind::Struct,
wire: true,
},
TypeContract {
name: "readiness_observation",
format_version: 1,
kind: TypeKind::Struct,
wire: true,
},
TypeContract {
name: "usage_dimension",
format_version: 1,
kind: TypeKind::Struct,
wire: true,
},
TypeContract {
name: "physical_usage_value",
format_version: 2,
kind: TypeKind::Struct,
wire: true,
},
TypeContract {
name: "core_usage_units",
format_version: 2,
kind: TypeKind::Struct,
wire: true,
},
TypeContract {
name: "core_usage_correction",
format_version: 2,
kind: TypeKind::Struct,
wire: true,
},
TypeContract {
name: "error_detail",
format_version: 1,
kind: TypeKind::TaggedUnion,
wire: true,
},
TypeContract {
name: "connection_profile",
format_version: 3,
kind: TypeKind::Struct,
wire: false,
},
];
#[derive(Clone, Copy, Debug, Eq, PartialEq)]
pub struct StreamContract {
pub name: &'static str,
pub action: Action,
pub transport: &'static str,
pub service: &'static str,
pub method: &'static str,
pub auth_metadata: &'static str,
pub auth_scheme: &'static str,
pub semantic_format_version: u16,
pub start_type: &'static str,
pub frame_type: &'static str,
}
pub const LODESTONE_API_STREAM_CONTRACTS: &[StreamContract] = &[StreamContract {
name: "subscription",
action: Action::SubscriptionRead,
transport: "grpc_tls",
service: "lodestone.api.FilterSubscription",
method: "/lodestone.api.FilterSubscription/Subscribe",
auth_metadata: "authorization",
auth_scheme: "ApiKey",
semantic_format_version: 1,
start_type: "subscription_start",
frame_type: "subscription_frame",
}];
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(deny_unknown_fields)]
pub struct ErrorBody {
pub code: ErrorCode,
pub message: String,
pub retry_safe: bool,
pub submitted: bool,
pub details: Option<ErrorDetail>,
}
#[derive(Clone, Copy, Debug, Eq, PartialEq)]
pub enum ErrorShapeError {
DetailCodeMismatch,
RetryAfterOutOfRange,
}
pub fn validate_error_body(body: &ErrorBody) -> Result<(), ErrorShapeError> {
let detail_matches = matches!(
(&body.code, &body.details),
(_, None)
| (ErrorCode::Aborted, Some(ErrorDetail::Aborted { .. }))
| (ErrorCode::DeadlineExceeded, Some(ErrorDetail::DeadlineExceeded { .. }))
| (ErrorCode::InvalidRequest, Some(ErrorDetail::InvalidRequest { .. }))
| (
ErrorCode::UnsupportedVersion,
Some(ErrorDetail::UnsupportedVersion { .. })
)
| (ErrorCode::Unauthenticated, Some(ErrorDetail::Unauthenticated))
| (ErrorCode::PermissionDenied, Some(ErrorDetail::PermissionDenied { .. }))
| (ErrorCode::NotFound, Some(ErrorDetail::NotFound { .. }))
| (ErrorCode::Conflict, Some(ErrorDetail::Conflict { .. }))
| (ErrorCode::StaleCursor, Some(ErrorDetail::StaleCursor { .. }))
| (
ErrorCode::RestartBudgetExhausted,
Some(ErrorDetail::RestartBudgetExhausted { .. })
)
| (ErrorCode::LimitExceeded, Some(ErrorDetail::LimitExceeded { .. }))
| (
ErrorCode::CapabilityUnavailable,
Some(ErrorDetail::CapabilityUnavailable { .. })
)
| (ErrorCode::NotSubmitted, Some(ErrorDetail::NotSubmitted { .. }))
| (
ErrorCode::SubmittedIndeterminate,
Some(ErrorDetail::SubmittedIndeterminate { .. })
)
| (ErrorCode::ExpiredUnknown, Some(ErrorDetail::ExpiredUnknown { .. }))
| (ErrorCode::SecretNotEscrowed, Some(ErrorDetail::SecretNotEscrowed))
| (ErrorCode::RetentionGap, Some(ErrorDetail::RetentionGap { .. }))
| (
ErrorCode::ArtifactRangeInvalid,
Some(ErrorDetail::ArtifactRangeInvalid { .. })
)
| (ErrorCode::ChecksumMismatch, Some(ErrorDetail::ChecksumMismatch { .. }))
| (
ErrorCode::TemporarilyUnavailable,
Some(ErrorDetail::TemporarilyUnavailable { .. })
)
| (ErrorCode::Internal, Some(ErrorDetail::Internal))
);
if !detail_matches {
return Err(ErrorShapeError::DetailCodeMismatch);
}
let retry_after = match &body.details {
Some(ErrorDetail::NotSubmitted { retry_after_millis })
| Some(ErrorDetail::TemporarilyUnavailable { retry_after_millis }) => retry_after_millis.as_ref(),
_ => None,
};
if retry_after
.and_then(|value| value.value.parse::<u64>().ok())
.is_some_and(|value| value > 60000)
{
return Err(ErrorShapeError::RetryAfterOutOfRange);
}
Ok(())
}
#[derive(Clone, Debug, Deserialize, Eq, PartialEq, Serialize)]
#[serde(deny_unknown_fields)]
pub struct RequestMeta {
pub format_version: u16,
pub request_id: String,
pub correlation_id: Identity,
pub absolute_deadline_unix_millis: U64,
pub workload_class: WorkloadClass,
}
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(deny_unknown_fields)]
pub struct DiscoverRequest {}
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(deny_unknown_fields)]
pub struct DiscoverResult {
pub principal_id: Identity,
pub collection_id: Identity,
pub policy_revision: U64,
pub artifact_version: String,
pub schema_id: String,
pub schema_digest: Digest,
pub streams: Vec<StreamBinding>,
pub capabilities: Vec<CapabilityGrant>,
pub limits: Vec<ProtocolLimit>,
}
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(deny_unknown_fields)]
pub struct ListIndexesRequest {
pub page_size: u32,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub cursor: Option<Cursor>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub name_prefix: Option<String>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub mode: Option<String>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub state: Option<String>,
pub restart_count: u32,
}
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(deny_unknown_fields)]
pub struct ListIndexesResult {
pub items: Vec<IndexSummary>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub next_cursor: Option<Cursor>,
pub restart_count: u32,
}
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(deny_unknown_fields)]
pub struct GetIndexRequest {
pub name: String,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub expected_incarnation: Option<Identity>,
}
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(deny_unknown_fields)]
pub struct GetIndexResult {
pub resource: IndexDetail,
}
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(deny_unknown_fields)]
pub struct ValidateIndexChangeRequest {
pub action_kind: String,
pub name: String,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub expected_incarnation: Option<Identity>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub expected_revision: Option<U64>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub mode: Option<String>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub mapping: Option<Mapping>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub policies: Option<IndexPolicies>,
}
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(deny_unknown_fields)]
pub struct ValidateIndexChangeResult {
pub change_kind: String,
pub fields_added: Vec<String>,
pub policy_axes_changed: Vec<String>,
pub required_capabilities: Vec<String>,
pub catalog_revision: U64,
pub policy_revision: U64,
}
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(deny_unknown_fields)]
pub struct ApplyIndexChangeRequest {
pub action_id: Digest,
pub index: Resource,
pub expected_revision: U64,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub mapping: Option<Mapping>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub policies: Option<IndexPolicies>,
}
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(deny_unknown_fields)]
pub struct ApplyIndexChangeResult {
pub receipt: IndexChangeApplyReceipt,
}
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(deny_unknown_fields)]
pub struct ApplyAdministrationMutationRequest {
pub action_id: Digest,
pub expected_revision: U64,
pub mutation: AdministrationMutation,
}
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(deny_unknown_fields)]
pub struct ApplyAdministrationMutationResult {
pub outcome: AdministrationOutcome,
}
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(deny_unknown_fields)]
pub struct ListAliasesRequest {
pub page_size: u32,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub cursor: Option<Cursor>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub name_prefix: Option<String>,
pub restart_count: u32,
}
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(deny_unknown_fields)]
pub struct ListAliasesResult {
pub items: Vec<AliasSummary>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub next_cursor: Option<Cursor>,
pub restart_count: u32,
}
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(deny_unknown_fields)]
pub struct GetAliasRequest {
pub name: String,
}
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(deny_unknown_fields)]
pub struct GetAliasResult {
pub resource: AliasDetail,
}
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(deny_unknown_fields)]
pub struct ListDataStreamsRequest {
pub page_size: u32,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub cursor: Option<Cursor>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub name_prefix: Option<String>,
pub restart_count: u32,
}
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(deny_unknown_fields)]
pub struct ListDataStreamsResult {
pub items: Vec<DataStreamSummary>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub next_cursor: Option<Cursor>,
pub restart_count: u32,
}
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(deny_unknown_fields)]
pub struct GetDataStreamRequest {
pub name: String,
}
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(deny_unknown_fields)]
pub struct GetDataStreamResult {
pub resource: DataStreamDetail,
}
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(deny_unknown_fields)]
pub struct ListComponentTemplatesRequest {
pub page_size: u32,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub cursor: Option<Cursor>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub name_prefix: Option<String>,
pub restart_count: u32,
}
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(deny_unknown_fields)]
pub struct ListComponentTemplatesResult {
pub items: Vec<ComponentTemplateSummary>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub next_cursor: Option<Cursor>,
pub restart_count: u32,
}
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(deny_unknown_fields)]
pub struct GetComponentTemplateRequest {
pub name: String,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub expected_incarnation: Option<Identity>,
}
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(deny_unknown_fields)]
pub struct GetComponentTemplateResult {
pub resource: ComponentTemplateDetail,
}
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(deny_unknown_fields)]
pub struct ListIndexTemplatesRequest {
pub page_size: u32,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub cursor: Option<Cursor>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub name_prefix: Option<String>,
pub restart_count: u32,
}
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(deny_unknown_fields)]
pub struct ListIndexTemplatesResult {
pub items: Vec<IndexTemplateSummary>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub next_cursor: Option<Cursor>,
pub restart_count: u32,
}
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(deny_unknown_fields)]
pub struct GetIndexTemplateRequest {
pub name: String,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub expected_incarnation: Option<Identity>,
}
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(deny_unknown_fields)]
pub struct GetIndexTemplateResult {
pub resource: IndexTemplateDetail,
}
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(deny_unknown_fields)]
pub struct ListIngestPipelinesRequest {
pub page_size: u32,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub cursor: Option<Cursor>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub name_prefix: Option<String>,
pub restart_count: u32,
}
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(deny_unknown_fields)]
pub struct ListIngestPipelinesResult {
pub items: Vec<IngestPipelineSummary>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub next_cursor: Option<Cursor>,
pub restart_count: u32,
}
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(deny_unknown_fields)]
pub struct GetIngestPipelineRequest {
pub name: String,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub expected_incarnation: Option<Identity>,
}
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(deny_unknown_fields)]
pub struct GetIngestPipelineResult {
pub resource: IngestPipelineDetail,
}
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(deny_unknown_fields)]
pub struct SimulateIngestPipelineRequest {
#[serde(default, skip_serializing_if = "Option::is_none")]
pub name: Option<String>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub expected: Option<ExpectedBinding>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub definition: Option<RawJson>,
pub source: RawJson,
}
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(deny_unknown_fields)]
pub struct SimulateIngestPipelineResult {
#[serde(default, skip_serializing_if = "Option::is_none")]
pub source: Option<RawJson>,
pub dropped: bool,
pub changed: bool,
}
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(deny_unknown_fields)]
pub struct ReprocessByQueryRequest {
pub action_id: Digest,
pub index: Resource,
pub query: Query,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub pipeline: Option<IngestPipelineSelection>,
pub batch_size: u32,
pub max_docs: U64,
pub proceed_on_conflict: bool,
pub slices: u32,
pub requests_per_second: u32,
pub wait_for_completion: bool,
}
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(deny_unknown_fields)]
pub struct ReprocessByQueryResult {
pub task_id: Identity,
pub scanned: U64,
pub updated: U64,
pub noops: U64,
pub version_conflicts: U64,
pub batches: U64,
pub completed: bool,
}
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(deny_unknown_fields)]
pub struct ListLifecyclePoliciesRequest {
pub page_size: u32,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub cursor: Option<Cursor>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub name_prefix: Option<String>,
pub restart_count: u32,
}
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(deny_unknown_fields)]
pub struct ListLifecyclePoliciesResult {
pub items: Vec<LifecyclePolicySummary>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub next_cursor: Option<Cursor>,
pub restart_count: u32,
}
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(deny_unknown_fields)]
pub struct GetLifecyclePolicyRequest {
pub name: String,
}
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(deny_unknown_fields)]
pub struct GetLifecyclePolicyResult {
pub resource: LifecyclePolicyDetail,
}
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(deny_unknown_fields)]
pub struct PrepareCreateIndexRequest {
pub name: String,
pub mapping: Mapping,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub resource_spec: Option<IndexResourceSpec>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub retained_event_identity: Option<bool>,
}
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(deny_unknown_fields)]
pub struct PrepareCreateIndexResult {
pub locator: Locator,
pub expires_at: U64,
pub semantic_digest: Digest,
pub resource_spec: IndexResourceSpec,
}
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(deny_unknown_fields)]
pub struct PrepareDeleteIndexRequest {
pub name: String,
pub expected_incarnation: Identity,
}
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(deny_unknown_fields)]
pub struct PrepareDeleteIndexResult {
#[serde(default, skip_serializing_if = "Option::is_none")]
pub locator: Option<Locator>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub expires_at: Option<U64>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub semantic_digest: Option<Digest>,
pub impact_digest: Digest,
pub blockers: Vec<String>,
pub scheduled_effects: Vec<String>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub estimated_documents: Option<U64>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub estimated_logical_bytes: Option<U64>,
}
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(deny_unknown_fields)]
pub struct SubmitCatalogActionRequest {
pub locator: Locator,
pub semantic_digest: Digest,
pub action_kind: String,
pub name: String,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub mapping: Option<Mapping>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub resource_spec: Option<IndexResourceSpec>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub expected_incarnation: Option<Identity>,
}
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(deny_unknown_fields)]
pub struct SubmitCatalogActionResult {
pub locator: Locator,
pub state: String,
pub submitted: bool,
}
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(deny_unknown_fields)]
pub struct ResolveCatalogActionRequest {
pub locator: Locator,
}
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(deny_unknown_fields)]
pub struct ResolveCatalogActionResult {
pub locator: Locator,
pub state: String,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub resource: Option<Resource>,
}
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(deny_unknown_fields)]
pub struct PrepareReplayableSourceIndexRequest {
pub name: String,
pub mapping: Mapping,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub resource_spec: Option<IndexResourceSpec>,
pub source: ReplayableSourceConfiguration,
}
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(deny_unknown_fields)]
pub struct PrepareReplayableSourceIndexResult {
pub locator: Locator,
pub expires_at: U64,
pub semantic_digest: Digest,
pub resource_spec: IndexResourceSpec,
}
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(deny_unknown_fields)]
pub struct SubmitReplayableSourceIndexRequest {
pub locator: Locator,
pub semantic_digest: Digest,
pub name: String,
pub mapping: Mapping,
pub resource_spec: IndexResourceSpec,
pub source: ReplayableSourceConfiguration,
}
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(deny_unknown_fields)]
pub struct SubmitReplayableSourceIndexResult {
pub locator: Locator,
pub state: String,
pub submitted: bool,
}
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(deny_unknown_fields)]
pub struct GetReplayableSourceRequest {
pub index: Resource,
}
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(deny_unknown_fields)]
pub struct GetReplayableSourceResult {
pub status: ReplayableSourceStatus,
}
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(deny_unknown_fields)]
pub struct ControlReplayableSourceRequest {
pub index: Resource,
pub expected_generation: U64,
pub transition: SourceControlTransition,
}
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(deny_unknown_fields)]
pub struct ControlReplayableSourceResult {
pub status: ReplayableSourceStatus,
pub submitted: bool,
}
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(deny_unknown_fields)]
pub struct CloneIndexRequest {
pub source: Resource,
pub destination_name: String,
pub operation_id: Identity,
pub source_cut_id: Identity,
}
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(deny_unknown_fields)]
pub struct CloneIndexResult {
pub destination: Resource,
pub source_cut_id: Identity,
pub submitted: bool,
}
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(deny_unknown_fields)]
pub struct ConfigureHistoryRequest {
pub index: Resource,
pub precondition: HistoryLedgerPrecondition,
pub policy: HistoryRetentionPolicy,
}
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(deny_unknown_fields)]
pub struct ConfigureHistoryResult {
pub status: HistoryStatus,
pub submitted: bool,
}
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(deny_unknown_fields)]
pub struct GetHistoryRequest {
pub index: Resource,
}
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(deny_unknown_fields)]
pub struct GetHistoryResult {
pub status: HistoryStatus,
}
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(deny_unknown_fields)]
pub struct ResolveHistoryRequest {
pub index: Resource,
pub selector: HistorySelector,
}
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(deny_unknown_fields)]
pub struct ResolveHistoryResult {
pub resolution: HistoryResolution,
}
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(deny_unknown_fields)]
pub struct PlaceHistoryHoldRequest {
pub index: Resource,
pub expected_ledger_revision: U64,
pub hold: HistoryHold,
}
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(deny_unknown_fields)]
pub struct PlaceHistoryHoldResult {
pub status: HistoryStatus,
pub submitted: bool,
}
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(deny_unknown_fields)]
pub struct ReleaseHistoryHoldRequest {
pub index: Resource,
pub expected_ledger_revision: U64,
pub hold_id: Identity,
}
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(deny_unknown_fields)]
pub struct ReleaseHistoryHoldResult {
pub status: HistoryStatus,
pub submitted: bool,
}
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(deny_unknown_fields)]
pub struct PrepareDocumentMutationRequest {
pub index: Resource,
pub document_id: String,
pub operation: String,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub source: Option<RawJson>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub routing: Option<String>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub condition: Option<DocumentMutationCondition>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub pipeline: Option<IngestPipelineSelection>,
}
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(deny_unknown_fields)]
pub struct PrepareDocumentMutationResult {
pub locator: Locator,
pub semantic_digest: Digest,
pub retention_max_entries: U64,
pub retention_sequence_window: U64,
}
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(deny_unknown_fields)]
pub struct SubmitDocumentMutationRequest {
pub locator: Locator,
pub semantic_digest: Digest,
pub index: Resource,
pub document_id: String,
pub operation: String,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub source: Option<RawJson>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub routing: Option<String>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub condition: Option<DocumentMutationCondition>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub pipeline: Option<IngestPipelineSelection>,
}
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(deny_unknown_fields)]
pub struct SubmitDocumentMutationResult {
pub locator: Locator,
pub state: String,
pub submitted: bool,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub sequence: Option<U64>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub mapping_generation: Option<U64>,
pub mapping_adopted: bool,
}
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(deny_unknown_fields)]
pub struct PrepareDocumentBulkRequest {
pub batch_id: Digest,
pub index: Resource,
pub items: Vec<BulkDocumentItem>,
}
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(deny_unknown_fields)]
pub struct PrepareDocumentBulkResult {
pub outcome: BulkDocumentOutcome,
}
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(deny_unknown_fields)]
pub struct SubmitDocumentBulkRequest {
pub batch_id: Digest,
pub index: Resource,
pub items: Vec<BulkDocumentItem>,
pub preparations: Vec<BulkDocumentItemOutcome>,
}
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(deny_unknown_fields)]
pub struct SubmitDocumentBulkResult {
pub outcome: BulkDocumentOutcome,
}
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(deny_unknown_fields)]
pub struct ResolveDocumentBulkRequest {
pub batch_id: Digest,
pub index: Resource,
pub items: Vec<BulkDocumentItemOutcome>,
}
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(deny_unknown_fields)]
pub struct ResolveDocumentBulkResult {
pub outcome: BulkDocumentOutcome,
}
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(deny_unknown_fields)]
pub struct PrepareAppendBulkRequest {
pub batch_id: Digest,
pub index: Resource,
pub items: Vec<RetainedAppendItem>,
}
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(deny_unknown_fields)]
pub struct PrepareAppendBulkResult {
pub outcome: RetainedAppendBulkOutcome,
}
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(deny_unknown_fields)]
pub struct SubmitAppendBulkRequest {
pub batch_id: Digest,
pub index: Resource,
pub items: Vec<RetainedAppendItem>,
pub preparations: Vec<RetainedAppendItemOutcome>,
}
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(deny_unknown_fields)]
pub struct SubmitAppendBulkResult {
pub outcome: RetainedAppendBulkOutcome,
}
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(deny_unknown_fields)]
pub struct ResolveAppendBulkRequest {
pub batch_id: Digest,
pub index: Resource,
pub items: Vec<RetainedAppendItemOutcome>,
}
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(deny_unknown_fields)]
pub struct ResolveAppendBulkResult {
pub outcome: RetainedAppendBulkOutcome,
}
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(deny_unknown_fields)]
pub struct ObserveAppendCommittedRequest {
pub index: Resource,
pub locator: Locator,
}
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(deny_unknown_fields)]
pub struct ObserveAppendCommittedResult {
pub outcome: RetainedAppendObservationOutcome,
}
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(deny_unknown_fields)]
pub struct ResolveDocumentMutationRequest {
pub locator: Locator,
}
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(deny_unknown_fields)]
pub struct ResolveDocumentMutationResult {
pub locator: Locator,
pub state: String,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub sequence: Option<U64>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub mapping_generation: Option<U64>,
pub mapping_adopted: bool,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub source: Option<RawJson>,
}
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(deny_unknown_fields)]
pub struct GetDocumentRequest {
pub index: Resource,
pub document_id: String,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub routing: Option<String>,
}
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(deny_unknown_fields)]
pub struct GetDocumentResult {
pub found: bool,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub source: Option<RawJson>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub sequence: Option<U64>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub primary_term: Option<U64>,
}
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(deny_unknown_fields)]
pub struct SearchRequest {
#[serde(default, skip_serializing_if = "Option::is_none")]
pub indexes: Option<Vec<Resource>>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub query: Option<Query>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub retrieval: Option<RetrievalPlan>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub aggregations: Option<Vec<Aggregation>>,
pub sort: Vec<SortSpec>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub routing: Option<Vec<String>>,
pub freshness: String,
pub page_size: u32,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub cursor: Option<Cursor>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub pit: Option<Cursor>,
pub allow_partial: bool,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub total_hits_threshold: Option<U64>,
pub diagnostics: bool,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub fragments: Option<FragmentRequest>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub features: Option<ResultFeatureRequest>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub diversification: Option<ResultDiversification>,
}
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(deny_unknown_fields)]
pub struct SearchResult {
pub hits: Vec<SearchHit>,
pub aggregations: Vec<AggregationResult>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub next_cursor: Option<Cursor>,
pub timed_out: bool,
pub partial: bool,
pub shards: ShardCounts,
pub total: SearchTotal,
pub failures: Vec<ErrorBody>,
pub vector_diagnostics: Vec<VectorBranchDiagnostics>,
}
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(deny_unknown_fields)]
pub struct OpenPitRequest {
pub indexes: Vec<Resource>,
pub keep_alive_millis: U64,
}
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(deny_unknown_fields)]
pub struct OpenPitResult {
pub pit: Cursor,
pub expires_at: U64,
pub shard_count: u32,
}
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(deny_unknown_fields)]
pub struct RenewPitRequest {
pub pit: Cursor,
pub keep_alive_millis: U64,
}
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(deny_unknown_fields)]
pub struct RenewPitResult {
pub pit: Cursor,
pub expires_at: U64,
pub shard_count: u32,
}
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(deny_unknown_fields)]
pub struct ClosePitRequest {
pub pit: Cursor,
}
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(deny_unknown_fields)]
pub struct ClosePitResult {
pub removed: bool,
}
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(deny_unknown_fields)]
pub struct ListOperationsRequest {
pub page_size: u32,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub cursor: Option<Cursor>,
}
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(deny_unknown_fields)]
pub struct ListOperationsResult {
pub items: Vec<Operation>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub next_cursor: Option<Cursor>,
}
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(deny_unknown_fields)]
pub struct GetOperationRequest {
pub locator: Locator,
}
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(deny_unknown_fields)]
pub struct GetOperationResult {
pub operation: Operation,
}
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(deny_unknown_fields)]
pub struct CancelOperationRequest {
pub locator: Locator,
pub expected_authority_revision: U64,
pub cancel_action: Identity,
}
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(deny_unknown_fields)]
pub struct CancelOperationResult {
pub locator: Locator,
pub cancel_generation: U64,
pub submitted: bool,
}
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(deny_unknown_fields)]
pub struct ListAuditEventsRequest {
pub start_time: U64,
pub end_time: U64,
pub actions: Vec<String>,
pub page_size: u32,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub cursor: Option<Cursor>,
}
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(deny_unknown_fields)]
pub struct ListAuditEventsResult {
pub events: Vec<AuditEvent>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub next_cursor: Option<Cursor>,
pub gaps: Vec<AuditGap>,
pub object_reads: u32,
}
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(deny_unknown_fields)]
pub struct ExportAuditEventsRequest {
pub start_time: U64,
pub end_time: U64,
pub actions: Vec<String>,
pub page_size: u32,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub cursor: Option<Cursor>,
}
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(deny_unknown_fields)]
pub struct ExportAuditEventsResult {
pub events: Vec<AuditEvent>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub next_cursor: Option<Cursor>,
pub gaps: Vec<AuditGap>,
pub object_reads: u32,
}
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(deny_unknown_fields)]
pub struct ReserveServiceCredentialRequest {
pub reservation_action_id: Digest,
pub activation_action_id: Digest,
pub role_grants: Vec<ServiceCredentialGrant>,
pub credential_expires_at: U64,
pub reservation_expires_at: U64,
}
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(deny_unknown_fields)]
pub struct ReserveServiceCredentialResult {
pub reservation: ServiceCredentialReservation,
}
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(deny_unknown_fields)]
pub struct ReserveServiceCredentialRotationRequest {
pub reservation_action_id: Digest,
pub activation_action_id: Digest,
pub current_api_key_id: Identity,
pub expected_generation: U64,
pub credential_expires_at: U64,
pub overlap_until: U64,
pub reservation_expires_at: U64,
}
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(deny_unknown_fields)]
pub struct ReserveServiceCredentialRotationResult {
pub reservation: ServiceCredentialReservation,
}
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(deny_unknown_fields)]
pub struct ActivateServiceCredentialRequest {
pub reservation: ServiceCredentialReservation,
pub verifier: Digest,
}
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(deny_unknown_fields)]
pub struct ActivateServiceCredentialResult {
pub locator: Locator,
pub outcome: SecurityActionOutcome,
pub secret_escrowed: bool,
}
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(deny_unknown_fields)]
pub struct ResolveServiceCredentialReservationRequest {
pub reservation_action_id: Digest,
}
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(deny_unknown_fields)]
pub struct ResolveServiceCredentialReservationResult {
pub state: String,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub reservation: Option<ServiceCredentialReservation>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub outcome: Option<SecurityActionOutcome>,
}
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(deny_unknown_fields)]
pub struct PrepareRevokeServiceCredentialRequest {
pub api_key_id: Identity,
pub expected_generation: U64,
}
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(deny_unknown_fields)]
pub struct PrepareRevokeServiceCredentialResult {
pub locator: Locator,
pub semantic_digest: Digest,
pub expires_at: U64,
}
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(deny_unknown_fields)]
pub struct RevokeServiceCredentialRequest {
pub locator: Locator,
pub api_key_id: Identity,
pub expected_generation: U64,
}
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(deny_unknown_fields)]
pub struct RevokeServiceCredentialResult {
pub locator: Locator,
pub principal_id: Identity,
pub api_key_id: Identity,
pub state: String,
}
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(deny_unknown_fields)]
pub struct ResolveSecurityActionRequest {
pub locator: Locator,
}
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(deny_unknown_fields)]
pub struct ResolveSecurityActionResult {
pub locator: Locator,
pub state: String,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub result: Option<SecurityActionOutcome>,
pub secret_escrowed: bool,
}
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(deny_unknown_fields)]
pub struct GetSecurityRoleRequest {
pub role_name: String,
}
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(deny_unknown_fields)]
pub struct GetSecurityRoleResult {
pub role: SecurityRole,
}
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(deny_unknown_fields)]
pub struct PrepareRoleAppendAccessChangeRequest {
pub role_name: String,
pub expected_role_version: U64,
pub changes: Vec<RoleAppendScopeChange>,
}
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(deny_unknown_fields)]
pub struct PrepareRoleAppendAccessChangeResult {
pub preparation: RoleAppendAccessPreparation,
}
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(deny_unknown_fields)]
pub struct SubmitRoleAppendAccessChangeRequest {
pub locator: Locator,
pub semantic_digest: Digest,
pub role_name: String,
pub expected_role_version: U64,
pub changes: Vec<RoleAppendScopeChange>,
}
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(deny_unknown_fields)]
pub struct SubmitRoleAppendAccessChangeResult {
pub locator: Locator,
pub state: String,
pub target_policy_revision: U64,
pub role: SecurityRole,
}
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(deny_unknown_fields)]
pub struct ListServiceCredentialsRequest {
pub page_size: u32,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub cursor: Option<Cursor>,
}
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(deny_unknown_fields)]
pub struct ListServiceCredentialsResult {
pub items: Vec<ServiceCredentialSummary>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub next_cursor: Option<Cursor>,
}
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(deny_unknown_fields)]
pub struct ListBackupsRequest {
pub page_size: u32,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub cursor: Option<Cursor>,
}
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(deny_unknown_fields)]
pub struct ListBackupsResult {
pub items: Vec<Operation>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub next_cursor: Option<Cursor>,
}
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(deny_unknown_fields)]
pub struct GetBackupRequest {
pub locator: Locator,
}
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(deny_unknown_fields)]
pub struct GetBackupResult {
pub operation: Operation,
pub artifacts: Vec<Artifact>,
}
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(deny_unknown_fields)]
pub struct CreateBackupRequest {
pub action_id: Digest,
pub encryption_policies: Vec<BackupEncryptionPolicy>,
}
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(deny_unknown_fields)]
pub struct CreateBackupResult {
pub outcome: BackupCreateOutcome,
}
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(deny_unknown_fields)]
pub struct ResolveBackupActionRequest {
pub action_id: Digest,
}
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(deny_unknown_fields)]
pub struct ResolveBackupActionResult {
pub operation: Operation,
}
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(deny_unknown_fields)]
pub struct GetRuntimeStatusRequest {}
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(deny_unknown_fields)]
pub struct GetRuntimeStatusResult {
pub ready: bool,
pub recovery_era: Identity,
pub catalog_revision: U64,
pub policy_revision: U64,
pub redacted: RuntimeStatusDetail,
}
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(deny_unknown_fields)]
pub struct GetResultCacheStatusRequest {}
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(deny_unknown_fields)]
pub struct GetResultCacheStatusResult {
pub status: ResultCacheStatus,
}
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(deny_unknown_fields)]
pub struct GetFieldPromotionStatusRequest {
pub index: Resource,
}
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(deny_unknown_fields)]
pub struct GetFieldPromotionStatusResult {
pub status: FieldPromotionStatus,
}
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(deny_unknown_fields)]
pub struct GetOverloadStatusRequest {
pub index: Resource,
}
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(deny_unknown_fields)]
pub struct GetOverloadStatusResult {
pub runtime_observed: bool,
pub shards: Vec<OverloadShardStatus>,
}
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(deny_unknown_fields)]
pub struct ConfigureExternalKeyRequest {
pub index: Resource,
pub expected_authority_revision: U64,
pub binding: ExternalKeyBinding,
}
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(deny_unknown_fields)]
pub struct ConfigureExternalKeyResult {
pub status: LifecycleStatus,
pub submitted: bool,
}
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(deny_unknown_fields)]
pub struct RotateExternalKeyBindingRequest {
pub index: Resource,
pub expected_authority_revision: U64,
pub predecessor_binding_id: Identity,
pub binding: ExternalKeyBinding,
}
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(deny_unknown_fields)]
pub struct RotateExternalKeyBindingResult {
pub status: LifecycleStatus,
pub submitted: bool,
}
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(deny_unknown_fields)]
pub struct ConfigureAggregateThenDeleteRequest {
pub index: Resource,
pub expected_authority_revision: U64,
pub policy: AggregateThenDeletePolicy,
}
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(deny_unknown_fields)]
pub struct ConfigureAggregateThenDeleteResult {
pub status: LifecycleStatus,
pub submitted: bool,
}
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(deny_unknown_fields)]
pub struct GetLifecycleStatusRequest {
pub index: Resource,
}
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(deny_unknown_fields)]
pub struct GetLifecycleStatusResult {
pub status: LifecycleStatus,
}
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(deny_unknown_fields)]
pub struct GetQuotaRequest {}
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(deny_unknown_fields)]
pub struct GetQuotaResult {
pub revision: U64,
pub limits: Vec<QuotaLimit>,
pub usage: Vec<QuotaConsumption>,
}
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(deny_unknown_fields)]
pub struct UpdateQuotaRequest {
pub expected_revision: U64,
pub limits: Vec<QuotaLimit>,
}
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(deny_unknown_fields)]
pub struct UpdateQuotaResult {
pub update: QuotaUpdate,
}
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(deny_unknown_fields)]
pub struct GetBindingRequest {}
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(deny_unknown_fields)]
pub struct GetBindingResult {
pub binding: CoreBinding,
pub derived: bool,
pub revision: U64,
}
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(deny_unknown_fields)]
pub struct GetAdmissionStatusRequest {}
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(deny_unknown_fields)]
pub struct GetAdmissionStatusResult {
pub state: String,
pub revision: U64,
pub converged: bool,
}
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(deny_unknown_fields)]
pub struct SetAdmissionRequest {
pub expected_revision: U64,
pub state: String,
}
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(deny_unknown_fields)]
pub struct SetAdmissionResult {
pub state: String,
pub revision: U64,
pub converged: bool,
}
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(deny_unknown_fields)]
pub struct GetQuiesceStatusRequest {}
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(deny_unknown_fields)]
pub struct GetQuiesceStatusResult {
pub ready: bool,
pub blockers: Vec<String>,
pub observations: Vec<ReadinessObservation>,
pub recovery_era: Identity,
pub observed_at: U64,
pub expires_at: U64,
}
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(deny_unknown_fields)]
pub struct GetDecommissionReadinessRequest {}
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(deny_unknown_fields)]
pub struct GetDecommissionReadinessResult {
pub ready: bool,
pub blockers: Vec<String>,
pub observations: Vec<ReadinessObservation>,
pub recovery_era: Identity,
pub observed_at: U64,
pub expires_at: U64,
}
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(deny_unknown_fields)]
pub struct GetUpgradeReadinessRequest {}
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(deny_unknown_fields)]
pub struct GetUpgradeReadinessResult {
pub ready: bool,
pub blockers: Vec<String>,
pub observations: Vec<ReadinessObservation>,
pub recovery_era: Identity,
pub observed_at: U64,
pub expires_at: U64,
}
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(deny_unknown_fields)]
pub struct GetMaintenanceStatusRequest {
pub page_size: u32,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub cursor: Option<Cursor>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub index: Option<Resource>,
}
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(deny_unknown_fields)]
pub struct GetMaintenanceStatusResult {
pub aggregate: MaintenanceStatusAggregate,
pub items: Vec<MaintenanceTaskStatus>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub next_cursor: Option<Cursor>,
}
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(deny_unknown_fields)]
pub struct GetRestoreReadinessRequest {}
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(deny_unknown_fields)]
pub struct GetRestoreReadinessResult {
pub ready: bool,
pub blockers: Vec<String>,
pub observations: Vec<ReadinessObservation>,
pub recovery_era: Identity,
pub observed_at: U64,
pub expires_at: U64,
}
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(deny_unknown_fields)]
pub struct WarmVectorIndexRequest {
pub index: Resource,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub expected_root_digest: Option<Digest>,
pub components: Vec<VectorWarmComponent>,
pub maximum_requests: u32,
pub maximum_bytes: U64,
pub maximum_achievements: u32,
pub expires_at: U64,
}
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(deny_unknown_fields)]
pub struct WarmVectorIndexResult {
pub result: VectorWarmResult,
}
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(deny_unknown_fields)]
pub struct EvaluateVectorRecallRequest {
pub action_id: Digest,
pub index: Resource,
pub field: String,
pub mapping_generation: U64,
pub snapshot: VectorEvaluationSnapshot,
pub query_set: VectorEvaluationQuerySet,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub filter: Option<Query>,
pub metric: VectorMetric,
pub k: u32,
pub candidate_policy: VectorCandidatePolicy,
pub budget: VectorEvaluationBudget,
pub maximum_bytes: U64,
}
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(deny_unknown_fields)]
pub struct EvaluateVectorRecallResult {
pub operation: Operation,
}
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(deny_unknown_fields)]
pub struct CalibrateVectorStrategyRequest {
pub action_id: Digest,
pub index: Resource,
pub field: String,
pub mapping_generation: U64,
pub snapshot: VectorEvaluationSnapshot,
pub query_set: VectorEvaluationQuerySet,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub filter: Option<Query>,
pub metric: VectorMetric,
pub k: u32,
pub objective: VectorCalibrationObjective,
pub minimum_recall_basis_points: u32,
pub budget: VectorEvaluationBudget,
pub maximum_bytes: U64,
}
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(deny_unknown_fields)]
pub struct CalibrateVectorStrategyResult {
pub operation: Operation,
}
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(deny_unknown_fields)]
pub struct GetVectorDiagnosticRequest {
pub locator: Locator,
}
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(deny_unknown_fields)]
pub struct GetVectorDiagnosticResult {
pub operation: Operation,
pub artifacts: Vec<Artifact>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub result: Option<VectorDiagnosticResult>,
}
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(deny_unknown_fields)]
pub struct CreateDiagnosticRequest {
pub scope: String,
pub maximum_bytes: U64,
}
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(deny_unknown_fields)]
pub struct CreateDiagnosticResult {
pub operation: Operation,
}
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(deny_unknown_fields)]
pub struct GetDiagnosticRequest {
pub locator: Locator,
}
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(deny_unknown_fields)]
pub struct GetDiagnosticResult {
pub operation: Operation,
pub artifacts: Vec<Artifact>,
}
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(deny_unknown_fields)]
pub struct ReadArtifactChunkRequest {
pub artifact: Artifact,
pub offset: U64,
pub length: u32,
}
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(deny_unknown_fields)]
pub struct ReadArtifactChunkResult {
pub offset: U64,
pub bytes_base64: String,
pub chunk_sha256: String,
pub artifact_sha256: String,
pub complete: bool,
}
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(deny_unknown_fields)]
pub struct ExportUsageRequest {
pub window_start: U64,
pub window_end: U64,
pub page_size: u32,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub cursor: Option<Cursor>,
}
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(deny_unknown_fields)]
pub struct ExportUsageResult {
pub units: Vec<CoreUsageUnits>,
pub corrections: Vec<CoreUsageCorrection>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub next_cursor: Option<Cursor>,
pub cumulative_through: U64,
}
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(deny_unknown_fields)]
pub struct ExecuteStateReadRequest {
pub index: Resource,
pub operation: StateOperation,
}
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(deny_unknown_fields)]
pub struct ExecuteStateReadResult {
pub result: StateCommandResult,
}
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(deny_unknown_fields)]
pub struct PrepareStateWriteRequest {
pub index: Resource,
pub action_id: Digest,
pub operation: StateOperation,
}
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(deny_unknown_fields)]
pub struct PrepareStateWriteResult {
pub locator: Locator,
pub semantic_digest: Digest,
pub retention_max_entries: U64,
pub retention_sequence_window: U64,
}
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(deny_unknown_fields)]
pub struct SubmitStateWriteRequest {
pub index: Resource,
pub action_id: Digest,
pub operation: StateOperation,
pub locator: Locator,
pub semantic_digest: Digest,
}
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(deny_unknown_fields)]
pub struct SubmitStateWriteResult {
#[serde(default, skip_serializing_if = "Option::is_none")]
pub result: Option<StateCommandResult>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub resolution: Option<StateWriteResolution>,
pub submitted: bool,
}
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(deny_unknown_fields)]
pub struct ResolveStateWriteRequest {
pub index: Resource,
pub action_id: Digest,
pub operation: StateOperation,
pub locator: Locator,
pub semantic_digest: Digest,
}
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(deny_unknown_fields)]
pub struct ResolveStateWriteResult {
pub resolution: StateWriteResolution,
}
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(tag = "command", content = "body", rename_all = "snake_case")]
pub enum RequestBody {
Discover(DiscoverRequest),
ListIndexes(ListIndexesRequest),
GetIndex(GetIndexRequest),
ValidateIndexChange(ValidateIndexChangeRequest),
ApplyIndexChange(ApplyIndexChangeRequest),
ApplyAdministrationMutation(ApplyAdministrationMutationRequest),
ListAliases(ListAliasesRequest),
GetAlias(GetAliasRequest),
ListDataStreams(ListDataStreamsRequest),
GetDataStream(GetDataStreamRequest),
ListComponentTemplates(ListComponentTemplatesRequest),
GetComponentTemplate(GetComponentTemplateRequest),
ListIndexTemplates(ListIndexTemplatesRequest),
GetIndexTemplate(GetIndexTemplateRequest),
ListIngestPipelines(ListIngestPipelinesRequest),
GetIngestPipeline(GetIngestPipelineRequest),
SimulateIngestPipeline(SimulateIngestPipelineRequest),
ReprocessByQuery(ReprocessByQueryRequest),
ListLifecyclePolicies(ListLifecyclePoliciesRequest),
GetLifecyclePolicy(GetLifecyclePolicyRequest),
PrepareCreateIndex(PrepareCreateIndexRequest),
PrepareDeleteIndex(PrepareDeleteIndexRequest),
SubmitCatalogAction(SubmitCatalogActionRequest),
ResolveCatalogAction(ResolveCatalogActionRequest),
PrepareReplayableSourceIndex(PrepareReplayableSourceIndexRequest),
SubmitReplayableSourceIndex(SubmitReplayableSourceIndexRequest),
GetReplayableSource(GetReplayableSourceRequest),
ControlReplayableSource(ControlReplayableSourceRequest),
CloneIndex(CloneIndexRequest),
ConfigureHistory(ConfigureHistoryRequest),
GetHistory(GetHistoryRequest),
ResolveHistory(ResolveHistoryRequest),
PlaceHistoryHold(PlaceHistoryHoldRequest),
ReleaseHistoryHold(ReleaseHistoryHoldRequest),
PrepareDocumentMutation(PrepareDocumentMutationRequest),
SubmitDocumentMutation(SubmitDocumentMutationRequest),
PrepareDocumentBulk(PrepareDocumentBulkRequest),
SubmitDocumentBulk(SubmitDocumentBulkRequest),
ResolveDocumentBulk(ResolveDocumentBulkRequest),
PrepareAppendBulk(PrepareAppendBulkRequest),
SubmitAppendBulk(SubmitAppendBulkRequest),
ResolveAppendBulk(ResolveAppendBulkRequest),
ObserveAppendCommitted(ObserveAppendCommittedRequest),
ResolveDocumentMutation(ResolveDocumentMutationRequest),
GetDocument(GetDocumentRequest),
Search(SearchRequest),
OpenPit(OpenPitRequest),
RenewPit(RenewPitRequest),
ClosePit(ClosePitRequest),
ListOperations(ListOperationsRequest),
GetOperation(GetOperationRequest),
CancelOperation(CancelOperationRequest),
ListAuditEvents(ListAuditEventsRequest),
ExportAuditEvents(ExportAuditEventsRequest),
ReserveServiceCredential(ReserveServiceCredentialRequest),
ReserveServiceCredentialRotation(ReserveServiceCredentialRotationRequest),
ActivateServiceCredential(ActivateServiceCredentialRequest),
ResolveServiceCredentialReservation(ResolveServiceCredentialReservationRequest),
PrepareRevokeServiceCredential(PrepareRevokeServiceCredentialRequest),
RevokeServiceCredential(RevokeServiceCredentialRequest),
ResolveSecurityAction(ResolveSecurityActionRequest),
GetSecurityRole(GetSecurityRoleRequest),
PrepareRoleAppendAccessChange(PrepareRoleAppendAccessChangeRequest),
SubmitRoleAppendAccessChange(SubmitRoleAppendAccessChangeRequest),
ListServiceCredentials(ListServiceCredentialsRequest),
ListBackups(ListBackupsRequest),
GetBackup(GetBackupRequest),
CreateBackup(CreateBackupRequest),
ResolveBackupAction(ResolveBackupActionRequest),
GetRuntimeStatus(GetRuntimeStatusRequest),
GetResultCacheStatus(GetResultCacheStatusRequest),
GetFieldPromotionStatus(GetFieldPromotionStatusRequest),
GetOverloadStatus(GetOverloadStatusRequest),
ConfigureExternalKey(ConfigureExternalKeyRequest),
RotateExternalKeyBinding(RotateExternalKeyBindingRequest),
ConfigureAggregateThenDelete(ConfigureAggregateThenDeleteRequest),
GetLifecycleStatus(GetLifecycleStatusRequest),
GetQuota(GetQuotaRequest),
UpdateQuota(UpdateQuotaRequest),
GetBinding(GetBindingRequest),
GetAdmissionStatus(GetAdmissionStatusRequest),
SetAdmission(SetAdmissionRequest),
GetQuiesceStatus(GetQuiesceStatusRequest),
GetDecommissionReadiness(GetDecommissionReadinessRequest),
GetUpgradeReadiness(GetUpgradeReadinessRequest),
GetMaintenanceStatus(GetMaintenanceStatusRequest),
GetRestoreReadiness(GetRestoreReadinessRequest),
WarmVectorIndex(WarmVectorIndexRequest),
EvaluateVectorRecall(EvaluateVectorRecallRequest),
CalibrateVectorStrategy(CalibrateVectorStrategyRequest),
GetVectorDiagnostic(GetVectorDiagnosticRequest),
CreateDiagnostic(CreateDiagnosticRequest),
GetDiagnostic(GetDiagnosticRequest),
ReadArtifactChunk(ReadArtifactChunkRequest),
ExportUsage(ExportUsageRequest),
ExecuteStateRead(ExecuteStateReadRequest),
PrepareStateWrite(PrepareStateWriteRequest),
SubmitStateWrite(SubmitStateWriteRequest),
ResolveStateWrite(ResolveStateWriteRequest),
}
#[allow(clippy::large_enum_variant)]
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(tag = "command", content = "body", rename_all = "snake_case")]
pub enum ResultBody {
Discover(DiscoverResult),
ListIndexes(ListIndexesResult),
GetIndex(GetIndexResult),
ValidateIndexChange(ValidateIndexChangeResult),
ApplyIndexChange(ApplyIndexChangeResult),
ApplyAdministrationMutation(ApplyAdministrationMutationResult),
ListAliases(ListAliasesResult),
GetAlias(GetAliasResult),
ListDataStreams(ListDataStreamsResult),
GetDataStream(GetDataStreamResult),
ListComponentTemplates(ListComponentTemplatesResult),
GetComponentTemplate(GetComponentTemplateResult),
ListIndexTemplates(ListIndexTemplatesResult),
GetIndexTemplate(GetIndexTemplateResult),
ListIngestPipelines(ListIngestPipelinesResult),
GetIngestPipeline(GetIngestPipelineResult),
SimulateIngestPipeline(SimulateIngestPipelineResult),
ReprocessByQuery(ReprocessByQueryResult),
ListLifecyclePolicies(ListLifecyclePoliciesResult),
GetLifecyclePolicy(GetLifecyclePolicyResult),
PrepareCreateIndex(PrepareCreateIndexResult),
PrepareDeleteIndex(PrepareDeleteIndexResult),
SubmitCatalogAction(SubmitCatalogActionResult),
ResolveCatalogAction(ResolveCatalogActionResult),
PrepareReplayableSourceIndex(PrepareReplayableSourceIndexResult),
SubmitReplayableSourceIndex(SubmitReplayableSourceIndexResult),
GetReplayableSource(GetReplayableSourceResult),
ControlReplayableSource(ControlReplayableSourceResult),
CloneIndex(CloneIndexResult),
ConfigureHistory(ConfigureHistoryResult),
GetHistory(GetHistoryResult),
ResolveHistory(ResolveHistoryResult),
PlaceHistoryHold(PlaceHistoryHoldResult),
ReleaseHistoryHold(ReleaseHistoryHoldResult),
PrepareDocumentMutation(PrepareDocumentMutationResult),
SubmitDocumentMutation(SubmitDocumentMutationResult),
PrepareDocumentBulk(PrepareDocumentBulkResult),
SubmitDocumentBulk(SubmitDocumentBulkResult),
ResolveDocumentBulk(ResolveDocumentBulkResult),
PrepareAppendBulk(PrepareAppendBulkResult),
SubmitAppendBulk(SubmitAppendBulkResult),
ResolveAppendBulk(ResolveAppendBulkResult),
ObserveAppendCommitted(ObserveAppendCommittedResult),
ResolveDocumentMutation(ResolveDocumentMutationResult),
GetDocument(GetDocumentResult),
Search(SearchResult),
OpenPit(OpenPitResult),
RenewPit(RenewPitResult),
ClosePit(ClosePitResult),
ListOperations(ListOperationsResult),
GetOperation(GetOperationResult),
CancelOperation(CancelOperationResult),
ListAuditEvents(ListAuditEventsResult),
ExportAuditEvents(ExportAuditEventsResult),
ReserveServiceCredential(ReserveServiceCredentialResult),
ReserveServiceCredentialRotation(ReserveServiceCredentialRotationResult),
ActivateServiceCredential(ActivateServiceCredentialResult),
ResolveServiceCredentialReservation(ResolveServiceCredentialReservationResult),
PrepareRevokeServiceCredential(PrepareRevokeServiceCredentialResult),
RevokeServiceCredential(RevokeServiceCredentialResult),
ResolveSecurityAction(ResolveSecurityActionResult),
GetSecurityRole(GetSecurityRoleResult),
PrepareRoleAppendAccessChange(PrepareRoleAppendAccessChangeResult),
SubmitRoleAppendAccessChange(SubmitRoleAppendAccessChangeResult),
ListServiceCredentials(ListServiceCredentialsResult),
ListBackups(ListBackupsResult),
GetBackup(GetBackupResult),
CreateBackup(CreateBackupResult),
ResolveBackupAction(ResolveBackupActionResult),
GetRuntimeStatus(GetRuntimeStatusResult),
GetResultCacheStatus(GetResultCacheStatusResult),
GetFieldPromotionStatus(GetFieldPromotionStatusResult),
GetOverloadStatus(GetOverloadStatusResult),
ConfigureExternalKey(ConfigureExternalKeyResult),
RotateExternalKeyBinding(RotateExternalKeyBindingResult),
ConfigureAggregateThenDelete(ConfigureAggregateThenDeleteResult),
GetLifecycleStatus(GetLifecycleStatusResult),
GetQuota(GetQuotaResult),
UpdateQuota(UpdateQuotaResult),
GetBinding(GetBindingResult),
GetAdmissionStatus(GetAdmissionStatusResult),
SetAdmission(SetAdmissionResult),
GetQuiesceStatus(GetQuiesceStatusResult),
GetDecommissionReadiness(GetDecommissionReadinessResult),
GetUpgradeReadiness(GetUpgradeReadinessResult),
GetMaintenanceStatus(GetMaintenanceStatusResult),
GetRestoreReadiness(GetRestoreReadinessResult),
WarmVectorIndex(WarmVectorIndexResult),
EvaluateVectorRecall(EvaluateVectorRecallResult),
CalibrateVectorStrategy(CalibrateVectorStrategyResult),
GetVectorDiagnostic(GetVectorDiagnosticResult),
CreateDiagnostic(CreateDiagnosticResult),
GetDiagnostic(GetDiagnosticResult),
ReadArtifactChunk(ReadArtifactChunkResult),
ExportUsage(ExportUsageResult),
ExecuteStateRead(ExecuteStateReadResult),
PrepareStateWrite(PrepareStateWriteResult),
SubmitStateWrite(SubmitStateWriteResult),
ResolveStateWrite(ResolveStateWriteResult),
}
pub const fn command_for_request(value: &RequestBody) -> Command {
match value {
RequestBody::Discover(_) => Command::Discover,
RequestBody::ListIndexes(_) => Command::ListIndexes,
RequestBody::GetIndex(_) => Command::GetIndex,
RequestBody::ValidateIndexChange(_) => Command::ValidateIndexChange,
RequestBody::ApplyIndexChange(_) => Command::ApplyIndexChange,
RequestBody::ApplyAdministrationMutation(_) => Command::ApplyAdministrationMutation,
RequestBody::ListAliases(_) => Command::ListAliases,
RequestBody::GetAlias(_) => Command::GetAlias,
RequestBody::ListDataStreams(_) => Command::ListDataStreams,
RequestBody::GetDataStream(_) => Command::GetDataStream,
RequestBody::ListComponentTemplates(_) => Command::ListComponentTemplates,
RequestBody::GetComponentTemplate(_) => Command::GetComponentTemplate,
RequestBody::ListIndexTemplates(_) => Command::ListIndexTemplates,
RequestBody::GetIndexTemplate(_) => Command::GetIndexTemplate,
RequestBody::ListIngestPipelines(_) => Command::ListIngestPipelines,
RequestBody::GetIngestPipeline(_) => Command::GetIngestPipeline,
RequestBody::SimulateIngestPipeline(_) => Command::SimulateIngestPipeline,
RequestBody::ReprocessByQuery(_) => Command::ReprocessByQuery,
RequestBody::ListLifecyclePolicies(_) => Command::ListLifecyclePolicies,
RequestBody::GetLifecyclePolicy(_) => Command::GetLifecyclePolicy,
RequestBody::PrepareCreateIndex(_) => Command::PrepareCreateIndex,
RequestBody::PrepareDeleteIndex(_) => Command::PrepareDeleteIndex,
RequestBody::SubmitCatalogAction(_) => Command::SubmitCatalogAction,
RequestBody::ResolveCatalogAction(_) => Command::ResolveCatalogAction,
RequestBody::PrepareReplayableSourceIndex(_) => Command::PrepareReplayableSourceIndex,
RequestBody::SubmitReplayableSourceIndex(_) => Command::SubmitReplayableSourceIndex,
RequestBody::GetReplayableSource(_) => Command::GetReplayableSource,
RequestBody::ControlReplayableSource(_) => Command::ControlReplayableSource,
RequestBody::CloneIndex(_) => Command::CloneIndex,
RequestBody::ConfigureHistory(_) => Command::ConfigureHistory,
RequestBody::GetHistory(_) => Command::GetHistory,
RequestBody::ResolveHistory(_) => Command::ResolveHistory,
RequestBody::PlaceHistoryHold(_) => Command::PlaceHistoryHold,
RequestBody::ReleaseHistoryHold(_) => Command::ReleaseHistoryHold,
RequestBody::PrepareDocumentMutation(_) => Command::PrepareDocumentMutation,
RequestBody::SubmitDocumentMutation(_) => Command::SubmitDocumentMutation,
RequestBody::PrepareDocumentBulk(_) => Command::PrepareDocumentBulk,
RequestBody::SubmitDocumentBulk(_) => Command::SubmitDocumentBulk,
RequestBody::ResolveDocumentBulk(_) => Command::ResolveDocumentBulk,
RequestBody::PrepareAppendBulk(_) => Command::PrepareAppendBulk,
RequestBody::SubmitAppendBulk(_) => Command::SubmitAppendBulk,
RequestBody::ResolveAppendBulk(_) => Command::ResolveAppendBulk,
RequestBody::ObserveAppendCommitted(_) => Command::ObserveAppendCommitted,
RequestBody::ResolveDocumentMutation(_) => Command::ResolveDocumentMutation,
RequestBody::GetDocument(_) => Command::GetDocument,
RequestBody::Search(_) => Command::Search,
RequestBody::OpenPit(_) => Command::OpenPit,
RequestBody::RenewPit(_) => Command::RenewPit,
RequestBody::ClosePit(_) => Command::ClosePit,
RequestBody::ListOperations(_) => Command::ListOperations,
RequestBody::GetOperation(_) => Command::GetOperation,
RequestBody::CancelOperation(_) => Command::CancelOperation,
RequestBody::ListAuditEvents(_) => Command::ListAuditEvents,
RequestBody::ExportAuditEvents(_) => Command::ExportAuditEvents,
RequestBody::ReserveServiceCredential(_) => Command::ReserveServiceCredential,
RequestBody::ReserveServiceCredentialRotation(_) => Command::ReserveServiceCredentialRotation,
RequestBody::ActivateServiceCredential(_) => Command::ActivateServiceCredential,
RequestBody::ResolveServiceCredentialReservation(_) => Command::ResolveServiceCredentialReservation,
RequestBody::PrepareRevokeServiceCredential(_) => Command::PrepareRevokeServiceCredential,
RequestBody::RevokeServiceCredential(_) => Command::RevokeServiceCredential,
RequestBody::ResolveSecurityAction(_) => Command::ResolveSecurityAction,
RequestBody::GetSecurityRole(_) => Command::GetSecurityRole,
RequestBody::PrepareRoleAppendAccessChange(_) => Command::PrepareRoleAppendAccessChange,
RequestBody::SubmitRoleAppendAccessChange(_) => Command::SubmitRoleAppendAccessChange,
RequestBody::ListServiceCredentials(_) => Command::ListServiceCredentials,
RequestBody::ListBackups(_) => Command::ListBackups,
RequestBody::GetBackup(_) => Command::GetBackup,
RequestBody::CreateBackup(_) => Command::CreateBackup,
RequestBody::ResolveBackupAction(_) => Command::ResolveBackupAction,
RequestBody::GetRuntimeStatus(_) => Command::GetRuntimeStatus,
RequestBody::GetResultCacheStatus(_) => Command::GetResultCacheStatus,
RequestBody::GetFieldPromotionStatus(_) => Command::GetFieldPromotionStatus,
RequestBody::GetOverloadStatus(_) => Command::GetOverloadStatus,
RequestBody::ConfigureExternalKey(_) => Command::ConfigureExternalKey,
RequestBody::RotateExternalKeyBinding(_) => Command::RotateExternalKeyBinding,
RequestBody::ConfigureAggregateThenDelete(_) => Command::ConfigureAggregateThenDelete,
RequestBody::GetLifecycleStatus(_) => Command::GetLifecycleStatus,
RequestBody::GetQuota(_) => Command::GetQuota,
RequestBody::UpdateQuota(_) => Command::UpdateQuota,
RequestBody::GetBinding(_) => Command::GetBinding,
RequestBody::GetAdmissionStatus(_) => Command::GetAdmissionStatus,
RequestBody::SetAdmission(_) => Command::SetAdmission,
RequestBody::GetQuiesceStatus(_) => Command::GetQuiesceStatus,
RequestBody::GetDecommissionReadiness(_) => Command::GetDecommissionReadiness,
RequestBody::GetUpgradeReadiness(_) => Command::GetUpgradeReadiness,
RequestBody::GetMaintenanceStatus(_) => Command::GetMaintenanceStatus,
RequestBody::GetRestoreReadiness(_) => Command::GetRestoreReadiness,
RequestBody::WarmVectorIndex(_) => Command::WarmVectorIndex,
RequestBody::EvaluateVectorRecall(_) => Command::EvaluateVectorRecall,
RequestBody::CalibrateVectorStrategy(_) => Command::CalibrateVectorStrategy,
RequestBody::GetVectorDiagnostic(_) => Command::GetVectorDiagnostic,
RequestBody::CreateDiagnostic(_) => Command::CreateDiagnostic,
RequestBody::GetDiagnostic(_) => Command::GetDiagnostic,
RequestBody::ReadArtifactChunk(_) => Command::ReadArtifactChunk,
RequestBody::ExportUsage(_) => Command::ExportUsage,
RequestBody::ExecuteStateRead(_) => Command::ExecuteStateRead,
RequestBody::PrepareStateWrite(_) => Command::PrepareStateWrite,
RequestBody::SubmitStateWrite(_) => Command::SubmitStateWrite,
RequestBody::ResolveStateWrite(_) => Command::ResolveStateWrite,
}
}
pub const fn command_for_result(value: &ResultBody) -> Command {
match value {
ResultBody::Discover(_) => Command::Discover,
ResultBody::ListIndexes(_) => Command::ListIndexes,
ResultBody::GetIndex(_) => Command::GetIndex,
ResultBody::ValidateIndexChange(_) => Command::ValidateIndexChange,
ResultBody::ApplyIndexChange(_) => Command::ApplyIndexChange,
ResultBody::ApplyAdministrationMutation(_) => Command::ApplyAdministrationMutation,
ResultBody::ListAliases(_) => Command::ListAliases,
ResultBody::GetAlias(_) => Command::GetAlias,
ResultBody::ListDataStreams(_) => Command::ListDataStreams,
ResultBody::GetDataStream(_) => Command::GetDataStream,
ResultBody::ListComponentTemplates(_) => Command::ListComponentTemplates,
ResultBody::GetComponentTemplate(_) => Command::GetComponentTemplate,
ResultBody::ListIndexTemplates(_) => Command::ListIndexTemplates,
ResultBody::GetIndexTemplate(_) => Command::GetIndexTemplate,
ResultBody::ListIngestPipelines(_) => Command::ListIngestPipelines,
ResultBody::GetIngestPipeline(_) => Command::GetIngestPipeline,
ResultBody::SimulateIngestPipeline(_) => Command::SimulateIngestPipeline,
ResultBody::ReprocessByQuery(_) => Command::ReprocessByQuery,
ResultBody::ListLifecyclePolicies(_) => Command::ListLifecyclePolicies,
ResultBody::GetLifecyclePolicy(_) => Command::GetLifecyclePolicy,
ResultBody::PrepareCreateIndex(_) => Command::PrepareCreateIndex,
ResultBody::PrepareDeleteIndex(_) => Command::PrepareDeleteIndex,
ResultBody::SubmitCatalogAction(_) => Command::SubmitCatalogAction,
ResultBody::ResolveCatalogAction(_) => Command::ResolveCatalogAction,
ResultBody::PrepareReplayableSourceIndex(_) => Command::PrepareReplayableSourceIndex,
ResultBody::SubmitReplayableSourceIndex(_) => Command::SubmitReplayableSourceIndex,
ResultBody::GetReplayableSource(_) => Command::GetReplayableSource,
ResultBody::ControlReplayableSource(_) => Command::ControlReplayableSource,
ResultBody::CloneIndex(_) => Command::CloneIndex,
ResultBody::ConfigureHistory(_) => Command::ConfigureHistory,
ResultBody::GetHistory(_) => Command::GetHistory,
ResultBody::ResolveHistory(_) => Command::ResolveHistory,
ResultBody::PlaceHistoryHold(_) => Command::PlaceHistoryHold,
ResultBody::ReleaseHistoryHold(_) => Command::ReleaseHistoryHold,
ResultBody::PrepareDocumentMutation(_) => Command::PrepareDocumentMutation,
ResultBody::SubmitDocumentMutation(_) => Command::SubmitDocumentMutation,
ResultBody::PrepareDocumentBulk(_) => Command::PrepareDocumentBulk,
ResultBody::SubmitDocumentBulk(_) => Command::SubmitDocumentBulk,
ResultBody::ResolveDocumentBulk(_) => Command::ResolveDocumentBulk,
ResultBody::PrepareAppendBulk(_) => Command::PrepareAppendBulk,
ResultBody::SubmitAppendBulk(_) => Command::SubmitAppendBulk,
ResultBody::ResolveAppendBulk(_) => Command::ResolveAppendBulk,
ResultBody::ObserveAppendCommitted(_) => Command::ObserveAppendCommitted,
ResultBody::ResolveDocumentMutation(_) => Command::ResolveDocumentMutation,
ResultBody::GetDocument(_) => Command::GetDocument,
ResultBody::Search(_) => Command::Search,
ResultBody::OpenPit(_) => Command::OpenPit,
ResultBody::RenewPit(_) => Command::RenewPit,
ResultBody::ClosePit(_) => Command::ClosePit,
ResultBody::ListOperations(_) => Command::ListOperations,
ResultBody::GetOperation(_) => Command::GetOperation,
ResultBody::CancelOperation(_) => Command::CancelOperation,
ResultBody::ListAuditEvents(_) => Command::ListAuditEvents,
ResultBody::ExportAuditEvents(_) => Command::ExportAuditEvents,
ResultBody::ReserveServiceCredential(_) => Command::ReserveServiceCredential,
ResultBody::ReserveServiceCredentialRotation(_) => Command::ReserveServiceCredentialRotation,
ResultBody::ActivateServiceCredential(_) => Command::ActivateServiceCredential,
ResultBody::ResolveServiceCredentialReservation(_) => Command::ResolveServiceCredentialReservation,
ResultBody::PrepareRevokeServiceCredential(_) => Command::PrepareRevokeServiceCredential,
ResultBody::RevokeServiceCredential(_) => Command::RevokeServiceCredential,
ResultBody::ResolveSecurityAction(_) => Command::ResolveSecurityAction,
ResultBody::GetSecurityRole(_) => Command::GetSecurityRole,
ResultBody::PrepareRoleAppendAccessChange(_) => Command::PrepareRoleAppendAccessChange,
ResultBody::SubmitRoleAppendAccessChange(_) => Command::SubmitRoleAppendAccessChange,
ResultBody::ListServiceCredentials(_) => Command::ListServiceCredentials,
ResultBody::ListBackups(_) => Command::ListBackups,
ResultBody::GetBackup(_) => Command::GetBackup,
ResultBody::CreateBackup(_) => Command::CreateBackup,
ResultBody::ResolveBackupAction(_) => Command::ResolveBackupAction,
ResultBody::GetRuntimeStatus(_) => Command::GetRuntimeStatus,
ResultBody::GetResultCacheStatus(_) => Command::GetResultCacheStatus,
ResultBody::GetFieldPromotionStatus(_) => Command::GetFieldPromotionStatus,
ResultBody::GetOverloadStatus(_) => Command::GetOverloadStatus,
ResultBody::ConfigureExternalKey(_) => Command::ConfigureExternalKey,
ResultBody::RotateExternalKeyBinding(_) => Command::RotateExternalKeyBinding,
ResultBody::ConfigureAggregateThenDelete(_) => Command::ConfigureAggregateThenDelete,
ResultBody::GetLifecycleStatus(_) => Command::GetLifecycleStatus,
ResultBody::GetQuota(_) => Command::GetQuota,
ResultBody::UpdateQuota(_) => Command::UpdateQuota,
ResultBody::GetBinding(_) => Command::GetBinding,
ResultBody::GetAdmissionStatus(_) => Command::GetAdmissionStatus,
ResultBody::SetAdmission(_) => Command::SetAdmission,
ResultBody::GetQuiesceStatus(_) => Command::GetQuiesceStatus,
ResultBody::GetDecommissionReadiness(_) => Command::GetDecommissionReadiness,
ResultBody::GetUpgradeReadiness(_) => Command::GetUpgradeReadiness,
ResultBody::GetMaintenanceStatus(_) => Command::GetMaintenanceStatus,
ResultBody::GetRestoreReadiness(_) => Command::GetRestoreReadiness,
ResultBody::WarmVectorIndex(_) => Command::WarmVectorIndex,
ResultBody::EvaluateVectorRecall(_) => Command::EvaluateVectorRecall,
ResultBody::CalibrateVectorStrategy(_) => Command::CalibrateVectorStrategy,
ResultBody::GetVectorDiagnostic(_) => Command::GetVectorDiagnostic,
ResultBody::CreateDiagnostic(_) => Command::CreateDiagnostic,
ResultBody::GetDiagnostic(_) => Command::GetDiagnostic,
ResultBody::ReadArtifactChunk(_) => Command::ReadArtifactChunk,
ResultBody::ExportUsage(_) => Command::ExportUsage,
ResultBody::ExecuteStateRead(_) => Command::ExecuteStateRead,
ResultBody::PrepareStateWrite(_) => Command::PrepareStateWrite,
ResultBody::SubmitStateWrite(_) => Command::SubmitStateWrite,
ResultBody::ResolveStateWrite(_) => Command::ResolveStateWrite,
}
}
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(deny_unknown_fields)]
pub struct RequestEnvelope {
pub meta: RequestMeta,
pub request: RequestBody,
}
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(tag = "outcome", rename_all = "snake_case")]
pub enum ResponseEnvelope {
Success {
format_version: u16,
request_id: String,
result: Box<ResultBody>,
},
Error {
format_version: u16,
request_id: String,
error: ErrorBody,
},
}
#[derive(Clone, Copy, Debug, Eq, PartialEq)]
pub struct CommandContract {
pub command: Command,
pub action: Action,
pub cancellable: bool,
pub mutation: &'static str,
}
pub const LODESTONE_API_COMMAND_CONTRACTS: &[CommandContract] = &[
CommandContract {
command: Command::Discover,
action: Action::IdentityDiscovery,
cancellable: true,
mutation: "read_only",
},
CommandContract {
command: Command::ListIndexes,
action: Action::CatalogRead,
cancellable: true,
mutation: "read_only",
},
CommandContract {
command: Command::GetIndex,
action: Action::CatalogRead,
cancellable: true,
mutation: "read_only",
},
CommandContract {
command: Command::ValidateIndexChange,
action: Action::IndexAdmin,
cancellable: true,
mutation: "read_only",
},
CommandContract {
command: Command::ApplyIndexChange,
action: Action::IndexAdmin,
cancellable: true,
mutation: "catalog_submit",
},
CommandContract {
command: Command::ApplyAdministrationMutation,
action: Action::LifecycleAdmin,
cancellable: true,
mutation: "administration_submit",
},
CommandContract {
command: Command::ListAliases,
action: Action::CatalogRead,
cancellable: true,
mutation: "read_only",
},
CommandContract {
command: Command::GetAlias,
action: Action::CatalogRead,
cancellable: true,
mutation: "read_only",
},
CommandContract {
command: Command::ListDataStreams,
action: Action::CatalogRead,
cancellable: true,
mutation: "read_only",
},
CommandContract {
command: Command::GetDataStream,
action: Action::CatalogRead,
cancellable: true,
mutation: "read_only",
},
CommandContract {
command: Command::ListComponentTemplates,
action: Action::CatalogRead,
cancellable: true,
mutation: "read_only",
},
CommandContract {
command: Command::GetComponentTemplate,
action: Action::CatalogRead,
cancellable: true,
mutation: "read_only",
},
CommandContract {
command: Command::ListIndexTemplates,
action: Action::CatalogRead,
cancellable: true,
mutation: "read_only",
},
CommandContract {
command: Command::GetIndexTemplate,
action: Action::CatalogRead,
cancellable: true,
mutation: "read_only",
},
CommandContract {
command: Command::ListIngestPipelines,
action: Action::LifecycleAdmin,
cancellable: true,
mutation: "read_only",
},
CommandContract {
command: Command::GetIngestPipeline,
action: Action::LifecycleAdmin,
cancellable: true,
mutation: "read_only",
},
CommandContract {
command: Command::SimulateIngestPipeline,
action: Action::LifecycleAdmin,
cancellable: true,
mutation: "read_only",
},
CommandContract {
command: Command::ReprocessByQuery,
action: Action::DataWrite,
cancellable: true,
mutation: "authority_submit",
},
CommandContract {
command: Command::ListLifecyclePolicies,
action: Action::CatalogRead,
cancellable: true,
mutation: "read_only",
},
CommandContract {
command: Command::GetLifecyclePolicy,
action: Action::CatalogRead,
cancellable: true,
mutation: "read_only",
},
CommandContract {
command: Command::PrepareCreateIndex,
action: Action::IndexAdmin,
cancellable: true,
mutation: "catalog_prepare",
},
CommandContract {
command: Command::PrepareDeleteIndex,
action: Action::IndexAdmin,
cancellable: true,
mutation: "catalog_prepare",
},
CommandContract {
command: Command::SubmitCatalogAction,
action: Action::IndexAdmin,
cancellable: true,
mutation: "catalog_submit",
},
CommandContract {
command: Command::ResolveCatalogAction,
action: Action::IndexAdmin,
cancellable: true,
mutation: "read_only",
},
CommandContract {
command: Command::PrepareReplayableSourceIndex,
action: Action::IndexAdmin,
cancellable: true,
mutation: "catalog_prepare",
},
CommandContract {
command: Command::SubmitReplayableSourceIndex,
action: Action::IndexAdmin,
cancellable: true,
mutation: "catalog_submit",
},
CommandContract {
command: Command::GetReplayableSource,
action: Action::CatalogRead,
cancellable: true,
mutation: "read_only",
},
CommandContract {
command: Command::ControlReplayableSource,
action: Action::IndexAdmin,
cancellable: true,
mutation: "catalog_submit",
},
CommandContract {
command: Command::CloneIndex,
action: Action::IndexAdmin,
cancellable: true,
mutation: "catalog_submit",
},
CommandContract {
command: Command::ConfigureHistory,
action: Action::IndexAdmin,
cancellable: true,
mutation: "catalog_submit",
},
CommandContract {
command: Command::GetHistory,
action: Action::CatalogRead,
cancellable: true,
mutation: "read_only",
},
CommandContract {
command: Command::ResolveHistory,
action: Action::DataRead,
cancellable: true,
mutation: "read_only",
},
CommandContract {
command: Command::PlaceHistoryHold,
action: Action::IndexAdmin,
cancellable: true,
mutation: "catalog_submit",
},
CommandContract {
command: Command::ReleaseHistoryHold,
action: Action::IndexAdmin,
cancellable: true,
mutation: "catalog_submit",
},
CommandContract {
command: Command::PrepareDocumentMutation,
action: Action::DataWrite,
cancellable: true,
mutation: "read_only_prepare",
},
CommandContract {
command: Command::SubmitDocumentMutation,
action: Action::DataWrite,
cancellable: true,
mutation: "wal_submit",
},
CommandContract {
command: Command::PrepareDocumentBulk,
action: Action::DataWrite,
cancellable: true,
mutation: "read_only_prepare",
},
CommandContract {
command: Command::SubmitDocumentBulk,
action: Action::DataWrite,
cancellable: true,
mutation: "wal_submit",
},
CommandContract {
command: Command::ResolveDocumentBulk,
action: Action::DataRead,
cancellable: true,
mutation: "read_only",
},
CommandContract {
command: Command::PrepareAppendBulk,
action: Action::Append,
cancellable: true,
mutation: "read_only_prepare",
},
CommandContract {
command: Command::SubmitAppendBulk,
action: Action::Append,
cancellable: true,
mutation: "wal_submit",
},
CommandContract {
command: Command::ResolveAppendBulk,
action: Action::ResolveAppend,
cancellable: true,
mutation: "read_only",
},
CommandContract {
command: Command::ObserveAppendCommitted,
action: Action::ResolveAppend,
cancellable: true,
mutation: "read_only",
},
CommandContract {
command: Command::ResolveDocumentMutation,
action: Action::DataRead,
cancellable: true,
mutation: "read_only",
},
CommandContract {
command: Command::GetDocument,
action: Action::DataRead,
cancellable: true,
mutation: "read_only",
},
CommandContract {
command: Command::Search,
action: Action::DataRead,
cancellable: true,
mutation: "read_only",
},
CommandContract {
command: Command::OpenPit,
action: Action::DataRead,
cancellable: true,
mutation: "authority_submit",
},
CommandContract {
command: Command::RenewPit,
action: Action::DataRead,
cancellable: true,
mutation: "authority_submit",
},
CommandContract {
command: Command::ClosePit,
action: Action::DataRead,
cancellable: true,
mutation: "authority_submit",
},
CommandContract {
command: Command::ListOperations,
action: Action::OperationRead,
cancellable: true,
mutation: "read_only",
},
CommandContract {
command: Command::GetOperation,
action: Action::OperationRead,
cancellable: true,
mutation: "read_only",
},
CommandContract {
command: Command::CancelOperation,
action: Action::OperationCancel,
cancellable: true,
mutation: "authority_submit",
},
CommandContract {
command: Command::ListAuditEvents,
action: Action::AuditRead,
cancellable: true,
mutation: "read_only",
},
CommandContract {
command: Command::ExportAuditEvents,
action: Action::AuditRead,
cancellable: true,
mutation: "read_only",
},
CommandContract {
command: Command::ReserveServiceCredential,
action: Action::SecurityAdmin,
cancellable: true,
mutation: "security_reserve",
},
CommandContract {
command: Command::ReserveServiceCredentialRotation,
action: Action::SecurityAdmin,
cancellable: true,
mutation: "security_reserve",
},
CommandContract {
command: Command::ActivateServiceCredential,
action: Action::SecurityAdmin,
cancellable: true,
mutation: "security_submit",
},
CommandContract {
command: Command::ResolveServiceCredentialReservation,
action: Action::SecurityRead,
cancellable: true,
mutation: "read_only",
},
CommandContract {
command: Command::PrepareRevokeServiceCredential,
action: Action::SecurityAdmin,
cancellable: true,
mutation: "read_only_prepare",
},
CommandContract {
command: Command::RevokeServiceCredential,
action: Action::SecurityAdmin,
cancellable: true,
mutation: "security_submit",
},
CommandContract {
command: Command::ResolveSecurityAction,
action: Action::SecurityRead,
cancellable: true,
mutation: "read_only",
},
CommandContract {
command: Command::GetSecurityRole,
action: Action::SecurityRead,
cancellable: true,
mutation: "read_only",
},
CommandContract {
command: Command::PrepareRoleAppendAccessChange,
action: Action::SecurityAdmin,
cancellable: true,
mutation: "read_only_prepare",
},
CommandContract {
command: Command::SubmitRoleAppendAccessChange,
action: Action::SecurityAdmin,
cancellable: true,
mutation: "security_submit",
},
CommandContract {
command: Command::ListServiceCredentials,
action: Action::SecurityRead,
cancellable: true,
mutation: "read_only",
},
CommandContract {
command: Command::ListBackups,
action: Action::BackupRead,
cancellable: true,
mutation: "read_only",
},
CommandContract {
command: Command::GetBackup,
action: Action::BackupRead,
cancellable: true,
mutation: "read_only",
},
CommandContract {
command: Command::CreateBackup,
action: Action::BackupAdmin,
cancellable: true,
mutation: "backup_submit",
},
CommandContract {
command: Command::ResolveBackupAction,
action: Action::BackupRead,
cancellable: true,
mutation: "read_only",
},
CommandContract {
command: Command::GetRuntimeStatus,
action: Action::CatalogRead,
cancellable: true,
mutation: "read_only",
},
CommandContract {
command: Command::GetResultCacheStatus,
action: Action::CatalogRead,
cancellable: true,
mutation: "read_only",
},
CommandContract {
command: Command::GetFieldPromotionStatus,
action: Action::CatalogRead,
cancellable: true,
mutation: "read_only",
},
CommandContract {
command: Command::GetOverloadStatus,
action: Action::CatalogRead,
cancellable: true,
mutation: "read_only",
},
CommandContract {
command: Command::ConfigureExternalKey,
action: Action::LifecycleAdmin,
cancellable: true,
mutation: "authority_submit",
},
CommandContract {
command: Command::RotateExternalKeyBinding,
action: Action::LifecycleAdmin,
cancellable: true,
mutation: "authority_submit",
},
CommandContract {
command: Command::ConfigureAggregateThenDelete,
action: Action::LifecycleAdmin,
cancellable: true,
mutation: "authority_submit",
},
CommandContract {
command: Command::GetLifecycleStatus,
action: Action::CatalogRead,
cancellable: true,
mutation: "read_only",
},
CommandContract {
command: Command::GetQuota,
action: Action::QuotaRead,
cancellable: true,
mutation: "read_only",
},
CommandContract {
command: Command::UpdateQuota,
action: Action::QuotaAdmin,
cancellable: true,
mutation: "quota_submit",
},
CommandContract {
command: Command::GetBinding,
action: Action::BindingRead,
cancellable: true,
mutation: "read_only",
},
CommandContract {
command: Command::GetAdmissionStatus,
action: Action::AdmissionRead,
cancellable: true,
mutation: "read_only",
},
CommandContract {
command: Command::SetAdmission,
action: Action::AdmissionAdmin,
cancellable: true,
mutation: "admission_submit",
},
CommandContract {
command: Command::GetQuiesceStatus,
action: Action::AdmissionRead,
cancellable: true,
mutation: "read_only",
},
CommandContract {
command: Command::GetDecommissionReadiness,
action: Action::AdmissionRead,
cancellable: true,
mutation: "read_only",
},
CommandContract {
command: Command::GetUpgradeReadiness,
action: Action::TaskRead,
cancellable: true,
mutation: "read_only",
},
CommandContract {
command: Command::GetMaintenanceStatus,
action: Action::TaskRead,
cancellable: true,
mutation: "read_only",
},
CommandContract {
command: Command::GetRestoreReadiness,
action: Action::BackupRead,
cancellable: true,
mutation: "read_only",
},
CommandContract {
command: Command::WarmVectorIndex,
action: Action::DataRead,
cancellable: true,
mutation: "read_only",
},
CommandContract {
command: Command::EvaluateVectorRecall,
action: Action::DiagnosticsCreate,
cancellable: true,
mutation: "diagnostic_submit",
},
CommandContract {
command: Command::CalibrateVectorStrategy,
action: Action::DiagnosticsCreate,
cancellable: true,
mutation: "diagnostic_submit",
},
CommandContract {
command: Command::GetVectorDiagnostic,
action: Action::DiagnosticsRead,
cancellable: true,
mutation: "read_only",
},
CommandContract {
command: Command::CreateDiagnostic,
action: Action::DiagnosticsCreate,
cancellable: true,
mutation: "diagnostic_submit",
},
CommandContract {
command: Command::GetDiagnostic,
action: Action::DiagnosticsRead,
cancellable: true,
mutation: "read_only",
},
CommandContract {
command: Command::ReadArtifactChunk,
action: Action::OperationRead,
cancellable: true,
mutation: "read_only",
},
CommandContract {
command: Command::ExportUsage,
action: Action::UsageRead,
cancellable: true,
mutation: "read_only",
},
CommandContract {
command: Command::ExecuteStateRead,
action: Action::DataRead,
cancellable: true,
mutation: "read_only",
},
CommandContract {
command: Command::PrepareStateWrite,
action: Action::DataWrite,
cancellable: true,
mutation: "read_only_prepare",
},
CommandContract {
command: Command::SubmitStateWrite,
action: Action::DataWrite,
cancellable: true,
mutation: "state_submit",
},
CommandContract {
command: Command::ResolveStateWrite,
action: Action::DataRead,
cancellable: true,
mutation: "read_only",
},
];
#[derive(Clone, Copy, Debug, Eq, PartialEq)]
pub struct CommandSemanticContract {
pub command: Command,
pub admissible_errors: &'static [ErrorCode],
pub limit_ids: &'static [&'static str],
pub effect_class: &'static str,
pub risk_flags: &'static [&'static str],
pub capability_family: &'static str,
pub retry_safety: &'static str,
pub identity_requirement: &'static str,
pub resolver: Option<Command>,
pub cancellation: &'static str,
pub side_effects: &'static [&'static str],
pub recovery: &'static str,
pub collection_index_ref: &'static str,
}
pub const LODESTONE_API_COMMAND_SEMANTICS: &[CommandSemanticContract] = &[
CommandSemanticContract {
command: Command::Discover,
admissible_errors: &[
ErrorCode::Aborted,
ErrorCode::DeadlineExceeded,
ErrorCode::InvalidRequest,
ErrorCode::UnsupportedVersion,
ErrorCode::Unauthenticated,
ErrorCode::PermissionDenied,
ErrorCode::NotFound,
ErrorCode::LimitExceeded,
ErrorCode::CapabilityUnavailable,
ErrorCode::TemporarilyUnavailable,
ErrorCode::Internal,
],
limit_ids: &["request_bytes", "response_bytes"],
effect_class: "read_only",
risk_flags: &[],
capability_family: "discovery",
retry_safety: "safe",
identity_requirement: "none",
resolver: None,
cancellation: "per_call",
side_effects: &[],
recovery: "retry",
collection_index_ref: "none",
},
CommandSemanticContract {
command: Command::ListIndexes,
admissible_errors: &[
ErrorCode::Aborted,
ErrorCode::DeadlineExceeded,
ErrorCode::InvalidRequest,
ErrorCode::UnsupportedVersion,
ErrorCode::Unauthenticated,
ErrorCode::PermissionDenied,
ErrorCode::NotFound,
ErrorCode::StaleCursor,
ErrorCode::RestartBudgetExhausted,
ErrorCode::LimitExceeded,
ErrorCode::CapabilityUnavailable,
ErrorCode::TemporarilyUnavailable,
ErrorCode::Internal,
],
limit_ids: &[
"request_bytes",
"response_bytes",
"page_size",
"catalog_page_size",
"catalog_restart_budget",
],
effect_class: "read_only",
risk_flags: &[],
capability_family: "catalog",
retry_safety: "safe",
identity_requirement: "none",
resolver: None,
cancellation: "per_call",
side_effects: &[],
recovery: "retry",
collection_index_ref: "none",
},
CommandSemanticContract {
command: Command::GetIndex,
admissible_errors: &[
ErrorCode::Aborted,
ErrorCode::DeadlineExceeded,
ErrorCode::InvalidRequest,
ErrorCode::UnsupportedVersion,
ErrorCode::Unauthenticated,
ErrorCode::PermissionDenied,
ErrorCode::NotFound,
ErrorCode::LimitExceeded,
ErrorCode::CapabilityUnavailable,
ErrorCode::TemporarilyUnavailable,
ErrorCode::Internal,
],
limit_ids: &["request_bytes", "response_bytes"],
effect_class: "read_only",
risk_flags: &[],
capability_family: "catalog",
retry_safety: "safe",
identity_requirement: "none",
resolver: None,
cancellation: "per_call",
side_effects: &[],
recovery: "retry",
collection_index_ref: "none",
},
CommandSemanticContract {
command: Command::ValidateIndexChange,
admissible_errors: &[
ErrorCode::Aborted,
ErrorCode::DeadlineExceeded,
ErrorCode::InvalidRequest,
ErrorCode::UnsupportedVersion,
ErrorCode::Unauthenticated,
ErrorCode::PermissionDenied,
ErrorCode::NotFound,
ErrorCode::LimitExceeded,
ErrorCode::CapabilityUnavailable,
ErrorCode::TemporarilyUnavailable,
ErrorCode::Internal,
],
limit_ids: &["request_bytes", "response_bytes"],
effect_class: "read_only",
risk_flags: &[],
capability_family: "catalog",
retry_safety: "safe",
identity_requirement: "none",
resolver: None,
cancellation: "per_call",
side_effects: &[],
recovery: "retry",
collection_index_ref: "request_name",
},
CommandSemanticContract {
command: Command::ApplyIndexChange,
admissible_errors: &[
ErrorCode::Aborted,
ErrorCode::DeadlineExceeded,
ErrorCode::InvalidRequest,
ErrorCode::UnsupportedVersion,
ErrorCode::Unauthenticated,
ErrorCode::PermissionDenied,
ErrorCode::NotFound,
ErrorCode::Conflict,
ErrorCode::LimitExceeded,
ErrorCode::CapabilityUnavailable,
ErrorCode::NotSubmitted,
ErrorCode::SubmittedIndeterminate,
ErrorCode::ExpiredUnknown,
ErrorCode::TemporarilyUnavailable,
ErrorCode::Internal,
],
limit_ids: &["request_bytes", "response_bytes"],
effect_class: "durable_submit",
risk_flags: &[],
capability_family: "catalog",
retry_safety: "pre_submit_only",
identity_requirement: "caller_action_id",
resolver: None,
cancellation: "per_call_until_submission_then_resolve",
side_effects: &["commits_authoritative_state"],
recovery: "retry_if_not_submitted",
collection_index_ref: "request_index",
},
CommandSemanticContract {
command: Command::ApplyAdministrationMutation,
admissible_errors: &[
ErrorCode::Aborted,
ErrorCode::DeadlineExceeded,
ErrorCode::InvalidRequest,
ErrorCode::UnsupportedVersion,
ErrorCode::Unauthenticated,
ErrorCode::PermissionDenied,
ErrorCode::NotFound,
ErrorCode::Conflict,
ErrorCode::LimitExceeded,
ErrorCode::CapabilityUnavailable,
ErrorCode::NotSubmitted,
ErrorCode::SubmittedIndeterminate,
ErrorCode::ExpiredUnknown,
ErrorCode::TemporarilyUnavailable,
ErrorCode::Internal,
],
limit_ids: &["request_bytes", "response_bytes"],
effect_class: "control_write",
risk_flags: &[],
capability_family: "lifecycle",
retry_safety: "pre_submit_only",
identity_requirement: "caller_action_id",
resolver: None,
cancellation: "per_call_until_submission_then_resolve",
side_effects: &["commits_authoritative_state"],
recovery: "retry_if_not_submitted",
collection_index_ref: "none",
},
CommandSemanticContract {
command: Command::ListAliases,
admissible_errors: &[
ErrorCode::Aborted,
ErrorCode::DeadlineExceeded,
ErrorCode::InvalidRequest,
ErrorCode::UnsupportedVersion,
ErrorCode::Unauthenticated,
ErrorCode::PermissionDenied,
ErrorCode::NotFound,
ErrorCode::StaleCursor,
ErrorCode::RestartBudgetExhausted,
ErrorCode::LimitExceeded,
ErrorCode::CapabilityUnavailable,
ErrorCode::TemporarilyUnavailable,
ErrorCode::Internal,
],
limit_ids: &[
"request_bytes",
"response_bytes",
"page_size",
"catalog_page_size",
"catalog_restart_budget",
],
effect_class: "read_only",
risk_flags: &[],
capability_family: "catalog",
retry_safety: "safe",
identity_requirement: "none",
resolver: None,
cancellation: "per_call",
side_effects: &[],
recovery: "retry",
collection_index_ref: "none",
},
CommandSemanticContract {
command: Command::GetAlias,
admissible_errors: &[
ErrorCode::Aborted,
ErrorCode::DeadlineExceeded,
ErrorCode::InvalidRequest,
ErrorCode::UnsupportedVersion,
ErrorCode::Unauthenticated,
ErrorCode::PermissionDenied,
ErrorCode::NotFound,
ErrorCode::LimitExceeded,
ErrorCode::CapabilityUnavailable,
ErrorCode::TemporarilyUnavailable,
ErrorCode::Internal,
],
limit_ids: &["request_bytes", "response_bytes"],
effect_class: "read_only",
risk_flags: &[],
capability_family: "catalog",
retry_safety: "safe",
identity_requirement: "none",
resolver: None,
cancellation: "per_call",
side_effects: &[],
recovery: "retry",
collection_index_ref: "none",
},
CommandSemanticContract {
command: Command::ListDataStreams,
admissible_errors: &[
ErrorCode::Aborted,
ErrorCode::DeadlineExceeded,
ErrorCode::InvalidRequest,
ErrorCode::UnsupportedVersion,
ErrorCode::Unauthenticated,
ErrorCode::PermissionDenied,
ErrorCode::NotFound,
ErrorCode::StaleCursor,
ErrorCode::RestartBudgetExhausted,
ErrorCode::LimitExceeded,
ErrorCode::CapabilityUnavailable,
ErrorCode::TemporarilyUnavailable,
ErrorCode::Internal,
],
limit_ids: &[
"request_bytes",
"response_bytes",
"page_size",
"catalog_page_size",
"catalog_restart_budget",
],
effect_class: "read_only",
risk_flags: &[],
capability_family: "catalog",
retry_safety: "safe",
identity_requirement: "none",
resolver: None,
cancellation: "per_call",
side_effects: &[],
recovery: "retry",
collection_index_ref: "none",
},
CommandSemanticContract {
command: Command::GetDataStream,
admissible_errors: &[
ErrorCode::Aborted,
ErrorCode::DeadlineExceeded,
ErrorCode::InvalidRequest,
ErrorCode::UnsupportedVersion,
ErrorCode::Unauthenticated,
ErrorCode::PermissionDenied,
ErrorCode::NotFound,
ErrorCode::LimitExceeded,
ErrorCode::CapabilityUnavailable,
ErrorCode::TemporarilyUnavailable,
ErrorCode::Internal,
],
limit_ids: &["request_bytes", "response_bytes"],
effect_class: "read_only",
risk_flags: &[],
capability_family: "catalog",
retry_safety: "safe",
identity_requirement: "none",
resolver: None,
cancellation: "per_call",
side_effects: &[],
recovery: "retry",
collection_index_ref: "none",
},
CommandSemanticContract {
command: Command::ListComponentTemplates,
admissible_errors: &[
ErrorCode::Aborted,
ErrorCode::DeadlineExceeded,
ErrorCode::InvalidRequest,
ErrorCode::UnsupportedVersion,
ErrorCode::Unauthenticated,
ErrorCode::PermissionDenied,
ErrorCode::NotFound,
ErrorCode::StaleCursor,
ErrorCode::RestartBudgetExhausted,
ErrorCode::LimitExceeded,
ErrorCode::CapabilityUnavailable,
ErrorCode::TemporarilyUnavailable,
ErrorCode::Internal,
],
limit_ids: &[
"request_bytes",
"response_bytes",
"page_size",
"catalog_page_size",
"catalog_restart_budget",
],
effect_class: "read_only",
risk_flags: &[],
capability_family: "catalog",
retry_safety: "safe",
identity_requirement: "none",
resolver: None,
cancellation: "per_call",
side_effects: &[],
recovery: "retry",
collection_index_ref: "none",
},
CommandSemanticContract {
command: Command::GetComponentTemplate,
admissible_errors: &[
ErrorCode::Aborted,
ErrorCode::DeadlineExceeded,
ErrorCode::InvalidRequest,
ErrorCode::UnsupportedVersion,
ErrorCode::Unauthenticated,
ErrorCode::PermissionDenied,
ErrorCode::NotFound,
ErrorCode::LimitExceeded,
ErrorCode::CapabilityUnavailable,
ErrorCode::TemporarilyUnavailable,
ErrorCode::Internal,
],
limit_ids: &["request_bytes", "response_bytes"],
effect_class: "read_only",
risk_flags: &[],
capability_family: "catalog",
retry_safety: "safe",
identity_requirement: "none",
resolver: None,
cancellation: "per_call",
side_effects: &[],
recovery: "retry",
collection_index_ref: "none",
},
CommandSemanticContract {
command: Command::ListIndexTemplates,
admissible_errors: &[
ErrorCode::Aborted,
ErrorCode::DeadlineExceeded,
ErrorCode::InvalidRequest,
ErrorCode::UnsupportedVersion,
ErrorCode::Unauthenticated,
ErrorCode::PermissionDenied,
ErrorCode::NotFound,
ErrorCode::StaleCursor,
ErrorCode::RestartBudgetExhausted,
ErrorCode::LimitExceeded,
ErrorCode::CapabilityUnavailable,
ErrorCode::TemporarilyUnavailable,
ErrorCode::Internal,
],
limit_ids: &[
"request_bytes",
"response_bytes",
"page_size",
"catalog_page_size",
"catalog_restart_budget",
],
effect_class: "read_only",
risk_flags: &[],
capability_family: "catalog",
retry_safety: "safe",
identity_requirement: "none",
resolver: None,
cancellation: "per_call",
side_effects: &[],
recovery: "retry",
collection_index_ref: "none",
},
CommandSemanticContract {
command: Command::GetIndexTemplate,
admissible_errors: &[
ErrorCode::Aborted,
ErrorCode::DeadlineExceeded,
ErrorCode::InvalidRequest,
ErrorCode::UnsupportedVersion,
ErrorCode::Unauthenticated,
ErrorCode::PermissionDenied,
ErrorCode::NotFound,
ErrorCode::LimitExceeded,
ErrorCode::CapabilityUnavailable,
ErrorCode::TemporarilyUnavailable,
ErrorCode::Internal,
],
limit_ids: &["request_bytes", "response_bytes"],
effect_class: "read_only",
risk_flags: &[],
capability_family: "catalog",
retry_safety: "safe",
identity_requirement: "none",
resolver: None,
cancellation: "per_call",
side_effects: &[],
recovery: "retry",
collection_index_ref: "none",
},
CommandSemanticContract {
command: Command::ListIngestPipelines,
admissible_errors: &[
ErrorCode::Aborted,
ErrorCode::DeadlineExceeded,
ErrorCode::InvalidRequest,
ErrorCode::UnsupportedVersion,
ErrorCode::Unauthenticated,
ErrorCode::PermissionDenied,
ErrorCode::NotFound,
ErrorCode::StaleCursor,
ErrorCode::RestartBudgetExhausted,
ErrorCode::LimitExceeded,
ErrorCode::CapabilityUnavailable,
ErrorCode::TemporarilyUnavailable,
ErrorCode::Internal,
],
limit_ids: &[
"request_bytes",
"response_bytes",
"page_size",
"catalog_page_size",
"catalog_restart_budget",
],
effect_class: "read_only",
risk_flags: &[],
capability_family: "lifecycle",
retry_safety: "safe",
identity_requirement: "none",
resolver: None,
cancellation: "per_call",
side_effects: &[],
recovery: "retry",
collection_index_ref: "none",
},
CommandSemanticContract {
command: Command::GetIngestPipeline,
admissible_errors: &[
ErrorCode::Aborted,
ErrorCode::DeadlineExceeded,
ErrorCode::InvalidRequest,
ErrorCode::UnsupportedVersion,
ErrorCode::Unauthenticated,
ErrorCode::PermissionDenied,
ErrorCode::NotFound,
ErrorCode::LimitExceeded,
ErrorCode::CapabilityUnavailable,
ErrorCode::TemporarilyUnavailable,
ErrorCode::Internal,
],
limit_ids: &["request_bytes", "response_bytes"],
effect_class: "read_only",
risk_flags: &[],
capability_family: "lifecycle",
retry_safety: "safe",
identity_requirement: "none",
resolver: None,
cancellation: "per_call",
side_effects: &[],
recovery: "retry",
collection_index_ref: "none",
},
CommandSemanticContract {
command: Command::SimulateIngestPipeline,
admissible_errors: &[
ErrorCode::Aborted,
ErrorCode::DeadlineExceeded,
ErrorCode::InvalidRequest,
ErrorCode::UnsupportedVersion,
ErrorCode::Unauthenticated,
ErrorCode::PermissionDenied,
ErrorCode::NotFound,
ErrorCode::LimitExceeded,
ErrorCode::CapabilityUnavailable,
ErrorCode::TemporarilyUnavailable,
ErrorCode::Internal,
],
limit_ids: &["request_bytes", "response_bytes"],
effect_class: "read_only",
risk_flags: &[],
capability_family: "lifecycle",
retry_safety: "safe",
identity_requirement: "none",
resolver: None,
cancellation: "per_call",
side_effects: &[],
recovery: "retry",
collection_index_ref: "none",
},
CommandSemanticContract {
command: Command::ReprocessByQuery,
admissible_errors: &[
ErrorCode::Aborted,
ErrorCode::DeadlineExceeded,
ErrorCode::InvalidRequest,
ErrorCode::UnsupportedVersion,
ErrorCode::Unauthenticated,
ErrorCode::PermissionDenied,
ErrorCode::NotFound,
ErrorCode::Conflict,
ErrorCode::LimitExceeded,
ErrorCode::CapabilityUnavailable,
ErrorCode::NotSubmitted,
ErrorCode::SubmittedIndeterminate,
ErrorCode::ExpiredUnknown,
ErrorCode::TemporarilyUnavailable,
ErrorCode::Internal,
],
limit_ids: &["request_bytes", "response_bytes"],
effect_class: "durable_submit",
risk_flags: &[],
capability_family: "data",
retry_safety: "safe",
identity_requirement: "caller_action_id",
resolver: None,
cancellation: "per_call_until_submission_then_resolve",
side_effects: &["commits_authoritative_state"],
recovery: "retry",
collection_index_ref: "request_index",
},
CommandSemanticContract {
command: Command::ListLifecyclePolicies,
admissible_errors: &[
ErrorCode::Aborted,
ErrorCode::DeadlineExceeded,
ErrorCode::InvalidRequest,
ErrorCode::UnsupportedVersion,
ErrorCode::Unauthenticated,
ErrorCode::PermissionDenied,
ErrorCode::NotFound,
ErrorCode::StaleCursor,
ErrorCode::RestartBudgetExhausted,
ErrorCode::LimitExceeded,
ErrorCode::CapabilityUnavailable,
ErrorCode::TemporarilyUnavailable,
ErrorCode::Internal,
],
limit_ids: &[
"request_bytes",
"response_bytes",
"page_size",
"catalog_page_size",
"catalog_restart_budget",
],
effect_class: "read_only",
risk_flags: &[],
capability_family: "catalog",
retry_safety: "safe",
identity_requirement: "none",
resolver: None,
cancellation: "per_call",
side_effects: &[],
recovery: "retry",
collection_index_ref: "none",
},
CommandSemanticContract {
command: Command::GetLifecyclePolicy,
admissible_errors: &[
ErrorCode::Aborted,
ErrorCode::DeadlineExceeded,
ErrorCode::InvalidRequest,
ErrorCode::UnsupportedVersion,
ErrorCode::Unauthenticated,
ErrorCode::PermissionDenied,
ErrorCode::NotFound,
ErrorCode::LimitExceeded,
ErrorCode::CapabilityUnavailable,
ErrorCode::TemporarilyUnavailable,
ErrorCode::Internal,
],
limit_ids: &["request_bytes", "response_bytes"],
effect_class: "read_only",
risk_flags: &[],
capability_family: "catalog",
retry_safety: "safe",
identity_requirement: "none",
resolver: None,
cancellation: "per_call",
side_effects: &[],
recovery: "retry",
collection_index_ref: "none",
},
CommandSemanticContract {
command: Command::PrepareCreateIndex,
admissible_errors: &[
ErrorCode::Aborted,
ErrorCode::DeadlineExceeded,
ErrorCode::InvalidRequest,
ErrorCode::UnsupportedVersion,
ErrorCode::Unauthenticated,
ErrorCode::PermissionDenied,
ErrorCode::NotFound,
ErrorCode::LimitExceeded,
ErrorCode::CapabilityUnavailable,
ErrorCode::TemporarilyUnavailable,
ErrorCode::Internal,
],
limit_ids: &[
"request_bytes",
"response_bytes",
"resource_initial_shards",
"resource_target_shard_bytes",
"resource_admission_weight",
"resource_ram_bytes",
"resource_nvme_bytes",
"resource_refresh_millis",
"resource_memtable_bytes",
"resource_parallelism",
],
effect_class: "prepare",
risk_flags: &[],
capability_family: "catalog",
retry_safety: "safe",
identity_requirement: "server_locator",
resolver: None,
cancellation: "per_call",
side_effects: &["creates_bounded_preparation"],
recovery: "retry",
collection_index_ref: "request_name",
},
CommandSemanticContract {
command: Command::PrepareDeleteIndex,
admissible_errors: &[
ErrorCode::Aborted,
ErrorCode::DeadlineExceeded,
ErrorCode::InvalidRequest,
ErrorCode::UnsupportedVersion,
ErrorCode::Unauthenticated,
ErrorCode::PermissionDenied,
ErrorCode::NotFound,
ErrorCode::LimitExceeded,
ErrorCode::CapabilityUnavailable,
ErrorCode::TemporarilyUnavailable,
ErrorCode::Internal,
],
limit_ids: &["request_bytes", "response_bytes"],
effect_class: "prepare",
risk_flags: &["destructive"],
capability_family: "catalog",
retry_safety: "safe",
identity_requirement: "server_locator",
resolver: None,
cancellation: "per_call",
side_effects: &["creates_bounded_preparation"],
recovery: "retry",
collection_index_ref: "request_name",
},
CommandSemanticContract {
command: Command::SubmitCatalogAction,
admissible_errors: &[
ErrorCode::Aborted,
ErrorCode::DeadlineExceeded,
ErrorCode::InvalidRequest,
ErrorCode::UnsupportedVersion,
ErrorCode::Unauthenticated,
ErrorCode::PermissionDenied,
ErrorCode::NotFound,
ErrorCode::Conflict,
ErrorCode::LimitExceeded,
ErrorCode::CapabilityUnavailable,
ErrorCode::NotSubmitted,
ErrorCode::SubmittedIndeterminate,
ErrorCode::ExpiredUnknown,
ErrorCode::TemporarilyUnavailable,
ErrorCode::Internal,
],
limit_ids: &[
"request_bytes",
"response_bytes",
"resource_initial_shards",
"resource_target_shard_bytes",
"resource_admission_weight",
"resource_ram_bytes",
"resource_nvme_bytes",
"resource_refresh_millis",
"resource_memtable_bytes",
"resource_parallelism",
],
effect_class: "durable_submit",
risk_flags: &[],
capability_family: "catalog",
retry_safety: "pre_submit_only",
identity_requirement: "request_locator",
resolver: Some(Command::ResolveCatalogAction),
cancellation: "per_call_until_submission_then_resolve",
side_effects: &["commits_authoritative_state"],
recovery: "resolve_with_resolve_catalog_action",
collection_index_ref: "request_name",
},
CommandSemanticContract {
command: Command::ResolveCatalogAction,
admissible_errors: &[
ErrorCode::Aborted,
ErrorCode::DeadlineExceeded,
ErrorCode::InvalidRequest,
ErrorCode::UnsupportedVersion,
ErrorCode::Unauthenticated,
ErrorCode::PermissionDenied,
ErrorCode::NotFound,
ErrorCode::LimitExceeded,
ErrorCode::CapabilityUnavailable,
ErrorCode::TemporarilyUnavailable,
ErrorCode::Internal,
],
limit_ids: &["request_bytes", "response_bytes"],
effect_class: "read_only",
risk_flags: &[],
capability_family: "catalog",
retry_safety: "safe",
identity_requirement: "request_locator",
resolver: None,
cancellation: "per_call",
side_effects: &[],
recovery: "retry",
collection_index_ref: "caller",
},
CommandSemanticContract {
command: Command::PrepareReplayableSourceIndex,
admissible_errors: &[
ErrorCode::Aborted,
ErrorCode::DeadlineExceeded,
ErrorCode::InvalidRequest,
ErrorCode::UnsupportedVersion,
ErrorCode::Unauthenticated,
ErrorCode::PermissionDenied,
ErrorCode::NotFound,
ErrorCode::LimitExceeded,
ErrorCode::CapabilityUnavailable,
ErrorCode::RetentionGap,
ErrorCode::TemporarilyUnavailable,
ErrorCode::Internal,
],
limit_ids: &[
"request_bytes",
"response_bytes",
"resource_initial_shards",
"resource_target_shard_bytes",
"resource_admission_weight",
"resource_ram_bytes",
"resource_nvme_bytes",
"resource_refresh_millis",
"resource_memtable_bytes",
"resource_parallelism",
],
effect_class: "prepare",
risk_flags: &[],
capability_family: "catalog",
retry_safety: "safe",
identity_requirement: "server_locator",
resolver: None,
cancellation: "per_call",
side_effects: &["creates_bounded_preparation"],
recovery: "retry",
collection_index_ref: "request_name",
},
CommandSemanticContract {
command: Command::SubmitReplayableSourceIndex,
admissible_errors: &[
ErrorCode::Aborted,
ErrorCode::DeadlineExceeded,
ErrorCode::InvalidRequest,
ErrorCode::UnsupportedVersion,
ErrorCode::Unauthenticated,
ErrorCode::PermissionDenied,
ErrorCode::NotFound,
ErrorCode::Conflict,
ErrorCode::LimitExceeded,
ErrorCode::CapabilityUnavailable,
ErrorCode::NotSubmitted,
ErrorCode::SubmittedIndeterminate,
ErrorCode::ExpiredUnknown,
ErrorCode::RetentionGap,
ErrorCode::TemporarilyUnavailable,
ErrorCode::Internal,
],
limit_ids: &[
"request_bytes",
"response_bytes",
"resource_initial_shards",
"resource_target_shard_bytes",
"resource_admission_weight",
"resource_ram_bytes",
"resource_nvme_bytes",
"resource_refresh_millis",
"resource_memtable_bytes",
"resource_parallelism",
],
effect_class: "durable_submit",
risk_flags: &[],
capability_family: "catalog",
retry_safety: "pre_submit_only",
identity_requirement: "request_locator",
resolver: Some(Command::ResolveCatalogAction),
cancellation: "per_call_until_submission_then_resolve",
side_effects: &["commits_authoritative_state"],
recovery: "resolve_with_resolve_catalog_action",
collection_index_ref: "request_name",
},
CommandSemanticContract {
command: Command::GetReplayableSource,
admissible_errors: &[
ErrorCode::Aborted,
ErrorCode::DeadlineExceeded,
ErrorCode::InvalidRequest,
ErrorCode::UnsupportedVersion,
ErrorCode::Unauthenticated,
ErrorCode::PermissionDenied,
ErrorCode::NotFound,
ErrorCode::LimitExceeded,
ErrorCode::CapabilityUnavailable,
ErrorCode::RetentionGap,
ErrorCode::TemporarilyUnavailable,
ErrorCode::Internal,
],
limit_ids: &["request_bytes", "response_bytes"],
effect_class: "read_only",
risk_flags: &[],
capability_family: "catalog",
retry_safety: "safe",
identity_requirement: "none",
resolver: None,
cancellation: "per_call",
side_effects: &[],
recovery: "retry",
collection_index_ref: "none",
},
CommandSemanticContract {
command: Command::ControlReplayableSource,
admissible_errors: &[
ErrorCode::Aborted,
ErrorCode::DeadlineExceeded,
ErrorCode::InvalidRequest,
ErrorCode::UnsupportedVersion,
ErrorCode::Unauthenticated,
ErrorCode::PermissionDenied,
ErrorCode::NotFound,
ErrorCode::Conflict,
ErrorCode::LimitExceeded,
ErrorCode::CapabilityUnavailable,
ErrorCode::NotSubmitted,
ErrorCode::SubmittedIndeterminate,
ErrorCode::ExpiredUnknown,
ErrorCode::RetentionGap,
ErrorCode::TemporarilyUnavailable,
ErrorCode::Internal,
],
limit_ids: &["request_bytes", "response_bytes"],
effect_class: "durable_submit",
risk_flags: &[],
capability_family: "catalog",
retry_safety: "pre_submit_only",
identity_requirement: "none",
resolver: None,
cancellation: "per_call_until_submission_then_resolve",
side_effects: &["commits_authoritative_state"],
recovery: "retry_if_not_submitted",
collection_index_ref: "request_index",
},
CommandSemanticContract {
command: Command::CloneIndex,
admissible_errors: &[
ErrorCode::Aborted,
ErrorCode::DeadlineExceeded,
ErrorCode::InvalidRequest,
ErrorCode::UnsupportedVersion,
ErrorCode::Unauthenticated,
ErrorCode::PermissionDenied,
ErrorCode::NotFound,
ErrorCode::Conflict,
ErrorCode::LimitExceeded,
ErrorCode::CapabilityUnavailable,
ErrorCode::NotSubmitted,
ErrorCode::SubmittedIndeterminate,
ErrorCode::ExpiredUnknown,
ErrorCode::TemporarilyUnavailable,
ErrorCode::Internal,
],
limit_ids: &["request_bytes", "response_bytes"],
effect_class: "durable_submit",
risk_flags: &[],
capability_family: "catalog",
retry_safety: "pre_submit_only",
identity_requirement: "caller_action_id",
resolver: Some(Command::CloneIndex),
cancellation: "per_call_until_submission_then_resolve",
side_effects: &["commits_authoritative_state"],
recovery: "resolve_with_clone_index",
collection_index_ref: "caller",
},
CommandSemanticContract {
command: Command::ConfigureHistory,
admissible_errors: &[
ErrorCode::Aborted,
ErrorCode::DeadlineExceeded,
ErrorCode::InvalidRequest,
ErrorCode::UnsupportedVersion,
ErrorCode::Unauthenticated,
ErrorCode::PermissionDenied,
ErrorCode::NotFound,
ErrorCode::Conflict,
ErrorCode::LimitExceeded,
ErrorCode::CapabilityUnavailable,
ErrorCode::NotSubmitted,
ErrorCode::SubmittedIndeterminate,
ErrorCode::ExpiredUnknown,
ErrorCode::TemporarilyUnavailable,
ErrorCode::Internal,
],
limit_ids: &["request_bytes", "response_bytes"],
effect_class: "durable_submit",
risk_flags: &[],
capability_family: "catalog",
retry_safety: "pre_submit_only",
identity_requirement: "none",
resolver: Some(Command::GetHistory),
cancellation: "per_call_until_submission_then_resolve",
side_effects: &["commits_authoritative_state"],
recovery: "resolve_with_get_history",
collection_index_ref: "request_index",
},
CommandSemanticContract {
command: Command::GetHistory,
admissible_errors: &[
ErrorCode::Aborted,
ErrorCode::DeadlineExceeded,
ErrorCode::InvalidRequest,
ErrorCode::UnsupportedVersion,
ErrorCode::Unauthenticated,
ErrorCode::PermissionDenied,
ErrorCode::NotFound,
ErrorCode::LimitExceeded,
ErrorCode::CapabilityUnavailable,
ErrorCode::TemporarilyUnavailable,
ErrorCode::Internal,
],
limit_ids: &["request_bytes", "response_bytes"],
effect_class: "read_only",
risk_flags: &[],
capability_family: "catalog",
retry_safety: "safe",
identity_requirement: "none",
resolver: None,
cancellation: "per_call",
side_effects: &[],
recovery: "retry",
collection_index_ref: "none",
},
CommandSemanticContract {
command: Command::ResolveHistory,
admissible_errors: &[
ErrorCode::Aborted,
ErrorCode::DeadlineExceeded,
ErrorCode::InvalidRequest,
ErrorCode::UnsupportedVersion,
ErrorCode::Unauthenticated,
ErrorCode::PermissionDenied,
ErrorCode::NotFound,
ErrorCode::LimitExceeded,
ErrorCode::CapabilityUnavailable,
ErrorCode::RetentionGap,
ErrorCode::TemporarilyUnavailable,
ErrorCode::Internal,
],
limit_ids: &["request_bytes", "response_bytes"],
effect_class: "read_only",
risk_flags: &[],
capability_family: "data",
retry_safety: "safe",
identity_requirement: "none",
resolver: None,
cancellation: "per_call",
side_effects: &[],
recovery: "retry",
collection_index_ref: "request_index",
},
CommandSemanticContract {
command: Command::PlaceHistoryHold,
admissible_errors: &[
ErrorCode::Aborted,
ErrorCode::DeadlineExceeded,
ErrorCode::InvalidRequest,
ErrorCode::UnsupportedVersion,
ErrorCode::Unauthenticated,
ErrorCode::PermissionDenied,
ErrorCode::NotFound,
ErrorCode::Conflict,
ErrorCode::LimitExceeded,
ErrorCode::CapabilityUnavailable,
ErrorCode::NotSubmitted,
ErrorCode::SubmittedIndeterminate,
ErrorCode::ExpiredUnknown,
ErrorCode::TemporarilyUnavailable,
ErrorCode::Internal,
],
limit_ids: &["request_bytes", "response_bytes"],
effect_class: "durable_submit",
risk_flags: &[],
capability_family: "catalog",
retry_safety: "pre_submit_only",
identity_requirement: "none",
resolver: Some(Command::GetHistory),
cancellation: "per_call_until_submission_then_resolve",
side_effects: &["commits_authoritative_state"],
recovery: "resolve_with_get_history",
collection_index_ref: "request_index",
},
CommandSemanticContract {
command: Command::ReleaseHistoryHold,
admissible_errors: &[
ErrorCode::Aborted,
ErrorCode::DeadlineExceeded,
ErrorCode::InvalidRequest,
ErrorCode::UnsupportedVersion,
ErrorCode::Unauthenticated,
ErrorCode::PermissionDenied,
ErrorCode::NotFound,
ErrorCode::Conflict,
ErrorCode::LimitExceeded,
ErrorCode::CapabilityUnavailable,
ErrorCode::NotSubmitted,
ErrorCode::SubmittedIndeterminate,
ErrorCode::ExpiredUnknown,
ErrorCode::TemporarilyUnavailable,
ErrorCode::Internal,
],
limit_ids: &["request_bytes", "response_bytes"],
effect_class: "durable_submit",
risk_flags: &[],
capability_family: "catalog",
retry_safety: "pre_submit_only",
identity_requirement: "none",
resolver: Some(Command::GetHistory),
cancellation: "per_call_until_submission_then_resolve",
side_effects: &["commits_authoritative_state"],
recovery: "resolve_with_get_history",
collection_index_ref: "request_index",
},
CommandSemanticContract {
command: Command::PrepareDocumentMutation,
admissible_errors: &[
ErrorCode::Aborted,
ErrorCode::DeadlineExceeded,
ErrorCode::InvalidRequest,
ErrorCode::UnsupportedVersion,
ErrorCode::Unauthenticated,
ErrorCode::PermissionDenied,
ErrorCode::NotFound,
ErrorCode::LimitExceeded,
ErrorCode::CapabilityUnavailable,
ErrorCode::TemporarilyUnavailable,
ErrorCode::Internal,
],
limit_ids: &["request_bytes", "response_bytes"],
effect_class: "prepare",
risk_flags: &[],
capability_family: "data",
retry_safety: "safe",
identity_requirement: "server_locator",
resolver: None,
cancellation: "per_call",
side_effects: &["creates_bounded_preparation"],
recovery: "retry",
collection_index_ref: "request_index",
},
CommandSemanticContract {
command: Command::SubmitDocumentMutation,
admissible_errors: &[
ErrorCode::Aborted,
ErrorCode::DeadlineExceeded,
ErrorCode::InvalidRequest,
ErrorCode::UnsupportedVersion,
ErrorCode::Unauthenticated,
ErrorCode::PermissionDenied,
ErrorCode::NotFound,
ErrorCode::Conflict,
ErrorCode::LimitExceeded,
ErrorCode::CapabilityUnavailable,
ErrorCode::NotSubmitted,
ErrorCode::SubmittedIndeterminate,
ErrorCode::ExpiredUnknown,
ErrorCode::TemporarilyUnavailable,
ErrorCode::Internal,
],
limit_ids: &["request_bytes", "response_bytes"],
effect_class: "durable_submit",
risk_flags: &[],
capability_family: "data",
retry_safety: "pre_submit_only",
identity_requirement: "request_locator",
resolver: Some(Command::ResolveDocumentMutation),
cancellation: "per_call_until_submission_then_resolve",
side_effects: &["commits_authoritative_state"],
recovery: "resolve_with_resolve_document_mutation",
collection_index_ref: "request_index",
},
CommandSemanticContract {
command: Command::PrepareDocumentBulk,
admissible_errors: &[
ErrorCode::Aborted,
ErrorCode::DeadlineExceeded,
ErrorCode::InvalidRequest,
ErrorCode::UnsupportedVersion,
ErrorCode::Unauthenticated,
ErrorCode::PermissionDenied,
ErrorCode::NotFound,
ErrorCode::LimitExceeded,
ErrorCode::CapabilityUnavailable,
ErrorCode::TemporarilyUnavailable,
ErrorCode::Internal,
],
limit_ids: &[
"request_bytes",
"response_bytes",
"bulk_document_items",
"bulk_document_bytes",
],
effect_class: "prepare",
risk_flags: &[],
capability_family: "data",
retry_safety: "safe",
identity_requirement: "caller_action_id",
resolver: None,
cancellation: "per_call",
side_effects: &["creates_bounded_preparation"],
recovery: "retry",
collection_index_ref: "request_index",
},
CommandSemanticContract {
command: Command::SubmitDocumentBulk,
admissible_errors: &[
ErrorCode::Aborted,
ErrorCode::DeadlineExceeded,
ErrorCode::InvalidRequest,
ErrorCode::UnsupportedVersion,
ErrorCode::Unauthenticated,
ErrorCode::PermissionDenied,
ErrorCode::NotFound,
ErrorCode::Conflict,
ErrorCode::LimitExceeded,
ErrorCode::CapabilityUnavailable,
ErrorCode::NotSubmitted,
ErrorCode::SubmittedIndeterminate,
ErrorCode::ExpiredUnknown,
ErrorCode::TemporarilyUnavailable,
ErrorCode::Internal,
],
limit_ids: &[
"request_bytes",
"response_bytes",
"bulk_document_items",
"bulk_document_bytes",
],
effect_class: "durable_submit",
risk_flags: &[],
capability_family: "data",
retry_safety: "pre_submit_only",
identity_requirement: "caller_action_id",
resolver: Some(Command::ResolveDocumentBulk),
cancellation: "per_call_until_submission_then_resolve",
side_effects: &["commits_authoritative_state"],
recovery: "resolve_with_resolve_document_bulk",
collection_index_ref: "request_index",
},
CommandSemanticContract {
command: Command::ResolveDocumentBulk,
admissible_errors: &[
ErrorCode::Aborted,
ErrorCode::DeadlineExceeded,
ErrorCode::InvalidRequest,
ErrorCode::UnsupportedVersion,
ErrorCode::Unauthenticated,
ErrorCode::PermissionDenied,
ErrorCode::NotFound,
ErrorCode::LimitExceeded,
ErrorCode::CapabilityUnavailable,
ErrorCode::TemporarilyUnavailable,
ErrorCode::Internal,
],
limit_ids: &[
"request_bytes",
"response_bytes",
"bulk_document_items",
"bulk_document_bytes",
],
effect_class: "read_only",
risk_flags: &[],
capability_family: "data",
retry_safety: "safe",
identity_requirement: "caller_action_id",
resolver: None,
cancellation: "per_call",
side_effects: &[],
recovery: "retry",
collection_index_ref: "request_index",
},
CommandSemanticContract {
command: Command::PrepareAppendBulk,
admissible_errors: &[
ErrorCode::Aborted,
ErrorCode::DeadlineExceeded,
ErrorCode::InvalidRequest,
ErrorCode::UnsupportedVersion,
ErrorCode::Unauthenticated,
ErrorCode::PermissionDenied,
ErrorCode::NotFound,
ErrorCode::LimitExceeded,
ErrorCode::CapabilityUnavailable,
ErrorCode::TemporarilyUnavailable,
ErrorCode::Internal,
],
limit_ids: &[
"request_bytes",
"response_bytes",
"bulk_document_items",
"bulk_document_bytes",
],
effect_class: "prepare",
risk_flags: &[],
capability_family: "data",
retry_safety: "safe",
identity_requirement: "caller_action_id",
resolver: None,
cancellation: "per_call",
side_effects: &[],
recovery: "retry",
collection_index_ref: "request_index",
},
CommandSemanticContract {
command: Command::SubmitAppendBulk,
admissible_errors: &[
ErrorCode::Aborted,
ErrorCode::DeadlineExceeded,
ErrorCode::InvalidRequest,
ErrorCode::UnsupportedVersion,
ErrorCode::Unauthenticated,
ErrorCode::PermissionDenied,
ErrorCode::NotFound,
ErrorCode::Conflict,
ErrorCode::LimitExceeded,
ErrorCode::CapabilityUnavailable,
ErrorCode::NotSubmitted,
ErrorCode::SubmittedIndeterminate,
ErrorCode::TemporarilyUnavailable,
ErrorCode::Internal,
],
limit_ids: &[
"request_bytes",
"response_bytes",
"bulk_document_items",
"bulk_document_bytes",
],
effect_class: "durable_submit",
risk_flags: &[],
capability_family: "data",
retry_safety: "pre_submit_only",
identity_requirement: "request_locator",
resolver: Some(Command::ResolveAppendBulk),
cancellation: "per_call_until_submission_then_resolve",
side_effects: &["commits_authoritative_state"],
recovery: "resolve_with_resolve_append_bulk",
collection_index_ref: "request_index",
},
CommandSemanticContract {
command: Command::ResolveAppendBulk,
admissible_errors: &[
ErrorCode::Aborted,
ErrorCode::DeadlineExceeded,
ErrorCode::InvalidRequest,
ErrorCode::UnsupportedVersion,
ErrorCode::Unauthenticated,
ErrorCode::PermissionDenied,
ErrorCode::NotFound,
ErrorCode::Conflict,
ErrorCode::LimitExceeded,
ErrorCode::CapabilityUnavailable,
ErrorCode::TemporarilyUnavailable,
ErrorCode::Internal,
],
limit_ids: &[
"request_bytes",
"response_bytes",
"bulk_document_items",
"bulk_document_bytes",
],
effect_class: "read_only",
risk_flags: &[],
capability_family: "data",
retry_safety: "safe",
identity_requirement: "request_locator",
resolver: None,
cancellation: "per_call",
side_effects: &[],
recovery: "retry",
collection_index_ref: "request_index",
},
CommandSemanticContract {
command: Command::ObserveAppendCommitted,
admissible_errors: &[
ErrorCode::Aborted,
ErrorCode::DeadlineExceeded,
ErrorCode::InvalidRequest,
ErrorCode::UnsupportedVersion,
ErrorCode::Unauthenticated,
ErrorCode::PermissionDenied,
ErrorCode::NotFound,
ErrorCode::Conflict,
ErrorCode::LimitExceeded,
ErrorCode::CapabilityUnavailable,
ErrorCode::TemporarilyUnavailable,
ErrorCode::Internal,
],
limit_ids: &["request_bytes", "response_bytes"],
effect_class: "read_only",
risk_flags: &[],
capability_family: "data",
retry_safety: "safe",
identity_requirement: "request_locator",
resolver: None,
cancellation: "per_call",
side_effects: &[],
recovery: "retry",
collection_index_ref: "request_index",
},
CommandSemanticContract {
command: Command::ResolveDocumentMutation,
admissible_errors: &[
ErrorCode::Aborted,
ErrorCode::DeadlineExceeded,
ErrorCode::InvalidRequest,
ErrorCode::UnsupportedVersion,
ErrorCode::Unauthenticated,
ErrorCode::PermissionDenied,
ErrorCode::NotFound,
ErrorCode::LimitExceeded,
ErrorCode::CapabilityUnavailable,
ErrorCode::TemporarilyUnavailable,
ErrorCode::Internal,
],
limit_ids: &["request_bytes", "response_bytes"],
effect_class: "read_only",
risk_flags: &[],
capability_family: "data",
retry_safety: "safe",
identity_requirement: "request_locator",
resolver: None,
cancellation: "per_call",
side_effects: &[],
recovery: "retry",
collection_index_ref: "caller",
},
CommandSemanticContract {
command: Command::GetDocument,
admissible_errors: &[
ErrorCode::Aborted,
ErrorCode::DeadlineExceeded,
ErrorCode::InvalidRequest,
ErrorCode::UnsupportedVersion,
ErrorCode::Unauthenticated,
ErrorCode::PermissionDenied,
ErrorCode::NotFound,
ErrorCode::LimitExceeded,
ErrorCode::CapabilityUnavailable,
ErrorCode::TemporarilyUnavailable,
ErrorCode::Internal,
],
limit_ids: &["request_bytes", "response_bytes"],
effect_class: "read_only",
risk_flags: &[],
capability_family: "data",
retry_safety: "safe",
identity_requirement: "none",
resolver: None,
cancellation: "per_call",
side_effects: &[],
recovery: "retry",
collection_index_ref: "request_index",
},
CommandSemanticContract {
command: Command::Search,
admissible_errors: &[
ErrorCode::Aborted,
ErrorCode::DeadlineExceeded,
ErrorCode::InvalidRequest,
ErrorCode::UnsupportedVersion,
ErrorCode::Unauthenticated,
ErrorCode::PermissionDenied,
ErrorCode::NotFound,
ErrorCode::StaleCursor,
ErrorCode::RestartBudgetExhausted,
ErrorCode::LimitExceeded,
ErrorCode::CapabilityUnavailable,
ErrorCode::TemporarilyUnavailable,
ErrorCode::Internal,
],
limit_ids: &[
"request_bytes",
"response_bytes",
"page_size",
"query_clauses",
"aggregation_nodes",
"aggregation_buckets",
"routing_values",
"routing_value_bytes",
"query_recursion_depth",
"text_query_bytes",
"text_query_fields",
"text_query_slop",
"text_query_boost",
"text_query_fuzzy_expansions",
"text_query_fuzzy_distance",
"text_query_dictionary_scan_terms",
"text_query_dictionary_scan_bytes",
"text_query_fuzzy_work_units",
"vector_dimensions",
"vector_query_bytes",
"vector_request_bytes",
"vector_candidates",
"vector_set_query_vectors",
"vector_set_query_bytes",
"retrieval_branches",
"retrieval_branch_name_bytes",
"retrieval_window",
"fragment_fields",
"fragments_per_field",
"fragment_bytes",
"fragment_total_bytes",
"result_feature_hits",
"result_features",
"diversification_fields",
"diversification_per_group",
"search_result_window",
],
effect_class: "read_only",
risk_flags: &[],
capability_family: "data",
retry_safety: "safe",
identity_requirement: "none",
resolver: None,
cancellation: "per_call",
side_effects: &[],
recovery: "retry",
collection_index_ref: "request_indexes_or_pit_authority",
},
CommandSemanticContract {
command: Command::OpenPit,
admissible_errors: &[
ErrorCode::Aborted,
ErrorCode::DeadlineExceeded,
ErrorCode::InvalidRequest,
ErrorCode::UnsupportedVersion,
ErrorCode::Unauthenticated,
ErrorCode::PermissionDenied,
ErrorCode::NotFound,
ErrorCode::Conflict,
ErrorCode::LimitExceeded,
ErrorCode::CapabilityUnavailable,
ErrorCode::NotSubmitted,
ErrorCode::SubmittedIndeterminate,
ErrorCode::ExpiredUnknown,
ErrorCode::TemporarilyUnavailable,
ErrorCode::Internal,
],
limit_ids: &["request_bytes", "response_bytes"],
effect_class: "lease_renewing_read",
risk_flags: &[],
capability_family: "data",
retry_safety: "pre_submit_only",
identity_requirement: "none",
resolver: None,
cancellation: "per_call_until_submission_then_resolve",
side_effects: &["renews_or_closes_existing_lease"],
recovery: "retry_if_not_submitted",
collection_index_ref: "request_indexes_uniform",
},
CommandSemanticContract {
command: Command::RenewPit,
admissible_errors: &[
ErrorCode::Aborted,
ErrorCode::DeadlineExceeded,
ErrorCode::InvalidRequest,
ErrorCode::UnsupportedVersion,
ErrorCode::Unauthenticated,
ErrorCode::PermissionDenied,
ErrorCode::NotFound,
ErrorCode::Conflict,
ErrorCode::LimitExceeded,
ErrorCode::CapabilityUnavailable,
ErrorCode::NotSubmitted,
ErrorCode::SubmittedIndeterminate,
ErrorCode::ExpiredUnknown,
ErrorCode::TemporarilyUnavailable,
ErrorCode::Internal,
],
limit_ids: &["request_bytes", "response_bytes"],
effect_class: "lease_renewing_read",
risk_flags: &[],
capability_family: "data",
retry_safety: "pre_submit_only",
identity_requirement: "none",
resolver: None,
cancellation: "per_call_until_submission_then_resolve",
side_effects: &["renews_or_closes_existing_lease"],
recovery: "retry_if_not_submitted",
collection_index_ref: "pit_authority",
},
CommandSemanticContract {
command: Command::ClosePit,
admissible_errors: &[
ErrorCode::Aborted,
ErrorCode::DeadlineExceeded,
ErrorCode::InvalidRequest,
ErrorCode::UnsupportedVersion,
ErrorCode::Unauthenticated,
ErrorCode::PermissionDenied,
ErrorCode::NotFound,
ErrorCode::Conflict,
ErrorCode::LimitExceeded,
ErrorCode::CapabilityUnavailable,
ErrorCode::NotSubmitted,
ErrorCode::SubmittedIndeterminate,
ErrorCode::ExpiredUnknown,
ErrorCode::TemporarilyUnavailable,
ErrorCode::Internal,
],
limit_ids: &["request_bytes", "response_bytes"],
effect_class: "lease_renewing_read",
risk_flags: &[],
capability_family: "data",
retry_safety: "pre_submit_only",
identity_requirement: "none",
resolver: None,
cancellation: "per_call_until_submission_then_resolve",
side_effects: &["renews_or_closes_existing_lease"],
recovery: "retry_if_not_submitted",
collection_index_ref: "pit_authority",
},
CommandSemanticContract {
command: Command::ListOperations,
admissible_errors: &[
ErrorCode::Aborted,
ErrorCode::DeadlineExceeded,
ErrorCode::InvalidRequest,
ErrorCode::UnsupportedVersion,
ErrorCode::Unauthenticated,
ErrorCode::PermissionDenied,
ErrorCode::NotFound,
ErrorCode::StaleCursor,
ErrorCode::RestartBudgetExhausted,
ErrorCode::LimitExceeded,
ErrorCode::CapabilityUnavailable,
ErrorCode::TemporarilyUnavailable,
ErrorCode::Internal,
],
limit_ids: &["request_bytes", "response_bytes", "page_size", "operation_page_size"],
effect_class: "read_only",
risk_flags: &[],
capability_family: "operations",
retry_safety: "safe",
identity_requirement: "none",
resolver: None,
cancellation: "per_call",
side_effects: &[],
recovery: "retry",
collection_index_ref: "none",
},
CommandSemanticContract {
command: Command::GetOperation,
admissible_errors: &[
ErrorCode::Aborted,
ErrorCode::DeadlineExceeded,
ErrorCode::InvalidRequest,
ErrorCode::UnsupportedVersion,
ErrorCode::Unauthenticated,
ErrorCode::PermissionDenied,
ErrorCode::NotFound,
ErrorCode::LimitExceeded,
ErrorCode::CapabilityUnavailable,
ErrorCode::TemporarilyUnavailable,
ErrorCode::Internal,
],
limit_ids: &["request_bytes", "response_bytes"],
effect_class: "read_only",
risk_flags: &[],
capability_family: "operations",
retry_safety: "safe",
identity_requirement: "request_locator",
resolver: None,
cancellation: "per_call",
side_effects: &[],
recovery: "retry",
collection_index_ref: "none",
},
CommandSemanticContract {
command: Command::CancelOperation,
admissible_errors: &[
ErrorCode::Aborted,
ErrorCode::DeadlineExceeded,
ErrorCode::InvalidRequest,
ErrorCode::UnsupportedVersion,
ErrorCode::Unauthenticated,
ErrorCode::PermissionDenied,
ErrorCode::NotFound,
ErrorCode::Conflict,
ErrorCode::LimitExceeded,
ErrorCode::CapabilityUnavailable,
ErrorCode::NotSubmitted,
ErrorCode::SubmittedIndeterminate,
ErrorCode::ExpiredUnknown,
ErrorCode::TemporarilyUnavailable,
ErrorCode::Internal,
],
limit_ids: &["request_bytes", "response_bytes"],
effect_class: "control_write",
risk_flags: &[],
capability_family: "operations",
retry_safety: "pre_submit_only",
identity_requirement: "request_locator",
resolver: None,
cancellation: "per_call_until_submission_then_resolve",
side_effects: &["commits_authoritative_state"],
recovery: "retry_if_not_submitted",
collection_index_ref: "none",
},
CommandSemanticContract {
command: Command::ListAuditEvents,
admissible_errors: &[
ErrorCode::Aborted,
ErrorCode::DeadlineExceeded,
ErrorCode::InvalidRequest,
ErrorCode::UnsupportedVersion,
ErrorCode::Unauthenticated,
ErrorCode::PermissionDenied,
ErrorCode::NotFound,
ErrorCode::StaleCursor,
ErrorCode::RestartBudgetExhausted,
ErrorCode::LimitExceeded,
ErrorCode::CapabilityUnavailable,
ErrorCode::TemporarilyUnavailable,
ErrorCode::Internal,
],
limit_ids: &["request_bytes", "response_bytes", "page_size"],
effect_class: "read_only",
risk_flags: &[],
capability_family: "audit",
retry_safety: "safe",
identity_requirement: "none",
resolver: None,
cancellation: "per_call",
side_effects: &[],
recovery: "retry",
collection_index_ref: "none",
},
CommandSemanticContract {
command: Command::ExportAuditEvents,
admissible_errors: &[
ErrorCode::Aborted,
ErrorCode::DeadlineExceeded,
ErrorCode::InvalidRequest,
ErrorCode::UnsupportedVersion,
ErrorCode::Unauthenticated,
ErrorCode::PermissionDenied,
ErrorCode::NotFound,
ErrorCode::StaleCursor,
ErrorCode::RestartBudgetExhausted,
ErrorCode::LimitExceeded,
ErrorCode::CapabilityUnavailable,
ErrorCode::TemporarilyUnavailable,
ErrorCode::Internal,
],
limit_ids: &["request_bytes", "response_bytes", "page_size"],
effect_class: "read_only",
risk_flags: &[],
capability_family: "audit",
retry_safety: "safe",
identity_requirement: "none",
resolver: None,
cancellation: "per_call",
side_effects: &[],
recovery: "retry",
collection_index_ref: "none",
},
CommandSemanticContract {
command: Command::ReserveServiceCredential,
admissible_errors: &[
ErrorCode::Aborted,
ErrorCode::DeadlineExceeded,
ErrorCode::InvalidRequest,
ErrorCode::UnsupportedVersion,
ErrorCode::Unauthenticated,
ErrorCode::PermissionDenied,
ErrorCode::NotFound,
ErrorCode::Conflict,
ErrorCode::LimitExceeded,
ErrorCode::CapabilityUnavailable,
ErrorCode::NotSubmitted,
ErrorCode::SubmittedIndeterminate,
ErrorCode::ExpiredUnknown,
ErrorCode::SecretNotEscrowed,
ErrorCode::TemporarilyUnavailable,
ErrorCode::Internal,
],
limit_ids: &["request_bytes", "response_bytes"],
effect_class: "durable_submit",
risk_flags: &["credential_sensitive"],
capability_family: "security",
retry_safety: "pre_submit_only",
identity_requirement: "caller_action_id",
resolver: Some(Command::ResolveServiceCredentialReservation),
cancellation: "per_call_until_submission_then_resolve",
side_effects: &["commits_authoritative_state"],
recovery: "resolve_with_resolve_service_credential_reservation",
collection_index_ref: "none",
},
CommandSemanticContract {
command: Command::ReserveServiceCredentialRotation,
admissible_errors: &[
ErrorCode::Aborted,
ErrorCode::DeadlineExceeded,
ErrorCode::InvalidRequest,
ErrorCode::UnsupportedVersion,
ErrorCode::Unauthenticated,
ErrorCode::PermissionDenied,
ErrorCode::NotFound,
ErrorCode::Conflict,
ErrorCode::LimitExceeded,
ErrorCode::CapabilityUnavailable,
ErrorCode::NotSubmitted,
ErrorCode::SubmittedIndeterminate,
ErrorCode::ExpiredUnknown,
ErrorCode::SecretNotEscrowed,
ErrorCode::TemporarilyUnavailable,
ErrorCode::Internal,
],
limit_ids: &["request_bytes", "response_bytes"],
effect_class: "durable_submit",
risk_flags: &["credential_sensitive"],
capability_family: "security",
retry_safety: "pre_submit_only",
identity_requirement: "caller_action_id",
resolver: Some(Command::ResolveServiceCredentialReservation),
cancellation: "per_call_until_submission_then_resolve",
side_effects: &["commits_authoritative_state"],
recovery: "resolve_with_resolve_service_credential_reservation",
collection_index_ref: "none",
},
CommandSemanticContract {
command: Command::ActivateServiceCredential,
admissible_errors: &[
ErrorCode::Aborted,
ErrorCode::DeadlineExceeded,
ErrorCode::InvalidRequest,
ErrorCode::UnsupportedVersion,
ErrorCode::Unauthenticated,
ErrorCode::PermissionDenied,
ErrorCode::NotFound,
ErrorCode::Conflict,
ErrorCode::LimitExceeded,
ErrorCode::CapabilityUnavailable,
ErrorCode::NotSubmitted,
ErrorCode::SubmittedIndeterminate,
ErrorCode::ExpiredUnknown,
ErrorCode::SecretNotEscrowed,
ErrorCode::TemporarilyUnavailable,
ErrorCode::Internal,
],
limit_ids: &["request_bytes", "response_bytes"],
effect_class: "durable_submit",
risk_flags: &["credential_sensitive"],
capability_family: "security",
retry_safety: "pre_submit_only",
identity_requirement: "server_locator",
resolver: Some(Command::ResolveServiceCredentialReservation),
cancellation: "per_call_until_submission_then_resolve",
side_effects: &["commits_authoritative_state"],
recovery: "resolve_with_resolve_service_credential_reservation",
collection_index_ref: "none",
},
CommandSemanticContract {
command: Command::ResolveServiceCredentialReservation,
admissible_errors: &[
ErrorCode::Aborted,
ErrorCode::DeadlineExceeded,
ErrorCode::InvalidRequest,
ErrorCode::UnsupportedVersion,
ErrorCode::Unauthenticated,
ErrorCode::PermissionDenied,
ErrorCode::NotFound,
ErrorCode::LimitExceeded,
ErrorCode::CapabilityUnavailable,
ErrorCode::SecretNotEscrowed,
ErrorCode::TemporarilyUnavailable,
ErrorCode::Internal,
],
limit_ids: &["request_bytes", "response_bytes"],
effect_class: "read_only",
risk_flags: &["credential_sensitive"],
capability_family: "security",
retry_safety: "safe",
identity_requirement: "caller_action_id",
resolver: None,
cancellation: "per_call",
side_effects: &[],
recovery: "retry",
collection_index_ref: "none",
},
CommandSemanticContract {
command: Command::PrepareRevokeServiceCredential,
admissible_errors: &[
ErrorCode::Aborted,
ErrorCode::DeadlineExceeded,
ErrorCode::InvalidRequest,
ErrorCode::UnsupportedVersion,
ErrorCode::Unauthenticated,
ErrorCode::PermissionDenied,
ErrorCode::NotFound,
ErrorCode::LimitExceeded,
ErrorCode::CapabilityUnavailable,
ErrorCode::SecretNotEscrowed,
ErrorCode::TemporarilyUnavailable,
ErrorCode::Internal,
],
limit_ids: &["request_bytes", "response_bytes"],
effect_class: "prepare",
risk_flags: &["destructive", "credential_sensitive"],
capability_family: "security",
retry_safety: "safe",
identity_requirement: "server_locator",
resolver: None,
cancellation: "per_call",
side_effects: &["creates_bounded_preparation"],
recovery: "retry",
collection_index_ref: "none",
},
CommandSemanticContract {
command: Command::RevokeServiceCredential,
admissible_errors: &[
ErrorCode::Aborted,
ErrorCode::DeadlineExceeded,
ErrorCode::InvalidRequest,
ErrorCode::UnsupportedVersion,
ErrorCode::Unauthenticated,
ErrorCode::PermissionDenied,
ErrorCode::NotFound,
ErrorCode::Conflict,
ErrorCode::LimitExceeded,
ErrorCode::CapabilityUnavailable,
ErrorCode::NotSubmitted,
ErrorCode::SubmittedIndeterminate,
ErrorCode::ExpiredUnknown,
ErrorCode::SecretNotEscrowed,
ErrorCode::TemporarilyUnavailable,
ErrorCode::Internal,
],
limit_ids: &["request_bytes", "response_bytes"],
effect_class: "durable_submit",
risk_flags: &["destructive", "credential_sensitive"],
capability_family: "security",
retry_safety: "pre_submit_only",
identity_requirement: "request_locator",
resolver: Some(Command::ResolveSecurityAction),
cancellation: "per_call_until_submission_then_resolve",
side_effects: &["commits_authoritative_state"],
recovery: "resolve_with_resolve_security_action",
collection_index_ref: "none",
},
CommandSemanticContract {
command: Command::ResolveSecurityAction,
admissible_errors: &[
ErrorCode::Aborted,
ErrorCode::DeadlineExceeded,
ErrorCode::InvalidRequest,
ErrorCode::UnsupportedVersion,
ErrorCode::Unauthenticated,
ErrorCode::PermissionDenied,
ErrorCode::NotFound,
ErrorCode::LimitExceeded,
ErrorCode::CapabilityUnavailable,
ErrorCode::SecretNotEscrowed,
ErrorCode::TemporarilyUnavailable,
ErrorCode::Internal,
],
limit_ids: &["request_bytes", "response_bytes"],
effect_class: "read_only",
risk_flags: &[],
capability_family: "security",
retry_safety: "safe",
identity_requirement: "request_locator",
resolver: None,
cancellation: "per_call",
side_effects: &[],
recovery: "retry",
collection_index_ref: "none",
},
CommandSemanticContract {
command: Command::GetSecurityRole,
admissible_errors: &[
ErrorCode::Aborted,
ErrorCode::DeadlineExceeded,
ErrorCode::InvalidRequest,
ErrorCode::UnsupportedVersion,
ErrorCode::Unauthenticated,
ErrorCode::PermissionDenied,
ErrorCode::NotFound,
ErrorCode::LimitExceeded,
ErrorCode::CapabilityUnavailable,
ErrorCode::TemporarilyUnavailable,
ErrorCode::Internal,
],
limit_ids: &["request_bytes", "response_bytes"],
effect_class: "read_only",
risk_flags: &[],
capability_family: "security",
retry_safety: "safe",
identity_requirement: "none",
resolver: None,
cancellation: "per_call",
side_effects: &[],
recovery: "retry",
collection_index_ref: "none",
},
CommandSemanticContract {
command: Command::PrepareRoleAppendAccessChange,
admissible_errors: &[
ErrorCode::Aborted,
ErrorCode::DeadlineExceeded,
ErrorCode::InvalidRequest,
ErrorCode::UnsupportedVersion,
ErrorCode::Unauthenticated,
ErrorCode::PermissionDenied,
ErrorCode::NotFound,
ErrorCode::Conflict,
ErrorCode::LimitExceeded,
ErrorCode::CapabilityUnavailable,
ErrorCode::TemporarilyUnavailable,
ErrorCode::Internal,
],
limit_ids: &["request_bytes", "response_bytes"],
effect_class: "prepare",
risk_flags: &["destructive"],
capability_family: "security",
retry_safety: "safe",
identity_requirement: "server_locator",
resolver: None,
cancellation: "per_call",
side_effects: &["creates_bounded_preparation"],
recovery: "retry",
collection_index_ref: "none",
},
CommandSemanticContract {
command: Command::SubmitRoleAppendAccessChange,
admissible_errors: &[
ErrorCode::Aborted,
ErrorCode::DeadlineExceeded,
ErrorCode::InvalidRequest,
ErrorCode::UnsupportedVersion,
ErrorCode::Unauthenticated,
ErrorCode::PermissionDenied,
ErrorCode::NotFound,
ErrorCode::Conflict,
ErrorCode::LimitExceeded,
ErrorCode::CapabilityUnavailable,
ErrorCode::NotSubmitted,
ErrorCode::SubmittedIndeterminate,
ErrorCode::ExpiredUnknown,
ErrorCode::TemporarilyUnavailable,
ErrorCode::Internal,
],
limit_ids: &["request_bytes", "response_bytes"],
effect_class: "durable_submit",
risk_flags: &["destructive"],
capability_family: "security",
retry_safety: "pre_submit_only",
identity_requirement: "request_locator",
resolver: Some(Command::ResolveSecurityAction),
cancellation: "per_call_until_submission_then_resolve",
side_effects: &["commits_authoritative_state"],
recovery: "resolve_with_resolve_security_action",
collection_index_ref: "none",
},
CommandSemanticContract {
command: Command::ListServiceCredentials,
admissible_errors: &[
ErrorCode::Aborted,
ErrorCode::DeadlineExceeded,
ErrorCode::InvalidRequest,
ErrorCode::UnsupportedVersion,
ErrorCode::Unauthenticated,
ErrorCode::PermissionDenied,
ErrorCode::NotFound,
ErrorCode::StaleCursor,
ErrorCode::RestartBudgetExhausted,
ErrorCode::LimitExceeded,
ErrorCode::CapabilityUnavailable,
ErrorCode::SecretNotEscrowed,
ErrorCode::TemporarilyUnavailable,
ErrorCode::Internal,
],
limit_ids: &["request_bytes", "response_bytes", "page_size"],
effect_class: "read_only",
risk_flags: &["credential_sensitive"],
capability_family: "security",
retry_safety: "safe",
identity_requirement: "none",
resolver: None,
cancellation: "per_call",
side_effects: &[],
recovery: "retry",
collection_index_ref: "none",
},
CommandSemanticContract {
command: Command::ListBackups,
admissible_errors: &[
ErrorCode::Aborted,
ErrorCode::DeadlineExceeded,
ErrorCode::InvalidRequest,
ErrorCode::UnsupportedVersion,
ErrorCode::Unauthenticated,
ErrorCode::PermissionDenied,
ErrorCode::NotFound,
ErrorCode::StaleCursor,
ErrorCode::RestartBudgetExhausted,
ErrorCode::LimitExceeded,
ErrorCode::CapabilityUnavailable,
ErrorCode::TemporarilyUnavailable,
ErrorCode::Internal,
],
limit_ids: &["request_bytes", "response_bytes", "page_size"],
effect_class: "read_only",
risk_flags: &[],
capability_family: "backup",
retry_safety: "safe",
identity_requirement: "none",
resolver: None,
cancellation: "per_call",
side_effects: &[],
recovery: "retry",
collection_index_ref: "none",
},
CommandSemanticContract {
command: Command::GetBackup,
admissible_errors: &[
ErrorCode::Aborted,
ErrorCode::DeadlineExceeded,
ErrorCode::InvalidRequest,
ErrorCode::UnsupportedVersion,
ErrorCode::Unauthenticated,
ErrorCode::PermissionDenied,
ErrorCode::NotFound,
ErrorCode::LimitExceeded,
ErrorCode::CapabilityUnavailable,
ErrorCode::TemporarilyUnavailable,
ErrorCode::Internal,
],
limit_ids: &["request_bytes", "response_bytes"],
effect_class: "read_only",
risk_flags: &[],
capability_family: "backup",
retry_safety: "safe",
identity_requirement: "request_locator",
resolver: None,
cancellation: "per_call",
side_effects: &[],
recovery: "retry",
collection_index_ref: "none",
},
CommandSemanticContract {
command: Command::CreateBackup,
admissible_errors: &[
ErrorCode::Aborted,
ErrorCode::DeadlineExceeded,
ErrorCode::InvalidRequest,
ErrorCode::UnsupportedVersion,
ErrorCode::Unauthenticated,
ErrorCode::PermissionDenied,
ErrorCode::NotFound,
ErrorCode::Conflict,
ErrorCode::LimitExceeded,
ErrorCode::CapabilityUnavailable,
ErrorCode::NotSubmitted,
ErrorCode::SubmittedIndeterminate,
ErrorCode::ExpiredUnknown,
ErrorCode::TemporarilyUnavailable,
ErrorCode::Internal,
],
limit_ids: &["request_bytes", "response_bytes"],
effect_class: "durable_submit",
risk_flags: &[],
capability_family: "backup",
retry_safety: "pre_submit_only",
identity_requirement: "caller_action_id",
resolver: Some(Command::ResolveBackupAction),
cancellation: "per_call_until_submission_then_resolve",
side_effects: &["commits_authoritative_state"],
recovery: "resolve_with_resolve_backup_action",
collection_index_ref: "none",
},
CommandSemanticContract {
command: Command::ResolveBackupAction,
admissible_errors: &[
ErrorCode::Aborted,
ErrorCode::DeadlineExceeded,
ErrorCode::InvalidRequest,
ErrorCode::UnsupportedVersion,
ErrorCode::Unauthenticated,
ErrorCode::PermissionDenied,
ErrorCode::NotFound,
ErrorCode::LimitExceeded,
ErrorCode::CapabilityUnavailable,
ErrorCode::TemporarilyUnavailable,
ErrorCode::Internal,
],
limit_ids: &["request_bytes", "response_bytes"],
effect_class: "read_only",
risk_flags: &[],
capability_family: "backup",
retry_safety: "safe",
identity_requirement: "caller_action_id",
resolver: None,
cancellation: "per_call",
side_effects: &[],
recovery: "retry",
collection_index_ref: "none",
},
CommandSemanticContract {
command: Command::GetRuntimeStatus,
admissible_errors: &[
ErrorCode::Aborted,
ErrorCode::DeadlineExceeded,
ErrorCode::InvalidRequest,
ErrorCode::UnsupportedVersion,
ErrorCode::Unauthenticated,
ErrorCode::PermissionDenied,
ErrorCode::NotFound,
ErrorCode::LimitExceeded,
ErrorCode::CapabilityUnavailable,
ErrorCode::TemporarilyUnavailable,
ErrorCode::Internal,
],
limit_ids: &["request_bytes", "response_bytes"],
effect_class: "read_only",
risk_flags: &[],
capability_family: "catalog",
retry_safety: "safe",
identity_requirement: "none",
resolver: None,
cancellation: "per_call",
side_effects: &[],
recovery: "retry",
collection_index_ref: "none",
},
CommandSemanticContract {
command: Command::GetResultCacheStatus,
admissible_errors: &[
ErrorCode::Aborted,
ErrorCode::DeadlineExceeded,
ErrorCode::InvalidRequest,
ErrorCode::UnsupportedVersion,
ErrorCode::Unauthenticated,
ErrorCode::PermissionDenied,
ErrorCode::NotFound,
ErrorCode::LimitExceeded,
ErrorCode::CapabilityUnavailable,
ErrorCode::TemporarilyUnavailable,
ErrorCode::Internal,
],
limit_ids: &["request_bytes", "response_bytes"],
effect_class: "read_only",
risk_flags: &[],
capability_family: "catalog",
retry_safety: "safe",
identity_requirement: "none",
resolver: None,
cancellation: "per_call",
side_effects: &[],
recovery: "retry",
collection_index_ref: "none",
},
CommandSemanticContract {
command: Command::GetFieldPromotionStatus,
admissible_errors: &[
ErrorCode::Aborted,
ErrorCode::DeadlineExceeded,
ErrorCode::InvalidRequest,
ErrorCode::UnsupportedVersion,
ErrorCode::Unauthenticated,
ErrorCode::PermissionDenied,
ErrorCode::NotFound,
ErrorCode::LimitExceeded,
ErrorCode::CapabilityUnavailable,
ErrorCode::TemporarilyUnavailable,
ErrorCode::Internal,
],
limit_ids: &["request_bytes", "response_bytes"],
effect_class: "read_only",
risk_flags: &[],
capability_family: "catalog",
retry_safety: "safe",
identity_requirement: "none",
resolver: None,
cancellation: "per_call",
side_effects: &[],
recovery: "retry",
collection_index_ref: "none",
},
CommandSemanticContract {
command: Command::GetOverloadStatus,
admissible_errors: &[
ErrorCode::Aborted,
ErrorCode::DeadlineExceeded,
ErrorCode::InvalidRequest,
ErrorCode::UnsupportedVersion,
ErrorCode::Unauthenticated,
ErrorCode::PermissionDenied,
ErrorCode::NotFound,
ErrorCode::LimitExceeded,
ErrorCode::CapabilityUnavailable,
ErrorCode::TemporarilyUnavailable,
ErrorCode::Internal,
],
limit_ids: &["request_bytes", "response_bytes"],
effect_class: "read_only",
risk_flags: &[],
capability_family: "catalog",
retry_safety: "safe",
identity_requirement: "none",
resolver: None,
cancellation: "per_call",
side_effects: &[],
recovery: "retry",
collection_index_ref: "none",
},
CommandSemanticContract {
command: Command::ConfigureExternalKey,
admissible_errors: &[
ErrorCode::Aborted,
ErrorCode::DeadlineExceeded,
ErrorCode::InvalidRequest,
ErrorCode::UnsupportedVersion,
ErrorCode::Unauthenticated,
ErrorCode::PermissionDenied,
ErrorCode::NotFound,
ErrorCode::Conflict,
ErrorCode::LimitExceeded,
ErrorCode::CapabilityUnavailable,
ErrorCode::NotSubmitted,
ErrorCode::SubmittedIndeterminate,
ErrorCode::ExpiredUnknown,
ErrorCode::TemporarilyUnavailable,
ErrorCode::Internal,
],
limit_ids: &["request_bytes", "response_bytes"],
effect_class: "control_write",
risk_flags: &[],
capability_family: "lifecycle",
retry_safety: "pre_submit_only",
identity_requirement: "none",
resolver: None,
cancellation: "per_call_until_submission_then_resolve",
side_effects: &["commits_authoritative_state"],
recovery: "retry_if_not_submitted",
collection_index_ref: "request_index",
},
CommandSemanticContract {
command: Command::RotateExternalKeyBinding,
admissible_errors: &[
ErrorCode::Aborted,
ErrorCode::DeadlineExceeded,
ErrorCode::InvalidRequest,
ErrorCode::UnsupportedVersion,
ErrorCode::Unauthenticated,
ErrorCode::PermissionDenied,
ErrorCode::NotFound,
ErrorCode::Conflict,
ErrorCode::LimitExceeded,
ErrorCode::CapabilityUnavailable,
ErrorCode::NotSubmitted,
ErrorCode::SubmittedIndeterminate,
ErrorCode::ExpiredUnknown,
ErrorCode::TemporarilyUnavailable,
ErrorCode::Internal,
],
limit_ids: &["request_bytes", "response_bytes"],
effect_class: "control_write",
risk_flags: &[],
capability_family: "lifecycle",
retry_safety: "pre_submit_only",
identity_requirement: "none",
resolver: None,
cancellation: "per_call_until_submission_then_resolve",
side_effects: &["commits_authoritative_state"],
recovery: "retry_if_not_submitted",
collection_index_ref: "request_index",
},
CommandSemanticContract {
command: Command::ConfigureAggregateThenDelete,
admissible_errors: &[
ErrorCode::Aborted,
ErrorCode::DeadlineExceeded,
ErrorCode::InvalidRequest,
ErrorCode::UnsupportedVersion,
ErrorCode::Unauthenticated,
ErrorCode::PermissionDenied,
ErrorCode::NotFound,
ErrorCode::Conflict,
ErrorCode::LimitExceeded,
ErrorCode::CapabilityUnavailable,
ErrorCode::NotSubmitted,
ErrorCode::SubmittedIndeterminate,
ErrorCode::ExpiredUnknown,
ErrorCode::TemporarilyUnavailable,
ErrorCode::Internal,
],
limit_ids: &["request_bytes", "response_bytes"],
effect_class: "control_write",
risk_flags: &["destructive"],
capability_family: "lifecycle",
retry_safety: "pre_submit_only",
identity_requirement: "none",
resolver: None,
cancellation: "per_call_until_submission_then_resolve",
side_effects: &["commits_authoritative_state"],
recovery: "retry_if_not_submitted",
collection_index_ref: "request_index",
},
CommandSemanticContract {
command: Command::GetLifecycleStatus,
admissible_errors: &[
ErrorCode::Aborted,
ErrorCode::DeadlineExceeded,
ErrorCode::InvalidRequest,
ErrorCode::UnsupportedVersion,
ErrorCode::Unauthenticated,
ErrorCode::PermissionDenied,
ErrorCode::NotFound,
ErrorCode::LimitExceeded,
ErrorCode::CapabilityUnavailable,
ErrorCode::TemporarilyUnavailable,
ErrorCode::Internal,
],
limit_ids: &["request_bytes", "response_bytes"],
effect_class: "read_only",
risk_flags: &[],
capability_family: "catalog",
retry_safety: "safe",
identity_requirement: "none",
resolver: None,
cancellation: "per_call",
side_effects: &[],
recovery: "retry",
collection_index_ref: "none",
},
CommandSemanticContract {
command: Command::GetQuota,
admissible_errors: &[
ErrorCode::Aborted,
ErrorCode::DeadlineExceeded,
ErrorCode::InvalidRequest,
ErrorCode::UnsupportedVersion,
ErrorCode::Unauthenticated,
ErrorCode::PermissionDenied,
ErrorCode::NotFound,
ErrorCode::LimitExceeded,
ErrorCode::CapabilityUnavailable,
ErrorCode::TemporarilyUnavailable,
ErrorCode::Internal,
],
limit_ids: &["request_bytes", "response_bytes"],
effect_class: "read_only",
risk_flags: &[],
capability_family: "quota",
retry_safety: "safe",
identity_requirement: "none",
resolver: None,
cancellation: "per_call",
side_effects: &[],
recovery: "retry",
collection_index_ref: "none",
},
CommandSemanticContract {
command: Command::UpdateQuota,
admissible_errors: &[
ErrorCode::Aborted,
ErrorCode::DeadlineExceeded,
ErrorCode::InvalidRequest,
ErrorCode::UnsupportedVersion,
ErrorCode::Unauthenticated,
ErrorCode::PermissionDenied,
ErrorCode::NotFound,
ErrorCode::Conflict,
ErrorCode::LimitExceeded,
ErrorCode::CapabilityUnavailable,
ErrorCode::NotSubmitted,
ErrorCode::SubmittedIndeterminate,
ErrorCode::ExpiredUnknown,
ErrorCode::TemporarilyUnavailable,
ErrorCode::Internal,
],
limit_ids: &["request_bytes", "response_bytes"],
effect_class: "control_write",
risk_flags: &[],
capability_family: "quota",
retry_safety: "pre_submit_only",
identity_requirement: "none",
resolver: None,
cancellation: "per_call_until_submission_then_resolve",
side_effects: &["commits_authoritative_state"],
recovery: "retry_if_not_submitted",
collection_index_ref: "none",
},
CommandSemanticContract {
command: Command::GetBinding,
admissible_errors: &[
ErrorCode::Aborted,
ErrorCode::DeadlineExceeded,
ErrorCode::InvalidRequest,
ErrorCode::UnsupportedVersion,
ErrorCode::Unauthenticated,
ErrorCode::PermissionDenied,
ErrorCode::NotFound,
ErrorCode::LimitExceeded,
ErrorCode::CapabilityUnavailable,
ErrorCode::TemporarilyUnavailable,
ErrorCode::Internal,
],
limit_ids: &["request_bytes", "response_bytes"],
effect_class: "read_only",
risk_flags: &[],
capability_family: "runtime_control",
retry_safety: "safe",
identity_requirement: "none",
resolver: None,
cancellation: "per_call",
side_effects: &[],
recovery: "retry",
collection_index_ref: "none",
},
CommandSemanticContract {
command: Command::GetAdmissionStatus,
admissible_errors: &[
ErrorCode::Aborted,
ErrorCode::DeadlineExceeded,
ErrorCode::InvalidRequest,
ErrorCode::UnsupportedVersion,
ErrorCode::Unauthenticated,
ErrorCode::PermissionDenied,
ErrorCode::NotFound,
ErrorCode::LimitExceeded,
ErrorCode::CapabilityUnavailable,
ErrorCode::TemporarilyUnavailable,
ErrorCode::Internal,
],
limit_ids: &["request_bytes", "response_bytes"],
effect_class: "read_only",
risk_flags: &[],
capability_family: "runtime_control",
retry_safety: "safe",
identity_requirement: "none",
resolver: None,
cancellation: "per_call",
side_effects: &[],
recovery: "retry",
collection_index_ref: "none",
},
CommandSemanticContract {
command: Command::SetAdmission,
admissible_errors: &[
ErrorCode::Aborted,
ErrorCode::DeadlineExceeded,
ErrorCode::InvalidRequest,
ErrorCode::UnsupportedVersion,
ErrorCode::Unauthenticated,
ErrorCode::PermissionDenied,
ErrorCode::NotFound,
ErrorCode::Conflict,
ErrorCode::LimitExceeded,
ErrorCode::CapabilityUnavailable,
ErrorCode::NotSubmitted,
ErrorCode::SubmittedIndeterminate,
ErrorCode::ExpiredUnknown,
ErrorCode::TemporarilyUnavailable,
ErrorCode::Internal,
],
limit_ids: &["request_bytes", "response_bytes"],
effect_class: "control_write",
risk_flags: &[],
capability_family: "runtime_control",
retry_safety: "pre_submit_only",
identity_requirement: "none",
resolver: None,
cancellation: "per_call_until_submission_then_resolve",
side_effects: &["commits_authoritative_state"],
recovery: "retry_if_not_submitted",
collection_index_ref: "none",
},
CommandSemanticContract {
command: Command::GetQuiesceStatus,
admissible_errors: &[
ErrorCode::Aborted,
ErrorCode::DeadlineExceeded,
ErrorCode::InvalidRequest,
ErrorCode::UnsupportedVersion,
ErrorCode::Unauthenticated,
ErrorCode::PermissionDenied,
ErrorCode::NotFound,
ErrorCode::LimitExceeded,
ErrorCode::CapabilityUnavailable,
ErrorCode::TemporarilyUnavailable,
ErrorCode::Internal,
],
limit_ids: &["request_bytes", "response_bytes"],
effect_class: "read_only",
risk_flags: &[],
capability_family: "runtime_control",
retry_safety: "safe",
identity_requirement: "none",
resolver: None,
cancellation: "per_call",
side_effects: &[],
recovery: "retry",
collection_index_ref: "none",
},
CommandSemanticContract {
command: Command::GetDecommissionReadiness,
admissible_errors: &[
ErrorCode::Aborted,
ErrorCode::DeadlineExceeded,
ErrorCode::InvalidRequest,
ErrorCode::UnsupportedVersion,
ErrorCode::Unauthenticated,
ErrorCode::PermissionDenied,
ErrorCode::NotFound,
ErrorCode::LimitExceeded,
ErrorCode::CapabilityUnavailable,
ErrorCode::TemporarilyUnavailable,
ErrorCode::Internal,
],
limit_ids: &["request_bytes", "response_bytes"],
effect_class: "read_only",
risk_flags: &[],
capability_family: "runtime_control",
retry_safety: "safe",
identity_requirement: "none",
resolver: None,
cancellation: "per_call",
side_effects: &[],
recovery: "retry",
collection_index_ref: "none",
},
CommandSemanticContract {
command: Command::GetUpgradeReadiness,
admissible_errors: &[
ErrorCode::Aborted,
ErrorCode::DeadlineExceeded,
ErrorCode::InvalidRequest,
ErrorCode::UnsupportedVersion,
ErrorCode::Unauthenticated,
ErrorCode::PermissionDenied,
ErrorCode::NotFound,
ErrorCode::LimitExceeded,
ErrorCode::CapabilityUnavailable,
ErrorCode::TemporarilyUnavailable,
ErrorCode::Internal,
],
limit_ids: &["request_bytes", "response_bytes"],
effect_class: "read_only",
risk_flags: &[],
capability_family: "operations",
retry_safety: "safe",
identity_requirement: "none",
resolver: None,
cancellation: "per_call",
side_effects: &[],
recovery: "retry",
collection_index_ref: "none",
},
CommandSemanticContract {
command: Command::GetMaintenanceStatus,
admissible_errors: &[
ErrorCode::Aborted,
ErrorCode::DeadlineExceeded,
ErrorCode::InvalidRequest,
ErrorCode::UnsupportedVersion,
ErrorCode::Unauthenticated,
ErrorCode::PermissionDenied,
ErrorCode::NotFound,
ErrorCode::StaleCursor,
ErrorCode::LimitExceeded,
ErrorCode::CapabilityUnavailable,
ErrorCode::TemporarilyUnavailable,
ErrorCode::Internal,
],
limit_ids: &["request_bytes", "response_bytes", "page_size", "operation_page_size"],
effect_class: "read_only",
risk_flags: &[],
capability_family: "operations",
retry_safety: "safe",
identity_requirement: "none",
resolver: None,
cancellation: "per_call",
side_effects: &[],
recovery: "retry",
collection_index_ref: "optional_request_index",
},
CommandSemanticContract {
command: Command::GetRestoreReadiness,
admissible_errors: &[
ErrorCode::Aborted,
ErrorCode::DeadlineExceeded,
ErrorCode::InvalidRequest,
ErrorCode::UnsupportedVersion,
ErrorCode::Unauthenticated,
ErrorCode::PermissionDenied,
ErrorCode::NotFound,
ErrorCode::LimitExceeded,
ErrorCode::CapabilityUnavailable,
ErrorCode::TemporarilyUnavailable,
ErrorCode::Internal,
],
limit_ids: &["request_bytes", "response_bytes"],
effect_class: "read_only",
risk_flags: &[],
capability_family: "backup",
retry_safety: "safe",
identity_requirement: "none",
resolver: None,
cancellation: "per_call",
side_effects: &[],
recovery: "retry",
collection_index_ref: "none",
},
CommandSemanticContract {
command: Command::WarmVectorIndex,
admissible_errors: &[
ErrorCode::Aborted,
ErrorCode::DeadlineExceeded,
ErrorCode::InvalidRequest,
ErrorCode::UnsupportedVersion,
ErrorCode::Unauthenticated,
ErrorCode::PermissionDenied,
ErrorCode::NotFound,
ErrorCode::Conflict,
ErrorCode::LimitExceeded,
ErrorCode::CapabilityUnavailable,
ErrorCode::TemporarilyUnavailable,
ErrorCode::Internal,
],
limit_ids: &[
"request_bytes",
"response_bytes",
"vector_warm_components",
"vector_warm_requests",
"vector_warm_bytes",
"vector_warm_achievements",
"vector_warm_ttl_millis",
],
effect_class: "read_only",
risk_flags: &[],
capability_family: "data",
retry_safety: "safe",
identity_requirement: "exact_root",
resolver: None,
cancellation: "per_call",
side_effects: &["populates_reconstructible_cache"],
recovery: "retry",
collection_index_ref: "request_index",
},
CommandSemanticContract {
command: Command::EvaluateVectorRecall,
admissible_errors: &[
ErrorCode::Aborted,
ErrorCode::DeadlineExceeded,
ErrorCode::InvalidRequest,
ErrorCode::UnsupportedVersion,
ErrorCode::Unauthenticated,
ErrorCode::PermissionDenied,
ErrorCode::NotFound,
ErrorCode::Conflict,
ErrorCode::LimitExceeded,
ErrorCode::CapabilityUnavailable,
ErrorCode::NotSubmitted,
ErrorCode::SubmittedIndeterminate,
ErrorCode::ExpiredUnknown,
ErrorCode::TemporarilyUnavailable,
ErrorCode::Internal,
],
limit_ids: &[
"request_bytes",
"response_bytes",
"vector_dimensions",
"vector_query_bytes",
"vector_request_bytes",
"vector_candidates",
"vector_evaluation_queries",
"vector_evaluation_k",
"vector_evaluation_artifact_bytes",
],
effect_class: "durable_submit",
risk_flags: &[],
capability_family: "diagnostics",
retry_safety: "pre_submit_only",
identity_requirement: "caller_action_id",
resolver: None,
cancellation: "per_call_until_submission_then_resolve",
side_effects: &["commits_authoritative_state"],
recovery: "retry_if_not_submitted",
collection_index_ref: "request_index",
},
CommandSemanticContract {
command: Command::CalibrateVectorStrategy,
admissible_errors: &[
ErrorCode::Aborted,
ErrorCode::DeadlineExceeded,
ErrorCode::InvalidRequest,
ErrorCode::UnsupportedVersion,
ErrorCode::Unauthenticated,
ErrorCode::PermissionDenied,
ErrorCode::NotFound,
ErrorCode::Conflict,
ErrorCode::LimitExceeded,
ErrorCode::CapabilityUnavailable,
ErrorCode::NotSubmitted,
ErrorCode::SubmittedIndeterminate,
ErrorCode::ExpiredUnknown,
ErrorCode::TemporarilyUnavailable,
ErrorCode::Internal,
],
limit_ids: &[
"request_bytes",
"response_bytes",
"vector_dimensions",
"vector_query_bytes",
"vector_request_bytes",
"vector_candidates",
"vector_evaluation_queries",
"vector_evaluation_k",
"vector_evaluation_profiles",
"vector_evaluation_artifact_bytes",
],
effect_class: "durable_submit",
risk_flags: &[],
capability_family: "diagnostics",
retry_safety: "pre_submit_only",
identity_requirement: "caller_action_id",
resolver: None,
cancellation: "per_call_until_submission_then_resolve",
side_effects: &["commits_authoritative_state"],
recovery: "retry_if_not_submitted",
collection_index_ref: "request_index",
},
CommandSemanticContract {
command: Command::GetVectorDiagnostic,
admissible_errors: &[
ErrorCode::Aborted,
ErrorCode::DeadlineExceeded,
ErrorCode::InvalidRequest,
ErrorCode::UnsupportedVersion,
ErrorCode::Unauthenticated,
ErrorCode::PermissionDenied,
ErrorCode::NotFound,
ErrorCode::LimitExceeded,
ErrorCode::CapabilityUnavailable,
ErrorCode::TemporarilyUnavailable,
ErrorCode::Internal,
],
limit_ids: &["request_bytes", "response_bytes"],
effect_class: "read_only",
risk_flags: &[],
capability_family: "diagnostics",
retry_safety: "safe",
identity_requirement: "request_locator",
resolver: None,
cancellation: "per_call",
side_effects: &[],
recovery: "retry",
collection_index_ref: "none",
},
CommandSemanticContract {
command: Command::CreateDiagnostic,
admissible_errors: &[
ErrorCode::Aborted,
ErrorCode::DeadlineExceeded,
ErrorCode::InvalidRequest,
ErrorCode::UnsupportedVersion,
ErrorCode::Unauthenticated,
ErrorCode::PermissionDenied,
ErrorCode::NotFound,
ErrorCode::Conflict,
ErrorCode::LimitExceeded,
ErrorCode::CapabilityUnavailable,
ErrorCode::NotSubmitted,
ErrorCode::SubmittedIndeterminate,
ErrorCode::ExpiredUnknown,
ErrorCode::TemporarilyUnavailable,
ErrorCode::Internal,
],
limit_ids: &["request_bytes", "response_bytes"],
effect_class: "durable_submit",
risk_flags: &[],
capability_family: "diagnostics",
retry_safety: "pre_submit_only",
identity_requirement: "none",
resolver: None,
cancellation: "per_call_until_submission_then_resolve",
side_effects: &["commits_authoritative_state"],
recovery: "retry_if_not_submitted",
collection_index_ref: "none",
},
CommandSemanticContract {
command: Command::GetDiagnostic,
admissible_errors: &[
ErrorCode::Aborted,
ErrorCode::DeadlineExceeded,
ErrorCode::InvalidRequest,
ErrorCode::UnsupportedVersion,
ErrorCode::Unauthenticated,
ErrorCode::PermissionDenied,
ErrorCode::NotFound,
ErrorCode::LimitExceeded,
ErrorCode::CapabilityUnavailable,
ErrorCode::TemporarilyUnavailable,
ErrorCode::Internal,
],
limit_ids: &["request_bytes", "response_bytes"],
effect_class: "read_only",
risk_flags: &[],
capability_family: "diagnostics",
retry_safety: "safe",
identity_requirement: "request_locator",
resolver: None,
cancellation: "per_call",
side_effects: &[],
recovery: "retry",
collection_index_ref: "none",
},
CommandSemanticContract {
command: Command::ReadArtifactChunk,
admissible_errors: &[
ErrorCode::Aborted,
ErrorCode::DeadlineExceeded,
ErrorCode::InvalidRequest,
ErrorCode::UnsupportedVersion,
ErrorCode::Unauthenticated,
ErrorCode::PermissionDenied,
ErrorCode::NotFound,
ErrorCode::LimitExceeded,
ErrorCode::CapabilityUnavailable,
ErrorCode::ArtifactRangeInvalid,
ErrorCode::ChecksumMismatch,
ErrorCode::TemporarilyUnavailable,
ErrorCode::Internal,
],
limit_ids: &["request_bytes", "response_bytes", "artifact_chunk_bytes"],
effect_class: "read_only",
risk_flags: &[],
capability_family: "operations",
retry_safety: "safe",
identity_requirement: "none",
resolver: None,
cancellation: "per_call",
side_effects: &[],
recovery: "retry",
collection_index_ref: "none",
},
CommandSemanticContract {
command: Command::ExportUsage,
admissible_errors: &[
ErrorCode::Aborted,
ErrorCode::DeadlineExceeded,
ErrorCode::InvalidRequest,
ErrorCode::UnsupportedVersion,
ErrorCode::Unauthenticated,
ErrorCode::PermissionDenied,
ErrorCode::NotFound,
ErrorCode::StaleCursor,
ErrorCode::RestartBudgetExhausted,
ErrorCode::LimitExceeded,
ErrorCode::CapabilityUnavailable,
ErrorCode::TemporarilyUnavailable,
ErrorCode::Internal,
],
limit_ids: &["request_bytes", "response_bytes", "page_size"],
effect_class: "read_only",
risk_flags: &[],
capability_family: "usage",
retry_safety: "safe",
identity_requirement: "none",
resolver: None,
cancellation: "per_call",
side_effects: &[],
recovery: "retry",
collection_index_ref: "none",
},
CommandSemanticContract {
command: Command::ExecuteStateRead,
admissible_errors: &[
ErrorCode::Aborted,
ErrorCode::DeadlineExceeded,
ErrorCode::InvalidRequest,
ErrorCode::UnsupportedVersion,
ErrorCode::Unauthenticated,
ErrorCode::PermissionDenied,
ErrorCode::NotFound,
ErrorCode::LimitExceeded,
ErrorCode::CapabilityUnavailable,
ErrorCode::TemporarilyUnavailable,
ErrorCode::Internal,
],
limit_ids: &[
"request_bytes",
"response_bytes",
"state_command_keys",
"state_command_value_bytes",
],
effect_class: "read_only",
risk_flags: &[],
capability_family: "data",
retry_safety: "safe",
identity_requirement: "none",
resolver: None,
cancellation: "per_call",
side_effects: &[],
recovery: "retry",
collection_index_ref: "request_index",
},
CommandSemanticContract {
command: Command::PrepareStateWrite,
admissible_errors: &[
ErrorCode::Aborted,
ErrorCode::DeadlineExceeded,
ErrorCode::InvalidRequest,
ErrorCode::UnsupportedVersion,
ErrorCode::Unauthenticated,
ErrorCode::PermissionDenied,
ErrorCode::NotFound,
ErrorCode::LimitExceeded,
ErrorCode::CapabilityUnavailable,
ErrorCode::TemporarilyUnavailable,
ErrorCode::Internal,
],
limit_ids: &[
"request_bytes",
"response_bytes",
"state_command_keys",
"state_command_value_bytes",
],
effect_class: "prepare",
risk_flags: &[],
capability_family: "data",
retry_safety: "safe",
identity_requirement: "caller_action_id",
resolver: None,
cancellation: "per_call",
side_effects: &["creates_bounded_preparation"],
recovery: "retry",
collection_index_ref: "request_index",
},
CommandSemanticContract {
command: Command::SubmitStateWrite,
admissible_errors: &[
ErrorCode::Aborted,
ErrorCode::DeadlineExceeded,
ErrorCode::InvalidRequest,
ErrorCode::UnsupportedVersion,
ErrorCode::Unauthenticated,
ErrorCode::PermissionDenied,
ErrorCode::NotFound,
ErrorCode::Conflict,
ErrorCode::LimitExceeded,
ErrorCode::CapabilityUnavailable,
ErrorCode::NotSubmitted,
ErrorCode::SubmittedIndeterminate,
ErrorCode::ExpiredUnknown,
ErrorCode::TemporarilyUnavailable,
ErrorCode::Internal,
],
limit_ids: &[
"request_bytes",
"response_bytes",
"state_command_keys",
"state_command_value_bytes",
],
effect_class: "durable_submit",
risk_flags: &[],
capability_family: "data",
retry_safety: "pre_submit_only",
identity_requirement: "request_locator",
resolver: Some(Command::ResolveStateWrite),
cancellation: "per_call_until_submission_then_resolve",
side_effects: &["commits_authoritative_state"],
recovery: "resolve_with_resolve_state_write",
collection_index_ref: "request_index",
},
CommandSemanticContract {
command: Command::ResolveStateWrite,
admissible_errors: &[
ErrorCode::Aborted,
ErrorCode::DeadlineExceeded,
ErrorCode::InvalidRequest,
ErrorCode::UnsupportedVersion,
ErrorCode::Unauthenticated,
ErrorCode::PermissionDenied,
ErrorCode::NotFound,
ErrorCode::LimitExceeded,
ErrorCode::CapabilityUnavailable,
ErrorCode::TemporarilyUnavailable,
ErrorCode::Internal,
],
limit_ids: &[
"request_bytes",
"response_bytes",
"state_command_keys",
"state_command_value_bytes",
],
effect_class: "read_only",
risk_flags: &[],
capability_family: "data",
retry_safety: "safe",
identity_requirement: "request_locator",
resolver: None,
cancellation: "per_call",
side_effects: &[],
recovery: "retry",
collection_index_ref: "request_index",
},
];
#[derive(Clone, Copy, Debug, Eq, PartialEq)]
pub struct CommandOutcomeContract {
pub command: Command,
pub pre_submit_retry_safe: bool,
pub possible_submission_states: &'static [&'static str],
pub identity_requirement: &'static str,
pub resolver_command: Option<Command>,
pub cancellation: &'static str,
pub bounded_retry_after: bool,
}
pub const LODESTONE_API_COMMAND_OUTCOMES: &[CommandOutcomeContract] = &[
CommandOutcomeContract {
command: Command::Discover,
pre_submit_retry_safe: true,
possible_submission_states: &["not_submitted", "resolved"],
identity_requirement: "none",
resolver_command: None,
cancellation: "per_call",
bounded_retry_after: true,
},
CommandOutcomeContract {
command: Command::ListIndexes,
pre_submit_retry_safe: true,
possible_submission_states: &["not_submitted", "resolved"],
identity_requirement: "none",
resolver_command: None,
cancellation: "per_call",
bounded_retry_after: true,
},
CommandOutcomeContract {
command: Command::GetIndex,
pre_submit_retry_safe: true,
possible_submission_states: &["not_submitted", "resolved"],
identity_requirement: "none",
resolver_command: None,
cancellation: "per_call",
bounded_retry_after: true,
},
CommandOutcomeContract {
command: Command::ValidateIndexChange,
pre_submit_retry_safe: true,
possible_submission_states: &["not_submitted", "resolved"],
identity_requirement: "none",
resolver_command: None,
cancellation: "per_call",
bounded_retry_after: true,
},
CommandOutcomeContract {
command: Command::ApplyIndexChange,
pre_submit_retry_safe: true,
possible_submission_states: &["not_submitted", "submitted", "indeterminate", "resolved"],
identity_requirement: "caller_action_id",
resolver_command: None,
cancellation: "per_call_until_submission_then_resolve",
bounded_retry_after: true,
},
CommandOutcomeContract {
command: Command::ApplyAdministrationMutation,
pre_submit_retry_safe: true,
possible_submission_states: &["not_submitted", "submitted", "indeterminate", "resolved"],
identity_requirement: "caller_action_id",
resolver_command: None,
cancellation: "per_call_until_submission_then_resolve",
bounded_retry_after: true,
},
CommandOutcomeContract {
command: Command::ListAliases,
pre_submit_retry_safe: true,
possible_submission_states: &["not_submitted", "resolved"],
identity_requirement: "none",
resolver_command: None,
cancellation: "per_call",
bounded_retry_after: true,
},
CommandOutcomeContract {
command: Command::GetAlias,
pre_submit_retry_safe: true,
possible_submission_states: &["not_submitted", "resolved"],
identity_requirement: "none",
resolver_command: None,
cancellation: "per_call",
bounded_retry_after: true,
},
CommandOutcomeContract {
command: Command::ListDataStreams,
pre_submit_retry_safe: true,
possible_submission_states: &["not_submitted", "resolved"],
identity_requirement: "none",
resolver_command: None,
cancellation: "per_call",
bounded_retry_after: true,
},
CommandOutcomeContract {
command: Command::GetDataStream,
pre_submit_retry_safe: true,
possible_submission_states: &["not_submitted", "resolved"],
identity_requirement: "none",
resolver_command: None,
cancellation: "per_call",
bounded_retry_after: true,
},
CommandOutcomeContract {
command: Command::ListComponentTemplates,
pre_submit_retry_safe: true,
possible_submission_states: &["not_submitted", "resolved"],
identity_requirement: "none",
resolver_command: None,
cancellation: "per_call",
bounded_retry_after: true,
},
CommandOutcomeContract {
command: Command::GetComponentTemplate,
pre_submit_retry_safe: true,
possible_submission_states: &["not_submitted", "resolved"],
identity_requirement: "none",
resolver_command: None,
cancellation: "per_call",
bounded_retry_after: true,
},
CommandOutcomeContract {
command: Command::ListIndexTemplates,
pre_submit_retry_safe: true,
possible_submission_states: &["not_submitted", "resolved"],
identity_requirement: "none",
resolver_command: None,
cancellation: "per_call",
bounded_retry_after: true,
},
CommandOutcomeContract {
command: Command::GetIndexTemplate,
pre_submit_retry_safe: true,
possible_submission_states: &["not_submitted", "resolved"],
identity_requirement: "none",
resolver_command: None,
cancellation: "per_call",
bounded_retry_after: true,
},
CommandOutcomeContract {
command: Command::ListIngestPipelines,
pre_submit_retry_safe: true,
possible_submission_states: &["not_submitted", "resolved"],
identity_requirement: "none",
resolver_command: None,
cancellation: "per_call",
bounded_retry_after: true,
},
CommandOutcomeContract {
command: Command::GetIngestPipeline,
pre_submit_retry_safe: true,
possible_submission_states: &["not_submitted", "resolved"],
identity_requirement: "none",
resolver_command: None,
cancellation: "per_call",
bounded_retry_after: true,
},
CommandOutcomeContract {
command: Command::SimulateIngestPipeline,
pre_submit_retry_safe: true,
possible_submission_states: &["not_submitted", "resolved"],
identity_requirement: "none",
resolver_command: None,
cancellation: "per_call",
bounded_retry_after: true,
},
CommandOutcomeContract {
command: Command::ReprocessByQuery,
pre_submit_retry_safe: true,
possible_submission_states: &[
"not_submitted",
"submitted",
"known_retired",
"indeterminate",
"resolved",
],
identity_requirement: "caller_action_id",
resolver_command: None,
cancellation: "per_call_until_submission_then_resolve",
bounded_retry_after: true,
},
CommandOutcomeContract {
command: Command::ListLifecyclePolicies,
pre_submit_retry_safe: true,
possible_submission_states: &["not_submitted", "resolved"],
identity_requirement: "none",
resolver_command: None,
cancellation: "per_call",
bounded_retry_after: true,
},
CommandOutcomeContract {
command: Command::GetLifecyclePolicy,
pre_submit_retry_safe: true,
possible_submission_states: &["not_submitted", "resolved"],
identity_requirement: "none",
resolver_command: None,
cancellation: "per_call",
bounded_retry_after: true,
},
CommandOutcomeContract {
command: Command::PrepareCreateIndex,
pre_submit_retry_safe: true,
possible_submission_states: &["not_submitted", "resolved"],
identity_requirement: "server_locator",
resolver_command: None,
cancellation: "per_call",
bounded_retry_after: true,
},
CommandOutcomeContract {
command: Command::PrepareDeleteIndex,
pre_submit_retry_safe: true,
possible_submission_states: &["not_submitted", "resolved"],
identity_requirement: "server_locator",
resolver_command: None,
cancellation: "per_call",
bounded_retry_after: true,
},
CommandOutcomeContract {
command: Command::SubmitCatalogAction,
pre_submit_retry_safe: true,
possible_submission_states: &[
"not_submitted",
"submitted",
"known_retired",
"indeterminate",
"resolved",
],
identity_requirement: "request_locator",
resolver_command: Some(Command::ResolveCatalogAction),
cancellation: "per_call_until_submission_then_resolve",
bounded_retry_after: true,
},
CommandOutcomeContract {
command: Command::ResolveCatalogAction,
pre_submit_retry_safe: true,
possible_submission_states: &["not_submitted", "resolved"],
identity_requirement: "request_locator",
resolver_command: None,
cancellation: "per_call",
bounded_retry_after: true,
},
CommandOutcomeContract {
command: Command::PrepareReplayableSourceIndex,
pre_submit_retry_safe: true,
possible_submission_states: &["not_submitted", "resolved"],
identity_requirement: "server_locator",
resolver_command: None,
cancellation: "per_call",
bounded_retry_after: true,
},
CommandOutcomeContract {
command: Command::SubmitReplayableSourceIndex,
pre_submit_retry_safe: true,
possible_submission_states: &[
"not_submitted",
"submitted",
"known_retired",
"indeterminate",
"resolved",
],
identity_requirement: "request_locator",
resolver_command: Some(Command::ResolveCatalogAction),
cancellation: "per_call_until_submission_then_resolve",
bounded_retry_after: true,
},
CommandOutcomeContract {
command: Command::GetReplayableSource,
pre_submit_retry_safe: true,
possible_submission_states: &["not_submitted", "resolved"],
identity_requirement: "none",
resolver_command: None,
cancellation: "per_call",
bounded_retry_after: true,
},
CommandOutcomeContract {
command: Command::ControlReplayableSource,
pre_submit_retry_safe: true,
possible_submission_states: &["not_submitted", "submitted", "indeterminate", "resolved"],
identity_requirement: "none",
resolver_command: None,
cancellation: "per_call_until_submission_then_resolve",
bounded_retry_after: true,
},
CommandOutcomeContract {
command: Command::CloneIndex,
pre_submit_retry_safe: true,
possible_submission_states: &[
"not_submitted",
"submitted",
"known_retired",
"indeterminate",
"resolved",
],
identity_requirement: "caller_action_id",
resolver_command: Some(Command::CloneIndex),
cancellation: "per_call_until_submission_then_resolve",
bounded_retry_after: true,
},
CommandOutcomeContract {
command: Command::ConfigureHistory,
pre_submit_retry_safe: true,
possible_submission_states: &[
"not_submitted",
"submitted",
"known_retired",
"indeterminate",
"resolved",
],
identity_requirement: "none",
resolver_command: Some(Command::GetHistory),
cancellation: "per_call_until_submission_then_resolve",
bounded_retry_after: true,
},
CommandOutcomeContract {
command: Command::GetHistory,
pre_submit_retry_safe: true,
possible_submission_states: &["not_submitted", "resolved"],
identity_requirement: "none",
resolver_command: None,
cancellation: "per_call",
bounded_retry_after: true,
},
CommandOutcomeContract {
command: Command::ResolveHistory,
pre_submit_retry_safe: true,
possible_submission_states: &["not_submitted", "resolved"],
identity_requirement: "none",
resolver_command: None,
cancellation: "per_call",
bounded_retry_after: true,
},
CommandOutcomeContract {
command: Command::PlaceHistoryHold,
pre_submit_retry_safe: true,
possible_submission_states: &[
"not_submitted",
"submitted",
"known_retired",
"indeterminate",
"resolved",
],
identity_requirement: "none",
resolver_command: Some(Command::GetHistory),
cancellation: "per_call_until_submission_then_resolve",
bounded_retry_after: true,
},
CommandOutcomeContract {
command: Command::ReleaseHistoryHold,
pre_submit_retry_safe: true,
possible_submission_states: &[
"not_submitted",
"submitted",
"known_retired",
"indeterminate",
"resolved",
],
identity_requirement: "none",
resolver_command: Some(Command::GetHistory),
cancellation: "per_call_until_submission_then_resolve",
bounded_retry_after: true,
},
CommandOutcomeContract {
command: Command::PrepareDocumentMutation,
pre_submit_retry_safe: true,
possible_submission_states: &["not_submitted", "resolved"],
identity_requirement: "server_locator",
resolver_command: None,
cancellation: "per_call",
bounded_retry_after: true,
},
CommandOutcomeContract {
command: Command::SubmitDocumentMutation,
pre_submit_retry_safe: true,
possible_submission_states: &[
"not_submitted",
"submitted",
"known_retired",
"indeterminate",
"resolved",
],
identity_requirement: "request_locator",
resolver_command: Some(Command::ResolveDocumentMutation),
cancellation: "per_call_until_submission_then_resolve",
bounded_retry_after: true,
},
CommandOutcomeContract {
command: Command::PrepareDocumentBulk,
pre_submit_retry_safe: true,
possible_submission_states: &["not_submitted", "resolved"],
identity_requirement: "caller_action_id",
resolver_command: None,
cancellation: "per_call",
bounded_retry_after: true,
},
CommandOutcomeContract {
command: Command::SubmitDocumentBulk,
pre_submit_retry_safe: true,
possible_submission_states: &[
"not_submitted",
"submitted",
"known_retired",
"indeterminate",
"resolved",
],
identity_requirement: "caller_action_id",
resolver_command: Some(Command::ResolveDocumentBulk),
cancellation: "per_call_until_submission_then_resolve",
bounded_retry_after: true,
},
CommandOutcomeContract {
command: Command::ResolveDocumentBulk,
pre_submit_retry_safe: true,
possible_submission_states: &["not_submitted", "resolved"],
identity_requirement: "caller_action_id",
resolver_command: None,
cancellation: "per_call",
bounded_retry_after: true,
},
CommandOutcomeContract {
command: Command::PrepareAppendBulk,
pre_submit_retry_safe: true,
possible_submission_states: &["not_submitted", "resolved"],
identity_requirement: "caller_action_id",
resolver_command: None,
cancellation: "per_call",
bounded_retry_after: true,
},
CommandOutcomeContract {
command: Command::SubmitAppendBulk,
pre_submit_retry_safe: true,
possible_submission_states: &["not_submitted", "submitted", "indeterminate", "resolved"],
identity_requirement: "request_locator",
resolver_command: Some(Command::ResolveAppendBulk),
cancellation: "per_call_until_submission_then_resolve",
bounded_retry_after: true,
},
CommandOutcomeContract {
command: Command::ResolveAppendBulk,
pre_submit_retry_safe: true,
possible_submission_states: &["not_submitted", "resolved"],
identity_requirement: "request_locator",
resolver_command: None,
cancellation: "per_call",
bounded_retry_after: true,
},
CommandOutcomeContract {
command: Command::ObserveAppendCommitted,
pre_submit_retry_safe: true,
possible_submission_states: &["not_submitted", "resolved"],
identity_requirement: "request_locator",
resolver_command: None,
cancellation: "per_call",
bounded_retry_after: true,
},
CommandOutcomeContract {
command: Command::ResolveDocumentMutation,
pre_submit_retry_safe: true,
possible_submission_states: &["not_submitted", "resolved"],
identity_requirement: "request_locator",
resolver_command: None,
cancellation: "per_call",
bounded_retry_after: true,
},
CommandOutcomeContract {
command: Command::GetDocument,
pre_submit_retry_safe: true,
possible_submission_states: &["not_submitted", "resolved"],
identity_requirement: "none",
resolver_command: None,
cancellation: "per_call",
bounded_retry_after: true,
},
CommandOutcomeContract {
command: Command::Search,
pre_submit_retry_safe: true,
possible_submission_states: &["not_submitted", "resolved"],
identity_requirement: "none",
resolver_command: None,
cancellation: "per_call",
bounded_retry_after: true,
},
CommandOutcomeContract {
command: Command::OpenPit,
pre_submit_retry_safe: true,
possible_submission_states: &["not_submitted", "submitted", "indeterminate", "resolved"],
identity_requirement: "none",
resolver_command: None,
cancellation: "per_call_until_submission_then_resolve",
bounded_retry_after: true,
},
CommandOutcomeContract {
command: Command::RenewPit,
pre_submit_retry_safe: true,
possible_submission_states: &["not_submitted", "submitted", "indeterminate", "resolved"],
identity_requirement: "none",
resolver_command: None,
cancellation: "per_call_until_submission_then_resolve",
bounded_retry_after: true,
},
CommandOutcomeContract {
command: Command::ClosePit,
pre_submit_retry_safe: true,
possible_submission_states: &["not_submitted", "submitted", "indeterminate", "resolved"],
identity_requirement: "none",
resolver_command: None,
cancellation: "per_call_until_submission_then_resolve",
bounded_retry_after: true,
},
CommandOutcomeContract {
command: Command::ListOperations,
pre_submit_retry_safe: true,
possible_submission_states: &["not_submitted", "resolved"],
identity_requirement: "none",
resolver_command: None,
cancellation: "per_call",
bounded_retry_after: true,
},
CommandOutcomeContract {
command: Command::GetOperation,
pre_submit_retry_safe: true,
possible_submission_states: &["not_submitted", "resolved"],
identity_requirement: "request_locator",
resolver_command: None,
cancellation: "per_call",
bounded_retry_after: true,
},
CommandOutcomeContract {
command: Command::CancelOperation,
pre_submit_retry_safe: true,
possible_submission_states: &["not_submitted", "submitted", "indeterminate", "resolved"],
identity_requirement: "request_locator",
resolver_command: None,
cancellation: "per_call_until_submission_then_resolve",
bounded_retry_after: true,
},
CommandOutcomeContract {
command: Command::ListAuditEvents,
pre_submit_retry_safe: true,
possible_submission_states: &["not_submitted", "resolved"],
identity_requirement: "none",
resolver_command: None,
cancellation: "per_call",
bounded_retry_after: true,
},
CommandOutcomeContract {
command: Command::ExportAuditEvents,
pre_submit_retry_safe: true,
possible_submission_states: &["not_submitted", "resolved"],
identity_requirement: "none",
resolver_command: None,
cancellation: "per_call",
bounded_retry_after: true,
},
CommandOutcomeContract {
command: Command::ReserveServiceCredential,
pre_submit_retry_safe: true,
possible_submission_states: &[
"not_submitted",
"submitted",
"known_retired",
"indeterminate",
"resolved",
],
identity_requirement: "caller_action_id",
resolver_command: Some(Command::ResolveServiceCredentialReservation),
cancellation: "per_call_until_submission_then_resolve",
bounded_retry_after: true,
},
CommandOutcomeContract {
command: Command::ReserveServiceCredentialRotation,
pre_submit_retry_safe: true,
possible_submission_states: &[
"not_submitted",
"submitted",
"known_retired",
"indeterminate",
"resolved",
],
identity_requirement: "caller_action_id",
resolver_command: Some(Command::ResolveServiceCredentialReservation),
cancellation: "per_call_until_submission_then_resolve",
bounded_retry_after: true,
},
CommandOutcomeContract {
command: Command::ActivateServiceCredential,
pre_submit_retry_safe: true,
possible_submission_states: &[
"not_submitted",
"submitted",
"known_retired",
"indeterminate",
"resolved",
],
identity_requirement: "server_locator",
resolver_command: Some(Command::ResolveServiceCredentialReservation),
cancellation: "per_call_until_submission_then_resolve",
bounded_retry_after: true,
},
CommandOutcomeContract {
command: Command::ResolveServiceCredentialReservation,
pre_submit_retry_safe: true,
possible_submission_states: &["not_submitted", "resolved"],
identity_requirement: "caller_action_id",
resolver_command: None,
cancellation: "per_call",
bounded_retry_after: true,
},
CommandOutcomeContract {
command: Command::PrepareRevokeServiceCredential,
pre_submit_retry_safe: true,
possible_submission_states: &["not_submitted", "resolved"],
identity_requirement: "server_locator",
resolver_command: None,
cancellation: "per_call",
bounded_retry_after: true,
},
CommandOutcomeContract {
command: Command::RevokeServiceCredential,
pre_submit_retry_safe: true,
possible_submission_states: &[
"not_submitted",
"submitted",
"known_retired",
"indeterminate",
"resolved",
],
identity_requirement: "request_locator",
resolver_command: Some(Command::ResolveSecurityAction),
cancellation: "per_call_until_submission_then_resolve",
bounded_retry_after: true,
},
CommandOutcomeContract {
command: Command::ResolveSecurityAction,
pre_submit_retry_safe: true,
possible_submission_states: &["not_submitted", "resolved"],
identity_requirement: "request_locator",
resolver_command: None,
cancellation: "per_call",
bounded_retry_after: true,
},
CommandOutcomeContract {
command: Command::GetSecurityRole,
pre_submit_retry_safe: true,
possible_submission_states: &["not_submitted", "resolved"],
identity_requirement: "none",
resolver_command: None,
cancellation: "per_call",
bounded_retry_after: true,
},
CommandOutcomeContract {
command: Command::PrepareRoleAppendAccessChange,
pre_submit_retry_safe: true,
possible_submission_states: &["not_submitted", "resolved"],
identity_requirement: "server_locator",
resolver_command: None,
cancellation: "per_call",
bounded_retry_after: true,
},
CommandOutcomeContract {
command: Command::SubmitRoleAppendAccessChange,
pre_submit_retry_safe: true,
possible_submission_states: &[
"not_submitted",
"submitted",
"known_retired",
"indeterminate",
"resolved",
],
identity_requirement: "request_locator",
resolver_command: Some(Command::ResolveSecurityAction),
cancellation: "per_call_until_submission_then_resolve",
bounded_retry_after: true,
},
CommandOutcomeContract {
command: Command::ListServiceCredentials,
pre_submit_retry_safe: true,
possible_submission_states: &["not_submitted", "resolved"],
identity_requirement: "none",
resolver_command: None,
cancellation: "per_call",
bounded_retry_after: true,
},
CommandOutcomeContract {
command: Command::ListBackups,
pre_submit_retry_safe: true,
possible_submission_states: &["not_submitted", "resolved"],
identity_requirement: "none",
resolver_command: None,
cancellation: "per_call",
bounded_retry_after: true,
},
CommandOutcomeContract {
command: Command::GetBackup,
pre_submit_retry_safe: true,
possible_submission_states: &["not_submitted", "resolved"],
identity_requirement: "request_locator",
resolver_command: None,
cancellation: "per_call",
bounded_retry_after: true,
},
CommandOutcomeContract {
command: Command::CreateBackup,
pre_submit_retry_safe: true,
possible_submission_states: &[
"not_submitted",
"submitted",
"known_retired",
"indeterminate",
"resolved",
],
identity_requirement: "caller_action_id",
resolver_command: Some(Command::ResolveBackupAction),
cancellation: "per_call_until_submission_then_resolve",
bounded_retry_after: true,
},
CommandOutcomeContract {
command: Command::ResolveBackupAction,
pre_submit_retry_safe: true,
possible_submission_states: &["not_submitted", "resolved"],
identity_requirement: "caller_action_id",
resolver_command: None,
cancellation: "per_call",
bounded_retry_after: true,
},
CommandOutcomeContract {
command: Command::GetRuntimeStatus,
pre_submit_retry_safe: true,
possible_submission_states: &["not_submitted", "resolved"],
identity_requirement: "none",
resolver_command: None,
cancellation: "per_call",
bounded_retry_after: true,
},
CommandOutcomeContract {
command: Command::GetResultCacheStatus,
pre_submit_retry_safe: true,
possible_submission_states: &["not_submitted", "resolved"],
identity_requirement: "none",
resolver_command: None,
cancellation: "per_call",
bounded_retry_after: true,
},
CommandOutcomeContract {
command: Command::GetFieldPromotionStatus,
pre_submit_retry_safe: true,
possible_submission_states: &["not_submitted", "resolved"],
identity_requirement: "none",
resolver_command: None,
cancellation: "per_call",
bounded_retry_after: true,
},
CommandOutcomeContract {
command: Command::GetOverloadStatus,
pre_submit_retry_safe: true,
possible_submission_states: &["not_submitted", "resolved"],
identity_requirement: "none",
resolver_command: None,
cancellation: "per_call",
bounded_retry_after: true,
},
CommandOutcomeContract {
command: Command::ConfigureExternalKey,
pre_submit_retry_safe: true,
possible_submission_states: &["not_submitted", "submitted", "indeterminate", "resolved"],
identity_requirement: "none",
resolver_command: None,
cancellation: "per_call_until_submission_then_resolve",
bounded_retry_after: true,
},
CommandOutcomeContract {
command: Command::RotateExternalKeyBinding,
pre_submit_retry_safe: true,
possible_submission_states: &["not_submitted", "submitted", "indeterminate", "resolved"],
identity_requirement: "none",
resolver_command: None,
cancellation: "per_call_until_submission_then_resolve",
bounded_retry_after: true,
},
CommandOutcomeContract {
command: Command::ConfigureAggregateThenDelete,
pre_submit_retry_safe: true,
possible_submission_states: &["not_submitted", "submitted", "indeterminate", "resolved"],
identity_requirement: "none",
resolver_command: None,
cancellation: "per_call_until_submission_then_resolve",
bounded_retry_after: true,
},
CommandOutcomeContract {
command: Command::GetLifecycleStatus,
pre_submit_retry_safe: true,
possible_submission_states: &["not_submitted", "resolved"],
identity_requirement: "none",
resolver_command: None,
cancellation: "per_call",
bounded_retry_after: true,
},
CommandOutcomeContract {
command: Command::GetQuota,
pre_submit_retry_safe: true,
possible_submission_states: &["not_submitted", "resolved"],
identity_requirement: "none",
resolver_command: None,
cancellation: "per_call",
bounded_retry_after: true,
},
CommandOutcomeContract {
command: Command::UpdateQuota,
pre_submit_retry_safe: true,
possible_submission_states: &["not_submitted", "submitted", "indeterminate", "resolved"],
identity_requirement: "none",
resolver_command: None,
cancellation: "per_call_until_submission_then_resolve",
bounded_retry_after: true,
},
CommandOutcomeContract {
command: Command::GetBinding,
pre_submit_retry_safe: true,
possible_submission_states: &["not_submitted", "resolved"],
identity_requirement: "none",
resolver_command: None,
cancellation: "per_call",
bounded_retry_after: true,
},
CommandOutcomeContract {
command: Command::GetAdmissionStatus,
pre_submit_retry_safe: true,
possible_submission_states: &["not_submitted", "resolved"],
identity_requirement: "none",
resolver_command: None,
cancellation: "per_call",
bounded_retry_after: true,
},
CommandOutcomeContract {
command: Command::SetAdmission,
pre_submit_retry_safe: true,
possible_submission_states: &["not_submitted", "submitted", "indeterminate", "resolved"],
identity_requirement: "none",
resolver_command: None,
cancellation: "per_call_until_submission_then_resolve",
bounded_retry_after: true,
},
CommandOutcomeContract {
command: Command::GetQuiesceStatus,
pre_submit_retry_safe: true,
possible_submission_states: &["not_submitted", "resolved"],
identity_requirement: "none",
resolver_command: None,
cancellation: "per_call",
bounded_retry_after: true,
},
CommandOutcomeContract {
command: Command::GetDecommissionReadiness,
pre_submit_retry_safe: true,
possible_submission_states: &["not_submitted", "resolved"],
identity_requirement: "none",
resolver_command: None,
cancellation: "per_call",
bounded_retry_after: true,
},
CommandOutcomeContract {
command: Command::GetUpgradeReadiness,
pre_submit_retry_safe: true,
possible_submission_states: &["not_submitted", "resolved"],
identity_requirement: "none",
resolver_command: None,
cancellation: "per_call",
bounded_retry_after: true,
},
CommandOutcomeContract {
command: Command::GetMaintenanceStatus,
pre_submit_retry_safe: true,
possible_submission_states: &["not_submitted", "resolved"],
identity_requirement: "none",
resolver_command: None,
cancellation: "per_call",
bounded_retry_after: true,
},
CommandOutcomeContract {
command: Command::GetRestoreReadiness,
pre_submit_retry_safe: true,
possible_submission_states: &["not_submitted", "resolved"],
identity_requirement: "none",
resolver_command: None,
cancellation: "per_call",
bounded_retry_after: true,
},
CommandOutcomeContract {
command: Command::WarmVectorIndex,
pre_submit_retry_safe: true,
possible_submission_states: &["not_submitted", "resolved"],
identity_requirement: "exact_root",
resolver_command: None,
cancellation: "per_call",
bounded_retry_after: true,
},
CommandOutcomeContract {
command: Command::EvaluateVectorRecall,
pre_submit_retry_safe: true,
possible_submission_states: &["not_submitted", "submitted", "indeterminate", "resolved"],
identity_requirement: "caller_action_id",
resolver_command: None,
cancellation: "per_call_until_submission_then_resolve",
bounded_retry_after: true,
},
CommandOutcomeContract {
command: Command::CalibrateVectorStrategy,
pre_submit_retry_safe: true,
possible_submission_states: &["not_submitted", "submitted", "indeterminate", "resolved"],
identity_requirement: "caller_action_id",
resolver_command: None,
cancellation: "per_call_until_submission_then_resolve",
bounded_retry_after: true,
},
CommandOutcomeContract {
command: Command::GetVectorDiagnostic,
pre_submit_retry_safe: true,
possible_submission_states: &["not_submitted", "resolved"],
identity_requirement: "request_locator",
resolver_command: None,
cancellation: "per_call",
bounded_retry_after: true,
},
CommandOutcomeContract {
command: Command::CreateDiagnostic,
pre_submit_retry_safe: true,
possible_submission_states: &["not_submitted", "submitted", "indeterminate", "resolved"],
identity_requirement: "none",
resolver_command: None,
cancellation: "per_call_until_submission_then_resolve",
bounded_retry_after: true,
},
CommandOutcomeContract {
command: Command::GetDiagnostic,
pre_submit_retry_safe: true,
possible_submission_states: &["not_submitted", "resolved"],
identity_requirement: "request_locator",
resolver_command: None,
cancellation: "per_call",
bounded_retry_after: true,
},
CommandOutcomeContract {
command: Command::ReadArtifactChunk,
pre_submit_retry_safe: true,
possible_submission_states: &["not_submitted", "resolved"],
identity_requirement: "none",
resolver_command: None,
cancellation: "per_call",
bounded_retry_after: true,
},
CommandOutcomeContract {
command: Command::ExportUsage,
pre_submit_retry_safe: true,
possible_submission_states: &["not_submitted", "resolved"],
identity_requirement: "none",
resolver_command: None,
cancellation: "per_call",
bounded_retry_after: true,
},
CommandOutcomeContract {
command: Command::ExecuteStateRead,
pre_submit_retry_safe: true,
possible_submission_states: &["not_submitted", "resolved"],
identity_requirement: "none",
resolver_command: None,
cancellation: "per_call",
bounded_retry_after: true,
},
CommandOutcomeContract {
command: Command::PrepareStateWrite,
pre_submit_retry_safe: true,
possible_submission_states: &["not_submitted", "resolved"],
identity_requirement: "caller_action_id",
resolver_command: None,
cancellation: "per_call",
bounded_retry_after: true,
},
CommandOutcomeContract {
command: Command::SubmitStateWrite,
pre_submit_retry_safe: true,
possible_submission_states: &[
"not_submitted",
"submitted",
"known_retired",
"indeterminate",
"resolved",
],
identity_requirement: "request_locator",
resolver_command: Some(Command::ResolveStateWrite),
cancellation: "per_call_until_submission_then_resolve",
bounded_retry_after: true,
},
CommandOutcomeContract {
command: Command::ResolveStateWrite,
pre_submit_retry_safe: true,
possible_submission_states: &["not_submitted", "resolved"],
identity_requirement: "request_locator",
resolver_command: None,
cancellation: "per_call",
bounded_retry_after: true,
},
];
#[derive(Clone, Copy, Debug, Eq, PartialEq)]
pub struct ErrorOutcomeContract {
pub code: ErrorCode,
pub when_not_submitted: Option<&'static str>,
pub when_submitted: Option<&'static str>,
pub retry_safe: &'static str,
pub retry_after_limit_id: Option<&'static str>,
pub recovery_identity: &'static str,
}
pub const LODESTONE_API_ERROR_OUTCOMES: &[ErrorOutcomeContract] = &[
ErrorOutcomeContract {
code: ErrorCode::Aborted,
when_not_submitted: Some("not_submitted"),
when_submitted: Some("submitted"),
retry_safe: "only_when_retry_safe",
retry_after_limit_id: None,
recovery_identity: "request_identity",
},
ErrorOutcomeContract {
code: ErrorCode::DeadlineExceeded,
when_not_submitted: Some("not_submitted"),
when_submitted: Some("submitted"),
retry_safe: "only_when_retry_safe",
retry_after_limit_id: None,
recovery_identity: "request_identity",
},
ErrorOutcomeContract {
code: ErrorCode::InvalidRequest,
when_not_submitted: Some("not_submitted"),
when_submitted: None,
retry_safe: "stop",
retry_after_limit_id: None,
recovery_identity: "none",
},
ErrorOutcomeContract {
code: ErrorCode::UnsupportedVersion,
when_not_submitted: Some("not_submitted"),
when_submitted: None,
retry_safe: "stop",
retry_after_limit_id: None,
recovery_identity: "none",
},
ErrorOutcomeContract {
code: ErrorCode::Unauthenticated,
when_not_submitted: Some("not_submitted"),
when_submitted: None,
retry_safe: "refresh_credential_then_retry",
retry_after_limit_id: None,
recovery_identity: "none",
},
ErrorOutcomeContract {
code: ErrorCode::PermissionDenied,
when_not_submitted: Some("not_submitted"),
when_submitted: None,
retry_safe: "stop",
retry_after_limit_id: None,
recovery_identity: "none",
},
ErrorOutcomeContract {
code: ErrorCode::NotFound,
when_not_submitted: Some("not_submitted"),
when_submitted: Some("resolved"),
retry_safe: "stop",
retry_after_limit_id: None,
recovery_identity: "request_identity",
},
ErrorOutcomeContract {
code: ErrorCode::Conflict,
when_not_submitted: Some("not_submitted"),
when_submitted: Some("resolved"),
retry_safe: "resolve_or_refresh_precondition",
retry_after_limit_id: None,
recovery_identity: "request_identity",
},
ErrorOutcomeContract {
code: ErrorCode::StaleCursor,
when_not_submitted: Some("not_submitted"),
when_submitted: None,
retry_safe: "restart_page",
retry_after_limit_id: None,
recovery_identity: "cursor",
},
ErrorOutcomeContract {
code: ErrorCode::RestartBudgetExhausted,
when_not_submitted: Some("not_submitted"),
when_submitted: None,
retry_safe: "stop",
retry_after_limit_id: None,
recovery_identity: "cursor",
},
ErrorOutcomeContract {
code: ErrorCode::LimitExceeded,
when_not_submitted: Some("not_submitted"),
when_submitted: None,
retry_safe: "reduce_request",
retry_after_limit_id: None,
recovery_identity: "none",
},
ErrorOutcomeContract {
code: ErrorCode::CapabilityUnavailable,
when_not_submitted: Some("not_submitted"),
when_submitted: None,
retry_safe: "stop",
retry_after_limit_id: None,
recovery_identity: "none",
},
ErrorOutcomeContract {
code: ErrorCode::NotSubmitted,
when_not_submitted: Some("not_submitted"),
when_submitted: None,
retry_safe: "retry_after",
retry_after_limit_id: Some("retry_after_millis"),
recovery_identity: "request_identity",
},
ErrorOutcomeContract {
code: ErrorCode::SubmittedIndeterminate,
when_not_submitted: None,
when_submitted: Some("indeterminate"),
retry_safe: "resolve",
retry_after_limit_id: None,
recovery_identity: "locator_or_caller_action_id",
},
ErrorOutcomeContract {
code: ErrorCode::ExpiredUnknown,
when_not_submitted: Some("known_retired"),
when_submitted: Some("known_retired"),
retry_safe: "stop",
retry_after_limit_id: None,
recovery_identity: "locator_or_caller_action_id",
},
ErrorOutcomeContract {
code: ErrorCode::SecretNotEscrowed,
when_not_submitted: None,
when_submitted: Some("resolved"),
retry_safe: "resolve",
retry_after_limit_id: None,
recovery_identity: "reservation_action_id",
},
ErrorOutcomeContract {
code: ErrorCode::RetentionGap,
when_not_submitted: Some("known_retired"),
when_submitted: Some("known_retired"),
retry_safe: "stop",
retry_after_limit_id: None,
recovery_identity: "cursor_or_locator",
},
ErrorOutcomeContract {
code: ErrorCode::ArtifactRangeInvalid,
when_not_submitted: Some("not_submitted"),
when_submitted: None,
retry_safe: "correct_range",
retry_after_limit_id: None,
recovery_identity: "artifact_identity",
},
ErrorOutcomeContract {
code: ErrorCode::ChecksumMismatch,
when_not_submitted: Some("resolved"),
when_submitted: Some("resolved"),
retry_safe: "stop",
retry_after_limit_id: None,
recovery_identity: "artifact_identity",
},
ErrorOutcomeContract {
code: ErrorCode::TemporarilyUnavailable,
when_not_submitted: Some("not_submitted"),
when_submitted: Some("submitted"),
retry_safe: "retry_after_when_safe",
retry_after_limit_id: Some("retry_after_millis"),
recovery_identity: "request_identity",
},
ErrorOutcomeContract {
code: ErrorCode::Internal,
when_not_submitted: Some("not_submitted"),
when_submitted: Some("indeterminate"),
retry_safe: "resolve_or_stop",
retry_after_limit_id: None,
recovery_identity: "request_identity",
},
];
#[derive(Clone, Copy, Debug, Eq, PartialEq)]
pub struct Limit {
pub id: &'static str,
pub default: u64,
pub maximum: u64,
pub unit: &'static str,
}
pub const LODESTONE_API_LIMITS: &[Limit] = &[
Limit {
id: "request_bytes",
default: 2097152,
maximum: 2097152,
unit: "bytes",
},
Limit {
id: "response_bytes",
default: 2097152,
maximum: 2097152,
unit: "bytes",
},
Limit {
id: "page_size",
default: 100,
maximum: 1000,
unit: "items",
},
Limit {
id: "catalog_page_size",
default: 100,
maximum: 100,
unit: "items",
},
Limit {
id: "catalog_restart_budget",
default: 8,
maximum: 8,
unit: "restarts",
},
Limit {
id: "query_clauses",
default: 256,
maximum: 1024,
unit: "clauses",
},
Limit {
id: "text_query_bytes",
default: 16384,
maximum: 16384,
unit: "bytes",
},
Limit {
id: "text_query_fields",
default: 64,
maximum: 64,
unit: "fields",
},
Limit {
id: "text_query_slop",
default: 64,
maximum: 64,
unit: "positions",
},
Limit {
id: "text_query_boost",
default: 1024,
maximum: 1024,
unit: "multiplier",
},
Limit {
id: "text_query_fuzzy_expansions",
default: 1024,
maximum: 1024,
unit: "terms",
},
Limit {
id: "text_query_fuzzy_distance",
default: 2,
maximum: 2,
unit: "edits",
},
Limit {
id: "text_query_dictionary_scan_terms",
default: 65536,
maximum: 65536,
unit: "terms",
},
Limit {
id: "text_query_dictionary_scan_bytes",
default: 16777216,
maximum: 16777216,
unit: "bytes",
},
Limit {
id: "text_query_fuzzy_work_units",
default: 2000000,
maximum: 2000000,
unit: "distance_cells",
},
Limit {
id: "aggregation_nodes",
default: 64,
maximum: 256,
unit: "nodes",
},
Limit {
id: "aggregation_buckets",
default: 65536,
maximum: 65536,
unit: "buckets",
},
Limit {
id: "approximate_cardinality_precision",
default: 12,
maximum: 16,
unit: "index_bits",
},
Limit {
id: "approximate_percentile_precision",
default: 10,
maximum: 12,
unit: "index_bits",
},
Limit {
id: "operation_page_authorities",
default: 6,
maximum: 6,
unit: "authorities",
},
Limit {
id: "artifact_chunk_bytes",
default: 262144,
maximum: 1048576,
unit: "bytes",
},
Limit {
id: "bulk_document_items",
default: 128,
maximum: 1024,
unit: "items",
},
Limit {
id: "bulk_document_bytes",
default: 2097152,
maximum: 2097152,
unit: "bytes",
},
Limit {
id: "state_command_keys",
default: 128,
maximum: 128,
unit: "keys",
},
Limit {
id: "state_command_value_bytes",
default: 1048576,
maximum: 1048576,
unit: "bytes",
},
Limit {
id: "state_write_outcomes",
default: 4096,
maximum: 4096,
unit: "entries",
},
Limit {
id: "exact_decimal_scale",
default: 18,
maximum: 1024,
unit: "decimal_places",
},
Limit {
id: "retry_after_millis",
default: 1000,
maximum: 60000,
unit: "milliseconds",
},
Limit {
id: "mapping_fields",
default: 16384,
maximum: 16384,
unit: "fields",
},
Limit {
id: "search_result_window",
default: 10000,
maximum: 10000,
unit: "items",
},
Limit {
id: "routing_values",
default: 1024,
maximum: 1024,
unit: "items",
},
Limit {
id: "routing_value_bytes",
default: 4096,
maximum: 4096,
unit: "bytes",
},
Limit {
id: "query_recursion_depth",
default: 64,
maximum: 64,
unit: "levels",
},
Limit {
id: "vector_dimensions",
default: 16384,
maximum: 16384,
unit: "dimensions",
},
Limit {
id: "vector_query_bytes",
default: 65536,
maximum: 65536,
unit: "bytes",
},
Limit {
id: "vector_request_bytes",
default: 1048576,
maximum: 1048576,
unit: "bytes",
},
Limit {
id: "vector_candidates",
default: 10000,
maximum: 10000,
unit: "items",
},
Limit {
id: "vector_set_document_vectors",
default: 128,
maximum: 128,
unit: "vectors",
},
Limit {
id: "vector_set_document_bytes",
default: 65536,
maximum: 65536,
unit: "bytes",
},
Limit {
id: "vector_set_query_vectors",
default: 32,
maximum: 32,
unit: "vectors",
},
Limit {
id: "vector_set_query_bytes",
default: 65536,
maximum: 65536,
unit: "bytes",
},
Limit {
id: "retrieval_branches",
default: 16,
maximum: 16,
unit: "branches",
},
Limit {
id: "retrieval_branch_name_bytes",
default: 64,
maximum: 64,
unit: "bytes",
},
Limit {
id: "retrieval_window",
default: 10000,
maximum: 10000,
unit: "items",
},
Limit {
id: "fragment_fields",
default: 4,
maximum: 16,
unit: "fields",
},
Limit {
id: "fragments_per_field",
default: 1,
maximum: 8,
unit: "items",
},
Limit {
id: "fragment_bytes",
default: 150,
maximum: 8192,
unit: "bytes",
},
Limit {
id: "fragment_total_bytes",
default: 65536,
maximum: 65536,
unit: "bytes",
},
Limit {
id: "result_feature_hits",
default: 10,
maximum: 100,
unit: "items",
},
Limit {
id: "result_features",
default: 4,
maximum: 16,
unit: "features",
},
Limit {
id: "diversification_fields",
default: 1,
maximum: 4,
unit: "fields",
},
Limit {
id: "diversification_per_group",
default: 1,
maximum: 64,
unit: "items",
},
Limit {
id: "vector_evaluation_queries",
default: 64,
maximum: 256,
unit: "queries",
},
Limit {
id: "vector_evaluation_k",
default: 10,
maximum: 1000,
unit: "items",
},
Limit {
id: "vector_evaluation_profiles",
default: 3,
maximum: 3,
unit: "profiles",
},
Limit {
id: "vector_evaluation_artifact_bytes",
default: 1048576,
maximum: 1048576,
unit: "bytes",
},
Limit {
id: "vector_warm_components",
default: 2,
maximum: 3,
unit: "components",
},
Limit {
id: "vector_warm_requests",
default: 1024,
maximum: 65536,
unit: "requests",
},
Limit {
id: "vector_warm_bytes",
default: 268435456,
maximum: 1073741824,
unit: "bytes",
},
Limit {
id: "vector_warm_achievements",
default: 1024,
maximum: 10000,
unit: "items",
},
Limit {
id: "vector_warm_ttl_millis",
default: 300000,
maximum: 900000,
unit: "milliseconds",
},
Limit {
id: "operation_page_size",
default: 100,
maximum: 100,
unit: "items",
},
Limit {
id: "resource_initial_shards",
default: 1,
maximum: 4096,
unit: "shards",
},
Limit {
id: "resource_target_shard_bytes",
default: 536870912,
maximum: 1125899906842624,
unit: "bytes",
},
Limit {
id: "resource_admission_weight",
default: 1,
maximum: 1000000,
unit: "weight",
},
Limit {
id: "resource_ram_bytes",
default: 1073741824,
maximum: 1125899906842624,
unit: "bytes",
},
Limit {
id: "resource_nvme_bytes",
default: 2147483648,
maximum: 1125899906842624,
unit: "bytes",
},
Limit {
id: "resource_refresh_millis",
default: 200,
maximum: 604800000,
unit: "milliseconds",
},
Limit {
id: "resource_memtable_bytes",
default: 268435456,
maximum: 1125899906842624,
unit: "bytes",
},
Limit {
id: "resource_parallelism",
default: 1,
maximum: 4096,
unit: "workers",
},
];
#[derive(Clone, Copy, Debug, Eq, PartialEq)]
pub enum JsonError {
DuplicateObjectField,
InvalidScalar,
}
pub fn validate_semantic_json(value: &JsonValue) -> Result<(), JsonError> {
match value {
JsonValue::I64(item) => item.validate().map_err(|_| JsonError::InvalidScalar),
JsonValue::U64(item) => item.validate().map_err(|_| JsonError::InvalidScalar),
JsonValue::ExactDecimal(item) => item.validate().map_err(|_| JsonError::InvalidScalar),
JsonValue::Approximate(item) => item.validate().map_err(|_| JsonError::InvalidScalar),
JsonValue::Array(items) => items.iter().try_for_each(validate_semantic_json),
JsonValue::Object(fields) => {
let mut names = std::collections::BTreeSet::new();
for field in fields {
if !names.insert(field.name.as_str()) {
return Err(JsonError::DuplicateObjectField);
}
validate_semantic_json(&field.value)?;
}
Ok(())
}
JsonValue::Null | JsonValue::Bool(_) | JsonValue::String(_) => Ok(()),
}
}
#[cfg(test)]
mod tests {
use super::*;
fn assert_fixture<T>(value: &serde_json::Value) -> Result<(), Box<dyn std::error::Error>>
where
T: serde::de::DeserializeOwned + Serialize,
{
let decoded: T = serde_json::from_value(value.clone())?;
assert_eq!(serde_json::to_value(decoded)?, *value);
Ok(())
}
#[test]
fn every_named_type_has_a_canonical_round_trip_fixture() -> Result<(), Box<dyn std::error::Error>> {
let document: serde_json::Value =
serde_json::from_str(include_str!("../../../tests/p10/lodestone-api-closed-schema.json"))?;
assert_eq!(document["spec_sha256"], LODESTONE_API_SPEC_SHA256);
let fixtures = document["named_types"]
.as_object()
.ok_or("named type fixtures are not an object")?;
assert_eq!(fixtures.len(), LODESTONE_API_TYPE_CONTRACTS.len());
for (name, value) in fixtures {
match name.as_str() {
"cursor" => assert_fixture::<Cursor>(value)?,
"locator" => assert_fixture::<Locator>(value)?,
"resource" => assert_fixture::<Resource>(value)?,
"field_promotion_configuration" => assert_fixture::<FieldPromotionConfiguration>(value)?,
"overload_configuration" => assert_fixture::<OverloadConfiguration>(value)?,
"index_policies" => assert_fixture::<IndexPolicies>(value)?,
"maintenance_budgets" => assert_fixture::<MaintenanceBudgets>(value)?,
"resource_durability_class" => assert_fixture::<ResourceDurabilityClass>(value)?,
"resource_storage_class" => assert_fixture::<ResourceStorageClass>(value)?,
"vector_quality_objective" => assert_fixture::<VectorQualityObjective>(value)?,
"vector_indexing_objective" => assert_fixture::<VectorIndexingObjective>(value)?,
"vector_residency_intent" => assert_fixture::<VectorResidencyIntent>(value)?,
"vector_calibration_binding" => assert_fixture::<VectorCalibrationBinding>(value)?,
"vector_resource_policy" => assert_fixture::<VectorResourcePolicy>(value)?,
"workload_class" => assert_fixture::<WorkloadClass>(value)?,
"index_resource_spec" => assert_fixture::<IndexResourceSpec>(value)?,
"index_summary" => assert_fixture::<IndexSummary>(value)?,
"mapping_mode" => assert_fixture::<MappingMode>(value)?,
"dynamic_mapping_policy" => assert_fixture::<DynamicMappingPolicy>(value)?,
"mapping_analyzer" => assert_fixture::<MappingAnalyzer>(value)?,
"keyword_normalizer" => assert_fixture::<KeywordNormalizer>(value)?,
"vector_metric" => assert_fixture::<VectorMetric>(value)?,
"mapping_scalar" => assert_fixture::<MappingScalar>(value)?,
"sparse_vector_weight_type" => assert_fixture::<SparseVectorWeightType>(value)?,
"mapping_field_type" => assert_fixture::<MappingFieldType>(value)?,
"mapping_field" => assert_fixture::<MappingField>(value)?,
"multi_field_projection" => assert_fixture::<MultiFieldProjection>(value)?,
"analyzer_identity" => assert_fixture::<AnalyzerIdentity>(value)?,
"keyword_limit" => assert_fixture::<KeywordLimit>(value)?,
"mapping" => assert_fixture::<Mapping>(value)?,
"index_detail" => assert_fixture::<IndexDetail>(value)?,
"source_provider" => assert_fixture::<SourceProvider>(value)?,
"source_decoder" => assert_fixture::<SourceDecoder>(value)?,
"source_replay_guarantees" => assert_fixture::<SourceReplayGuarantees>(value)?,
"source_partition_configuration" => assert_fixture::<SourcePartitionConfiguration>(value)?,
"replayable_source_configuration" => assert_fixture::<ReplayableSourceConfiguration>(value)?,
"source_partition_status" => assert_fixture::<SourcePartitionStatus>(value)?,
"replayable_source_status" => assert_fixture::<ReplayableSourceStatus>(value)?,
"source_control_transition" => assert_fixture::<SourceControlTransition>(value)?,
"history_ledger_precondition" => assert_fixture::<HistoryLedgerPrecondition>(value)?,
"history_retention_policy" => assert_fixture::<HistoryRetentionPolicy>(value)?,
"history_selector" => assert_fixture::<HistorySelector>(value)?,
"history_hold" => assert_fixture::<HistoryHold>(value)?,
"history_status" => assert_fixture::<HistoryStatus>(value)?,
"history_resolution" => assert_fixture::<HistoryResolution>(value)?,
"index_reference" => assert_fixture::<IndexReference>(value)?,
"alias_target" => assert_fixture::<AliasTarget>(value)?,
"alias_summary" => assert_fixture::<AliasSummary>(value)?,
"alias_detail" => assert_fixture::<AliasDetail>(value)?,
"data_stream_summary" => assert_fixture::<DataStreamSummary>(value)?,
"component_template_binding" => assert_fixture::<ComponentTemplateBinding>(value)?,
"index_template_binding" => assert_fixture::<IndexTemplateBinding>(value)?,
"lifecycle_policy_binding" => assert_fixture::<LifecyclePolicyBinding>(value)?,
"data_stream_detail" => assert_fixture::<DataStreamDetail>(value)?,
"component_template_summary" => assert_fixture::<ComponentTemplateSummary>(value)?,
"component_template_detail" => assert_fixture::<ComponentTemplateDetail>(value)?,
"index_template_summary" => assert_fixture::<IndexTemplateSummary>(value)?,
"index_template_detail" => assert_fixture::<IndexTemplateDetail>(value)?,
"ingest_pipeline_summary" => assert_fixture::<IngestPipelineSummary>(value)?,
"ingest_pipeline_detail" => assert_fixture::<IngestPipelineDetail>(value)?,
"ingest_pipeline_selection" => assert_fixture::<IngestPipelineSelection>(value)?,
"lifecycle_policy_summary" => assert_fixture::<LifecyclePolicySummary>(value)?,
"rollover_thresholds" => assert_fixture::<RolloverThresholds>(value)?,
"retention_policy" => assert_fixture::<RetentionPolicy>(value)?,
"lifecycle_policy_detail" => assert_fixture::<LifecyclePolicyDetail>(value)?,
"text_query_operator" => assert_fixture::<TextQueryOperator>(value)?,
"text_query_analyzer" => assert_fixture::<TextQueryAnalyzer>(value)?,
"zero_terms_query" => assert_fixture::<ZeroTermsQuery>(value)?,
"text_query_options" => assert_fixture::<TextQueryOptions>(value)?,
"multi_match_mode" => assert_fixture::<MultiMatchMode>(value)?,
"multi_match_field" => assert_fixture::<MultiMatchField>(value)?,
"multi_match_options" => assert_fixture::<MultiMatchOptions>(value)?,
"sort_order" => assert_fixture::<SortOrder>(value)?,
"sort_mode" => assert_fixture::<SortMode>(value)?,
"missing_order" => assert_fixture::<MissingOrder>(value)?,
"nested_score_mode" => assert_fixture::<NestedScoreMode>(value)?,
"nested_inner_hits" => assert_fixture::<NestedInnerHits>(value)?,
"sort_spec" => assert_fixture::<SortSpec>(value)?,
"query" => assert_fixture::<Query>(value)?,
"dense_retrieval_mode" => assert_fixture::<DenseRetrievalMode>(value)?,
"vector_achieved_mode" => assert_fixture::<VectorAchievedMode>(value)?,
"vector_branch_diagnostics" => assert_fixture::<VectorBranchDiagnostics>(value)?,
"dense_vector_element_type" => assert_fixture::<DenseVectorElementType>(value)?,
"dense_vector_byte_order" => assert_fixture::<DenseVectorByteOrder>(value)?,
"vector_value" => assert_fixture::<VectorValue>(value)?,
"sparse_vector_entry" => assert_fixture::<SparseVectorEntry>(value)?,
"sparse_vector_value" => assert_fixture::<SparseVectorValue>(value)?,
"vector_set_value" => assert_fixture::<VectorSetValue>(value)?,
"vector_evaluation_snapshot" => assert_fixture::<VectorEvaluationSnapshot>(value)?,
"vector_evaluation_query_set" => assert_fixture::<VectorEvaluationQuerySet>(value)?,
"vector_evaluation_budget" => assert_fixture::<VectorEvaluationBudget>(value)?,
"vector_candidate_policy" => assert_fixture::<VectorCandidatePolicy>(value)?,
"vector_calibration_objective" => assert_fixture::<VectorCalibrationObjective>(value)?,
"vector_strategy_profile" => assert_fixture::<VectorStrategyProfile>(value)?,
"vector_evaluation_work" => assert_fixture::<VectorEvaluationWork>(value)?,
"vector_evaluation_error_code" => assert_fixture::<VectorEvaluationErrorCode>(value)?,
"vector_evaluation_error" => assert_fixture::<VectorEvaluationError>(value)?,
"vector_recall_result" => assert_fixture::<VectorRecallResult>(value)?,
"vector_calibration_candidate" => assert_fixture::<VectorCalibrationCandidate>(value)?,
"vector_calibration_result" => assert_fixture::<VectorCalibrationResult>(value)?,
"vector_diagnostic_result" => assert_fixture::<VectorDiagnosticResult>(value)?,
"vector_warm_component" => assert_fixture::<VectorWarmComponent>(value)?,
"vector_warm_state" => assert_fixture::<VectorWarmState>(value)?,
"vector_warm_achievement" => assert_fixture::<VectorWarmAchievement>(value)?,
"vector_warm_result" => assert_fixture::<VectorWarmResult>(value)?,
"dense_retrieval_threshold" => assert_fixture::<DenseRetrievalThreshold>(value)?,
"retrieval_branch" => assert_fixture::<RetrievalBranch>(value)?,
"weighted_rrf_fusion" => assert_fixture::<WeightedRrfFusion>(value)?,
"retrieval_plan" => assert_fixture::<RetrievalPlan>(value)?,
"histogram_bounds" => assert_fixture::<HistogramBounds>(value)?,
"date_histogram_bounds" => assert_fixture::<DateHistogramBounds>(value)?,
"approximation_algorithm" => assert_fixture::<ApproximationAlgorithm>(value)?,
"approximation" => assert_fixture::<Approximation>(value)?,
"percentile_value" => assert_fixture::<PercentileValue>(value)?,
"approximate_percentile_value" => assert_fixture::<ApproximatePercentileValue>(value)?,
"aggregation" => assert_fixture::<Aggregation>(value)?,
"nested_search_hit" => assert_fixture::<NestedSearchHit>(value)?,
"named_nested_inner_hits_result" => assert_fixture::<NamedNestedInnerHitsResult>(value)?,
"fragment_boundary" => assert_fixture::<FragmentBoundary>(value)?,
"fragment_offset_encoding" => assert_fixture::<FragmentOffsetEncoding>(value)?,
"fragment_ranker" => assert_fixture::<FragmentRanker>(value)?,
"fragment_request" => assert_fixture::<FragmentRequest>(value)?,
"search_fragment" => assert_fixture::<SearchFragment>(value)?,
"numeric_feature_transform" => assert_fixture::<NumericFeatureTransform>(value)?,
"numeric_result_feature" => assert_fixture::<NumericResultFeature>(value)?,
"result_feature_request" => assert_fixture::<ResultFeatureRequest>(value)?,
"result_diversification" => assert_fixture::<ResultDiversification>(value)?,
"branch_score_kind" => assert_fixture::<BranchScoreKind>(value)?,
"result_feature" => assert_fixture::<ResultFeature>(value)?,
"search_hit" => assert_fixture::<SearchHit>(value)?,
"aggregation_bucket" => assert_fixture::<AggregationBucket>(value)?,
"aggregation_result" => assert_fixture::<AggregationResult>(value)?,
"shard_counts" => assert_fixture::<ShardCounts>(value)?,
"total_hits_relation" => assert_fixture::<TotalHitsRelation>(value)?,
"search_total" => assert_fixture::<SearchTotal>(value)?,
"artifact" => assert_fixture::<Artifact>(value)?,
"operation" => assert_fixture::<Operation>(value)?,
"submission_state" => assert_fixture::<SubmissionState>(value)?,
"expected_binding" => assert_fixture::<ExpectedBinding>(value)?,
"administration_alias_action" => assert_fixture::<AdministrationAliasAction>(value)?,
"administration_mutation" => assert_fixture::<AdministrationMutation>(value)?,
"administration_outcome" => assert_fixture::<AdministrationOutcome>(value)?,
"index_change_apply_receipt" => assert_fixture::<IndexChangeApplyReceipt>(value)?,
"backup_encryption_policy" => assert_fixture::<BackupEncryptionPolicy>(value)?,
"backup_create_outcome" => assert_fixture::<BackupCreateOutcome>(value)?,
"bulk_document_item" => assert_fixture::<BulkDocumentItem>(value)?,
"bulk_document_item_outcome" => assert_fixture::<BulkDocumentItemOutcome>(value)?,
"bulk_document_outcome" => assert_fixture::<BulkDocumentOutcome>(value)?,
"retained_append_item" => assert_fixture::<RetainedAppendItem>(value)?,
"retained_append_state" => assert_fixture::<RetainedAppendState>(value)?,
"retained_append_retry_safety" => assert_fixture::<RetainedAppendRetrySafety>(value)?,
"retained_append_item_outcome" => assert_fixture::<RetainedAppendItemOutcome>(value)?,
"retained_append_bulk_outcome" => assert_fixture::<RetainedAppendBulkOutcome>(value)?,
"retained_append_observation_state" => assert_fixture::<RetainedAppendObservationState>(value)?,
"retained_append_observation_outcome" => assert_fixture::<RetainedAppendObservationOutcome>(value)?,
"binary_value" => assert_fixture::<BinaryValue>(value)?,
"state_hash_field" => assert_fixture::<StateHashField>(value)?,
"state_set_entry" => assert_fixture::<StateSetEntry>(value)?,
"state_set_condition" => assert_fixture::<StateSetCondition>(value)?,
"state_operation" => assert_fixture::<StateOperation>(value)?,
"state_optional_value" => assert_fixture::<StateOptionalValue>(value)?,
"state_command_result" => assert_fixture::<StateCommandResult>(value)?,
"state_write_resolution" => assert_fixture::<StateWriteResolution>(value)?,
"service_credential_reservation" => assert_fixture::<ServiceCredentialReservation>(value)?,
"subscription_metadata_field" => assert_fixture::<SubscriptionMetadataField>(value)?,
"subscription_field" => assert_fixture::<SubscriptionField>(value)?,
"subscription_filter" => assert_fixture::<SubscriptionFilter>(value)?,
"subscription_cursor_entry" => assert_fixture::<SubscriptionCursorEntry>(value)?,
"subscription_route" => assert_fixture::<SubscriptionRoute>(value)?,
"subscription_start_position" => assert_fixture::<SubscriptionStartPosition>(value)?,
"subscription_start" => assert_fixture::<SubscriptionStart>(value)?,
"subscription_accepted" => assert_fixture::<SubscriptionAccepted>(value)?,
"subscription_writer_fence" => assert_fixture::<SubscriptionWriterFence>(value)?,
"subscription_event" => assert_fixture::<SubscriptionEvent>(value)?,
"subscription_heartbeat" => assert_fixture::<SubscriptionHeartbeat>(value)?,
"subscription_gap" => assert_fixture::<SubscriptionGap>(value)?,
"subscription_terminal" => assert_fixture::<SubscriptionTerminal>(value)?,
"subscription_frame" => assert_fixture::<SubscriptionFrame>(value)?,
"stream_binding" => assert_fixture::<StreamBinding>(value)?,
"capability_grant" => assert_fixture::<CapabilityGrant>(value)?,
"protocol_limit" => assert_fixture::<ProtocolLimit>(value)?,
"document_mutation_condition" => assert_fixture::<DocumentMutationCondition>(value)?,
"audit_event" => assert_fixture::<AuditEvent>(value)?,
"audit_gap" => assert_fixture::<AuditGap>(value)?,
"service_credential_grant" => assert_fixture::<ServiceCredentialGrant>(value)?,
"service_credential_summary" => assert_fixture::<ServiceCredentialSummary>(value)?,
"security_role" => assert_fixture::<SecurityRole>(value)?,
"role_append_scope_change" => assert_fixture::<RoleAppendScopeChange>(value)?,
"role_append_access_preparation" => assert_fixture::<RoleAppendAccessPreparation>(value)?,
"security_action_outcome" => assert_fixture::<SecurityActionOutcome>(value)?,
"maintenance_work_state" => assert_fixture::<MaintenanceWorkState>(value)?,
"maintenance_attempt_state" => assert_fixture::<MaintenanceAttemptState>(value)?,
"maintenance_failure_class" => assert_fixture::<MaintenanceFailureClass>(value)?,
"maintenance_failure_class_count" => assert_fixture::<MaintenanceFailureClassCount>(value)?,
"maintenance_attempt_observation" => assert_fixture::<MaintenanceAttemptObservation>(value)?,
"maintenance_task_scope" => assert_fixture::<MaintenanceTaskScope>(value)?,
"maintenance_task_status" => assert_fixture::<MaintenanceTaskStatus>(value)?,
"maintenance_status_aggregate" => assert_fixture::<MaintenanceStatusAggregate>(value)?,
"runtime_status_detail" => assert_fixture::<RuntimeStatusDetail>(value)?,
"result_cache_status" => assert_fixture::<ResultCacheStatus>(value)?,
"field_promotion_status" => assert_fixture::<FieldPromotionStatus>(value)?,
"overload_shard_status" => assert_fixture::<OverloadShardStatus>(value)?,
"external_key_binding" => assert_fixture::<ExternalKeyBinding>(value)?,
"rollup_measure" => assert_fixture::<RollupMeasure>(value)?,
"aggregate_then_delete_policy" => assert_fixture::<AggregateThenDeletePolicy>(value)?,
"lifecycle_binding_status" => assert_fixture::<LifecycleBindingStatus>(value)?,
"lifecycle_rollup_status" => assert_fixture::<LifecycleRollupStatus>(value)?,
"lifecycle_status" => assert_fixture::<LifecycleStatus>(value)?,
"quota_limit" => assert_fixture::<QuotaLimit>(value)?,
"quota_consumption" => assert_fixture::<QuotaConsumption>(value)?,
"quota_update" => assert_fixture::<QuotaUpdate>(value)?,
"core_binding" => assert_fixture::<CoreBinding>(value)?,
"readiness_observation" => assert_fixture::<ReadinessObservation>(value)?,
"usage_dimension" => assert_fixture::<UsageDimension>(value)?,
"physical_usage_value" => assert_fixture::<PhysicalUsageValue>(value)?,
"core_usage_units" => assert_fixture::<CoreUsageUnits>(value)?,
"core_usage_correction" => assert_fixture::<CoreUsageCorrection>(value)?,
"error_detail" => assert_fixture::<ErrorDetail>(value)?,
"connection_profile" => assert_fixture::<ConnectionProfile>(value)?,
_ => return Err("fixture names an unknown generated type".into()),
}
}
Ok(())
}
#[test]
fn every_aggregation_variant_has_a_canonical_fixture() -> Result<(), Box<dyn std::error::Error>> {
let document: serde_json::Value =
serde_json::from_str(include_str!("../../../tests/p10/lodestone-api-closed-schema.json"))?;
let fixtures = document["aggregation_variants"]
.as_object()
.ok_or("aggregation fixtures are not an object")?;
assert_eq!(fixtures.len(), 16);
for value in fixtures.values() {
assert_fixture::<Aggregation>(value)?;
}
Ok(())
}
#[test]
fn exact_scalar_canonicality_is_closed() {
assert_eq!(
U64 {
value: u64::MAX.to_string()
}
.validate(),
Ok(())
);
assert_eq!(
I64 {
value: i64::MIN.to_string()
}
.validate(),
Ok(())
);
assert_eq!(U64 { value: "01".to_owned() }.validate(), Err(ScalarError::InvalidU64));
assert_eq!(
ExactDecimal {
coefficient: "12345".to_owned(),
scale: 2
}
.validate(),
Ok(())
);
assert_eq!(
ExactDecimal {
coefficient: "123450".to_owned(),
scale: 3
}
.validate(),
Err(ScalarError::InvalidDecimal)
);
assert_eq!(
ExactDecimal {
coefficient: "1".to_owned(),
scale: 1_025
}
.validate(),
Err(ScalarError::InvalidDecimal)
);
}
#[test]
fn scalar_decoders_refuse_numbers_and_noncanonical_strings() {
assert!(serde_json::from_str::<U64>("9007199254740993").is_err());
assert!(serde_json::from_str::<U64>(r#""01""#).is_err());
assert!(serde_json::from_str::<Identity>(r#""0123456789ABCDEF0123456789ABCDEF""#).is_err());
assert!(serde_json::from_str::<Digest>(r#""0123456789abcdef0123456789abcdef""#).is_err());
assert!(serde_json::from_str::<ExactDecimal>(r#"{"coefficient":"123450","scale":3}"#).is_err());
assert!(serde_json::from_str::<ApproximateNumber>(r#""1.0""#).is_err());
}
#[test]
fn semantic_json_rejects_duplicate_fields() {
let value = JsonValue::Object(vec![
JsonField {
name: "x".to_owned(),
value: JsonValue::Null,
},
JsonField {
name: "x".to_owned(),
value: JsonValue::Bool(true),
},
]);
assert_eq!(validate_semantic_json(&value), Err(JsonError::DuplicateObjectField));
}
#[test]
fn strict_generated_shapes_refuse_malformed_duplicate_unknown_field_and_tag() {
assert!(serde_json::from_str::<DiscoverRequest>(r#"{"unexpected":true}"#).is_err());
assert!(serde_json::from_str::<Cursor>(r#"{"value":"a","value":"b"}"#).is_err());
assert!(serde_json::from_str::<Query>(r#"{"kind":"future_query"}"#).is_err());
assert!(serde_json::from_str::<Cursor>(r#"{"value":1}"#).is_err());
}
#[test]
fn registries_match_the_idl() {
assert_eq!(LODESTONE_API_COMMAND_CONTRACTS.len(), 99);
assert_eq!(LODESTONE_API_COMMAND_SEMANTICS.len(), 99);
assert_eq!(LODESTONE_API_COMMAND_OUTCOMES.len(), 99);
assert_eq!(LODESTONE_API_ERROR_OUTCOMES.len(), 21);
assert_eq!(LODESTONE_API_TYPE_CONTRACTS.len(), 219);
assert_eq!(LODESTONE_API_STREAM_CONTRACTS.len(), 1);
assert_eq!(LODESTONE_API_LIMITS.len(), 70);
}
#[test]
fn mutation_outcome_metadata_matches_submission_boundaries() {
for (command, outcome) in LODESTONE_API_COMMAND_CONTRACTS
.iter()
.zip(LODESTONE_API_COMMAND_OUTCOMES)
{
assert_eq!(command.command, outcome.command);
let submits = !matches!(command.mutation, "read_only" | "read_only_prepare" | "catalog_prepare");
assert_eq!(outcome.possible_submission_states.contains(&"submitted"), submits);
assert_eq!(outcome.possible_submission_states.contains(&"indeterminate"), submits);
assert_eq!(
outcome.cancellation == "per_call_until_submission_then_resolve",
submits
);
}
for command in [
Command::ReserveServiceCredential,
Command::ReserveServiceCredentialRotation,
] {
let outcome = LODESTONE_API_COMMAND_OUTCOMES
.iter()
.find(|outcome| outcome.command == command);
assert!(
matches!(outcome, Some(value) if value.identity_requirement == "caller_action_id" && value.resolver_command == Some(Command::ResolveServiceCredentialReservation))
);
}
}
}