/
type-volume-error.go
84 lines (70 loc) · 2.1 KB
/
type-volume-error.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
package azgo
import (
"encoding/xml"
"reflect"
log "github.com/sirupsen/logrus"
)
// VolumeErrorType is a structure to represent a volume-error ZAPI object
type VolumeErrorType struct {
XMLName xml.Name `xml:"volume-error"`
ErrnoPtr *int `xml:"errno"`
NamePtr *VolumeNameType `xml:"name"`
ReasonPtr *string `xml:"reason"`
VserverPtr *string `xml:"vserver"`
}
// NewVolumeErrorType is a factory method for creating new instances of VolumeErrorType objects
func NewVolumeErrorType() *VolumeErrorType {
return &VolumeErrorType{}
}
// ToXML converts this object into an xml string representation
func (o *VolumeErrorType) 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 VolumeErrorType) String() string {
return ToString(reflect.ValueOf(o))
}
// Errno is a 'getter' method
func (o *VolumeErrorType) Errno() int {
r := *o.ErrnoPtr
return r
}
// SetErrno is a fluent style 'setter' method that can be chained
func (o *VolumeErrorType) SetErrno(newValue int) *VolumeErrorType {
o.ErrnoPtr = &newValue
return o
}
// Name is a 'getter' method
func (o *VolumeErrorType) Name() VolumeNameType {
r := *o.NamePtr
return r
}
// SetName is a fluent style 'setter' method that can be chained
func (o *VolumeErrorType) SetName(newValue VolumeNameType) *VolumeErrorType {
o.NamePtr = &newValue
return o
}
// Reason is a 'getter' method
func (o *VolumeErrorType) Reason() string {
r := *o.ReasonPtr
return r
}
// SetReason is a fluent style 'setter' method that can be chained
func (o *VolumeErrorType) SetReason(newValue string) *VolumeErrorType {
o.ReasonPtr = &newValue
return o
}
// Vserver is a 'getter' method
func (o *VolumeErrorType) Vserver() string {
r := *o.VserverPtr
return r
}
// SetVserver is a fluent style 'setter' method that can be chained
func (o *VolumeErrorType) SetVserver(newValue string) *VolumeErrorType {
o.VserverPtr = &newValue
return o
}