-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmodel_v0_0_39_acct_gather_energy.go
307 lines (256 loc) · 9.13 KB
/
model_v0_0_39_acct_gather_energy.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
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
/*
Slurm REST API
API to access and control Slurm
API version: Slurm-24.05.2&openapi/dbv0.0.39&openapi/v0.0.39&openapi/slurmdbd&openapi/slurmctld
Contact: [email protected]
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package slurmrest
import (
"encoding/json"
)
// checks if the V0039AcctGatherEnergy type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &V0039AcctGatherEnergy{}
// V0039AcctGatherEnergy struct for V0039AcctGatherEnergy
type V0039AcctGatherEnergy struct {
AverageWatts *int32 `json:"average_watts,omitempty"`
BaseConsumedEnergy *int64 `json:"base_consumed_energy,omitempty"`
ConsumedEnergy *int64 `json:"consumed_energy,omitempty"`
CurrentWatts *V0039Uint32NoVal `json:"current_watts,omitempty"`
PreviousConsumedEnergy *int64 `json:"previous_consumed_energy,omitempty"`
LastCollected *int64 `json:"last_collected,omitempty"`
}
// NewV0039AcctGatherEnergy instantiates a new V0039AcctGatherEnergy object
// This constructor will assign default values to properties that have it defined,
// and makes sure properties required by API are set, but the set of arguments
// will change when the set of required properties is changed
func NewV0039AcctGatherEnergy() *V0039AcctGatherEnergy {
this := V0039AcctGatherEnergy{}
return &this
}
// NewV0039AcctGatherEnergyWithDefaults instantiates a new V0039AcctGatherEnergy object
// This constructor will only assign default values to properties that have it defined,
// but it doesn't guarantee that properties required by API are set
func NewV0039AcctGatherEnergyWithDefaults() *V0039AcctGatherEnergy {
this := V0039AcctGatherEnergy{}
return &this
}
// GetAverageWatts returns the AverageWatts field value if set, zero value otherwise.
func (o *V0039AcctGatherEnergy) GetAverageWatts() int32 {
if o == nil || IsNil(o.AverageWatts) {
var ret int32
return ret
}
return *o.AverageWatts
}
// GetAverageWattsOk returns a tuple with the AverageWatts field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *V0039AcctGatherEnergy) GetAverageWattsOk() (*int32, bool) {
if o == nil || IsNil(o.AverageWatts) {
return nil, false
}
return o.AverageWatts, true
}
// HasAverageWatts returns a boolean if a field has been set.
func (o *V0039AcctGatherEnergy) HasAverageWatts() bool {
if o != nil && !IsNil(o.AverageWatts) {
return true
}
return false
}
// SetAverageWatts gets a reference to the given int32 and assigns it to the AverageWatts field.
func (o *V0039AcctGatherEnergy) SetAverageWatts(v int32) {
o.AverageWatts = &v
}
// GetBaseConsumedEnergy returns the BaseConsumedEnergy field value if set, zero value otherwise.
func (o *V0039AcctGatherEnergy) GetBaseConsumedEnergy() int64 {
if o == nil || IsNil(o.BaseConsumedEnergy) {
var ret int64
return ret
}
return *o.BaseConsumedEnergy
}
// GetBaseConsumedEnergyOk returns a tuple with the BaseConsumedEnergy field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *V0039AcctGatherEnergy) GetBaseConsumedEnergyOk() (*int64, bool) {
if o == nil || IsNil(o.BaseConsumedEnergy) {
return nil, false
}
return o.BaseConsumedEnergy, true
}
// HasBaseConsumedEnergy returns a boolean if a field has been set.
func (o *V0039AcctGatherEnergy) HasBaseConsumedEnergy() bool {
if o != nil && !IsNil(o.BaseConsumedEnergy) {
return true
}
return false
}
// SetBaseConsumedEnergy gets a reference to the given int64 and assigns it to the BaseConsumedEnergy field.
func (o *V0039AcctGatherEnergy) SetBaseConsumedEnergy(v int64) {
o.BaseConsumedEnergy = &v
}
// GetConsumedEnergy returns the ConsumedEnergy field value if set, zero value otherwise.
func (o *V0039AcctGatherEnergy) GetConsumedEnergy() int64 {
if o == nil || IsNil(o.ConsumedEnergy) {
var ret int64
return ret
}
return *o.ConsumedEnergy
}
// GetConsumedEnergyOk returns a tuple with the ConsumedEnergy field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *V0039AcctGatherEnergy) GetConsumedEnergyOk() (*int64, bool) {
if o == nil || IsNil(o.ConsumedEnergy) {
return nil, false
}
return o.ConsumedEnergy, true
}
// HasConsumedEnergy returns a boolean if a field has been set.
func (o *V0039AcctGatherEnergy) HasConsumedEnergy() bool {
if o != nil && !IsNil(o.ConsumedEnergy) {
return true
}
return false
}
// SetConsumedEnergy gets a reference to the given int64 and assigns it to the ConsumedEnergy field.
func (o *V0039AcctGatherEnergy) SetConsumedEnergy(v int64) {
o.ConsumedEnergy = &v
}
// GetCurrentWatts returns the CurrentWatts field value if set, zero value otherwise.
func (o *V0039AcctGatherEnergy) GetCurrentWatts() V0039Uint32NoVal {
if o == nil || IsNil(o.CurrentWatts) {
var ret V0039Uint32NoVal
return ret
}
return *o.CurrentWatts
}
// GetCurrentWattsOk returns a tuple with the CurrentWatts field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *V0039AcctGatherEnergy) GetCurrentWattsOk() (*V0039Uint32NoVal, bool) {
if o == nil || IsNil(o.CurrentWatts) {
return nil, false
}
return o.CurrentWatts, true
}
// HasCurrentWatts returns a boolean if a field has been set.
func (o *V0039AcctGatherEnergy) HasCurrentWatts() bool {
if o != nil && !IsNil(o.CurrentWatts) {
return true
}
return false
}
// SetCurrentWatts gets a reference to the given V0039Uint32NoVal and assigns it to the CurrentWatts field.
func (o *V0039AcctGatherEnergy) SetCurrentWatts(v V0039Uint32NoVal) {
o.CurrentWatts = &v
}
// GetPreviousConsumedEnergy returns the PreviousConsumedEnergy field value if set, zero value otherwise.
func (o *V0039AcctGatherEnergy) GetPreviousConsumedEnergy() int64 {
if o == nil || IsNil(o.PreviousConsumedEnergy) {
var ret int64
return ret
}
return *o.PreviousConsumedEnergy
}
// GetPreviousConsumedEnergyOk returns a tuple with the PreviousConsumedEnergy field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *V0039AcctGatherEnergy) GetPreviousConsumedEnergyOk() (*int64, bool) {
if o == nil || IsNil(o.PreviousConsumedEnergy) {
return nil, false
}
return o.PreviousConsumedEnergy, true
}
// HasPreviousConsumedEnergy returns a boolean if a field has been set.
func (o *V0039AcctGatherEnergy) HasPreviousConsumedEnergy() bool {
if o != nil && !IsNil(o.PreviousConsumedEnergy) {
return true
}
return false
}
// SetPreviousConsumedEnergy gets a reference to the given int64 and assigns it to the PreviousConsumedEnergy field.
func (o *V0039AcctGatherEnergy) SetPreviousConsumedEnergy(v int64) {
o.PreviousConsumedEnergy = &v
}
// GetLastCollected returns the LastCollected field value if set, zero value otherwise.
func (o *V0039AcctGatherEnergy) GetLastCollected() int64 {
if o == nil || IsNil(o.LastCollected) {
var ret int64
return ret
}
return *o.LastCollected
}
// GetLastCollectedOk returns a tuple with the LastCollected field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *V0039AcctGatherEnergy) GetLastCollectedOk() (*int64, bool) {
if o == nil || IsNil(o.LastCollected) {
return nil, false
}
return o.LastCollected, true
}
// HasLastCollected returns a boolean if a field has been set.
func (o *V0039AcctGatherEnergy) HasLastCollected() bool {
if o != nil && !IsNil(o.LastCollected) {
return true
}
return false
}
// SetLastCollected gets a reference to the given int64 and assigns it to the LastCollected field.
func (o *V0039AcctGatherEnergy) SetLastCollected(v int64) {
o.LastCollected = &v
}
func (o V0039AcctGatherEnergy) MarshalJSON() ([]byte, error) {
toSerialize,err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o V0039AcctGatherEnergy) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.AverageWatts) {
toSerialize["average_watts"] = o.AverageWatts
}
if !IsNil(o.BaseConsumedEnergy) {
toSerialize["base_consumed_energy"] = o.BaseConsumedEnergy
}
if !IsNil(o.ConsumedEnergy) {
toSerialize["consumed_energy"] = o.ConsumedEnergy
}
if !IsNil(o.CurrentWatts) {
toSerialize["current_watts"] = o.CurrentWatts
}
if !IsNil(o.PreviousConsumedEnergy) {
toSerialize["previous_consumed_energy"] = o.PreviousConsumedEnergy
}
if !IsNil(o.LastCollected) {
toSerialize["last_collected"] = o.LastCollected
}
return toSerialize, nil
}
type NullableV0039AcctGatherEnergy struct {
value *V0039AcctGatherEnergy
isSet bool
}
func (v NullableV0039AcctGatherEnergy) Get() *V0039AcctGatherEnergy {
return v.value
}
func (v *NullableV0039AcctGatherEnergy) Set(val *V0039AcctGatherEnergy) {
v.value = val
v.isSet = true
}
func (v NullableV0039AcctGatherEnergy) IsSet() bool {
return v.isSet
}
func (v *NullableV0039AcctGatherEnergy) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableV0039AcctGatherEnergy(val *V0039AcctGatherEnergy) *NullableV0039AcctGatherEnergy {
return &NullableV0039AcctGatherEnergy{value: val, isSet: true}
}
func (v NullableV0039AcctGatherEnergy) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableV0039AcctGatherEnergy) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}