...
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 package models
18
19
20
21
22 import (
23 "context"
24
25 "github.com/go-openapi/errors"
26 "github.com/go-openapi/strfmt"
27 "github.com/go-openapi/swag"
28 "github.com/go-openapi/validate"
29 )
30
31
32
33
34 type VersionInfo struct {
35
36
37
38 Branch *string `json:"branch"`
39
40
41
42 BuildDate *string `json:"buildDate"`
43
44
45
46 BuildUser *string `json:"buildUser"`
47
48
49
50 GoVersion *string `json:"goVersion"`
51
52
53
54 Revision *string `json:"revision"`
55
56
57
58 Version *string `json:"version"`
59 }
60
61
62 func (m *VersionInfo) Validate(formats strfmt.Registry) error {
63 var res []error
64
65 if err := m.validateBranch(formats); err != nil {
66 res = append(res, err)
67 }
68
69 if err := m.validateBuildDate(formats); err != nil {
70 res = append(res, err)
71 }
72
73 if err := m.validateBuildUser(formats); err != nil {
74 res = append(res, err)
75 }
76
77 if err := m.validateGoVersion(formats); err != nil {
78 res = append(res, err)
79 }
80
81 if err := m.validateRevision(formats); err != nil {
82 res = append(res, err)
83 }
84
85 if err := m.validateVersion(formats); err != nil {
86 res = append(res, err)
87 }
88
89 if len(res) > 0 {
90 return errors.CompositeValidationError(res...)
91 }
92 return nil
93 }
94
95 func (m *VersionInfo) validateBranch(formats strfmt.Registry) error {
96
97 if err := validate.Required("branch", "body", m.Branch); err != nil {
98 return err
99 }
100
101 return nil
102 }
103
104 func (m *VersionInfo) validateBuildDate(formats strfmt.Registry) error {
105
106 if err := validate.Required("buildDate", "body", m.BuildDate); err != nil {
107 return err
108 }
109
110 return nil
111 }
112
113 func (m *VersionInfo) validateBuildUser(formats strfmt.Registry) error {
114
115 if err := validate.Required("buildUser", "body", m.BuildUser); err != nil {
116 return err
117 }
118
119 return nil
120 }
121
122 func (m *VersionInfo) validateGoVersion(formats strfmt.Registry) error {
123
124 if err := validate.Required("goVersion", "body", m.GoVersion); err != nil {
125 return err
126 }
127
128 return nil
129 }
130
131 func (m *VersionInfo) validateRevision(formats strfmt.Registry) error {
132
133 if err := validate.Required("revision", "body", m.Revision); err != nil {
134 return err
135 }
136
137 return nil
138 }
139
140 func (m *VersionInfo) validateVersion(formats strfmt.Registry) error {
141
142 if err := validate.Required("version", "body", m.Version); err != nil {
143 return err
144 }
145
146 return nil
147 }
148
149
150 func (m *VersionInfo) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
151 return nil
152 }
153
154
155 func (m *VersionInfo) MarshalBinary() ([]byte, error) {
156 if m == nil {
157 return nil, nil
158 }
159 return swag.WriteJSON(m)
160 }
161
162
163 func (m *VersionInfo) UnmarshalBinary(b []byte) error {
164 var res VersionInfo
165 if err := swag.ReadJSON(b, &res); err != nil {
166 return err
167 }
168 *m = res
169 return nil
170 }
171
View as plain text