-
Notifications
You must be signed in to change notification settings - Fork 0
/
model_disk_summary.go
597 lines (505 loc) · 14.1 KB
/
model_disk_summary.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
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
/*
Proxmox
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
API version: 2023-01-01
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package proxmox
import (
"encoding/json"
)
// checks if the DiskSummary type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &DiskSummary{}
// DiskSummary struct for DiskSummary
type DiskSummary struct {
Devpath string `json:"devpath"`
Gpt float32 `json:"gpt"`
Osdid float32 `json:"osdid"`
// The size of the disk in bytes
Size float32 `json:"size"`
ByIdLink *string `json:"by_id_link,omitempty"`
Model *string `json:"model,omitempty"`
Parent *string `json:"parent,omitempty"`
Health *string `json:"health,omitempty"`
Serial *string `json:"serial,omitempty"`
Rpm interface{} `json:"rpm,omitempty"`
Wwn *string `json:"wwn,omitempty"`
Vendor *string `json:"vendor,omitempty"`
Wearout interface{} `json:"wearout,omitempty"`
Type *DiskType `json:"type,omitempty"`
Mounted *float32 `json:"mounted,omitempty"`
}
// NewDiskSummary instantiates a new DiskSummary 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 NewDiskSummary(devpath string, gpt float32, osdid float32, size float32) *DiskSummary {
this := DiskSummary{}
this.Devpath = devpath
this.Gpt = gpt
this.Osdid = osdid
this.Size = size
return &this
}
// NewDiskSummaryWithDefaults instantiates a new DiskSummary 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 NewDiskSummaryWithDefaults() *DiskSummary {
this := DiskSummary{}
return &this
}
// GetDevpath returns the Devpath field value
func (o *DiskSummary) GetDevpath() string {
if o == nil {
var ret string
return ret
}
return o.Devpath
}
// GetDevpathOk returns a tuple with the Devpath field value
// and a boolean to check if the value has been set.
func (o *DiskSummary) GetDevpathOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.Devpath, true
}
// SetDevpath sets field value
func (o *DiskSummary) SetDevpath(v string) {
o.Devpath = v
}
// GetGpt returns the Gpt field value
func (o *DiskSummary) GetGpt() float32 {
if o == nil {
var ret float32
return ret
}
return o.Gpt
}
// GetGptOk returns a tuple with the Gpt field value
// and a boolean to check if the value has been set.
func (o *DiskSummary) GetGptOk() (*float32, bool) {
if o == nil {
return nil, false
}
return &o.Gpt, true
}
// SetGpt sets field value
func (o *DiskSummary) SetGpt(v float32) {
o.Gpt = v
}
// GetOsdid returns the Osdid field value
func (o *DiskSummary) GetOsdid() float32 {
if o == nil {
var ret float32
return ret
}
return o.Osdid
}
// GetOsdidOk returns a tuple with the Osdid field value
// and a boolean to check if the value has been set.
func (o *DiskSummary) GetOsdidOk() (*float32, bool) {
if o == nil {
return nil, false
}
return &o.Osdid, true
}
// SetOsdid sets field value
func (o *DiskSummary) SetOsdid(v float32) {
o.Osdid = v
}
// GetSize returns the Size field value
func (o *DiskSummary) GetSize() float32 {
if o == nil {
var ret float32
return ret
}
return o.Size
}
// GetSizeOk returns a tuple with the Size field value
// and a boolean to check if the value has been set.
func (o *DiskSummary) GetSizeOk() (*float32, bool) {
if o == nil {
return nil, false
}
return &o.Size, true
}
// SetSize sets field value
func (o *DiskSummary) SetSize(v float32) {
o.Size = v
}
// GetByIdLink returns the ByIdLink field value if set, zero value otherwise.
func (o *DiskSummary) GetByIdLink() string {
if o == nil || isNil(o.ByIdLink) {
var ret string
return ret
}
return *o.ByIdLink
}
// GetByIdLinkOk returns a tuple with the ByIdLink field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *DiskSummary) GetByIdLinkOk() (*string, bool) {
if o == nil || isNil(o.ByIdLink) {
return nil, false
}
return o.ByIdLink, true
}
// HasByIdLink returns a boolean if a field has been set.
func (o *DiskSummary) HasByIdLink() bool {
if o != nil && !isNil(o.ByIdLink) {
return true
}
return false
}
// SetByIdLink gets a reference to the given string and assigns it to the ByIdLink field.
func (o *DiskSummary) SetByIdLink(v string) {
o.ByIdLink = &v
}
// GetModel returns the Model field value if set, zero value otherwise.
func (o *DiskSummary) GetModel() string {
if o == nil || isNil(o.Model) {
var ret string
return ret
}
return *o.Model
}
// GetModelOk returns a tuple with the Model field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *DiskSummary) GetModelOk() (*string, bool) {
if o == nil || isNil(o.Model) {
return nil, false
}
return o.Model, true
}
// HasModel returns a boolean if a field has been set.
func (o *DiskSummary) HasModel() bool {
if o != nil && !isNil(o.Model) {
return true
}
return false
}
// SetModel gets a reference to the given string and assigns it to the Model field.
func (o *DiskSummary) SetModel(v string) {
o.Model = &v
}
// GetParent returns the Parent field value if set, zero value otherwise.
func (o *DiskSummary) GetParent() string {
if o == nil || isNil(o.Parent) {
var ret string
return ret
}
return *o.Parent
}
// GetParentOk returns a tuple with the Parent field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *DiskSummary) GetParentOk() (*string, bool) {
if o == nil || isNil(o.Parent) {
return nil, false
}
return o.Parent, true
}
// HasParent returns a boolean if a field has been set.
func (o *DiskSummary) HasParent() bool {
if o != nil && !isNil(o.Parent) {
return true
}
return false
}
// SetParent gets a reference to the given string and assigns it to the Parent field.
func (o *DiskSummary) SetParent(v string) {
o.Parent = &v
}
// GetHealth returns the Health field value if set, zero value otherwise.
func (o *DiskSummary) GetHealth() string {
if o == nil || isNil(o.Health) {
var ret string
return ret
}
return *o.Health
}
// GetHealthOk returns a tuple with the Health field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *DiskSummary) GetHealthOk() (*string, bool) {
if o == nil || isNil(o.Health) {
return nil, false
}
return o.Health, true
}
// HasHealth returns a boolean if a field has been set.
func (o *DiskSummary) HasHealth() bool {
if o != nil && !isNil(o.Health) {
return true
}
return false
}
// SetHealth gets a reference to the given string and assigns it to the Health field.
func (o *DiskSummary) SetHealth(v string) {
o.Health = &v
}
// GetSerial returns the Serial field value if set, zero value otherwise.
func (o *DiskSummary) GetSerial() string {
if o == nil || isNil(o.Serial) {
var ret string
return ret
}
return *o.Serial
}
// GetSerialOk returns a tuple with the Serial field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *DiskSummary) GetSerialOk() (*string, bool) {
if o == nil || isNil(o.Serial) {
return nil, false
}
return o.Serial, true
}
// HasSerial returns a boolean if a field has been set.
func (o *DiskSummary) HasSerial() bool {
if o != nil && !isNil(o.Serial) {
return true
}
return false
}
// SetSerial gets a reference to the given string and assigns it to the Serial field.
func (o *DiskSummary) SetSerial(v string) {
o.Serial = &v
}
// GetRpm returns the Rpm field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *DiskSummary) GetRpm() interface{} {
if o == nil {
var ret interface{}
return ret
}
return o.Rpm
}
// GetRpmOk returns a tuple with the Rpm field value if set, nil otherwise
// and a boolean to check if the value has been set.
// NOTE: If the value is an explicit nil, `nil, true` will be returned
func (o *DiskSummary) GetRpmOk() (*interface{}, bool) {
if o == nil || isNil(o.Rpm) {
return nil, false
}
return &o.Rpm, true
}
// HasRpm returns a boolean if a field has been set.
func (o *DiskSummary) HasRpm() bool {
if o != nil && isNil(o.Rpm) {
return true
}
return false
}
// SetRpm gets a reference to the given interface{} and assigns it to the Rpm field.
func (o *DiskSummary) SetRpm(v interface{}) {
o.Rpm = v
}
// GetWwn returns the Wwn field value if set, zero value otherwise.
func (o *DiskSummary) GetWwn() string {
if o == nil || isNil(o.Wwn) {
var ret string
return ret
}
return *o.Wwn
}
// GetWwnOk returns a tuple with the Wwn field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *DiskSummary) GetWwnOk() (*string, bool) {
if o == nil || isNil(o.Wwn) {
return nil, false
}
return o.Wwn, true
}
// HasWwn returns a boolean if a field has been set.
func (o *DiskSummary) HasWwn() bool {
if o != nil && !isNil(o.Wwn) {
return true
}
return false
}
// SetWwn gets a reference to the given string and assigns it to the Wwn field.
func (o *DiskSummary) SetWwn(v string) {
o.Wwn = &v
}
// GetVendor returns the Vendor field value if set, zero value otherwise.
func (o *DiskSummary) GetVendor() string {
if o == nil || isNil(o.Vendor) {
var ret string
return ret
}
return *o.Vendor
}
// GetVendorOk returns a tuple with the Vendor field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *DiskSummary) GetVendorOk() (*string, bool) {
if o == nil || isNil(o.Vendor) {
return nil, false
}
return o.Vendor, true
}
// HasVendor returns a boolean if a field has been set.
func (o *DiskSummary) HasVendor() bool {
if o != nil && !isNil(o.Vendor) {
return true
}
return false
}
// SetVendor gets a reference to the given string and assigns it to the Vendor field.
func (o *DiskSummary) SetVendor(v string) {
o.Vendor = &v
}
// GetWearout returns the Wearout field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *DiskSummary) GetWearout() interface{} {
if o == nil {
var ret interface{}
return ret
}
return o.Wearout
}
// GetWearoutOk returns a tuple with the Wearout field value if set, nil otherwise
// and a boolean to check if the value has been set.
// NOTE: If the value is an explicit nil, `nil, true` will be returned
func (o *DiskSummary) GetWearoutOk() (*interface{}, bool) {
if o == nil || isNil(o.Wearout) {
return nil, false
}
return &o.Wearout, true
}
// HasWearout returns a boolean if a field has been set.
func (o *DiskSummary) HasWearout() bool {
if o != nil && isNil(o.Wearout) {
return true
}
return false
}
// SetWearout gets a reference to the given interface{} and assigns it to the Wearout field.
func (o *DiskSummary) SetWearout(v interface{}) {
o.Wearout = v
}
// GetType returns the Type field value if set, zero value otherwise.
func (o *DiskSummary) GetType() DiskType {
if o == nil || isNil(o.Type) {
var ret DiskType
return ret
}
return *o.Type
}
// GetTypeOk returns a tuple with the Type field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *DiskSummary) GetTypeOk() (*DiskType, bool) {
if o == nil || isNil(o.Type) {
return nil, false
}
return o.Type, true
}
// HasType returns a boolean if a field has been set.
func (o *DiskSummary) HasType() bool {
if o != nil && !isNil(o.Type) {
return true
}
return false
}
// SetType gets a reference to the given DiskType and assigns it to the Type field.
func (o *DiskSummary) SetType(v DiskType) {
o.Type = &v
}
// GetMounted returns the Mounted field value if set, zero value otherwise.
func (o *DiskSummary) GetMounted() float32 {
if o == nil || isNil(o.Mounted) {
var ret float32
return ret
}
return *o.Mounted
}
// GetMountedOk returns a tuple with the Mounted field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *DiskSummary) GetMountedOk() (*float32, bool) {
if o == nil || isNil(o.Mounted) {
return nil, false
}
return o.Mounted, true
}
// HasMounted returns a boolean if a field has been set.
func (o *DiskSummary) HasMounted() bool {
if o != nil && !isNil(o.Mounted) {
return true
}
return false
}
// SetMounted gets a reference to the given float32 and assigns it to the Mounted field.
func (o *DiskSummary) SetMounted(v float32) {
o.Mounted = &v
}
func (o DiskSummary) MarshalJSON() ([]byte, error) {
toSerialize,err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o DiskSummary) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
toSerialize["devpath"] = o.Devpath
toSerialize["gpt"] = o.Gpt
toSerialize["osdid"] = o.Osdid
toSerialize["size"] = o.Size
if !isNil(o.ByIdLink) {
toSerialize["by_id_link"] = o.ByIdLink
}
if !isNil(o.Model) {
toSerialize["model"] = o.Model
}
if !isNil(o.Parent) {
toSerialize["parent"] = o.Parent
}
if !isNil(o.Health) {
toSerialize["health"] = o.Health
}
if !isNil(o.Serial) {
toSerialize["serial"] = o.Serial
}
if o.Rpm != nil {
toSerialize["rpm"] = o.Rpm
}
if !isNil(o.Wwn) {
toSerialize["wwn"] = o.Wwn
}
if !isNil(o.Vendor) {
toSerialize["vendor"] = o.Vendor
}
if o.Wearout != nil {
toSerialize["wearout"] = o.Wearout
}
if !isNil(o.Type) {
toSerialize["type"] = o.Type
}
if !isNil(o.Mounted) {
toSerialize["mounted"] = o.Mounted
}
return toSerialize, nil
}
type NullableDiskSummary struct {
value *DiskSummary
isSet bool
}
func (v NullableDiskSummary) Get() *DiskSummary {
return v.value
}
func (v *NullableDiskSummary) Set(val *DiskSummary) {
v.value = val
v.isSet = true
}
func (v NullableDiskSummary) IsSet() bool {
return v.isSet
}
func (v *NullableDiskSummary) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableDiskSummary(val *DiskSummary) *NullableDiskSummary {
return &NullableDiskSummary{value: val, isSet: true}
}
func (v NullableDiskSummary) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableDiskSummary) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}