hotdata 0.16.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};

/// LineageAncestorInfo : One database up a fork chain.
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct LineageAncestorInfo {
    #[serde(rename = "database_id")]
    pub database_id: String,
    /// False once the ancestor has been deleted. Its place in the chain is kept either way, and the ancestry continues past it.
    #[serde(rename = "exists")]
    pub exists: bool,
    /// When the next database down the chain was forked from it.
    #[serde(
        rename = "forked_at",
        default,
        with = "::serde_with::rust::double_option",
        skip_serializing_if = "Option::is_none"
    )]
    pub forked_at: Option<Option<String>>,
    /// The ancestor's current label, or the one captured at fork time when it no longer exists.
    #[serde(
        rename = "name",
        default,
        with = "::serde_with::rust::double_option",
        skip_serializing_if = "Option::is_none"
    )]
    pub name: Option<Option<String>>,
    /// Version of this ancestor's data that the next database down the chain copied. See `forked_from.snapshot_id`.
    #[serde(
        rename = "snapshot_id",
        default,
        with = "::serde_with::rust::double_option",
        skip_serializing_if = "Option::is_none"
    )]
    pub snapshot_id: Option<Option<i64>>,
}

impl LineageAncestorInfo {
    /// One database up a fork chain.
    pub fn new(database_id: String, exists: bool) -> LineageAncestorInfo {
        LineageAncestorInfo {
            database_id,
            exists,
            forked_at: None,
            name: None,
            snapshot_id: None,
        }
    }
}