hotdata 0.19.0

Powerful data platform API for datasets, queries, and analytics.
Documentation
/*
 * Hotdata API
 *
 * Powerful data platform API for instant 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};

/// ManagedTableConstantPerKeyResponse : The declaration as it now stands after a `constant-per-key` write.  Echoed back rather than returning `204` so a caller can confirm what actually took effect instead of assuming its request applied — the same reason `/v1/information_schema` reports the field.
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct ManagedTableConstantPerKeyResponse {
    /// Connection backing the catalog the table belongs to. For a database default catalog this is the database's `default_connection_id`, so it is the value that addresses the table through the connection-scoped endpoints — not the database id the request may have used.
    #[serde(rename = "connection_id")]
    pub connection_id: String,
    /// The columns now declared constant per key. Empty means no declaration, i.e. the unrestricted search.
    #[serde(rename = "constant_per_key")]
    pub constant_per_key: Vec<String>,
    /// Schema the table belongs to, as stored: lowercased, which may differ from the spelling in the request path.
    #[serde(rename = "schema")]
    pub schema: String,
    /// Table the declaration was written to, as stored: lowercased, which may differ from the spelling in the request path.
    #[serde(rename = "table")]
    pub table: String,
}

impl ManagedTableConstantPerKeyResponse {
    /// The declaration as it now stands after a `constant-per-key` write.  Echoed back rather than returning `204` so a caller can confirm what actually took effect instead of assuming its request applied — the same reason `/v1/information_schema` reports the field.
    pub fn new(
        connection_id: String,
        constant_per_key: Vec<String>,
        schema: String,
        table: String,
    ) -> ManagedTableConstantPerKeyResponse {
        ManagedTableConstantPerKeyResponse {
            connection_id,
            constant_per_key,
            schema,
            table,
        }
    }
}