-
Notifications
You must be signed in to change notification settings - Fork 4
/
request.go
231 lines (197 loc) · 8.94 KB
/
request.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
// This file was auto-generated by Fern from our API Definition.
package api
import (
fmt "fmt"
time "time"
)
type RequestListRequest struct {
Id []*string `json:"-" url:"id,omitempty"`
Status *RequestListRequestStatus `json:"-" url:"status,omitempty"`
RejectionCause *RequestRejectionCause `json:"-" url:"rejection_cause,omitempty"`
SourceId []*string `json:"-" url:"source_id,omitempty"`
Verified *bool `json:"-" url:"verified,omitempty"`
SearchTerm *string `json:"-" url:"search_term,omitempty"`
Headers *string `json:"-" url:"headers,omitempty"`
Body *string `json:"-" url:"body,omitempty"`
ParsedQuery *string `json:"-" url:"parsed_query,omitempty"`
Path *string `json:"-" url:"path,omitempty"`
IgnoredCount *int `json:"-" url:"ignored_count,omitempty"`
EventsCount *int `json:"-" url:"events_count,omitempty"`
IngestedAt *time.Time `json:"-" url:"ingested_at,omitempty"`
BulkRetryId []*string `json:"-" url:"bulk_retry_id,omitempty"`
Include *string `json:"-" url:"include,omitempty"`
OrderBy *RequestListRequestOrderBy `json:"-" url:"order_by,omitempty"`
Dir *RequestListRequestDir `json:"-" url:"dir,omitempty"`
Limit *int `json:"-" url:"limit,omitempty"`
Next *string `json:"-" url:"next,omitempty"`
Prev *string `json:"-" url:"prev,omitempty"`
}
type RequestListEventRequest struct {
Id []*string `json:"-" url:"id,omitempty"`
Status *EventStatus `json:"-" url:"status,omitempty"`
WebhookId []*string `json:"-" url:"webhook_id,omitempty"`
DestinationId []*string `json:"-" url:"destination_id,omitempty"`
SourceId []*string `json:"-" url:"source_id,omitempty"`
Attempts *int `json:"-" url:"attempts,omitempty"`
ResponseStatus *int `json:"-" url:"response_status,omitempty"`
SuccessfulAt *time.Time `json:"-" url:"successful_at,omitempty"`
CreatedAt *time.Time `json:"-" url:"created_at,omitempty"`
ErrorCode *AttemptErrorCodes `json:"-" url:"error_code,omitempty"`
CliId *string `json:"-" url:"cli_id,omitempty"`
LastAttemptAt *time.Time `json:"-" url:"last_attempt_at,omitempty"`
SearchTerm *string `json:"-" url:"search_term,omitempty"`
Headers *string `json:"-" url:"headers,omitempty"`
Body *string `json:"-" url:"body,omitempty"`
ParsedQuery *string `json:"-" url:"parsed_query,omitempty"`
Path *string `json:"-" url:"path,omitempty"`
CliUserId []*string `json:"-" url:"cli_user_id,omitempty"`
IssueId []*string `json:"-" url:"issue_id,omitempty"`
EventDataId []*string `json:"-" url:"event_data_id,omitempty"`
BulkRetryId []*string `json:"-" url:"bulk_retry_id,omitempty"`
Include *string `json:"-" url:"include,omitempty"`
OrderBy *RequestListEventRequestOrderBy `json:"-" url:"order_by,omitempty"`
Dir *RequestListEventRequestDir `json:"-" url:"dir,omitempty"`
Limit *int `json:"-" url:"limit,omitempty"`
Next *string `json:"-" url:"next,omitempty"`
Prev *string `json:"-" url:"prev,omitempty"`
}
type RequestListIgnoredEventRequest struct {
Id []*string `json:"-" url:"id,omitempty"`
OrderBy *RequestListIgnoredEventRequestOrderBy `json:"-" url:"order_by,omitempty"`
Dir *RequestListIgnoredEventRequestDir `json:"-" url:"dir,omitempty"`
Limit *int `json:"-" url:"limit,omitempty"`
Next *string `json:"-" url:"next,omitempty"`
Prev *string `json:"-" url:"prev,omitempty"`
}
type RequestRetryRequest struct {
// Subset of webhook_ids to re-run the event logic on. Useful to retry only specific ignored_events
WebhookIds []string `json:"webhook_ids,omitempty" url:"-"`
}
// Sort direction
type RequestListEventRequestDir string
const (
RequestListEventRequestDirAsc RequestListEventRequestDir = "asc"
RequestListEventRequestDirDesc RequestListEventRequestDir = "desc"
)
func NewRequestListEventRequestDirFromString(s string) (RequestListEventRequestDir, error) {
switch s {
case "asc":
return RequestListEventRequestDirAsc, nil
case "desc":
return RequestListEventRequestDirDesc, nil
}
var t RequestListEventRequestDir
return "", fmt.Errorf("%s is not a valid %T", s, t)
}
func (r RequestListEventRequestDir) Ptr() *RequestListEventRequestDir {
return &r
}
// Sort key
type RequestListEventRequestOrderBy string
const (
RequestListEventRequestOrderByLastAttemptAt RequestListEventRequestOrderBy = "last_attempt_at"
RequestListEventRequestOrderByCreatedAt RequestListEventRequestOrderBy = "created_at"
)
func NewRequestListEventRequestOrderByFromString(s string) (RequestListEventRequestOrderBy, error) {
switch s {
case "last_attempt_at":
return RequestListEventRequestOrderByLastAttemptAt, nil
case "created_at":
return RequestListEventRequestOrderByCreatedAt, nil
}
var t RequestListEventRequestOrderBy
return "", fmt.Errorf("%s is not a valid %T", s, t)
}
func (r RequestListEventRequestOrderBy) Ptr() *RequestListEventRequestOrderBy {
return &r
}
type RequestListIgnoredEventRequestDir string
const (
RequestListIgnoredEventRequestDirAsc RequestListIgnoredEventRequestDir = "asc"
RequestListIgnoredEventRequestDirDesc RequestListIgnoredEventRequestDir = "desc"
)
func NewRequestListIgnoredEventRequestDirFromString(s string) (RequestListIgnoredEventRequestDir, error) {
switch s {
case "asc":
return RequestListIgnoredEventRequestDirAsc, nil
case "desc":
return RequestListIgnoredEventRequestDirDesc, nil
}
var t RequestListIgnoredEventRequestDir
return "", fmt.Errorf("%s is not a valid %T", s, t)
}
func (r RequestListIgnoredEventRequestDir) Ptr() *RequestListIgnoredEventRequestDir {
return &r
}
type RequestListIgnoredEventRequestOrderBy string
const (
RequestListIgnoredEventRequestOrderByCreatedAt RequestListIgnoredEventRequestOrderBy = "created_at"
)
func NewRequestListIgnoredEventRequestOrderByFromString(s string) (RequestListIgnoredEventRequestOrderBy, error) {
switch s {
case "created_at":
return RequestListIgnoredEventRequestOrderByCreatedAt, nil
}
var t RequestListIgnoredEventRequestOrderBy
return "", fmt.Errorf("%s is not a valid %T", s, t)
}
func (r RequestListIgnoredEventRequestOrderBy) Ptr() *RequestListIgnoredEventRequestOrderBy {
return &r
}
// Sort direction
type RequestListRequestDir string
const (
RequestListRequestDirAsc RequestListRequestDir = "asc"
RequestListRequestDirDesc RequestListRequestDir = "desc"
)
func NewRequestListRequestDirFromString(s string) (RequestListRequestDir, error) {
switch s {
case "asc":
return RequestListRequestDirAsc, nil
case "desc":
return RequestListRequestDirDesc, nil
}
var t RequestListRequestDir
return "", fmt.Errorf("%s is not a valid %T", s, t)
}
func (r RequestListRequestDir) Ptr() *RequestListRequestDir {
return &r
}
// Sort key
type RequestListRequestOrderBy string
const (
RequestListRequestOrderByIngestedAt RequestListRequestOrderBy = "ingested_at"
RequestListRequestOrderByCreatedAt RequestListRequestOrderBy = "created_at"
)
func NewRequestListRequestOrderByFromString(s string) (RequestListRequestOrderBy, error) {
switch s {
case "ingested_at":
return RequestListRequestOrderByIngestedAt, nil
case "created_at":
return RequestListRequestOrderByCreatedAt, nil
}
var t RequestListRequestOrderBy
return "", fmt.Errorf("%s is not a valid %T", s, t)
}
func (r RequestListRequestOrderBy) Ptr() *RequestListRequestOrderBy {
return &r
}
// Filter by status
type RequestListRequestStatus string
const (
RequestListRequestStatusAccepted RequestListRequestStatus = "accepted"
RequestListRequestStatusRejected RequestListRequestStatus = "rejected"
)
func NewRequestListRequestStatusFromString(s string) (RequestListRequestStatus, error) {
switch s {
case "accepted":
return RequestListRequestStatusAccepted, nil
case "rejected":
return RequestListRequestStatusRejected, nil
}
var t RequestListRequestStatus
return "", fmt.Errorf("%s is not a valid %T", s, t)
}
func (r RequestListRequestStatus) Ptr() *RequestListRequestStatus {
return &r
}