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

/// LineageForkInfo : One database forked directly from the one being asked about.
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct LineageForkInfo {
    #[serde(rename = "database_id")]
    pub database_id: String,
    /// False once the fork has been deleted. The record of it is kept either way, so a source can still account for everything taken from it.
    #[serde(rename = "exists")]
    pub exists: bool,
    /// When the fork was taken.
    #[serde(
        rename = "forked_at",
        default,
        with = "::serde_with::rust::double_option",
        skip_serializing_if = "Option::is_none"
    )]
    pub forked_at: Option<Option<String>>,
    /// Absent once the fork has been deleted — only the record of it remains.
    #[serde(
        rename = "name",
        default,
        with = "::serde_with::rust::double_option",
        skip_serializing_if = "Option::is_none"
    )]
    pub name: Option<Option<String>>,
    /// Version of this database's data that the fork 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 LineageForkInfo {
    /// One database forked directly from the one being asked about.
    pub fn new(database_id: String, exists: bool) -> LineageForkInfo {
        LineageForkInfo {
            database_id,
            exists,
            forked_at: None,
            name: None,
            snapshot_id: None,
        }
    }
}