hotdata 0.14.0

Powerful data platform API for datasets, queries, and analytics.
Documentation
/*
 * Hotdata API
 *
 * Powerful data platform API for managed databases, queries, and analytics.
 *
 * The version of the OpenAPI document: 1.0.0
 * Contact: developers@hotdata.dev
 * Generated by: https://openapi-generator.tech
 */

use crate::models;
use serde::{Deserialize, Serialize};

/// TableSortKey : One key of a table's sort order.  Rows are written in this order, which keeps the values in each file within a narrow range and lets queries filtering on those columns skip files entirely. Most useful on columns you filter by ranges, such as a timestamp.
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct TableSortKey {
    #[serde(rename = "column")]
    pub column: String,
    /// `asc` (the default) or `desc`. Null when the table was declared without an explicit direction for this key.
    #[serde(
        rename = "direction",
        default,
        with = "::serde_with::rust::double_option",
        skip_serializing_if = "Option::is_none"
    )]
    pub direction: Option<Option<String>>,
    /// Where nulls are placed: `first` or `last`. Defaults to the SQL default for the chosen direction. Null when the table was declared without an explicit placement for this key.
    #[serde(
        rename = "nulls",
        default,
        with = "::serde_with::rust::double_option",
        skip_serializing_if = "Option::is_none"
    )]
    pub nulls: Option<Option<String>>,
}

impl TableSortKey {
    /// One key of a table's sort order.  Rows are written in this order, which keeps the values in each file within a narrow range and lets queries filtering on those columns skip files entirely. Most useful on columns you filter by ranges, such as a timestamp.
    pub fn new(column: String) -> TableSortKey {
        TableSortKey {
            column,
            direction: None,
            nulls: None,
        }
    }
}