/*
* 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 CreateMaterializedViewRequest {
#[serde(rename = "identity", skip_serializing_if = "Option::is_none")]
pub identity: Option<Box<models::Identity>>,
/// View identifier path (namespace + view name)
#[serde(rename = "id", skip_serializing_if = "Option::is_none")]
pub id: Option<Vec<String>>,
/// The materialized view kind. - `query` — plain query-backed view (no UDTF), 1:1 rows. - `udtf` — batch UDTF-backed view (N:M rows, full refresh). - `chunker`, aka 'scalar_udtf' — chunker view (1:N row expansion, incremental refresh).
#[serde(rename = "kind")]
pub kind: Kind,
/// Opaque serialized representation of the source query that defines the view's input. The format is defined by the client; the namespace server stores it without interpreting it.
#[serde(rename = "source_query")]
pub source_query: String,
/// Base64-encoded Arrow schema of the view output
#[serde(rename = "output_schema")]
pub output_schema: String,
#[serde(rename = "udtf_spec", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
pub udtf_spec: Option<Option<Box<models::MaterializedViewUdtfEntry>>>,
/// If false, the server kicks off an initial refresh immediately after creating the view and the response includes a job ID.
#[serde(rename = "with_no_data", skip_serializing_if = "Option::is_none")]
pub with_no_data: Option<bool>,
/// If true, the view is automatically refreshed when source-table data changes past the deployment-level threshold. Boolean opt-in only; the threshold and cooldown are configured on the deployment, not per-view.
#[serde(rename = "auto_refresh", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
pub auto_refresh: Option<Option<bool>>,
}
impl CreateMaterializedViewRequest {
pub fn new(kind: Kind, source_query: String, output_schema: String) -> CreateMaterializedViewRequest {
CreateMaterializedViewRequest {
identity: None,
id: None,
kind,
source_query,
output_schema,
udtf_spec: None,
with_no_data: None,
auto_refresh: None,
}
}
}
/// The materialized view kind. - `query` — plain query-backed view (no UDTF), 1:1 rows. - `udtf` — batch UDTF-backed view (N:M rows, full refresh). - `chunker`, aka 'scalar_udtf' — chunker view (1:N row expansion, incremental refresh).
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum Kind {
#[serde(rename = "query")]
Query,
#[serde(rename = "udtf")]
Udtf,
#[serde(rename = "chunker")]
Chunker,
}
impl Default for Kind {
fn default() -> Kind {
Self::Query
}
}