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
/*
* Hotdata API
*
* Powerful data platform API for datasets, 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};
/// CreateDatabaseResponse : Response body for POST /databases
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct CreateDatabaseResponse {
/// 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,
/// Internal id of the connection that backs this database's `default` catalog. Workspace-level connection endpoints (list, get, health, delete, cache purge) refuse to act on this id — it is exposed only for the managed-tables load endpoint (`POST /v1/connections/{id}/schemas/{s}/tables/{t}/loads`) so callers can publish parquet into tables declared at database-create time. Addressing it directly in SQL is not the recommended path — use `default` inside an `X-Database-Id` scope instead.
#[serde(rename = "default_connection_id")]
pub default_connection_id: 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 = "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 CreateDatabaseResponse {
/// Response body for POST /databases
pub fn new(
default_catalog: String,
default_connection_id: String,
id: String,
) -> CreateDatabaseResponse {
CreateDatabaseResponse {
default_catalog,
default_connection_id,
expires_at: None,
id,
name: None,
}
}
}