Skip to main content

lance_namespace_reqwest_client/models/
create_table_version_entry.rs

1/*
2 * Lance Namespace Specification
3 *
4 * 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. 
5 *
6 * The version of the OpenAPI document: 1.0.0
7 * 
8 * Generated by: https://openapi-generator.tech
9 */
10
11use crate::models;
12use serde::{Deserialize, Serialize};
13
14/// 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. 
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct CreateTableVersionEntry {
17    /// The table identifier
18    #[serde(rename = "id")]
19    pub id: Vec<String>,
20    /// Version number to create
21    #[serde(rename = "version")]
22    pub version: i64,
23    /// Path to the manifest file for this version
24    #[serde(rename = "manifest_path")]
25    pub manifest_path: String,
26    /// Size of the manifest file in bytes
27    #[serde(rename = "manifest_size", skip_serializing_if = "Option::is_none")]
28    pub manifest_size: Option<i64>,
29    /// Optional ETag for the manifest file
30    #[serde(rename = "e_tag", skip_serializing_if = "Option::is_none")]
31    pub e_tag: Option<String>,
32    /// Optional metadata for the version
33    #[serde(rename = "metadata", skip_serializing_if = "Option::is_none")]
34    pub metadata: Option<std::collections::HashMap<String, String>>,
35    /// 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. 
36    #[serde(rename = "naming_scheme", skip_serializing_if = "Option::is_none")]
37    pub naming_scheme: Option<String>,
38}
39
40impl CreateTableVersionEntry {
41    /// 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. 
42    pub fn new(id: Vec<String>, version: i64, manifest_path: String) -> CreateTableVersionEntry {
43        CreateTableVersionEntry {
44            id,
45            version,
46            manifest_path,
47            manifest_size: None,
48            e_tag: None,
49            metadata: None,
50            naming_scheme: None,
51        }
52    }
53}
54