lance_namespace_reqwest_client/models/create_table_version_request.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/// CreateTableVersionRequest : Request to create a new table version entry. 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 CreateTableVersionRequest {
17 #[serde(rename = "identity", skip_serializing_if = "Option::is_none")]
18 pub identity: Option<Box<models::Identity>>,
19 /// Arbitrary context for a request as key-value pairs. How to use the context is custom to the specific implementation. REST NAMESPACE ONLY Context entries are passed via HTTP headers using the naming convention `x-lance-ctx-<key>: <value>`. For example, a context entry `{\"trace_id\": \"abc123\"}` would be sent as the header `x-lance-ctx-trace_id: abc123`.
20 #[serde(rename = "context", skip_serializing_if = "Option::is_none")]
21 pub context: Option<std::collections::HashMap<String, String>>,
22 /// The table identifier
23 #[serde(rename = "id", skip_serializing_if = "Option::is_none")]
24 pub id: Option<Vec<String>>,
25 /// Version number to create
26 #[serde(rename = "version")]
27 pub version: i64,
28 /// Path to the manifest file for this version
29 #[serde(rename = "manifest_path")]
30 pub manifest_path: String,
31 /// Size of the manifest file in bytes
32 #[serde(rename = "manifest_size", skip_serializing_if = "Option::is_none")]
33 pub manifest_size: Option<i64>,
34 /// Optional ETag for the manifest file
35 #[serde(rename = "e_tag", skip_serializing_if = "Option::is_none")]
36 pub e_tag: Option<String>,
37 /// Optional metadata for the version
38 #[serde(rename = "metadata", skip_serializing_if = "Option::is_none")]
39 pub metadata: Option<std::collections::HashMap<String, String>>,
40 /// 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.
41 #[serde(rename = "naming_scheme", skip_serializing_if = "Option::is_none")]
42 pub naming_scheme: Option<String>,
43}
44
45impl CreateTableVersionRequest {
46 /// Request to create a new table version entry. This supports `put_if_not_exists` semantics, where the operation fails if the version already exists.
47 pub fn new(version: i64, manifest_path: String) -> CreateTableVersionRequest {
48 CreateTableVersionRequest {
49 identity: None,
50 context: None,
51 id: None,
52 version,
53 manifest_path,
54 manifest_size: None,
55 e_tag: None,
56 metadata: None,
57 naming_scheme: None,
58 }
59 }
60}
61