-
Notifications
You must be signed in to change notification settings - Fork 30
Expand file tree
/
Copy pathmodel_backup.go
More file actions
615 lines (503 loc) · 18.1 KB
/
model_backup.go
File metadata and controls
615 lines (503 loc) · 18.1 KB
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
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
/*
STACKIT IaaS API
This API allows you to create and modify IaaS resources.
API version: 2
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package iaas
import (
"encoding/json"
"time"
)
// checks if the Backup type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &Backup{}
/*
types and functions for availabilityZone
*/
// isNotNullableString
type BackupGetAvailabilityZoneAttributeType = *string
func getBackupGetAvailabilityZoneAttributeTypeOk(arg BackupGetAvailabilityZoneAttributeType) (ret BackupGetAvailabilityZoneRetType, ok bool) {
if arg == nil {
return ret, false
}
return *arg, true
}
func setBackupGetAvailabilityZoneAttributeType(arg *BackupGetAvailabilityZoneAttributeType, val BackupGetAvailabilityZoneRetType) {
*arg = &val
}
type BackupGetAvailabilityZoneArgType = string
type BackupGetAvailabilityZoneRetType = string
/*
types and functions for createdAt
*/
// isDateTime
type BackupGetCreatedAtAttributeType = *time.Time
type BackupGetCreatedAtArgType = time.Time
type BackupGetCreatedAtRetType = time.Time
func getBackupGetCreatedAtAttributeTypeOk(arg BackupGetCreatedAtAttributeType) (ret BackupGetCreatedAtRetType, ok bool) {
if arg == nil {
return ret, false
}
return *arg, true
}
func setBackupGetCreatedAtAttributeType(arg *BackupGetCreatedAtAttributeType, val BackupGetCreatedAtRetType) {
*arg = &val
}
/*
types and functions for encrypted
*/
// isBoolean
type BackupgetEncryptedAttributeType = *bool
type BackupgetEncryptedArgType = bool
type BackupgetEncryptedRetType = bool
func getBackupgetEncryptedAttributeTypeOk(arg BackupgetEncryptedAttributeType) (ret BackupgetEncryptedRetType, ok bool) {
if arg == nil {
return ret, false
}
return *arg, true
}
func setBackupgetEncryptedAttributeType(arg *BackupgetEncryptedAttributeType, val BackupgetEncryptedRetType) {
*arg = &val
}
/*
types and functions for id
*/
// isNotNullableString
type BackupGetIdAttributeType = *string
func getBackupGetIdAttributeTypeOk(arg BackupGetIdAttributeType) (ret BackupGetIdRetType, ok bool) {
if arg == nil {
return ret, false
}
return *arg, true
}
func setBackupGetIdAttributeType(arg *BackupGetIdAttributeType, val BackupGetIdRetType) {
*arg = &val
}
type BackupGetIdArgType = string
type BackupGetIdRetType = string
/*
types and functions for labels
*/
// isFreeform
type BackupGetLabelsAttributeType = *map[string]interface{}
type BackupGetLabelsArgType = map[string]interface{}
type BackupGetLabelsRetType = map[string]interface{}
func getBackupGetLabelsAttributeTypeOk(arg BackupGetLabelsAttributeType) (ret BackupGetLabelsRetType, ok bool) {
if arg == nil {
return ret, false
}
return *arg, true
}
func setBackupGetLabelsAttributeType(arg *BackupGetLabelsAttributeType, val BackupGetLabelsRetType) {
*arg = &val
}
/*
types and functions for name
*/
// isNotNullableString
type BackupGetNameAttributeType = *string
func getBackupGetNameAttributeTypeOk(arg BackupGetNameAttributeType) (ret BackupGetNameRetType, ok bool) {
if arg == nil {
return ret, false
}
return *arg, true
}
func setBackupGetNameAttributeType(arg *BackupGetNameAttributeType, val BackupGetNameRetType) {
*arg = &val
}
type BackupGetNameArgType = string
type BackupGetNameRetType = string
/*
types and functions for size
*/
// isLong
type BackupGetSizeAttributeType = *int64
type BackupGetSizeArgType = int64
type BackupGetSizeRetType = int64
func getBackupGetSizeAttributeTypeOk(arg BackupGetSizeAttributeType) (ret BackupGetSizeRetType, ok bool) {
if arg == nil {
return ret, false
}
return *arg, true
}
func setBackupGetSizeAttributeType(arg *BackupGetSizeAttributeType, val BackupGetSizeRetType) {
*arg = &val
}
/*
types and functions for snapshotId
*/
// isNotNullableString
type BackupGetSnapshotIdAttributeType = *string
func getBackupGetSnapshotIdAttributeTypeOk(arg BackupGetSnapshotIdAttributeType) (ret BackupGetSnapshotIdRetType, ok bool) {
if arg == nil {
return ret, false
}
return *arg, true
}
func setBackupGetSnapshotIdAttributeType(arg *BackupGetSnapshotIdAttributeType, val BackupGetSnapshotIdRetType) {
*arg = &val
}
type BackupGetSnapshotIdArgType = string
type BackupGetSnapshotIdRetType = string
/*
types and functions for status
*/
// isNotNullableString
type BackupGetStatusAttributeType = *string
func getBackupGetStatusAttributeTypeOk(arg BackupGetStatusAttributeType) (ret BackupGetStatusRetType, ok bool) {
if arg == nil {
return ret, false
}
return *arg, true
}
func setBackupGetStatusAttributeType(arg *BackupGetStatusAttributeType, val BackupGetStatusRetType) {
*arg = &val
}
type BackupGetStatusArgType = string
type BackupGetStatusRetType = string
/*
types and functions for updatedAt
*/
// isDateTime
type BackupGetUpdatedAtAttributeType = *time.Time
type BackupGetUpdatedAtArgType = time.Time
type BackupGetUpdatedAtRetType = time.Time
func getBackupGetUpdatedAtAttributeTypeOk(arg BackupGetUpdatedAtAttributeType) (ret BackupGetUpdatedAtRetType, ok bool) {
if arg == nil {
return ret, false
}
return *arg, true
}
func setBackupGetUpdatedAtAttributeType(arg *BackupGetUpdatedAtAttributeType, val BackupGetUpdatedAtRetType) {
*arg = &val
}
/*
types and functions for volumeId
*/
// isNotNullableString
type BackupGetVolumeIdAttributeType = *string
func getBackupGetVolumeIdAttributeTypeOk(arg BackupGetVolumeIdAttributeType) (ret BackupGetVolumeIdRetType, ok bool) {
if arg == nil {
return ret, false
}
return *arg, true
}
func setBackupGetVolumeIdAttributeType(arg *BackupGetVolumeIdAttributeType, val BackupGetVolumeIdRetType) {
*arg = &val
}
type BackupGetVolumeIdArgType = string
type BackupGetVolumeIdRetType = string
// Backup Object that represents a backup.
type Backup struct {
// Object that represents an availability zone.
AvailabilityZone BackupGetAvailabilityZoneAttributeType `json:"availabilityZone,omitempty"`
// Date-time when resource was created.
CreatedAt BackupGetCreatedAtAttributeType `json:"createdAt,omitempty"`
// Indicates if a volume is encrypted.
Encrypted BackupgetEncryptedAttributeType `json:"encrypted,omitempty"`
// Universally Unique Identifier (UUID).
Id BackupGetIdAttributeType `json:"id,omitempty"`
// Object that represents the labels of an object. Regex for keys: `^(?=.{1,63}$)([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]$`. Regex for values: `^(?=.{0,63}$)(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])*$`. Providing a `null` value for a key will remove that key. The `stackit-` prefix is reserved and cannot be used for Keys.
Labels BackupGetLabelsAttributeType `json:"labels,omitempty"`
// The name for a General Object. Matches Names and also UUIDs.
Name BackupGetNameAttributeType `json:"name,omitempty"`
// Size in Gigabyte.
Size BackupGetSizeAttributeType `json:"size,omitempty"`
// Universally Unique Identifier (UUID).
SnapshotId BackupGetSnapshotIdAttributeType `json:"snapshotId,omitempty"`
// The status of a backup object. Possible values: `AVAILABLE`, `CREATING`, `DELETED`, `DELETING`, `ERROR`, `RESTORING`.
Status BackupGetStatusAttributeType `json:"status,omitempty"`
// Date-time when resource was last updated.
UpdatedAt BackupGetUpdatedAtAttributeType `json:"updatedAt,omitempty"`
// Universally Unique Identifier (UUID).
VolumeId BackupGetVolumeIdAttributeType `json:"volumeId,omitempty"`
}
// NewBackup instantiates a new Backup 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 NewBackup() *Backup {
this := Backup{}
return &this
}
// NewBackupWithDefaults instantiates a new Backup 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 NewBackupWithDefaults() *Backup {
this := Backup{}
return &this
}
// GetAvailabilityZone returns the AvailabilityZone field value if set, zero value otherwise.
func (o *Backup) GetAvailabilityZone() (res BackupGetAvailabilityZoneRetType) {
res, _ = o.GetAvailabilityZoneOk()
return
}
// GetAvailabilityZoneOk returns a tuple with the AvailabilityZone field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Backup) GetAvailabilityZoneOk() (ret BackupGetAvailabilityZoneRetType, ok bool) {
return getBackupGetAvailabilityZoneAttributeTypeOk(o.AvailabilityZone)
}
// HasAvailabilityZone returns a boolean if a field has been set.
func (o *Backup) HasAvailabilityZone() bool {
_, ok := o.GetAvailabilityZoneOk()
return ok
}
// SetAvailabilityZone gets a reference to the given string and assigns it to the AvailabilityZone field.
func (o *Backup) SetAvailabilityZone(v BackupGetAvailabilityZoneRetType) {
setBackupGetAvailabilityZoneAttributeType(&o.AvailabilityZone, v)
}
// GetCreatedAt returns the CreatedAt field value if set, zero value otherwise.
func (o *Backup) GetCreatedAt() (res BackupGetCreatedAtRetType) {
res, _ = o.GetCreatedAtOk()
return
}
// GetCreatedAtOk returns a tuple with the CreatedAt field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Backup) GetCreatedAtOk() (ret BackupGetCreatedAtRetType, ok bool) {
return getBackupGetCreatedAtAttributeTypeOk(o.CreatedAt)
}
// HasCreatedAt returns a boolean if a field has been set.
func (o *Backup) HasCreatedAt() bool {
_, ok := o.GetCreatedAtOk()
return ok
}
// SetCreatedAt gets a reference to the given time.Time and assigns it to the CreatedAt field.
func (o *Backup) SetCreatedAt(v BackupGetCreatedAtRetType) {
setBackupGetCreatedAtAttributeType(&o.CreatedAt, v)
}
// GetEncrypted returns the Encrypted field value if set, zero value otherwise.
func (o *Backup) GetEncrypted() (res BackupgetEncryptedRetType) {
res, _ = o.GetEncryptedOk()
return
}
// GetEncryptedOk returns a tuple with the Encrypted field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Backup) GetEncryptedOk() (ret BackupgetEncryptedRetType, ok bool) {
return getBackupgetEncryptedAttributeTypeOk(o.Encrypted)
}
// HasEncrypted returns a boolean if a field has been set.
func (o *Backup) HasEncrypted() bool {
_, ok := o.GetEncryptedOk()
return ok
}
// SetEncrypted gets a reference to the given bool and assigns it to the Encrypted field.
func (o *Backup) SetEncrypted(v BackupgetEncryptedRetType) {
setBackupgetEncryptedAttributeType(&o.Encrypted, v)
}
// GetId returns the Id field value if set, zero value otherwise.
func (o *Backup) GetId() (res BackupGetIdRetType) {
res, _ = o.GetIdOk()
return
}
// GetIdOk returns a tuple with the Id field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Backup) GetIdOk() (ret BackupGetIdRetType, ok bool) {
return getBackupGetIdAttributeTypeOk(o.Id)
}
// HasId returns a boolean if a field has been set.
func (o *Backup) HasId() bool {
_, ok := o.GetIdOk()
return ok
}
// SetId gets a reference to the given string and assigns it to the Id field.
func (o *Backup) SetId(v BackupGetIdRetType) {
setBackupGetIdAttributeType(&o.Id, v)
}
// GetLabels returns the Labels field value if set, zero value otherwise.
func (o *Backup) GetLabels() (res BackupGetLabelsRetType) {
res, _ = o.GetLabelsOk()
return
}
// GetLabelsOk returns a tuple with the Labels field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Backup) GetLabelsOk() (ret BackupGetLabelsRetType, ok bool) {
return getBackupGetLabelsAttributeTypeOk(o.Labels)
}
// HasLabels returns a boolean if a field has been set.
func (o *Backup) HasLabels() bool {
_, ok := o.GetLabelsOk()
return ok
}
// SetLabels gets a reference to the given map[string]interface{} and assigns it to the Labels field.
func (o *Backup) SetLabels(v BackupGetLabelsRetType) {
setBackupGetLabelsAttributeType(&o.Labels, v)
}
// GetName returns the Name field value if set, zero value otherwise.
func (o *Backup) GetName() (res BackupGetNameRetType) {
res, _ = o.GetNameOk()
return
}
// GetNameOk returns a tuple with the Name field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Backup) GetNameOk() (ret BackupGetNameRetType, ok bool) {
return getBackupGetNameAttributeTypeOk(o.Name)
}
// HasName returns a boolean if a field has been set.
func (o *Backup) HasName() bool {
_, ok := o.GetNameOk()
return ok
}
// SetName gets a reference to the given string and assigns it to the Name field.
func (o *Backup) SetName(v BackupGetNameRetType) {
setBackupGetNameAttributeType(&o.Name, v)
}
// GetSize returns the Size field value if set, zero value otherwise.
func (o *Backup) GetSize() (res BackupGetSizeRetType) {
res, _ = o.GetSizeOk()
return
}
// GetSizeOk returns a tuple with the Size field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Backup) GetSizeOk() (ret BackupGetSizeRetType, ok bool) {
return getBackupGetSizeAttributeTypeOk(o.Size)
}
// HasSize returns a boolean if a field has been set.
func (o *Backup) HasSize() bool {
_, ok := o.GetSizeOk()
return ok
}
// SetSize gets a reference to the given int64 and assigns it to the Size field.
func (o *Backup) SetSize(v BackupGetSizeRetType) {
setBackupGetSizeAttributeType(&o.Size, v)
}
// GetSnapshotId returns the SnapshotId field value if set, zero value otherwise.
func (o *Backup) GetSnapshotId() (res BackupGetSnapshotIdRetType) {
res, _ = o.GetSnapshotIdOk()
return
}
// GetSnapshotIdOk returns a tuple with the SnapshotId field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Backup) GetSnapshotIdOk() (ret BackupGetSnapshotIdRetType, ok bool) {
return getBackupGetSnapshotIdAttributeTypeOk(o.SnapshotId)
}
// HasSnapshotId returns a boolean if a field has been set.
func (o *Backup) HasSnapshotId() bool {
_, ok := o.GetSnapshotIdOk()
return ok
}
// SetSnapshotId gets a reference to the given string and assigns it to the SnapshotId field.
func (o *Backup) SetSnapshotId(v BackupGetSnapshotIdRetType) {
setBackupGetSnapshotIdAttributeType(&o.SnapshotId, v)
}
// GetStatus returns the Status field value if set, zero value otherwise.
func (o *Backup) GetStatus() (res BackupGetStatusRetType) {
res, _ = o.GetStatusOk()
return
}
// GetStatusOk returns a tuple with the Status field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Backup) GetStatusOk() (ret BackupGetStatusRetType, ok bool) {
return getBackupGetStatusAttributeTypeOk(o.Status)
}
// HasStatus returns a boolean if a field has been set.
func (o *Backup) HasStatus() bool {
_, ok := o.GetStatusOk()
return ok
}
// SetStatus gets a reference to the given string and assigns it to the Status field.
func (o *Backup) SetStatus(v BackupGetStatusRetType) {
setBackupGetStatusAttributeType(&o.Status, v)
}
// GetUpdatedAt returns the UpdatedAt field value if set, zero value otherwise.
func (o *Backup) GetUpdatedAt() (res BackupGetUpdatedAtRetType) {
res, _ = o.GetUpdatedAtOk()
return
}
// GetUpdatedAtOk returns a tuple with the UpdatedAt field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Backup) GetUpdatedAtOk() (ret BackupGetUpdatedAtRetType, ok bool) {
return getBackupGetUpdatedAtAttributeTypeOk(o.UpdatedAt)
}
// HasUpdatedAt returns a boolean if a field has been set.
func (o *Backup) HasUpdatedAt() bool {
_, ok := o.GetUpdatedAtOk()
return ok
}
// SetUpdatedAt gets a reference to the given time.Time and assigns it to the UpdatedAt field.
func (o *Backup) SetUpdatedAt(v BackupGetUpdatedAtRetType) {
setBackupGetUpdatedAtAttributeType(&o.UpdatedAt, v)
}
// GetVolumeId returns the VolumeId field value if set, zero value otherwise.
func (o *Backup) GetVolumeId() (res BackupGetVolumeIdRetType) {
res, _ = o.GetVolumeIdOk()
return
}
// GetVolumeIdOk returns a tuple with the VolumeId field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Backup) GetVolumeIdOk() (ret BackupGetVolumeIdRetType, ok bool) {
return getBackupGetVolumeIdAttributeTypeOk(o.VolumeId)
}
// HasVolumeId returns a boolean if a field has been set.
func (o *Backup) HasVolumeId() bool {
_, ok := o.GetVolumeIdOk()
return ok
}
// SetVolumeId gets a reference to the given string and assigns it to the VolumeId field.
func (o *Backup) SetVolumeId(v BackupGetVolumeIdRetType) {
setBackupGetVolumeIdAttributeType(&o.VolumeId, v)
}
func (o Backup) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if val, ok := getBackupGetAvailabilityZoneAttributeTypeOk(o.AvailabilityZone); ok {
toSerialize["AvailabilityZone"] = val
}
if val, ok := getBackupGetCreatedAtAttributeTypeOk(o.CreatedAt); ok {
toSerialize["CreatedAt"] = val
}
if val, ok := getBackupgetEncryptedAttributeTypeOk(o.Encrypted); ok {
toSerialize["Encrypted"] = val
}
if val, ok := getBackupGetIdAttributeTypeOk(o.Id); ok {
toSerialize["Id"] = val
}
if val, ok := getBackupGetLabelsAttributeTypeOk(o.Labels); ok {
toSerialize["Labels"] = val
}
if val, ok := getBackupGetNameAttributeTypeOk(o.Name); ok {
toSerialize["Name"] = val
}
if val, ok := getBackupGetSizeAttributeTypeOk(o.Size); ok {
toSerialize["Size"] = val
}
if val, ok := getBackupGetSnapshotIdAttributeTypeOk(o.SnapshotId); ok {
toSerialize["SnapshotId"] = val
}
if val, ok := getBackupGetStatusAttributeTypeOk(o.Status); ok {
toSerialize["Status"] = val
}
if val, ok := getBackupGetUpdatedAtAttributeTypeOk(o.UpdatedAt); ok {
toSerialize["UpdatedAt"] = val
}
if val, ok := getBackupGetVolumeIdAttributeTypeOk(o.VolumeId); ok {
toSerialize["VolumeId"] = val
}
return toSerialize, nil
}
type NullableBackup struct {
value *Backup
isSet bool
}
func (v NullableBackup) Get() *Backup {
return v.value
}
func (v *NullableBackup) Set(val *Backup) {
v.value = val
v.isSet = true
}
func (v NullableBackup) IsSet() bool {
return v.isSet
}
func (v *NullableBackup) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableBackup(val *Backup) *NullableBackup {
return &NullableBackup{value: val, isSet: true}
}
func (v NullableBackup) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableBackup) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}