-
Notifications
You must be signed in to change notification settings - Fork 0
/
api-export-policy-create.go
176 lines (146 loc) · 6.41 KB
/
api-export-policy-create.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
package azgo
import (
"encoding/xml"
"reflect"
log "github.com/sirupsen/logrus"
)
// ExportPolicyCreateRequest is a structure to represent a export-policy-create Request ZAPI object
type ExportPolicyCreateRequest struct {
XMLName xml.Name `xml:"export-policy-create"`
PolicyNamePtr *ExportPolicyNameType `xml:"policy-name"`
ReturnRecordPtr *bool `xml:"return-record"`
}
// ExportPolicyCreateResponse is a structure to represent a export-policy-create Response ZAPI object
type ExportPolicyCreateResponse struct {
XMLName xml.Name `xml:"netapp"`
ResponseVersion string `xml:"version,attr"`
ResponseXmlns string `xml:"xmlns,attr"`
Result ExportPolicyCreateResponseResult `xml:"results"`
}
// NewExportPolicyCreateResponse is a factory method for creating new instances of ExportPolicyCreateResponse objects
func NewExportPolicyCreateResponse() *ExportPolicyCreateResponse {
return &ExportPolicyCreateResponse{}
}
// String returns a string representation of this object's fields and implements the Stringer interface
func (o ExportPolicyCreateResponse) String() string {
return ToString(reflect.ValueOf(o))
}
// ToXML converts this object into an xml string representation
func (o *ExportPolicyCreateResponse) ToXML() (string, error) {
output, err := xml.MarshalIndent(o, " ", " ")
if err != nil {
log.Errorf("error: %v", err)
}
return string(output), err
}
// ExportPolicyCreateResponseResult is a structure to represent a export-policy-create Response Result ZAPI object
type ExportPolicyCreateResponseResult struct {
XMLName xml.Name `xml:"results"`
ResultStatusAttr string `xml:"status,attr"`
ResultReasonAttr string `xml:"reason,attr"`
ResultErrnoAttr string `xml:"errno,attr"`
ResultPtr *ExportPolicyCreateResponseResultResult `xml:"result"`
}
// NewExportPolicyCreateRequest is a factory method for creating new instances of ExportPolicyCreateRequest objects
func NewExportPolicyCreateRequest() *ExportPolicyCreateRequest {
return &ExportPolicyCreateRequest{}
}
// NewExportPolicyCreateResponseResult is a factory method for creating new instances of ExportPolicyCreateResponseResult objects
func NewExportPolicyCreateResponseResult() *ExportPolicyCreateResponseResult {
return &ExportPolicyCreateResponseResult{}
}
// ToXML converts this object into an xml string representation
func (o *ExportPolicyCreateRequest) 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 *ExportPolicyCreateResponseResult) 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 ExportPolicyCreateRequest) String() string {
return ToString(reflect.ValueOf(o))
}
// String returns a string representation of this object's fields and implements the Stringer interface
func (o ExportPolicyCreateResponseResult) 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 *ExportPolicyCreateRequest) ExecuteUsing(zr *ZapiRunner) (*ExportPolicyCreateResponse, 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 *ExportPolicyCreateRequest) executeWithoutIteration(zr *ZapiRunner) (*ExportPolicyCreateResponse, error) {
result, err := zr.ExecuteUsing(o, "ExportPolicyCreateRequest", NewExportPolicyCreateResponse())
if result == nil {
return nil, err
}
return result.(*ExportPolicyCreateResponse), err
}
// PolicyName is a 'getter' method
func (o *ExportPolicyCreateRequest) PolicyName() ExportPolicyNameType {
r := *o.PolicyNamePtr
return r
}
// SetPolicyName is a fluent style 'setter' method that can be chained
func (o *ExportPolicyCreateRequest) SetPolicyName(newValue ExportPolicyNameType) *ExportPolicyCreateRequest {
o.PolicyNamePtr = &newValue
return o
}
// ReturnRecord is a 'getter' method
func (o *ExportPolicyCreateRequest) ReturnRecord() bool {
r := *o.ReturnRecordPtr
return r
}
// SetReturnRecord is a fluent style 'setter' method that can be chained
func (o *ExportPolicyCreateRequest) SetReturnRecord(newValue bool) *ExportPolicyCreateRequest {
o.ReturnRecordPtr = &newValue
return o
}
// ExportPolicyCreateResponseResultResult is a wrapper
type ExportPolicyCreateResponseResultResult struct {
XMLName xml.Name `xml:"result"`
ExportPolicyInfoPtr *ExportPolicyInfoType `xml:"export-policy-info"`
}
// String returns a string representation of this object's fields and implements the Stringer interface
func (o ExportPolicyCreateResponseResultResult) String() string {
return ToString(reflect.ValueOf(o))
}
// ExportPolicyInfo is a 'getter' method
func (o *ExportPolicyCreateResponseResultResult) ExportPolicyInfo() ExportPolicyInfoType {
r := *o.ExportPolicyInfoPtr
return r
}
// SetExportPolicyInfo is a fluent style 'setter' method that can be chained
func (o *ExportPolicyCreateResponseResultResult) SetExportPolicyInfo(newValue ExportPolicyInfoType) *ExportPolicyCreateResponseResultResult {
o.ExportPolicyInfoPtr = &newValue
return o
}
// values is a 'getter' method
func (o *ExportPolicyCreateResponseResultResult) values() ExportPolicyInfoType {
r := *o.ExportPolicyInfoPtr
return r
}
// setValues is a fluent style 'setter' method that can be chained
func (o *ExportPolicyCreateResponseResultResult) setValues(newValue ExportPolicyInfoType) *ExportPolicyCreateResponseResultResult {
o.ExportPolicyInfoPtr = &newValue
return o
}
// Result is a 'getter' method
func (o *ExportPolicyCreateResponseResult) Result() ExportPolicyCreateResponseResultResult {
r := *o.ResultPtr
return r
}
// SetResult is a fluent style 'setter' method that can be chained
func (o *ExportPolicyCreateResponseResult) SetResult(newValue ExportPolicyCreateResponseResultResult) *ExportPolicyCreateResponseResult {
o.ResultPtr = &newValue
return o
}