/
type-system-version-tuple.go
71 lines (59 loc) · 1.91 KB
/
type-system-version-tuple.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
package azgo
import (
"encoding/xml"
"reflect"
log "github.com/sirupsen/logrus"
)
// SystemVersionTupleType is a structure to represent a system-version-tuple ZAPI object
type SystemVersionTupleType struct {
XMLName xml.Name `xml:"system-version-tuple"`
GenerationPtr *int `xml:"generation"`
MajorPtr *int `xml:"major"`
MinorPtr *int `xml:"minor"`
}
// NewSystemVersionTupleType is a factory method for creating new instances of SystemVersionTupleType objects
func NewSystemVersionTupleType() *SystemVersionTupleType {
return &SystemVersionTupleType{}
}
// ToXML converts this object into an xml string representation
func (o *SystemVersionTupleType) 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 SystemVersionTupleType) String() string {
return ToString(reflect.ValueOf(o))
}
// Generation is a 'getter' method
func (o *SystemVersionTupleType) Generation() int {
r := *o.GenerationPtr
return r
}
// SetGeneration is a fluent style 'setter' method that can be chained
func (o *SystemVersionTupleType) SetGeneration(newValue int) *SystemVersionTupleType {
o.GenerationPtr = &newValue
return o
}
// Major is a 'getter' method
func (o *SystemVersionTupleType) Major() int {
r := *o.MajorPtr
return r
}
// SetMajor is a fluent style 'setter' method that can be chained
func (o *SystemVersionTupleType) SetMajor(newValue int) *SystemVersionTupleType {
o.MajorPtr = &newValue
return o
}
// Minor is a 'getter' method
func (o *SystemVersionTupleType) Minor() int {
r := *o.MinorPtr
return r
}
// SetMinor is a fluent style 'setter' method that can be chained
func (o *SystemVersionTupleType) SetMinor(newValue int) *SystemVersionTupleType {
o.MinorPtr = &newValue
return o
}