-
Notifications
You must be signed in to change notification settings - Fork 14
/
Copy pathnotifications.go
188 lines (162 loc) · 4.46 KB
/
notifications.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
// 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 NotificationListParams struct {
Cursor *string `json:"-" url:"cursor,omitempty"`
}
type SubmissionChecksReplaceParams struct {
Checks []*BaseCheck `json:"checks,omitempty" url:"checks,omitempty"`
}
type BaseCheck struct {
Id string `json:"id" url:"id"`
Status CheckStatus `json:"status,omitempty" url:"status,omitempty"`
type_ string
_rawJSON json.RawMessage
}
func (b *BaseCheck) Type() string {
return b.type_
}
func (b *BaseCheck) UnmarshalJSON(data []byte) error {
type embed BaseCheck
var unmarshaler = struct {
embed
}{
embed: embed(*b),
}
if err := json.Unmarshal(data, &unmarshaler); err != nil {
return err
}
*b = BaseCheck(unmarshaler.embed)
b.type_ = "custom"
b._rawJSON = json.RawMessage(data)
return nil
}
func (b *BaseCheck) MarshalJSON() ([]byte, error) {
type embed BaseCheck
var marshaler = struct {
embed
Type string `json:"type"`
}{
embed: embed(*b),
Type: "custom",
}
return json.Marshal(marshaler)
}
func (b *BaseCheck) 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 NotificationGetContentResponse struct {
Blocks []*NotificationBlock `json:"blocks,omitempty" url:"blocks,omitempty"`
Channels []*NotificationChannel `json:"channels,omitempty" url:"channels,omitempty"`
Checksum *string `json:"checksum,omitempty" url:"checksum,omitempty"`
_rawJSON json.RawMessage
}
func (n *NotificationGetContentResponse) UnmarshalJSON(data []byte) error {
type unmarshaler NotificationGetContentResponse
var value unmarshaler
if err := json.Unmarshal(data, &value); err != nil {
return err
}
*n = NotificationGetContentResponse(value)
n._rawJSON = json.RawMessage(data)
return nil
}
func (n *NotificationGetContentResponse) String() string {
if len(n._rawJSON) > 0 {
if value, err := core.StringifyJSON(n._rawJSON); err == nil {
return value
}
}
if value, err := core.StringifyJSON(n); err == nil {
return value
}
return fmt.Sprintf("%#v", n)
}
type NotificationListResponse struct {
Paging *Paging `json:"paging,omitempty" url:"paging,omitempty"`
Results []*Notification `json:"results,omitempty" url:"results,omitempty"`
_rawJSON json.RawMessage
}
func (n *NotificationListResponse) UnmarshalJSON(data []byte) error {
type unmarshaler NotificationListResponse
var value unmarshaler
if err := json.Unmarshal(data, &value); err != nil {
return err
}
*n = NotificationListResponse(value)
n._rawJSON = json.RawMessage(data)
return nil
}
func (n *NotificationListResponse) String() string {
if len(n._rawJSON) > 0 {
if value, err := core.StringifyJSON(n._rawJSON); err == nil {
return value
}
}
if value, err := core.StringifyJSON(n); err == nil {
return value
}
return fmt.Sprintf("%#v", n)
}
type SubmissionChecksGetResponse struct {
Checks []*Check `json:"checks,omitempty" url:"checks,omitempty"`
_rawJSON json.RawMessage
}
func (s *SubmissionChecksGetResponse) UnmarshalJSON(data []byte) error {
type unmarshaler SubmissionChecksGetResponse
var value unmarshaler
if err := json.Unmarshal(data, &value); err != nil {
return err
}
*s = SubmissionChecksGetResponse(value)
s._rawJSON = json.RawMessage(data)
return nil
}
func (s *SubmissionChecksGetResponse) 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 SubmissionChecksReplaceResponse struct {
Checks []*Check `json:"checks,omitempty" url:"checks,omitempty"`
_rawJSON json.RawMessage
}
func (s *SubmissionChecksReplaceResponse) UnmarshalJSON(data []byte) error {
type unmarshaler SubmissionChecksReplaceResponse
var value unmarshaler
if err := json.Unmarshal(data, &value); err != nil {
return err
}
*s = SubmissionChecksReplaceResponse(value)
s._rawJSON = json.RawMessage(data)
return nil
}
func (s *SubmissionChecksReplaceResponse) 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)
}