-
Notifications
You must be signed in to change notification settings - Fork 14
/
profiles.go
312 lines (271 loc) · 6.97 KB
/
profiles.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
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
// 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 MergeProfileRequest struct {
Profile map[string]interface{} `json:"profile,omitempty" url:"profile,omitempty"`
}
type GetListSubscriptionsRequest struct {
// A unique identifier that allows for fetching the next set of message statuses.
Cursor *string `json:"-" url:"cursor,omitempty"`
}
type ReplaceProfileRequest struct {
Profile map[string]interface{} `json:"profile,omitempty" url:"profile,omitempty"`
}
type DeleteListSubscriptionResponse struct {
status string
_rawJSON json.RawMessage
}
func (d *DeleteListSubscriptionResponse) Status() string {
return d.status
}
func (d *DeleteListSubscriptionResponse) UnmarshalJSON(data []byte) error {
type embed DeleteListSubscriptionResponse
var unmarshaler = struct {
embed
}{
embed: embed(*d),
}
if err := json.Unmarshal(data, &unmarshaler); err != nil {
return err
}
*d = DeleteListSubscriptionResponse(unmarshaler.embed)
d.status = "SUCCESS"
d._rawJSON = json.RawMessage(data)
return nil
}
func (d *DeleteListSubscriptionResponse) MarshalJSON() ([]byte, error) {
type embed DeleteListSubscriptionResponse
var marshaler = struct {
embed
Status string `json:"status"`
}{
embed: embed(*d),
Status: "SUCCESS",
}
return json.Marshal(marshaler)
}
func (d *DeleteListSubscriptionResponse) String() string {
if len(d._rawJSON) > 0 {
if value, err := core.StringifyJSON(d._rawJSON); err == nil {
return value
}
}
if value, err := core.StringifyJSON(d); err == nil {
return value
}
return fmt.Sprintf("%#v", d)
}
type GetListSubscriptionsResponse struct {
Paging *Paging `json:"paging,omitempty" url:"paging,omitempty"`
// An array of lists
Results []*GetListSubscriptionsList `json:"results,omitempty" url:"results,omitempty"`
_rawJSON json.RawMessage
}
func (g *GetListSubscriptionsResponse) UnmarshalJSON(data []byte) error {
type unmarshaler GetListSubscriptionsResponse
var value unmarshaler
if err := json.Unmarshal(data, &value); err != nil {
return err
}
*g = GetListSubscriptionsResponse(value)
g._rawJSON = json.RawMessage(data)
return nil
}
func (g *GetListSubscriptionsResponse) String() string {
if len(g._rawJSON) > 0 {
if value, err := core.StringifyJSON(g._rawJSON); err == nil {
return value
}
}
if value, err := core.StringifyJSON(g); err == nil {
return value
}
return fmt.Sprintf("%#v", g)
}
type MergeProfileResponse struct {
status string
_rawJSON json.RawMessage
}
func (m *MergeProfileResponse) Status() string {
return m.status
}
func (m *MergeProfileResponse) UnmarshalJSON(data []byte) error {
type embed MergeProfileResponse
var unmarshaler = struct {
embed
}{
embed: embed(*m),
}
if err := json.Unmarshal(data, &unmarshaler); err != nil {
return err
}
*m = MergeProfileResponse(unmarshaler.embed)
m.status = "SUCCESS"
m._rawJSON = json.RawMessage(data)
return nil
}
func (m *MergeProfileResponse) MarshalJSON() ([]byte, error) {
type embed MergeProfileResponse
var marshaler = struct {
embed
Status string `json:"status"`
}{
embed: embed(*m),
Status: "SUCCESS",
}
return json.Marshal(marshaler)
}
func (m *MergeProfileResponse) String() string {
if len(m._rawJSON) > 0 {
if value, err := core.StringifyJSON(m._rawJSON); err == nil {
return value
}
}
if value, err := core.StringifyJSON(m); err == nil {
return value
}
return fmt.Sprintf("%#v", m)
}
type ProfileGetResponse struct {
Profile map[string]interface{} `json:"profile,omitempty" url:"profile,omitempty"`
Preferences *RecipientPreferences `json:"preferences,omitempty" url:"preferences,omitempty"`
_rawJSON json.RawMessage
}
func (p *ProfileGetResponse) UnmarshalJSON(data []byte) error {
type unmarshaler ProfileGetResponse
var value unmarshaler
if err := json.Unmarshal(data, &value); err != nil {
return err
}
*p = ProfileGetResponse(value)
p._rawJSON = json.RawMessage(data)
return nil
}
func (p *ProfileGetResponse) String() string {
if len(p._rawJSON) > 0 {
if value, err := core.StringifyJSON(p._rawJSON); err == nil {
return value
}
}
if value, err := core.StringifyJSON(p); err == nil {
return value
}
return fmt.Sprintf("%#v", p)
}
type ReplaceProfileResponse struct {
status string
_rawJSON json.RawMessage
}
func (r *ReplaceProfileResponse) Status() string {
return r.status
}
func (r *ReplaceProfileResponse) UnmarshalJSON(data []byte) error {
type embed ReplaceProfileResponse
var unmarshaler = struct {
embed
}{
embed: embed(*r),
}
if err := json.Unmarshal(data, &unmarshaler); err != nil {
return err
}
*r = ReplaceProfileResponse(unmarshaler.embed)
r.status = "SUCCESS"
r._rawJSON = json.RawMessage(data)
return nil
}
func (r *ReplaceProfileResponse) MarshalJSON() ([]byte, error) {
type embed ReplaceProfileResponse
var marshaler = struct {
embed
Status string `json:"status"`
}{
embed: embed(*r),
Status: "SUCCESS",
}
return json.Marshal(marshaler)
}
func (r *ReplaceProfileResponse) String() string {
if len(r._rawJSON) > 0 {
if value, err := core.StringifyJSON(r._rawJSON); err == nil {
return value
}
}
if value, err := core.StringifyJSON(r); err == nil {
return value
}
return fmt.Sprintf("%#v", r)
}
type SubscribeToListsRequest struct {
Lists []*SubscribeToListsRequestListObject `json:"lists,omitempty" url:"lists,omitempty"`
_rawJSON json.RawMessage
}
func (s *SubscribeToListsRequest) UnmarshalJSON(data []byte) error {
type unmarshaler SubscribeToListsRequest
var value unmarshaler
if err := json.Unmarshal(data, &value); err != nil {
return err
}
*s = SubscribeToListsRequest(value)
s._rawJSON = json.RawMessage(data)
return nil
}
func (s *SubscribeToListsRequest) String() string {
if len(s._rawJSON) > 0 {
if value, err := core.StringifyJSON(s._rawJSON); err == nil {
return value
}
}
if value, err := core.StringifyJSON(s); err == nil {
return value
}
return fmt.Sprintf("%#v", s)
}
type SubscribeToListsResponse struct {
status string
_rawJSON json.RawMessage
}
func (s *SubscribeToListsResponse) Status() string {
return s.status
}
func (s *SubscribeToListsResponse) UnmarshalJSON(data []byte) error {
type embed SubscribeToListsResponse
var unmarshaler = struct {
embed
}{
embed: embed(*s),
}
if err := json.Unmarshal(data, &unmarshaler); err != nil {
return err
}
*s = SubscribeToListsResponse(unmarshaler.embed)
s.status = "SUCCESS"
s._rawJSON = json.RawMessage(data)
return nil
}
func (s *SubscribeToListsResponse) MarshalJSON() ([]byte, error) {
type embed SubscribeToListsResponse
var marshaler = struct {
embed
Status string `json:"status"`
}{
embed: embed(*s),
Status: "SUCCESS",
}
return json.Marshal(marshaler)
}
func (s *SubscribeToListsResponse) String() string {
if len(s._rawJSON) > 0 {
if value, err := core.StringifyJSON(s._rawJSON); err == nil {
return value
}
}
if value, err := core.StringifyJSON(s); err == nil {
return value
}
return fmt.Sprintf("%#v", s)
}