-
Notifications
You must be signed in to change notification settings - Fork 14
/
sourcedremio.go
70 lines (58 loc) · 1.35 KB
/
sourcedremio.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
// 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 Dremio string
const (
DremioDremio Dremio = "dremio"
)
func (e Dremio) ToPointer() *Dremio {
return &e
}
func (e *Dremio) UnmarshalJSON(data []byte) error {
var v string
if err := json.Unmarshal(data, &v); err != nil {
return err
}
switch v {
case "dremio":
*e = Dremio(v)
return nil
default:
return fmt.Errorf("invalid value for Dremio: %v", v)
}
}
type SourceDremio struct {
// API Key that is generated when you authenticate to Dremio API
APIKey string `json:"api_key"`
// URL of your Dremio instance
BaseURL *string `default:"https://app.dremio.cloud" json:"base_url"`
sourceType Dremio `const:"dremio" json:"sourceType"`
}
func (s SourceDremio) MarshalJSON() ([]byte, error) {
return utils.MarshalJSON(s, "", false)
}
func (s *SourceDremio) UnmarshalJSON(data []byte) error {
if err := utils.UnmarshalJSON(data, &s, "", false, false); err != nil {
return err
}
return nil
}
func (o *SourceDremio) GetAPIKey() string {
if o == nil {
return ""
}
return o.APIKey
}
func (o *SourceDremio) GetBaseURL() *string {
if o == nil {
return nil
}
return o.BaseURL
}
func (o *SourceDremio) GetSourceType() Dremio {
return DremioDremio
}