@@ -42,84 +42,6 @@ func PolicyFromJSON(body []byte) (result Policy) {
4242 return result
4343}
4444
45- // -------- User Rules File --------
46-
47- type UserRulesFile struct {
48- Content string `json:"content"`
49- Version int `json:"version"`
50- }
51-
52- type userRulesFileWrapper struct {
53- UserRulesFile UserRulesFile `json:"userRulesFile"`
54- }
55-
56- func (userRulesFile * UserRulesFile ) ToJSON () io.Reader {
57- payload , _ := json .Marshal (userRulesFileWrapper {* userRulesFile })
58- return bytes .NewBuffer (payload )
59- }
60-
61- func UserRulesFileFromJSON (body []byte ) UserRulesFile {
62- var result userRulesFileWrapper
63- _ = json .Unmarshal (body , & result )
64-
65- return result .UserRulesFile
66- }
67-
68- // -------- Notification Channels --------
69-
70- type NotificationChannelOptions struct {
71- EmailRecipients []string `json:"emailRecipients,omitempty"` // Type: email
72- SnsTopicARNs []string `json:"snsTopicARNs,omitempty"` // Type: SNS
73- APIKey string `json:"apiKey,omitempty"` // Type: VictorOps, OpsGenie
74- RoutingKey string `json:"routingKey,omitempty"` // Type: VictorOps
75- Url string `json:"url,omitempty"` // Type: OpsGenie, Webhook and Slack
76- Channel string `json:"channel,omitempty"` // Type: Slack
77- Account string `json:"account,omitempty"` // Type: PagerDuty
78- ServiceKey string `json:"serviceKey,omitempty"` // Type: PagerDuty
79- ServiceName string `json:"serviceName,omitempty"` // Type: PagerDuty
80- Region string `json:"region,omitempty"` // Type: OpsGenie
81-
82- NotifyOnOk bool `json:"notifyOnOk"`
83- NotifyOnResolve bool `json:"notifyOnResolve"`
84- SendTestNotification bool `json:"sendTestNotification"`
85- }
86-
87- type NotificationChannel struct {
88- ID int `json:"id,omitempty"`
89- Version int `json:"version,omitempty"`
90- Type string `json:"type"`
91- Name string `json:"name"`
92- Enabled bool `json:"enabled"`
93- Options NotificationChannelOptions `json:"options"`
94- }
95-
96- func (n * NotificationChannel ) ToJSON () io.Reader {
97- payload , _ := json .Marshal (notificationChannelWrapper {* n })
98- return bytes .NewBuffer (payload )
99- }
100-
101- func NotificationChannelFromJSON (body []byte ) NotificationChannel {
102- var result notificationChannelWrapper
103- _ = json .Unmarshal (body , & result )
104-
105- return result .NotificationChannel
106- }
107-
108- func NotificationChannelListFromJSON (body []byte ) []NotificationChannel {
109- var result notificationChannelListWrapper
110- _ = json .Unmarshal (body , & result )
111-
112- return result .NotificationChannels
113- }
114-
115- type notificationChannelListWrapper struct {
116- NotificationChannels []NotificationChannel `json:"notificationChannels"`
117- }
118-
119- type notificationChannelWrapper struct {
120- NotificationChannel NotificationChannel `json:"notificationChannel"`
121- }
122-
12345// -------- Rules --------
12446
12547type Rule struct {
@@ -265,61 +187,6 @@ func MacroFromJSON(body []byte) (macro Macro, err error) {
265187 return
266188}
267189
268- // -------- Team --------
269- type Team struct {
270- ID int `json:"id,omitempty"`
271- Version int `json:"version,omitempty"`
272- Theme string `json:"theme"`
273- Name string `json:"name"`
274- Description string `json:"description"`
275- ScopeBy string `json:"show"`
276- Filter string `json:"filter"`
277- CanUseSysdigCapture bool `json:"canUseSysdigCapture"`
278- UserRoles []UserRoles `json:"userRoles,omitempty"`
279- DefaultTeam bool `json:"default"`
280- Products []string `json:"products"`
281- }
282-
283- type UserRoles struct {
284- UserId int `json:"userId"`
285- Email string `json:"userName,omitempty"`
286- Role string `json:"role"`
287- Admin bool `json:"admin,omitempty"`
288- }
289-
290- func (t * Team ) ToJSON () io.Reader {
291- payload , _ := json .Marshal (* t )
292- return bytes .NewBuffer (payload )
293- }
294-
295- func TeamFromJSON (body []byte ) Team {
296- var result teamWrapper
297- _ = json .Unmarshal (body , & result )
298-
299- return result .Team
300- }
301-
302- type teamWrapper struct {
303- Team Team `json:"team"`
304- }
305-
306- // -------- UsersList --------
307- type UsersList struct {
308- ID int `json:"id"`
309- Email string `json:"username"`
310- }
311-
312- func UsersListFromJSON (body []byte ) []UsersList {
313- var result usersListWrapper
314- _ = json .Unmarshal (body , & result )
315-
316- return result .UsersList
317- }
318-
319- type usersListWrapper struct {
320- UsersList []UsersList `json:"users"`
321- }
322-
323190// -------- VulnerabilityExceptionList --------
324191
325192type VulnerabilityExceptionList struct {
@@ -389,35 +256,6 @@ func CloudAccountFromJSON(body []byte) *CloudAccount {
389256 return & result
390257}
391258
392- // -------- BenchmarkTask --------
393-
394- var SupportedBenchmarkTaskSchemas = []string {
395- "aws_foundations_bench-1.3.0" ,
396- "gcp_foundations_bench-1.2.0" ,
397- "azure_foundations_bench-1.3.0" ,
398- }
399-
400- type BenchmarkTask struct {
401- ID int `json:"id,omitempty"`
402- Name string `json:"name"`
403- Schema string `json:"schema"`
404- Scope string `json:"scope"`
405- Schedule string `json:"schedule"`
406- Enabled bool `json:"enabled"`
407- }
408-
409- func (t * BenchmarkTask ) ToJSON () io.Reader {
410- payload , _ := json .Marshal (* t )
411- return bytes .NewBuffer (payload )
412- }
413-
414- func BenchmarkTaskFromJSON (body []byte ) * BenchmarkTask {
415- var result BenchmarkTask
416- _ = json .Unmarshal (body , & result )
417-
418- return & result
419- }
420-
421259// -------- Scanning Policies --------
422260type ScanningPolicy struct {
423261 ID string `json:"id,omitempty"`
0 commit comments