-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathstatus_pages.go
More file actions
356 lines (324 loc) · 13.1 KB
/
Copy pathstatus_pages.go
File metadata and controls
356 lines (324 loc) · 13.1 KB
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
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
// Code generated by internal/cmd/gen; DO NOT EDIT.
package flashduty
import "context"
// StatusPagesService handles the "On-call/Status pages" API resource.
type StatusPagesService service
// List status pages.
//
// List all status pages owned by the account, including their components and sections.
//
// API: GET /status-page/list (status-page-read-page-list).
func (s *StatusPagesService) ReadPageList(ctx context.Context) (*ListStatusPageResponse, *Response, error) {
out := new(ListStatusPageResponse)
resp, err := s.client.doGet(ctx, "/status-page/list", nil, out)
if err != nil {
return nil, resp, err
}
return out, resp, nil
}
// List active status page events.
//
// List in-progress (non-terminal) events of a given type for a status page.
//
// API: GET /status-page/change/active/list (statusPageChangeActiveList).
func (s *StatusPagesService) ChangeActiveList(ctx context.Context, req *StatusPagesChangeActiveListRequest) (*StatusPageChangeListResponse, *Response, error) {
out := new(StatusPageChangeListResponse)
resp, err := s.client.doGet(ctx, "/status-page/change/active/list", req, out)
if err != nil {
return nil, resp, err
}
return out, resp, nil
}
// Create status page event.
//
// Create a new incident or maintenance event on a status page.
//
// API: POST /status-page/change/create (statusPageChangeCreate).
func (s *StatusPagesService) ChangeCreate(ctx context.Context, req *CreateStatusPageChangeRequest) (*StatusPageChangeCreateResponse, *Response, error) {
out := new(StatusPageChangeCreateResponse)
resp, err := s.client.do(ctx, "/status-page/change/create", req, out)
if err != nil {
return nil, resp, err
}
return out, resp, nil
}
// Delete status page event.
//
// Delete a status page event.
//
// API: POST /status-page/change/delete (statusPageChangeDelete).
func (s *StatusPagesService) ChangeDelete(ctx context.Context, req *DeleteStatusPageChangeRequest) (*Response, error) {
return s.client.do(ctx, "/status-page/change/delete", req, nil)
}
// Get status page event detail.
//
// Retrieve details of a specific status page event (incident or maintenance).
//
// API: GET /status-page/change/info (statusPageChangeInfo).
func (s *StatusPagesService) ChangeInfo(ctx context.Context, req *StatusPagesChangeInfoRequest) (*StatusPageChangeItem, *Response, error) {
out := new(StatusPageChangeItem)
resp, err := s.client.doGet(ctx, "/status-page/change/info", req, out)
if err != nil {
return nil, resp, err
}
return out, resp, nil
}
// List status page events.
//
// List status page events for console management. Unlike the public display endpoints, the response includes hidden components.
//
// API: GET /status-page/change/list (statusPageChangeList).
func (s *StatusPagesService) ChangeList(ctx context.Context, req *StatusPagesChangeListRequest) (*StatusPageChangeListResponse, *Response, error) {
out := new(StatusPageChangeListResponse)
resp, err := s.client.doGet(ctx, "/status-page/change/list", req, out)
if err != nil {
return nil, resp, err
}
return out, resp, nil
}
// Create event timeline entry.
//
// Add a timeline update to a status page event.
//
// API: POST /status-page/change/timeline/create (statusPageChangeTimelineCreate).
func (s *StatusPagesService) ChangeTimelineCreate(ctx context.Context, req *CreateStatusPageChangeTimelineRequest) (*StatusPageChangeTimelineCreateResponse, *Response, error) {
out := new(StatusPageChangeTimelineCreateResponse)
resp, err := s.client.do(ctx, "/status-page/change/timeline/create", req, out)
if err != nil {
return nil, resp, err
}
return out, resp, nil
}
// Delete event timeline entry.
//
// Delete a timeline entry from a status page event.
//
// API: POST /status-page/change/timeline/delete (statusPageChangeTimelineDelete).
func (s *StatusPagesService) ChangeTimelineDelete(ctx context.Context, req *DeleteStatusPageChangeTimelineRequest) (*Response, error) {
return s.client.do(ctx, "/status-page/change/timeline/delete", req, nil)
}
// Update event timeline entry.
//
// Update a timeline entry for a status page event.
//
// API: POST /status-page/change/timeline/update (statusPageChangeTimelineUpdate).
func (s *StatusPagesService) ChangeTimelineUpdate(ctx context.Context, req *UpdateStatusPageChangeTimelineRequest) (*Response, error) {
return s.client.do(ctx, "/status-page/change/timeline/update", req, nil)
}
// Update status page event.
//
// Update an existing status page event.
//
// API: POST /status-page/change/update (statusPageChangeUpdate).
func (s *StatusPagesService) ChangeUpdate(ctx context.Context, req *UpdateStatusPageChangeRequest) (*Response, error) {
return s.client.do(ctx, "/status-page/change/update", req, nil)
}
// Delete status page component.
//
// Delete a service component from a status page.
//
// API: POST /status-page/component/delete (statusPageComponentDelete).
func (s *StatusPagesService) ComponentDelete(ctx context.Context, req *DeleteStatusPageComponentRequest) (*Response, error) {
return s.client.do(ctx, "/status-page/component/delete", req, nil)
}
// Upsert status page component.
//
// Create or update a service component on a status page.
//
// API: POST /status-page/component/upsert (statusPageComponentUpsert).
func (s *StatusPagesService) ComponentUpsert(ctx context.Context, req *UpsertStatusPageComponentRequest) (*UpsertStatusPageComponentResponse, *Response, error) {
out := new(UpsertStatusPageComponentResponse)
resp, err := s.client.do(ctx, "/status-page/component/upsert", req, out)
if err != nil {
return nil, resp, err
}
return out, resp, nil
}
// Create status page.
//
// Create a new status page.
//
// API: POST /status-page/create (statusPageCreate).
func (s *StatusPagesService) Create(ctx context.Context, req *CreateStatusPageRequest) (*CreateStatusPageResponse, *Response, error) {
out := new(CreateStatusPageResponse)
resp, err := s.client.do(ctx, "/status-page/create", req, out)
if err != nil {
return nil, resp, err
}
return out, resp, nil
}
// Delete status page.
//
// Delete a status page.
//
// API: POST /status-page/delete (statusPageDelete).
func (s *StatusPagesService) Delete(ctx context.Context, req *DeleteStatusPageRequest) (*Response, error) {
return s.client.do(ctx, "/status-page/delete", req, nil)
}
// Create status page draft.
//
// Store a status page event draft so a human can review and publish it from the console.
//
// API: POST /status-page/draft/create (statusPageDraftCreate).
func (s *StatusPagesService) DraftCreate(ctx context.Context, req *CreateStatusPageDraftRequest) (*StatusPageDraftCreateResponse, *Response, error) {
out := new(StatusPageDraftCreateResponse)
resp, err := s.client.do(ctx, "/status-page/draft/create", req, out)
if err != nil {
return nil, resp, err
}
return out, resp, nil
}
// Get status page detail.
//
// Retrieve detailed configuration for a specific status page.
//
// API: GET /status-page/info (statusPageInfo).
func (s *StatusPagesService) Info(ctx context.Context, req *StatusPagesInfoRequest) (*StatusPageInfoResponse, *Response, error) {
out := new(StatusPageInfoResponse)
resp, err := s.client.doGet(ctx, "/status-page/info", req, out)
if err != nil {
return nil, resp, err
}
return out, resp, nil
}
// Migrate email subscribers.
//
// Start a migration job that imports email subscribers from an Atlassian Statuspage into an existing Flashduty status page.
//
// API: POST /status-page/migrate-email-subscribers (statusPageMigrateEmailSubscribers).
func (s *StatusPagesService) MigrateEmailSubscribers(ctx context.Context, req *MigrateStatusPageEmailSubscribersRequest) (*StatusPageMigrationStartResponse, *Response, error) {
out := new(StatusPageMigrationStartResponse)
resp, err := s.client.do(ctx, "/status-page/migrate-email-subscribers", req, out)
if err != nil {
return nil, resp, err
}
return out, resp, nil
}
// Migrate status page structure.
//
// Start a migration job that imports the structure and historical events of an Atlassian Statuspage into a new Flashduty status page.
//
// API: POST /status-page/migrate-structure (statusPageMigrateStructure).
func (s *StatusPagesService) MigrateStructure(ctx context.Context, req *MigrateStatusPageStructureRequest) (*StatusPageMigrationStartResponse, *Response, error) {
out := new(StatusPageMigrationStartResponse)
resp, err := s.client.do(ctx, "/status-page/migrate-structure", req, out)
if err != nil {
return nil, resp, err
}
return out, resp, nil
}
// Cancel status page migration.
//
// Cancel an in-progress status page migration job. Only jobs currently in the `running` state can be cancelled.
//
// API: POST /status-page/migration/cancel (statusPageMigrationCancel).
func (s *StatusPagesService) MigrationCancel(ctx context.Context, req *CancelStatusPageMigrationRequest) (*Response, error) {
return s.client.do(ctx, "/status-page/migration/cancel", req, nil)
}
// Get migration status.
//
// Get the current status and progress of a status page migration job.
//
// API: GET /status-page/migration/status (statusPageMigrationStatus).
func (s *StatusPagesService) MigrationStatus(ctx context.Context, req *StatusPagesMigrationStatusRequest) (*StatusPageMigrationJob, *Response, error) {
out := new(StatusPageMigrationJob)
resp, err := s.client.doGet(ctx, "/status-page/migration/status", req, out)
if err != nil {
return nil, resp, err
}
return out, resp, nil
}
// Delete status page section.
//
// Delete a section from a status page.
//
// API: POST /status-page/section/delete (statusPageSectionDelete).
func (s *StatusPagesService) SectionDelete(ctx context.Context, req *DeleteStatusPageSectionRequest) (*Response, error) {
return s.client.do(ctx, "/status-page/section/delete", req, nil)
}
// Upsert status page section.
//
// Create or update a section on a status page.
//
// API: POST /status-page/section/upsert (statusPageSectionUpsert).
func (s *StatusPagesService) SectionUpsert(ctx context.Context, req *UpsertStatusPageSectionRequest) (*UpsertStatusPageSectionResponse, *Response, error) {
out := new(UpsertStatusPageSectionResponse)
resp, err := s.client.do(ctx, "/status-page/section/upsert", req, out)
if err != nil {
return nil, resp, err
}
return out, resp, nil
}
// Export subscribers.
//
// Export subscribers list for a status page as a CSV attachment. The response is a `text/csv` file with columns: Method, Recipient, Components, Subscribe All, Locale.
//
// The success body is a file, not a JSON envelope: it is returned on Response.Raw.
//
// API: POST /status-page/subscriber/export (statusPageSubscriberExport).
func (s *StatusPagesService) SubscriberExport(ctx context.Context, req *ExportStatusPageSubscribersRequest) (*Response, error) {
return s.client.do(ctx, "/status-page/subscriber/export", req, nil)
}
// Import subscribers.
//
// Bulk import subscribers for a status page. The account must be allowlisted for subscriber import; otherwise the call is rejected with an access-denied error.
//
// API: POST /status-page/subscriber/import (statusPageSubscriberImport).
func (s *StatusPagesService) SubscriberImport(ctx context.Context, req *ImportStatusPageSubscribersRequest) (*Response, error) {
return s.client.do(ctx, "/status-page/subscriber/import", req, nil)
}
// List status page subscribers.
//
// List subscribers who have signed up for status page notifications.
//
// API: GET /status-page/subscriber/list (statusPageSubscriberList).
func (s *StatusPagesService) SubscriberList(ctx context.Context, req *StatusPagesSubscriberListRequest) (*StatusPageSubscriberListResponse, *Response, error) {
out := new(StatusPageSubscriberListResponse)
resp, err := s.client.doGet(ctx, "/status-page/subscriber/list", req, out)
if err != nil {
return nil, resp, err
}
return out, resp, nil
}
// Delete status page template.
//
// Delete an event template from a status page.
//
// API: POST /status-page/template/delete (statusPageTemplateDelete).
func (s *StatusPagesService) TemplateDelete(ctx context.Context, req *DeleteStatusPageTemplateRequest) (*Response, error) {
return s.client.do(ctx, "/status-page/template/delete", req, nil)
}
// List status page templates.
//
// List all event templates for a status page.
//
// API: GET /status-page/template/list (statusPageTemplateList).
func (s *StatusPagesService) TemplateList(ctx context.Context, req *StatusPagesTemplateListRequest) (*ListStatusPageTemplatesResponse, *Response, error) {
out := new(ListStatusPageTemplatesResponse)
resp, err := s.client.doGet(ctx, "/status-page/template/list", req, out)
if err != nil {
return nil, resp, err
}
return out, resp, nil
}
// Upsert status page template.
//
// Create or update an event template for a status page.
//
// API: POST /status-page/template/upsert (statusPageTemplateUpsert).
func (s *StatusPagesService) TemplateUpsert(ctx context.Context, req *UpsertStatusPageTemplateRequest) (*UpsertStatusPageTemplateResponse, *Response, error) {
out := new(UpsertStatusPageTemplateResponse)
resp, err := s.client.do(ctx, "/status-page/template/upsert", req, out)
if err != nil {
return nil, resp, err
}
return out, resp, nil
}
// Update status page.
//
// Update an existing status page configuration.
//
// API: POST /status-page/update (statusPageUpdate).
func (s *StatusPagesService) Update(ctx context.Context, req *UpdateStatusPageRequest) (*Response, error) {
return s.client.do(ctx, "/status-page/update", req, nil)
}