lance-namespace-reqwest-client 0.7.7

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 MaterializedViewUdtfEntry {
    /// Discriminates a batch UDTF (`udtf`, full-overwrite refresh) from a chunker (`chunker`, incremental 1:N refresh). Must match the enclosing request's `kind`. 
    #[serde(rename = "kind")]
    pub kind: Kind,
    /// Base64-encoded UDTFSpec / ChunkerSpec JSON envelope (per kind). 
    #[serde(rename = "udtf")]
    pub udtf: String,
    /// SHA-256 checksum of the envelope; server validates.
    #[serde(rename = "udtf_sha")]
    pub udtf_sha: String,
    /// Name of the UDTF
    #[serde(rename = "udtf_name")]
    pub udtf_name: String,
    /// Version of the UDTF
    #[serde(rename = "udtf_version")]
    pub udtf_version: String,
    /// Source columns the UDTF reads. Null means all columns (batch UDTF only). 
    #[serde(rename = "input_columns", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub input_columns: Option<Option<Vec<String>>>,
    /// Batch UDTF only. Column-value partition key for partition-parallel execution. Mutually exclusive with `partition_by_indexed_column`. 
    #[serde(rename = "partition_by", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub partition_by: Option<Option<String>>,
    /// Batch UDTF only. Source column with an IVF-family index used for index-based partitioning. The server validates the index exists at create time. 
    #[serde(rename = "partition_by_indexed_column", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub partition_by_indexed_column: Option<Option<String>>,
    /// Ray actor CPU request.
    #[serde(rename = "num_cpus", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub num_cpus: Option<Option<f64>>,
    /// Ray actor GPU request.
    #[serde(rename = "num_gpus", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub num_gpus: Option<Option<f64>>,
    /// Ray actor memory request, in bytes.
    #[serde(rename = "memory", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub memory: Option<Option<i32>>,
    /// Batch UDTF only. Serialized ErrorHandlingConfig controlling partition-grain fail/retry/skip behavior. 
    #[serde(rename = "error_handling", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub error_handling: Option<Option<serde_json::Value>>,
    /// Chunker only. True for a batched chunker; affects how the worker dispatches input rows. 
    #[serde(rename = "batch", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub batch: Option<Option<bool>>,
    /// JSON-serialized GenevaManifest for the UDTF environment.
    #[serde(rename = "manifest", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub manifest: Option<Option<String>>,
    /// SHA-256 checksum of the manifest content.
    #[serde(rename = "manifest_checksum", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub manifest_checksum: Option<Option<String>>,
}

impl MaterializedViewUdtfEntry {
    pub fn new(kind: Kind, udtf: String, udtf_sha: String, udtf_name: String, udtf_version: String) -> MaterializedViewUdtfEntry {
        MaterializedViewUdtfEntry {
            kind,
            udtf,
            udtf_sha,
            udtf_name,
            udtf_version,
            input_columns: None,
            partition_by: None,
            partition_by_indexed_column: None,
            num_cpus: None,
            num_gpus: None,
            memory: None,
            error_handling: None,
            batch: None,
            manifest: None,
            manifest_checksum: None,
        }
    }
}
/// Discriminates a batch UDTF (`udtf`, full-overwrite refresh) from a chunker (`chunker`, incremental 1:N refresh). Must match the enclosing request's `kind`. 
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum Kind {
    #[serde(rename = "udtf")]
    Udtf,
    #[serde(rename = "chunker")]
    Chunker,
}

impl Default for Kind {
    fn default() -> Kind {
        Self::Udtf
    }
}