-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathautomations.go
More file actions
120 lines (109 loc) · 3.97 KB
/
Copy pathautomations.go
File metadata and controls
120 lines (109 loc) · 3.97 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
// Code generated by internal/cmd/gen; DO NOT EDIT.
package flashduty
import "context"
// AutomationsService handles the "AI SRE/Automations" API resource.
type AutomationsService service
// Get Automation rule.
//
// Get one Automation rule by ID.
//
// API: POST /safari/automation/rule/get (automation-rule-read-get).
func (s *AutomationsService) RuleReadGet(ctx context.Context, req *AutomationRuleIDRequest) (*AutomationRuleItem, *Response, error) {
out := new(AutomationRuleItem)
resp, err := s.client.do(ctx, "/safari/automation/rule/get", req, out)
if err != nil {
return nil, resp, err
}
return out, resp, nil
}
// List Automation rules.
//
// List Automation rules visible to the caller.
//
// API: POST /safari/automation/rule/list (automation-rule-read-list).
func (s *AutomationsService) RuleReadList(ctx context.Context, req *AutomationRuleListRequest) (*AutomationRuleListResponse, *Response, error) {
out := new(AutomationRuleListResponse)
resp, err := s.client.do(ctx, "/safari/automation/rule/list", req, out)
if err != nil {
return nil, resp, err
}
return out, resp, nil
}
// Create Automation rule.
//
// Create an Automation rule with schedule, HTTP POST, and On-call incident triggers.
//
// API: POST /safari/automation/rule/create (automation-rule-write-create).
func (s *AutomationsService) RuleWriteCreate(ctx context.Context, req *AutomationRuleCreateRequest) (*AutomationRuleItem, *Response, error) {
out := new(AutomationRuleItem)
resp, err := s.client.do(ctx, "/safari/automation/rule/create", req, out)
if err != nil {
return nil, resp, err
}
return out, resp, nil
}
// Delete Automation rule.
//
// Delete an Automation rule.
//
// API: POST /safari/automation/rule/delete (automation-rule-write-delete).
func (s *AutomationsService) RuleWriteDelete(ctx context.Context, req *AutomationRuleIDRequest) (*any, *Response, error) {
out := new(any)
resp, err := s.client.do(ctx, "/safari/automation/rule/delete", req, out)
if err != nil {
return nil, resp, err
}
return out, resp, nil
}
// Run Automation rule.
//
// Manually run an Automation rule immediately, outside its schedule.
//
// API: POST /safari/automation/rule/run (automation-rule-write-run).
func (s *AutomationsService) RuleWriteRun(ctx context.Context, req *AutomationRuleIDRequest) (*ManualRunRuleResult, *Response, error) {
out := new(ManualRunRuleResult)
resp, err := s.client.do(ctx, "/safari/automation/rule/run", req, out)
if err != nil {
return nil, resp, err
}
return out, resp, nil
}
// Update Automation rule.
//
// Update mutable Automation rule fields, including HTTP POST and On-call incident trigger settings.
//
// API: POST /safari/automation/rule/update (automation-rule-write-update).
func (s *AutomationsService) RuleWriteUpdate(ctx context.Context, req *AutomationRuleUpdateRequest) (*AutomationRuleItem, *Response, error) {
out := new(AutomationRuleItem)
resp, err := s.client.do(ctx, "/safari/automation/rule/update", req, out)
if err != nil {
return nil, resp, err
}
return out, resp, nil
}
// List Automation runs.
//
// List run history for a rule the caller can manage.
//
// API: POST /safari/automation/run/list (automation-run-read-list).
func (s *AutomationsService) RunReadList(ctx context.Context, req *AutomationRunListRequest) (*AutomationRunListResponse, *Response, error) {
out := new(AutomationRunListResponse)
resp, err := s.client.do(ctx, "/safari/automation/run/list", req, out)
if err != nil {
return nil, resp, err
}
return out, resp, nil
}
// List Automation templates.
//
// List preset Automation templates for the requested locale.
//
// API: POST /safari/automation/template/list (automation-template-read-list).
func (s *AutomationsService) TemplateReadList(ctx context.Context, req *AutomationTemplateListRequest) (*AutomationTemplateListResponse, *Response, error) {
out := new(AutomationTemplateListResponse)
resp, err := s.client.do(ctx, "/safari/automation/template/list", req, out)
if err != nil {
return nil, resp, err
}
return out, resp, nil
}