-
Notifications
You must be signed in to change notification settings - Fork 14
/
bulk.go
171 lines (148 loc) · 4.51 KB
/
bulk.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
// 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 BulkCreateJobParams struct {
Message *InboundBulkMessage `json:"message,omitempty" url:"message,omitempty"`
}
type BulkCreateJobResponse struct {
JobId string `json:"jobId" url:"jobId"`
_rawJSON json.RawMessage
}
func (b *BulkCreateJobResponse) UnmarshalJSON(data []byte) error {
type unmarshaler BulkCreateJobResponse
var value unmarshaler
if err := json.Unmarshal(data, &value); err != nil {
return err
}
*b = BulkCreateJobResponse(value)
b._rawJSON = json.RawMessage(data)
return nil
}
func (b *BulkCreateJobResponse) 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 BulkGetJobResponse struct {
Job *JobDetails `json:"job,omitempty" url:"job,omitempty"`
_rawJSON json.RawMessage
}
func (b *BulkGetJobResponse) UnmarshalJSON(data []byte) error {
type unmarshaler BulkGetJobResponse
var value unmarshaler
if err := json.Unmarshal(data, &value); err != nil {
return err
}
*b = BulkGetJobResponse(value)
b._rawJSON = json.RawMessage(data)
return nil
}
func (b *BulkGetJobResponse) 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 BulkGetJobUsersResponse struct {
Items []*BulkMessageUserResponse `json:"items,omitempty" url:"items,omitempty"`
Paging *Paging `json:"paging,omitempty" url:"paging,omitempty"`
_rawJSON json.RawMessage
}
func (b *BulkGetJobUsersResponse) UnmarshalJSON(data []byte) error {
type unmarshaler BulkGetJobUsersResponse
var value unmarshaler
if err := json.Unmarshal(data, &value); err != nil {
return err
}
*b = BulkGetJobUsersResponse(value)
b._rawJSON = json.RawMessage(data)
return nil
}
func (b *BulkGetJobUsersResponse) 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 BulkIngestUsersParams struct {
Users []*InboundBulkMessageUser `json:"users,omitempty" url:"users,omitempty"`
_rawJSON json.RawMessage
}
func (b *BulkIngestUsersParams) UnmarshalJSON(data []byte) error {
type unmarshaler BulkIngestUsersParams
var value unmarshaler
if err := json.Unmarshal(data, &value); err != nil {
return err
}
*b = BulkIngestUsersParams(value)
b._rawJSON = json.RawMessage(data)
return nil
}
func (b *BulkIngestUsersParams) 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 InboundBulkMessage struct {
// A unique identifier that represents the brand that should be used
// for rendering the notification.
Brand *string `json:"brand,omitempty" url:"brand,omitempty"`
// JSON that includes any data you want to pass to a message template.
// The data will populate the corresponding template variables.
Data map[string]interface{} `json:"data,omitempty" url:"data,omitempty"`
Event *string `json:"event,omitempty" url:"event,omitempty"`
Locale map[string]interface{} `json:"locale,omitempty" url:"locale,omitempty"`
// JSON that is merged into the request sent by Courier to the provider
// to override properties or to gain access to features in the provider
// API that are not natively supported by Courier.
Override interface{} `json:"override,omitempty" url:"override,omitempty"`
Message *InboundBulkMessageV2 `json:"message,omitempty" url:"message,omitempty"`
_rawJSON json.RawMessage
}
func (i *InboundBulkMessage) UnmarshalJSON(data []byte) error {
type unmarshaler InboundBulkMessage
var value unmarshaler
if err := json.Unmarshal(data, &value); err != nil {
return err
}
*i = InboundBulkMessage(value)
i._rawJSON = json.RawMessage(data)
return nil
}
func (i *InboundBulkMessage) String() string {
if len(i._rawJSON) > 0 {
if value, err := core.StringifyJSON(i._rawJSON); err == nil {
return value
}
}
if value, err := core.StringifyJSON(i); err == nil {
return value
}
return fmt.Sprintf("%#v", i)
}