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
/*
* 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};
/// CreateConnectionRequest : Request body for POST /connections
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct CreateConnectionRequest {
/// Connection configuration object. Fields vary by source type (host, port, database, etc.).
#[serde(rename = "config")]
pub config: std::collections::HashMap<String, serde_json::Value>,
#[serde(rename = "name")]
pub name: String,
/// Optional reference to a secret by ID (e.g., \"secr_abc123\"). If provided, this secret will be used for authentication. Mutually exclusive with `secret_name`.
#[serde(
rename = "secret_id",
default,
with = "::serde_with::rust::double_option",
skip_serializing_if = "Option::is_none"
)]
pub secret_id: Option<Option<String>>,
/// Optional reference to a secret by name. If provided, this secret will be used for authentication. Mutually exclusive with `secret_id`.
#[serde(
rename = "secret_name",
default,
with = "::serde_with::rust::double_option",
skip_serializing_if = "Option::is_none"
)]
pub secret_name: Option<Option<String>>,
/// If true, skip automatic schema discovery after registering the connection. The connection will be created but no tables will be discovered. You can run discovery later via the refresh endpoint.
#[serde(rename = "skip_discovery", skip_serializing_if = "Option::is_none")]
pub skip_discovery: Option<bool>,
#[serde(rename = "source_type")]
pub source_type: String,
/// Physical storage backend for tables created under this connection. `\"parquet\"` (default) uses the versioned parquet cache. `\"ducklake\"` stores data in a DuckLake catalog in the shared metadata DB configured via `ducklake.metadata_pg_url`; accepted for any source type and requires that pool to be configured.
#[serde(
rename = "storage_backend",
default,
with = "::serde_with::rust::double_option",
skip_serializing_if = "Option::is_none"
)]
pub storage_backend: Option<Option<String>>,
}
impl CreateConnectionRequest {
/// Request body for POST /connections
pub fn new(
config: std::collections::HashMap<String, serde_json::Value>,
name: String,
source_type: String,
) -> CreateConnectionRequest {
CreateConnectionRequest {
config,
name,
secret_id: None,
secret_name: None,
skip_discovery: None,
source_type,
storage_backend: None,
}
}
}