-
Notifications
You must be signed in to change notification settings - Fork 14
/
Copy pathbrands.go
186 lines (162 loc) · 4.88 KB
/
brands.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
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
// This file was auto-generated by Fern from our API Definition.
package api
import (
json "encoding/json"
fmt "fmt"
core "github.com/trycourier/courier-go/v3/core"
)
type ListBrandsRequest struct {
// A unique identifier that allows for fetching the next set of brands.
Cursor *string `json:"-" url:"cursor,omitempty"`
}
type BrandUpdateParameters struct {
// The name of the brand.
Name string `json:"name" url:"name"`
Settings *BrandSettings `json:"settings,omitempty" url:"settings,omitempty"`
Snippets *BrandSnippets `json:"snippets,omitempty" url:"snippets,omitempty"`
}
type Brand struct {
// The date/time of when the brand was created. Represented in milliseconds since Unix epoch.
Created int `json:"created" url:"created"`
// Brand Identifier
Id *string `json:"id,omitempty" url:"id,omitempty"`
// Brand name
Name string `json:"name" url:"name"`
// The date/time of when the brand was published. Represented in milliseconds since Unix epoch.
Published int `json:"published" url:"published"`
Settings *BrandSettings `json:"settings,omitempty" url:"settings,omitempty"`
// The date/time of when the brand was updated. Represented in milliseconds since Unix epoch.
Updated int `json:"updated" url:"updated"`
Snippets *BrandSnippets `json:"snippets,omitempty" url:"snippets,omitempty"`
// The version identifier for the brand
Version string `json:"version" url:"version"`
_rawJSON json.RawMessage
}
func (b *Brand) UnmarshalJSON(data []byte) error {
type unmarshaler Brand
var value unmarshaler
if err := json.Unmarshal(data, &value); err != nil {
return err
}
*b = Brand(value)
b._rawJSON = json.RawMessage(data)
return nil
}
func (b *Brand) String() string {
if len(b._rawJSON) > 0 {
if value, err := core.StringifyJSON(b._rawJSON); err == nil {
return value
}
}
if value, err := core.StringifyJSON(b); err == nil {
return value
}
return fmt.Sprintf("%#v", b)
}
type BrandParameters struct {
Id *string `json:"id,omitempty" url:"id,omitempty"`
// The name of the brand.
Name string `json:"name" url:"name"`
Settings *BrandSettings `json:"settings,omitempty" url:"settings,omitempty"`
Snippets *BrandSnippets `json:"snippets,omitempty" url:"snippets,omitempty"`
_rawJSON json.RawMessage
}
func (b *BrandParameters) UnmarshalJSON(data []byte) error {
type unmarshaler BrandParameters
var value unmarshaler
if err := json.Unmarshal(data, &value); err != nil {
return err
}
*b = BrandParameters(value)
b._rawJSON = json.RawMessage(data)
return nil
}
func (b *BrandParameters) String() string {
if len(b._rawJSON) > 0 {
if value, err := core.StringifyJSON(b._rawJSON); err == nil {
return value
}
}
if value, err := core.StringifyJSON(b); err == nil {
return value
}
return fmt.Sprintf("%#v", b)
}
type BrandSettings struct {
Colors *BrandColors `json:"colors,omitempty" url:"colors,omitempty"`
Inapp interface{} `json:"inapp,omitempty" url:"inapp,omitempty"`
Email *Email `json:"email,omitempty" url:"email,omitempty"`
_rawJSON json.RawMessage
}
func (b *BrandSettings) UnmarshalJSON(data []byte) error {
type unmarshaler BrandSettings
var value unmarshaler
if err := json.Unmarshal(data, &value); err != nil {
return err
}
*b = BrandSettings(value)
b._rawJSON = json.RawMessage(data)
return nil
}
func (b *BrandSettings) String() string {
if len(b._rawJSON) > 0 {
if value, err := core.StringifyJSON(b._rawJSON); err == nil {
return value
}
}
if value, err := core.StringifyJSON(b); err == nil {
return value
}
return fmt.Sprintf("%#v", b)
}
type BrandSnippets struct {
Items []*BrandSnippet `json:"items,omitempty" url:"items,omitempty"`
_rawJSON json.RawMessage
}
func (b *BrandSnippets) UnmarshalJSON(data []byte) error {
type unmarshaler BrandSnippets
var value unmarshaler
if err := json.Unmarshal(data, &value); err != nil {
return err
}
*b = BrandSnippets(value)
b._rawJSON = json.RawMessage(data)
return nil
}
func (b *BrandSnippets) String() string {
if len(b._rawJSON) > 0 {
if value, err := core.StringifyJSON(b._rawJSON); err == nil {
return value
}
}
if value, err := core.StringifyJSON(b); err == nil {
return value
}
return fmt.Sprintf("%#v", b)
}
type BrandsResponse struct {
Paging *Paging `json:"paging,omitempty" url:"paging,omitempty"`
Results []*Brand `json:"results,omitempty" url:"results,omitempty"`
_rawJSON json.RawMessage
}
func (b *BrandsResponse) UnmarshalJSON(data []byte) error {
type unmarshaler BrandsResponse
var value unmarshaler
if err := json.Unmarshal(data, &value); err != nil {
return err
}
*b = BrandsResponse(value)
b._rawJSON = json.RawMessage(data)
return nil
}
func (b *BrandsResponse) String() string {
if len(b._rawJSON) > 0 {
if value, err := core.StringifyJSON(b._rawJSON); err == nil {
return value
}
}
if value, err := core.StringifyJSON(b); err == nil {
return value
}
return fmt.Sprintf("%#v", b)
}