-
Notifications
You must be signed in to change notification settings - Fork 0
/
api-quota-set-entry.go
245 lines (205 loc) · 7.55 KB
/
api-quota-set-entry.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
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
package azgo
import (
"encoding/xml"
"reflect"
log "github.com/sirupsen/logrus"
)
// QuotaSetEntryRequest is a structure to represent a quota-set-entry Request ZAPI object
type QuotaSetEntryRequest struct {
XMLName xml.Name `xml:"quota-set-entry"`
DiskLimitPtr *string `xml:"disk-limit"`
FileLimitPtr *string `xml:"file-limit"`
PerformUserMappingPtr *bool `xml:"perform-user-mapping"`
PolicyPtr *string `xml:"policy"`
QtreePtr *string `xml:"qtree"`
QuotaTargetPtr *string `xml:"quota-target"`
QuotaTypePtr *string `xml:"quota-type"`
SoftDiskLimitPtr *string `xml:"soft-disk-limit"`
SoftFileLimitPtr *string `xml:"soft-file-limit"`
ThresholdPtr *string `xml:"threshold"`
VolumePtr *string `xml:"volume"`
}
// QuotaSetEntryResponse is a structure to represent a quota-set-entry Response ZAPI object
type QuotaSetEntryResponse struct {
XMLName xml.Name `xml:"netapp"`
ResponseVersion string `xml:"version,attr"`
ResponseXmlns string `xml:"xmlns,attr"`
Result QuotaSetEntryResponseResult `xml:"results"`
}
// NewQuotaSetEntryResponse is a factory method for creating new instances of QuotaSetEntryResponse objects
func NewQuotaSetEntryResponse() *QuotaSetEntryResponse {
return &QuotaSetEntryResponse{}
}
// String returns a string representation of this object's fields and implements the Stringer interface
func (o QuotaSetEntryResponse) String() string {
return ToString(reflect.ValueOf(o))
}
// ToXML converts this object into an xml string representation
func (o *QuotaSetEntryResponse) ToXML() (string, error) {
output, err := xml.MarshalIndent(o, " ", " ")
if err != nil {
log.Errorf("error: %v", err)
}
return string(output), err
}
// QuotaSetEntryResponseResult is a structure to represent a quota-set-entry Response Result ZAPI object
type QuotaSetEntryResponseResult struct {
XMLName xml.Name `xml:"results"`
ResultStatusAttr string `xml:"status,attr"`
ResultReasonAttr string `xml:"reason,attr"`
ResultErrnoAttr string `xml:"errno,attr"`
}
// NewQuotaSetEntryRequest is a factory method for creating new instances of QuotaSetEntryRequest objects
func NewQuotaSetEntryRequest() *QuotaSetEntryRequest {
return &QuotaSetEntryRequest{}
}
// NewQuotaSetEntryResponseResult is a factory method for creating new instances of QuotaSetEntryResponseResult objects
func NewQuotaSetEntryResponseResult() *QuotaSetEntryResponseResult {
return &QuotaSetEntryResponseResult{}
}
// ToXML converts this object into an xml string representation
func (o *QuotaSetEntryRequest) ToXML() (string, error) {
output, err := xml.MarshalIndent(o, " ", " ")
if err != nil {
log.Errorf("error: %v", err)
}
return string(output), err
}
// ToXML converts this object into an xml string representation
func (o *QuotaSetEntryResponseResult) ToXML() (string, error) {
output, err := xml.MarshalIndent(o, " ", " ")
if err != nil {
log.Errorf("error: %v", err)
}
return string(output), err
}
// String returns a string representation of this object's fields and implements the Stringer interface
func (o QuotaSetEntryRequest) String() string {
return ToString(reflect.ValueOf(o))
}
// String returns a string representation of this object's fields and implements the Stringer interface
func (o QuotaSetEntryResponseResult) String() string {
return ToString(reflect.ValueOf(o))
}
// ExecuteUsing converts this object to a ZAPI XML representation and uses the supplied ZapiRunner to send to a filer
func (o *QuotaSetEntryRequest) ExecuteUsing(zr *ZapiRunner) (*QuotaSetEntryResponse, error) {
return o.executeWithoutIteration(zr)
}
// executeWithoutIteration converts this object to a ZAPI XML representation and uses the supplied ZapiRunner to send to a filer
func (o *QuotaSetEntryRequest) executeWithoutIteration(zr *ZapiRunner) (*QuotaSetEntryResponse, error) {
result, err := zr.ExecuteUsing(o, "QuotaSetEntryRequest", NewQuotaSetEntryResponse())
if result == nil {
return nil, err
}
return result.(*QuotaSetEntryResponse), err
}
// DiskLimit is a 'getter' method
func (o *QuotaSetEntryRequest) DiskLimit() string {
r := *o.DiskLimitPtr
return r
}
// SetDiskLimit is a fluent style 'setter' method that can be chained
func (o *QuotaSetEntryRequest) SetDiskLimit(newValue string) *QuotaSetEntryRequest {
o.DiskLimitPtr = &newValue
return o
}
// FileLimit is a 'getter' method
func (o *QuotaSetEntryRequest) FileLimit() string {
r := *o.FileLimitPtr
return r
}
// SetFileLimit is a fluent style 'setter' method that can be chained
func (o *QuotaSetEntryRequest) SetFileLimit(newValue string) *QuotaSetEntryRequest {
o.FileLimitPtr = &newValue
return o
}
// PerformUserMapping is a 'getter' method
func (o *QuotaSetEntryRequest) PerformUserMapping() bool {
r := *o.PerformUserMappingPtr
return r
}
// SetPerformUserMapping is a fluent style 'setter' method that can be chained
func (o *QuotaSetEntryRequest) SetPerformUserMapping(newValue bool) *QuotaSetEntryRequest {
o.PerformUserMappingPtr = &newValue
return o
}
// Policy is a 'getter' method
func (o *QuotaSetEntryRequest) Policy() string {
r := *o.PolicyPtr
return r
}
// SetPolicy is a fluent style 'setter' method that can be chained
func (o *QuotaSetEntryRequest) SetPolicy(newValue string) *QuotaSetEntryRequest {
o.PolicyPtr = &newValue
return o
}
// Qtree is a 'getter' method
func (o *QuotaSetEntryRequest) Qtree() string {
r := *o.QtreePtr
return r
}
// SetQtree is a fluent style 'setter' method that can be chained
func (o *QuotaSetEntryRequest) SetQtree(newValue string) *QuotaSetEntryRequest {
o.QtreePtr = &newValue
return o
}
// QuotaTarget is a 'getter' method
func (o *QuotaSetEntryRequest) QuotaTarget() string {
r := *o.QuotaTargetPtr
return r
}
// SetQuotaTarget is a fluent style 'setter' method that can be chained
func (o *QuotaSetEntryRequest) SetQuotaTarget(newValue string) *QuotaSetEntryRequest {
o.QuotaTargetPtr = &newValue
return o
}
// QuotaType is a 'getter' method
func (o *QuotaSetEntryRequest) QuotaType() string {
r := *o.QuotaTypePtr
return r
}
// SetQuotaType is a fluent style 'setter' method that can be chained
func (o *QuotaSetEntryRequest) SetQuotaType(newValue string) *QuotaSetEntryRequest {
o.QuotaTypePtr = &newValue
return o
}
// SoftDiskLimit is a 'getter' method
func (o *QuotaSetEntryRequest) SoftDiskLimit() string {
r := *o.SoftDiskLimitPtr
return r
}
// SetSoftDiskLimit is a fluent style 'setter' method that can be chained
func (o *QuotaSetEntryRequest) SetSoftDiskLimit(newValue string) *QuotaSetEntryRequest {
o.SoftDiskLimitPtr = &newValue
return o
}
// SoftFileLimit is a 'getter' method
func (o *QuotaSetEntryRequest) SoftFileLimit() string {
r := *o.SoftFileLimitPtr
return r
}
// SetSoftFileLimit is a fluent style 'setter' method that can be chained
func (o *QuotaSetEntryRequest) SetSoftFileLimit(newValue string) *QuotaSetEntryRequest {
o.SoftFileLimitPtr = &newValue
return o
}
// Threshold is a 'getter' method
func (o *QuotaSetEntryRequest) Threshold() string {
r := *o.ThresholdPtr
return r
}
// SetThreshold is a fluent style 'setter' method that can be chained
func (o *QuotaSetEntryRequest) SetThreshold(newValue string) *QuotaSetEntryRequest {
o.ThresholdPtr = &newValue
return o
}
// Volume is a 'getter' method
func (o *QuotaSetEntryRequest) Volume() string {
r := *o.VolumePtr
return r
}
// SetVolume is a fluent style 'setter' method that can be chained
func (o *QuotaSetEntryRequest) SetVolume(newValue string) *QuotaSetEntryRequest {
o.VolumePtr = &newValue
return o
}