lance-namespace-reqwest-client 0.8.6

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://lancedb.github.io/lance-namespace/spec/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://lancedb.github.io/lance-namespace/spec/impls/rest for more details.
Documentation
/*
 * 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};

#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct IndexContent {
    /// Name of the index
    #[serde(rename = "index_name")]
    pub index_name: String,
    /// Unique identifier for the index
    #[serde(rename = "index_uuid")]
    pub index_uuid: String,
    /// Canonical Lance field paths covered by this index. Nested fields use dot-separated segments; segments containing literal dots are backtick-quoted, and backticks inside quoted segments are doubled.
    #[serde(rename = "columns")]
    pub columns: Vec<String>,
    /// Current status of the index
    #[serde(rename = "status")]
    pub status: String,
    /// Friendly index type, e.g. IVF_PQ, BTREE. Unknown if no plugin recognizes the index.
    #[serde(rename = "index_type", skip_serializing_if = "Option::is_none")]
    pub index_type: Option<String>,
    /// Protobuf type URL, a precise type identifier for the index.
    #[serde(rename = "type_url", skip_serializing_if = "Option::is_none")]
    pub type_url: Option<String>,
    /// Number of live rows covered by the index. This does not count rows that are in the index but have since been deleted.
    #[serde(rename = "num_indexed_rows", skip_serializing_if = "Option::is_none")]
    pub num_indexed_rows: Option<i64>,
    /// Number of rows that are not indexed.
    #[serde(rename = "num_unindexed_rows", skip_serializing_if = "Option::is_none")]
    pub num_unindexed_rows: Option<i64>,
    /// Total index size in bytes across all segments. Null for indices predating file-size tracking.
    #[serde(rename = "size_bytes", skip_serializing_if = "Option::is_none")]
    pub size_bytes: Option<i64>,
    /// Number of index deltas/segments.
    #[serde(rename = "num_segments", skip_serializing_if = "Option::is_none")]
    pub num_segments: Option<i32>,
    /// Creation time for indexes. Null for legacy indices.
    #[serde(rename = "created_at", skip_serializing_if = "Option::is_none")]
    pub created_at: Option<String>,
    /// On-disk index format version.
    #[serde(rename = "index_version", skip_serializing_if = "Option::is_none")]
    pub index_version: Option<i32>,
    /// Opaque, type-specific JSON with additional index details. For vector indices this carries metric/distance type, partitioning, and HNSW/PQ/SQ/RQ parameters.
    #[serde(rename = "index_details", skip_serializing_if = "Option::is_none")]
    pub index_details: Option<String>,
}

impl IndexContent {
    pub fn new(index_name: String, index_uuid: String, columns: Vec<String>, status: String) -> IndexContent {
        IndexContent {
            index_name,
            index_uuid,
            columns,
            status,
            index_type: None,
            type_url: None,
            num_indexed_rows: None,
            num_unindexed_rows: None,
            size_bytes: None,
            num_segments: None,
            created_at: None,
            index_version: None,
            index_details: None,
        }
    }
}