/*
* Lance Namespace Specification
*
* This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts: The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lance.org/format/namespace/operations for more details. The `servers`, `security`, `paths`, `components/parameters` sections are for the Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lance.org/format/namespace/rest for more details.
*
* The version of the OpenAPI document: 1.0.0
*
* Generated by: https://openapi-generator.tech
*/
use crate::models;
use serde::{Deserialize, Serialize};
/// CreateTableVersionEntry : An entry for creating a new table version in a batch operation. This supports `put_if_not_exists` semantics, where the operation fails if the version already exists.
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct CreateTableVersionEntry {
/// The table identifier
#[serde(rename = "id")]
pub id: Vec<String>,
/// Version number to create
#[serde(rename = "version")]
pub version: i64,
/// Path to the manifest file for this version
#[serde(rename = "manifest_path")]
pub manifest_path: String,
/// Size of the manifest file in bytes
#[serde(rename = "manifest_size", skip_serializing_if = "Option::is_none")]
pub manifest_size: Option<i64>,
/// Optional ETag for the manifest file
#[serde(rename = "e_tag", skip_serializing_if = "Option::is_none")]
pub e_tag: Option<String>,
/// Optional metadata for the version
#[serde(rename = "metadata", skip_serializing_if = "Option::is_none")]
pub metadata: Option<std::collections::HashMap<String, String>>,
/// The naming scheme used for manifest files in the `_versions/` directory. Known values: - `V1`: `_versions/{version}.manifest` - Simple version-based naming - `V2`: `_versions/{inverted_version}.manifest` - Zero-padded, reversed version number (uses `u64::MAX - version`) for O(1) lookup of latest version on object stores V2 is preferred for new tables as it enables efficient latest-version discovery without needing to list all versions.
#[serde(rename = "naming_scheme", skip_serializing_if = "Option::is_none")]
pub naming_scheme: Option<String>,
}
impl CreateTableVersionEntry {
/// An entry for creating a new table version in a batch operation. This supports `put_if_not_exists` semantics, where the operation fails if the version already exists.
pub fn new(id: Vec<String>, version: i64, manifest_path: String) -> CreateTableVersionEntry {
CreateTableVersionEntry {
id,
version,
manifest_path,
manifest_size: None,
e_tag: None,
metadata: None,
naming_scheme: None,
}
}
}