Repository navigation
Expand file tree
/
Copy pathintegrations.go
More file actions
161 lines (146 loc) · 5.54 KB
/
Copy pathintegrations.go
File metadata and controls
161 lines (146 loc) · 5.54 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
// Code generated by internal/cmd/gen; DO NOT EDIT.
package flashduty
import "context"
// IntegrationsService handles the "On-call/Integrations" API resource.
type IntegrationsService service
// Attempt IM person linking.
//
// Try to automatically link unbound members to their IM accounts for one integration.
//
// API: POST /datasource/im/person/try-link (datasourceImPersonTryLink).
func (s *IntegrationsService) DatasourceImPersonTryLink(ctx context.Context, req *TryLinkPersonRequest) (*TryLinkPersonResponse, *Response, error) {
out := new(TryLinkPersonResponse)
resp, err := s.client.do(ctx, "/datasource/im/person/try-link", req, out)
if err != nil {
return nil, resp, err
}
return out, resp, nil
}
// Get integration detail.
//
// Return one integration, including its settings with sensitive values masked.
//
// API: POST /integration/info (integration-api-read-info).
func (s *IntegrationsService) IntegrationAPIReadInfo(ctx context.Context, req *GetIntegrationRequest) (*IntegrationDetail, *Response, error) {
out := new(IntegrationDetail)
resp, err := s.client.do(ctx, "/integration/info", req, out)
if err != nil {
return nil, resp, err
}
return out, resp, nil
}
// List integrations.
//
// List the account's alert-source and change-source integrations.
//
// API: POST /integration/list (integration-api-read-list).
func (s *IntegrationsService) IntegrationAPIReadList(ctx context.Context, req *ListIntegrationsRequest) (*ListIntegrationsResponse, *Response, error) {
out := new(ListIntegrationsResponse)
resp, err := s.client.do(ctx, "/integration/list", req, out)
if err != nil {
return nil, resp, err
}
return out, resp, nil
}
// List integration types.
//
// List the integration types the account can configure.
//
// API: POST /integration/type/list (integration-api-read-type-list).
func (s *IntegrationsService) IntegrationAPIReadTypeList(ctx context.Context, req *IntegrationTypeListRequest) (*ListIntegrationTypesResponse, *Response, error) {
out := new(ListIntegrationTypesResponse)
resp, err := s.client.do(ctx, "/integration/type/list", req, out)
if err != nil {
return nil, resp, err
}
return out, resp, nil
}
// Create integration.
//
// Create an integration for an alert source or change source.
//
// API: POST /integration/create (integration-api-write-create).
func (s *IntegrationsService) IntegrationAPIWriteCreate(ctx context.Context, req *CreateIntegrationRequest) (*CreateIntegrationResponse, *Response, error) {
out := new(CreateIntegrationResponse)
resp, err := s.client.do(ctx, "/integration/create", req, out)
if err != nil {
return nil, resp, err
}
return out, resp, nil
}
// Delete integration.
//
// Delete an integration that nothing else references.
//
// API: POST /integration/delete (integration-api-write-delete).
func (s *IntegrationsService) IntegrationAPIWriteDelete(ctx context.Context, req *IntegrationLifecycleRequest) (*Response, error) {
return s.client.do(ctx, "/integration/delete", req, nil)
}
// Disable integration.
//
// Disable an integration without deleting its configuration.
//
// API: POST /integration/disable (integration-api-write-disable).
func (s *IntegrationsService) IntegrationAPIWriteDisable(ctx context.Context, req *IntegrationLifecycleRequest) (*Response, error) {
return s.client.do(ctx, "/integration/disable", req, nil)
}
// Enable integration.
//
// Re-enable a disabled integration so it accepts events again.
//
// API: POST /integration/enable (integration-api-write-enable).
func (s *IntegrationsService) IntegrationAPIWriteEnable(ctx context.Context, req *IntegrationLifecycleRequest) (*Response, error) {
return s.client.do(ctx, "/integration/enable", req, nil)
}
// Rotate integration key.
//
// Issue a new integration key and invalidate the previous one.
//
// API: POST /integration/key/rotate (integration-api-write-rotate-key).
func (s *IntegrationsService) IntegrationAPIWriteRotateKey(ctx context.Context, req *IntegrationLifecycleRequest) (*RotateIntegrationKeyResponse, *Response, error) {
out := new(RotateIntegrationKeyResponse)
resp, err := s.client.do(ctx, "/integration/key/rotate", req, out)
if err != nil {
return nil, resp, err
}
return out, resp, nil
}
// Update integration.
//
// Update an integration's name, description, team, or settings.
//
// API: POST /integration/update (integration-api-write-update).
func (s *IntegrationsService) IntegrationAPIWriteUpdate(ctx context.Context, req *UpdateIntegrationRequest) (*IntegrationDetail, *Response, error) {
out := new(IntegrationDetail)
resp, err := s.client.do(ctx, "/integration/update", req, out)
if err != nil {
return nil, resp, err
}
return out, resp, nil
}
// Get webhook delivery detail.
//
// Retrieve the detailed payload and response for a specific webhook delivery attempt.
//
// API: POST /webhook/history/detail (webhookHistoryDetail).
func (s *IntegrationsService) Detail(ctx context.Context, req *GetWebhookHistoryDetailRequest) (*WebhookHistoryDetail, *Response, error) {
out := new(WebhookHistoryDetail)
resp, err := s.client.do(ctx, "/webhook/history/detail", req, out)
if err != nil {
return nil, resp, err
}
return out, resp, nil
}
// List webhook delivery history.
//
// List the delivery history for outbound webhook notifications.
//
// API: POST /webhook/history/list (webhookHistoryList).
func (s *IntegrationsService) List(ctx context.Context, req *ListWebhookHistoryRequest) (*ListWebhookHistoryResponse, *Response, error) {
out := new(ListWebhookHistoryResponse)
resp, err := s.client.do(ctx, "/webhook/history/list", req, out)
if err != nil {
return nil, resp, err
}
return out, resp, nil
}