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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
/*
* 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};
/// DatabaseDetailResponse : Response body for GET /databases/{database_id}
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct DatabaseDetailResponse {
#[serde(rename = "attachments")]
pub attachments: Vec<models::DatabaseAttachmentInfo>,
/// When the database was created.
#[serde(
rename = "created_at",
default,
with = "::serde_with::rust::double_option",
skip_serializing_if = "Option::is_none"
)]
pub created_at: Option<Option<String>>,
/// Name the database's default catalog answers to inside its query scope (`default` unless overridden at create time).
#[serde(rename = "default_catalog")]
pub default_catalog: String,
/// Id of the connection backing this database's `default` catalog. Pass it as `connection_id` to `POST /v1/databases/{other}/catalogs` to attach this database's catalog into another database. In SQL, address the catalog as `default` inside an `X-Database-Id` scope, not by id.
#[serde(rename = "default_connection_id")]
pub default_connection_id: String,
/// Schema that unqualified table names resolve to inside this database's query scope. `main` unless the database declares a single schema or a `default_schema` was set at create time.
#[serde(rename = "default_schema")]
pub default_schema: String,
/// When this database expires.
#[serde(
rename = "expires_at",
default,
with = "::serde_with::rust::double_option",
skip_serializing_if = "Option::is_none"
)]
pub expires_at: Option<Option<String>>,
#[serde(
rename = "forked_from",
default,
with = "::serde_with::rust::double_option",
skip_serializing_if = "Option::is_none"
)]
pub forked_from: Option<Option<Box<models::ForkedFromInfo>>>,
#[serde(rename = "id")]
pub id: String,
#[serde(
rename = "name",
default,
with = "::serde_with::rust::double_option",
skip_serializing_if = "Option::is_none"
)]
pub name: Option<Option<String>>,
}
impl DatabaseDetailResponse {
/// Response body for GET /databases/{database_id}
pub fn new(
attachments: Vec<models::DatabaseAttachmentInfo>,
default_catalog: String,
default_connection_id: String,
default_schema: String,
id: String,
) -> DatabaseDetailResponse {
DatabaseDetailResponse {
attachments,
created_at: None,
default_catalog,
default_connection_id,
default_schema,
expires_at: None,
forked_from: None,
id,
name: None,
}
}
}