-
Notifications
You must be signed in to change notification settings - Fork 14
/
destinationduckdb.go
79 lines (66 loc) · 1.83 KB
/
destinationduckdb.go
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
// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
package shared
import (
"encoding/json"
"fmt"
"github.com/airbytehq/terraform-provider-airbyte/internal/sdk/pkg/utils"
)
type Duckdb string
const (
DuckdbDuckdb Duckdb = "duckdb"
)
func (e Duckdb) ToPointer() *Duckdb {
return &e
}
func (e *Duckdb) UnmarshalJSON(data []byte) error {
var v string
if err := json.Unmarshal(data, &v); err != nil {
return err
}
switch v {
case "duckdb":
*e = Duckdb(v)
return nil
default:
return fmt.Errorf("invalid value for Duckdb: %v", v)
}
}
type DestinationDuckdb struct {
destinationType Duckdb `const:"duckdb" json:"destinationType"`
// Path to the .duckdb file, or the text 'md:' to connect to MotherDuck. The file will be placed inside that local mount. For more information check out our <a href="https://docs.airbyte.io/integrations/destinations/duckdb">docs</a>
DestinationPath string `json:"destination_path"`
// API key to use for authentication to a MotherDuck database.
MotherduckAPIKey *string `json:"motherduck_api_key,omitempty"`
// Database schema name, default for duckdb is 'main'.
Schema *string `json:"schema,omitempty"`
}
func (d DestinationDuckdb) MarshalJSON() ([]byte, error) {
return utils.MarshalJSON(d, "", false)
}
func (d *DestinationDuckdb) UnmarshalJSON(data []byte) error {
if err := utils.UnmarshalJSON(data, &d, "", false, false); err != nil {
return err
}
return nil
}
func (o *DestinationDuckdb) GetDestinationType() Duckdb {
return DuckdbDuckdb
}
func (o *DestinationDuckdb) GetDestinationPath() string {
if o == nil {
return ""
}
return o.DestinationPath
}
func (o *DestinationDuckdb) GetMotherduckAPIKey() *string {
if o == nil {
return nil
}
return o.MotherduckAPIKey
}
func (o *DestinationDuckdb) GetSchema() *string {
if o == nil {
return nil
}
return o.Schema
}