-
Notifications
You must be signed in to change notification settings - Fork 14
/
destinationdevnullupdate.go
107 lines (84 loc) · 2.34 KB
/
destinationdevnullupdate.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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
package shared
import (
"encoding/json"
"errors"
"fmt"
"github.com/airbytehq/terraform-provider-airbyte/internal/sdk/pkg/utils"
)
type TestDestinationType string
const (
TestDestinationTypeSilent TestDestinationType = "SILENT"
)
func (e TestDestinationType) ToPointer() *TestDestinationType {
return &e
}
func (e *TestDestinationType) UnmarshalJSON(data []byte) error {
var v string
if err := json.Unmarshal(data, &v); err != nil {
return err
}
switch v {
case "SILENT":
*e = TestDestinationType(v)
return nil
default:
return fmt.Errorf("invalid value for TestDestinationType: %v", v)
}
}
type Silent struct {
testDestinationType *TestDestinationType `const:"SILENT" json:"test_destination_type"`
}
func (s Silent) MarshalJSON() ([]byte, error) {
return utils.MarshalJSON(s, "", false)
}
func (s *Silent) UnmarshalJSON(data []byte) error {
if err := utils.UnmarshalJSON(data, &s, "", false, true); err != nil {
return err
}
return nil
}
func (o *Silent) GetTestDestinationType() *TestDestinationType {
return TestDestinationTypeSilent.ToPointer()
}
type TestDestinationUnionType string
const (
TestDestinationUnionTypeSilent TestDestinationUnionType = "Silent"
)
// TestDestination - The type of destination to be used
type TestDestination struct {
Silent *Silent
Type TestDestinationUnionType
}
func CreateTestDestinationSilent(silent Silent) TestDestination {
typ := TestDestinationUnionTypeSilent
return TestDestination{
Silent: &silent,
Type: typ,
}
}
func (u *TestDestination) UnmarshalJSON(data []byte) error {
silent := new(Silent)
if err := utils.UnmarshalJSON(data, &silent, "", true, true); err == nil {
u.Silent = silent
u.Type = TestDestinationUnionTypeSilent
return nil
}
return errors.New("could not unmarshal into supported union types")
}
func (u TestDestination) MarshalJSON() ([]byte, error) {
if u.Silent != nil {
return utils.MarshalJSON(u.Silent, "", true)
}
return nil, errors.New("could not marshal union type: all fields are null")
}
type DestinationDevNullUpdate struct {
// The type of destination to be used
TestDestination TestDestination `json:"test_destination"`
}
func (o *DestinationDevNullUpdate) GetTestDestination() TestDestination {
if o == nil {
return TestDestination{}
}
return o.TestDestination
}