-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathmac_list.go
180 lines (143 loc) · 6.32 KB
/
mac_list.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
package objects
// THIS FILE IS AUTO GENERATED BY bin/gen.go! DO NOT EDIT!
import (
"fmt"
"github.com/esurdam/go-sophos"
)
// MacList is a generated struct representing the Sophos MacList Endpoint
// GET /api/nodes/mac_list
type MacList struct {
MacListGroup MacListGroup `json:"mac_list_group"`
MacListMacList MacListMacList `json:"mac_list_mac_list"`
}
var _ sophos.Endpoint = &MacList{}
var defsMacList = map[string]sophos.RestObject{
"MacListGroup": &MacListGroup{},
"MacListMacList": &MacListMacList{},
}
// RestObjects implements the sophos.Node interface and returns a map of MacList's Objects
func (MacList) RestObjects() map[string]sophos.RestObject { return defsMacList }
// GetPath implements sophos.RestGetter
func (*MacList) GetPath() string { return "/api/nodes/mac_list" }
// RefRequired implements sophos.RestGetter
func (*MacList) RefRequired() (string, bool) { return "", false }
var defMacList = &sophos.Definition{Description: "mac_list", Name: "mac_list", Link: "/api/definitions/mac_list"}
// Definition returns the /api/definitions struct of MacList
func (MacList) Definition() sophos.Definition { return *defMacList }
// ApiRoutes returns all known MacList Paths
func (MacList) ApiRoutes() []string {
return []string{
"/api/objects/mac_list/group/",
"/api/objects/mac_list/group/{ref}",
"/api/objects/mac_list/group/{ref}/usedby",
"/api/objects/mac_list/mac_list/",
"/api/objects/mac_list/mac_list/{ref}",
"/api/objects/mac_list/mac_list/{ref}/usedby",
}
}
// References returns the MacList's references. These strings serve no purpose other than to demonstrate which
// Reference keys are used for this Endpoint
func (MacList) References() []string {
return []string{
"REF_MacListGroup",
"REF_MacListMacList",
}
}
// MacListGroups is an Sophos Endpoint subType and implements sophos.RestObject
type MacListGroups []MacListGroup
// MacListGroup represents a UTM group
type MacListGroup struct {
Locked string `json:"_locked"`
ObjectType string `json:"_type"`
Reference string `json:"_ref"`
Comment string `json:"comment"`
Name string `json:"name"`
}
var _ sophos.RestGetter = &MacListGroup{}
// GetPath implements sophos.RestObject and returns the MacListGroups GET path
// Returns all available mac_list/group objects
func (*MacListGroups) GetPath() string { return "/api/objects/mac_list/group/" }
// RefRequired implements sophos.RestObject
func (*MacListGroups) RefRequired() (string, bool) { return "", false }
// GetPath implements sophos.RestObject and returns the MacListGroups GET path
// Returns all available group types
func (m *MacListGroup) GetPath() string {
return fmt.Sprintf("/api/objects/mac_list/group/%s", m.Reference)
}
// RefRequired implements sophos.RestObject
func (m *MacListGroup) RefRequired() (string, bool) { return m.Reference, true }
// DeletePath implements sophos.RestObject and returns the MacListGroup DELETE path
// Creates or updates the complete object group
func (*MacListGroup) DeletePath(ref string) string {
return fmt.Sprintf("/api/objects/mac_list/group/%s", ref)
}
// PatchPath implements sophos.RestObject and returns the MacListGroup PATCH path
// Changes to parts of the object group types
func (*MacListGroup) PatchPath(ref string) string {
return fmt.Sprintf("/api/objects/mac_list/group/%s", ref)
}
// PostPath implements sophos.RestObject and returns the MacListGroup POST path
// Create a new mac_list/group object
func (*MacListGroup) PostPath() string {
return "/api/objects/mac_list/group/"
}
// PutPath implements sophos.RestObject and returns the MacListGroup PUT path
// Creates or updates the complete object group
func (*MacListGroup) PutPath(ref string) string {
return fmt.Sprintf("/api/objects/mac_list/group/%s", ref)
}
// UsedByPath implements sophos.RestObject
// Returns the objects and the nodes that use the object with the given ref
func (*MacListGroup) UsedByPath(ref string) string {
return fmt.Sprintf("/api/objects/mac_list/group/%s/usedby", ref)
}
// MacListMacLists is an Sophos Endpoint subType and implements sophos.RestObject
type MacListMacLists []MacListMacList
// MacListMacList represents a UTM MAC address list
type MacListMacList struct {
Locked string `json:"_locked"`
ObjectType string `json:"_type"`
Reference string `json:"_ref"`
AddressList []string `json:"address_list"`
Comment string `json:"comment"`
HostList []string `json:"host_list"`
Name string `json:"name"`
}
var _ sophos.RestGetter = &MacListMacList{}
// GetPath implements sophos.RestObject and returns the MacListMacLists GET path
// Returns all available mac_list/mac_list objects
func (*MacListMacLists) GetPath() string { return "/api/objects/mac_list/mac_list/" }
// RefRequired implements sophos.RestObject
func (*MacListMacLists) RefRequired() (string, bool) { return "", false }
// GetPath implements sophos.RestObject and returns the MacListMacLists GET path
// Returns all available mac_list types
func (m *MacListMacList) GetPath() string {
return fmt.Sprintf("/api/objects/mac_list/mac_list/%s", m.Reference)
}
// RefRequired implements sophos.RestObject
func (m *MacListMacList) RefRequired() (string, bool) { return m.Reference, true }
// DeletePath implements sophos.RestObject and returns the MacListMacList DELETE path
// Creates or updates the complete object mac_list
func (*MacListMacList) DeletePath(ref string) string {
return fmt.Sprintf("/api/objects/mac_list/mac_list/%s", ref)
}
// PatchPath implements sophos.RestObject and returns the MacListMacList PATCH path
// Changes to parts of the object mac_list types
func (*MacListMacList) PatchPath(ref string) string {
return fmt.Sprintf("/api/objects/mac_list/mac_list/%s", ref)
}
// PostPath implements sophos.RestObject and returns the MacListMacList POST path
// Create a new mac_list/mac_list object
func (*MacListMacList) PostPath() string {
return "/api/objects/mac_list/mac_list/"
}
// PutPath implements sophos.RestObject and returns the MacListMacList PUT path
// Creates or updates the complete object mac_list
func (*MacListMacList) PutPath(ref string) string {
return fmt.Sprintf("/api/objects/mac_list/mac_list/%s", ref)
}
// UsedByPath implements sophos.RestObject
// Returns the objects and the nodes that use the object with the given ref
func (*MacListMacList) UsedByPath(ref string) string {
return fmt.Sprintf("/api/objects/mac_list/mac_list/%s/usedby", ref)
}