1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
/*
* 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};
/// DatabaseLineageResponse : Response body for GET /databases/{database_id}/lineage. Answers where a database came from and what came from it. Everything here is a historical record: forks are independent databases, and lineage does not make one depend on another.
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct DatabaseLineageResponse {
/// Fork ancestry, nearest parent first, ending at the database named by `root_id` unless `ancestors_truncated` says otherwise. A deleted generation does not cut the chain short — it is listed with `exists` false and the ancestry continues past it. Empty when this database is not a fork.
#[serde(rename = "ancestors")]
pub ancestors: Vec<models::LineageAncestorInfo>,
/// True when the ancestry is longer than one response carries, so `ancestors` stops before reaching `root_id`.
#[serde(rename = "ancestors_truncated")]
pub ancestors_truncated: bool,
/// The database this lineage describes.
#[serde(rename = "database_id")]
pub database_id: String,
/// How many databases were forked directly from this one in total — so you can tell whether `forks` is the whole set or only the newest of it.
#[serde(rename = "fork_count")]
pub fork_count: i64,
/// The databases forked directly from this one, most recently forked first, including any that have since been deleted. A fork of a fork appears in its own parent's lineage, not here.
#[serde(rename = "forks")]
pub forks: Vec<models::LineageForkInfo>,
/// Top of the family tree: the database the whole chain of forks descends from. Equal to `database_id` when this database is not a fork.
#[serde(rename = "root_id")]
pub root_id: String,
}
impl DatabaseLineageResponse {
/// Response body for GET /databases/{database_id}/lineage. Answers where a database came from and what came from it. Everything here is a historical record: forks are independent databases, and lineage does not make one depend on another.
pub fn new(
ancestors: Vec<models::LineageAncestorInfo>,
ancestors_truncated: bool,
database_id: String,
fork_count: i64,
forks: Vec<models::LineageForkInfo>,
root_id: String,
) -> DatabaseLineageResponse {
DatabaseLineageResponse {
ancestors,
ancestors_truncated,
database_id,
fork_count,
forks,
root_id,
}
}
}