-
Notifications
You must be signed in to change notification settings - Fork 14
/
sourcepersistiq.go
61 lines (50 loc) · 1.3 KB
/
sourcepersistiq.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
// 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 Persistiq string
const (
PersistiqPersistiq Persistiq = "persistiq"
)
func (e Persistiq) ToPointer() *Persistiq {
return &e
}
func (e *Persistiq) UnmarshalJSON(data []byte) error {
var v string
if err := json.Unmarshal(data, &v); err != nil {
return err
}
switch v {
case "persistiq":
*e = Persistiq(v)
return nil
default:
return fmt.Errorf("invalid value for Persistiq: %v", v)
}
}
type SourcePersistiq struct {
// PersistIq API Key. See the <a href="https://apidocs.persistiq.com/#authentication">docs</a> for more information on where to find that key.
APIKey string `json:"api_key"`
sourceType Persistiq `const:"persistiq" json:"sourceType"`
}
func (s SourcePersistiq) MarshalJSON() ([]byte, error) {
return utils.MarshalJSON(s, "", false)
}
func (s *SourcePersistiq) UnmarshalJSON(data []byte) error {
if err := utils.UnmarshalJSON(data, &s, "", false, false); err != nil {
return err
}
return nil
}
func (o *SourcePersistiq) GetAPIKey() string {
if o == nil {
return ""
}
return o.APIKey
}
func (o *SourcePersistiq) GetSourceType() Persistiq {
return PersistiqPersistiq
}