-
Notifications
You must be signed in to change notification settings - Fork 0
/
type-plex-attributes.go
170 lines (143 loc) · 5.23 KB
/
type-plex-attributes.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
package azgo
import (
"encoding/xml"
"reflect"
log "github.com/sirupsen/logrus"
)
// PlexAttributesType is a structure to represent a plex-attributes ZAPI object
type PlexAttributesType struct {
XMLName xml.Name `xml:"plex-attributes"`
IsOnlinePtr *bool `xml:"is-online"`
IsResyncingPtr *bool `xml:"is-resyncing"`
PlexNamePtr *string `xml:"plex-name"`
PlexResyncPctWithPrecisionPtr *string `xml:"plex-resync-pct-with-precision"`
PlexStatusPtr *string `xml:"plex-status"`
PoolPtr *int `xml:"pool"`
RaidgroupsPtr *PlexAttributesTypeRaidgroups `xml:"raidgroups"`
// work in progress
ResyncLevelPtr *int `xml:"resync-level"`
ResyncingPercentagePtr *int `xml:"resyncing-percentage"`
}
// NewPlexAttributesType is a factory method for creating new instances of PlexAttributesType objects
func NewPlexAttributesType() *PlexAttributesType {
return &PlexAttributesType{}
}
// ToXML converts this object into an xml string representation
func (o *PlexAttributesType) 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 PlexAttributesType) String() string {
return ToString(reflect.ValueOf(o))
}
// IsOnline is a 'getter' method
func (o *PlexAttributesType) IsOnline() bool {
r := *o.IsOnlinePtr
return r
}
// SetIsOnline is a fluent style 'setter' method that can be chained
func (o *PlexAttributesType) SetIsOnline(newValue bool) *PlexAttributesType {
o.IsOnlinePtr = &newValue
return o
}
// IsResyncing is a 'getter' method
func (o *PlexAttributesType) IsResyncing() bool {
r := *o.IsResyncingPtr
return r
}
// SetIsResyncing is a fluent style 'setter' method that can be chained
func (o *PlexAttributesType) SetIsResyncing(newValue bool) *PlexAttributesType {
o.IsResyncingPtr = &newValue
return o
}
// PlexName is a 'getter' method
func (o *PlexAttributesType) PlexName() string {
r := *o.PlexNamePtr
return r
}
// SetPlexName is a fluent style 'setter' method that can be chained
func (o *PlexAttributesType) SetPlexName(newValue string) *PlexAttributesType {
o.PlexNamePtr = &newValue
return o
}
// PlexResyncPctWithPrecision is a 'getter' method
func (o *PlexAttributesType) PlexResyncPctWithPrecision() string {
r := *o.PlexResyncPctWithPrecisionPtr
return r
}
// SetPlexResyncPctWithPrecision is a fluent style 'setter' method that can be chained
func (o *PlexAttributesType) SetPlexResyncPctWithPrecision(newValue string) *PlexAttributesType {
o.PlexResyncPctWithPrecisionPtr = &newValue
return o
}
// PlexStatus is a 'getter' method
func (o *PlexAttributesType) PlexStatus() string {
r := *o.PlexStatusPtr
return r
}
// SetPlexStatus is a fluent style 'setter' method that can be chained
func (o *PlexAttributesType) SetPlexStatus(newValue string) *PlexAttributesType {
o.PlexStatusPtr = &newValue
return o
}
// Pool is a 'getter' method
func (o *PlexAttributesType) Pool() int {
r := *o.PoolPtr
return r
}
// SetPool is a fluent style 'setter' method that can be chained
func (o *PlexAttributesType) SetPool(newValue int) *PlexAttributesType {
o.PoolPtr = &newValue
return o
}
// PlexAttributesTypeRaidgroups is a wrapper
type PlexAttributesTypeRaidgroups struct {
XMLName xml.Name `xml:"raidgroups"`
RaidgroupAttributesPtr []RaidgroupAttributesType `xml:"raidgroup-attributes"`
}
// RaidgroupAttributes is a 'getter' method
func (o *PlexAttributesTypeRaidgroups) RaidgroupAttributes() []RaidgroupAttributesType {
r := o.RaidgroupAttributesPtr
return r
}
// SetRaidgroupAttributes is a fluent style 'setter' method that can be chained
func (o *PlexAttributesTypeRaidgroups) SetRaidgroupAttributes(newValue []RaidgroupAttributesType) *PlexAttributesTypeRaidgroups {
newSlice := make([]RaidgroupAttributesType, len(newValue))
copy(newSlice, newValue)
o.RaidgroupAttributesPtr = newSlice
return o
}
// Raidgroups is a 'getter' method
func (o *PlexAttributesType) Raidgroups() PlexAttributesTypeRaidgroups {
r := *o.RaidgroupsPtr
return r
}
// SetRaidgroups is a fluent style 'setter' method that can be chained
func (o *PlexAttributesType) SetRaidgroups(newValue PlexAttributesTypeRaidgroups) *PlexAttributesType {
o.RaidgroupsPtr = &newValue
return o
}
// ResyncLevel is a 'getter' method
func (o *PlexAttributesType) ResyncLevel() int {
r := *o.ResyncLevelPtr
return r
}
// SetResyncLevel is a fluent style 'setter' method that can be chained
func (o *PlexAttributesType) SetResyncLevel(newValue int) *PlexAttributesType {
o.ResyncLevelPtr = &newValue
return o
}
// ResyncingPercentage is a 'getter' method
func (o *PlexAttributesType) ResyncingPercentage() int {
r := *o.ResyncingPercentagePtr
return r
}
// SetResyncingPercentage is a fluent style 'setter' method that can be chained
func (o *PlexAttributesType) SetResyncingPercentage(newValue int) *PlexAttributesType {
o.ResyncingPercentagePtr = &newValue
return o
}