-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmodel_container.go
More file actions
954 lines (815 loc) · 28.8 KB
/
model_container.go
File metadata and controls
954 lines (815 loc) · 28.8 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
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
/*
QuantCDN API
Unified API for QuantCDN Admin and QuantCloud Platform services
API version: 4.15.8
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package quantadmingo
import (
"encoding/json"
"fmt"
)
// checks if the Container type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &Container{}
// Container struct for Container
type Container struct {
// Name of the container
Name string `json:"name" validate:"regexp=^[a-zA-Z0-9_-]+$"`
ImageReference ContainerImageReference `json:"imageReference"`
// Container-level CPU units
Cpu NullableInt32 `json:"cpu,omitempty"`
// Container-level memory hard limit (MiB)
Memory NullableInt32 `json:"memory,omitempty"`
// Container-level memory soft limit (MiB)
MemoryReservation NullableInt32 `json:"memoryReservation,omitempty"`
// List of container ports to expose
ExposedPorts []int32 `json:"exposedPorts,omitempty"`
MountPoints []ContainerMountPointsInner `json:"mountPoints,omitempty"`
// Environment variables specific to this container
Environment []ContainerEnvironmentInner `json:"environment,omitempty"`
// Secrets mapped to environment variables
Secrets []ContainerSecretsInner `json:"secrets,omitempty"`
HealthCheck NullableContainerHealthCheck `json:"healthCheck,omitempty"`
// Container startup dependencies
DependsOn []ContainerDependsOnInner `json:"dependsOn,omitempty"`
Command []string `json:"command,omitempty"`
EntryPoint []string `json:"entryPoint,omitempty"`
WorkingDirectory NullableString `json:"workingDirectory,omitempty"`
Essential NullableBool `json:"essential,omitempty"`
ReadonlyRootFilesystem NullableBool `json:"readonlyRootFilesystem,omitempty"`
User NullableString `json:"user,omitempty"`
// Enable origin protection for all exposed ports on this container. Use originProtectionConfig for advanced options like IP allow lists.
OriginProtection NullableBool `json:"originProtection,omitempty"`
OriginProtectionConfig NullableContainerOriginProtectionConfig `json:"originProtectionConfig,omitempty"`
AdditionalProperties map[string]interface{}
}
type _Container Container
// NewContainer instantiates a new Container 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 NewContainer(name string, imageReference ContainerImageReference) *Container {
this := Container{}
this.Name = name
this.ImageReference = imageReference
var essential bool = true
this.Essential = *NewNullableBool(&essential)
var readonlyRootFilesystem bool = false
this.ReadonlyRootFilesystem = *NewNullableBool(&readonlyRootFilesystem)
var originProtection bool = false
this.OriginProtection = *NewNullableBool(&originProtection)
return &this
}
// NewContainerWithDefaults instantiates a new Container 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 NewContainerWithDefaults() *Container {
this := Container{}
var essential bool = true
this.Essential = *NewNullableBool(&essential)
var readonlyRootFilesystem bool = false
this.ReadonlyRootFilesystem = *NewNullableBool(&readonlyRootFilesystem)
var originProtection bool = false
this.OriginProtection = *NewNullableBool(&originProtection)
return &this
}
// GetName returns the Name field value
func (o *Container) GetName() string {
if o == nil {
var ret string
return ret
}
return o.Name
}
// GetNameOk returns a tuple with the Name field value
// and a boolean to check if the value has been set.
func (o *Container) GetNameOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.Name, true
}
// SetName sets field value
func (o *Container) SetName(v string) {
o.Name = v
}
// GetImageReference returns the ImageReference field value
func (o *Container) GetImageReference() ContainerImageReference {
if o == nil {
var ret ContainerImageReference
return ret
}
return o.ImageReference
}
// GetImageReferenceOk returns a tuple with the ImageReference field value
// and a boolean to check if the value has been set.
func (o *Container) GetImageReferenceOk() (*ContainerImageReference, bool) {
if o == nil {
return nil, false
}
return &o.ImageReference, true
}
// SetImageReference sets field value
func (o *Container) SetImageReference(v ContainerImageReference) {
o.ImageReference = v
}
// GetCpu returns the Cpu field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *Container) GetCpu() int32 {
if o == nil || IsNil(o.Cpu.Get()) {
var ret int32
return ret
}
return *o.Cpu.Get()
}
// GetCpuOk returns a tuple with the Cpu 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 *Container) GetCpuOk() (*int32, bool) {
if o == nil {
return nil, false
}
return o.Cpu.Get(), o.Cpu.IsSet()
}
// HasCpu returns a boolean if a field has been set.
func (o *Container) HasCpu() bool {
if o != nil && o.Cpu.IsSet() {
return true
}
return false
}
// SetCpu gets a reference to the given NullableInt32 and assigns it to the Cpu field.
func (o *Container) SetCpu(v int32) {
o.Cpu.Set(&v)
}
// SetCpuNil sets the value for Cpu to be an explicit nil
func (o *Container) SetCpuNil() {
o.Cpu.Set(nil)
}
// UnsetCpu ensures that no value is present for Cpu, not even an explicit nil
func (o *Container) UnsetCpu() {
o.Cpu.Unset()
}
// GetMemory returns the Memory field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *Container) GetMemory() int32 {
if o == nil || IsNil(o.Memory.Get()) {
var ret int32
return ret
}
return *o.Memory.Get()
}
// GetMemoryOk returns a tuple with the Memory 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 *Container) GetMemoryOk() (*int32, bool) {
if o == nil {
return nil, false
}
return o.Memory.Get(), o.Memory.IsSet()
}
// HasMemory returns a boolean if a field has been set.
func (o *Container) HasMemory() bool {
if o != nil && o.Memory.IsSet() {
return true
}
return false
}
// SetMemory gets a reference to the given NullableInt32 and assigns it to the Memory field.
func (o *Container) SetMemory(v int32) {
o.Memory.Set(&v)
}
// SetMemoryNil sets the value for Memory to be an explicit nil
func (o *Container) SetMemoryNil() {
o.Memory.Set(nil)
}
// UnsetMemory ensures that no value is present for Memory, not even an explicit nil
func (o *Container) UnsetMemory() {
o.Memory.Unset()
}
// GetMemoryReservation returns the MemoryReservation field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *Container) GetMemoryReservation() int32 {
if o == nil || IsNil(o.MemoryReservation.Get()) {
var ret int32
return ret
}
return *o.MemoryReservation.Get()
}
// GetMemoryReservationOk returns a tuple with the MemoryReservation 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 *Container) GetMemoryReservationOk() (*int32, bool) {
if o == nil {
return nil, false
}
return o.MemoryReservation.Get(), o.MemoryReservation.IsSet()
}
// HasMemoryReservation returns a boolean if a field has been set.
func (o *Container) HasMemoryReservation() bool {
if o != nil && o.MemoryReservation.IsSet() {
return true
}
return false
}
// SetMemoryReservation gets a reference to the given NullableInt32 and assigns it to the MemoryReservation field.
func (o *Container) SetMemoryReservation(v int32) {
o.MemoryReservation.Set(&v)
}
// SetMemoryReservationNil sets the value for MemoryReservation to be an explicit nil
func (o *Container) SetMemoryReservationNil() {
o.MemoryReservation.Set(nil)
}
// UnsetMemoryReservation ensures that no value is present for MemoryReservation, not even an explicit nil
func (o *Container) UnsetMemoryReservation() {
o.MemoryReservation.Unset()
}
// GetExposedPorts returns the ExposedPorts field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *Container) GetExposedPorts() []int32 {
if o == nil {
var ret []int32
return ret
}
return o.ExposedPorts
}
// GetExposedPortsOk returns a tuple with the ExposedPorts 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 *Container) GetExposedPortsOk() ([]int32, bool) {
if o == nil || IsNil(o.ExposedPorts) {
return nil, false
}
return o.ExposedPorts, true
}
// HasExposedPorts returns a boolean if a field has been set.
func (o *Container) HasExposedPorts() bool {
if o != nil && !IsNil(o.ExposedPorts) {
return true
}
return false
}
// SetExposedPorts gets a reference to the given []int32 and assigns it to the ExposedPorts field.
func (o *Container) SetExposedPorts(v []int32) {
o.ExposedPorts = v
}
// GetMountPoints returns the MountPoints field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *Container) GetMountPoints() []ContainerMountPointsInner {
if o == nil {
var ret []ContainerMountPointsInner
return ret
}
return o.MountPoints
}
// GetMountPointsOk returns a tuple with the MountPoints 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 *Container) GetMountPointsOk() ([]ContainerMountPointsInner, bool) {
if o == nil || IsNil(o.MountPoints) {
return nil, false
}
return o.MountPoints, true
}
// HasMountPoints returns a boolean if a field has been set.
func (o *Container) HasMountPoints() bool {
if o != nil && !IsNil(o.MountPoints) {
return true
}
return false
}
// SetMountPoints gets a reference to the given []ContainerMountPointsInner and assigns it to the MountPoints field.
func (o *Container) SetMountPoints(v []ContainerMountPointsInner) {
o.MountPoints = v
}
// GetEnvironment returns the Environment field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *Container) GetEnvironment() []ContainerEnvironmentInner {
if o == nil {
var ret []ContainerEnvironmentInner
return ret
}
return o.Environment
}
// GetEnvironmentOk returns a tuple with the Environment 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 *Container) GetEnvironmentOk() ([]ContainerEnvironmentInner, bool) {
if o == nil || IsNil(o.Environment) {
return nil, false
}
return o.Environment, true
}
// HasEnvironment returns a boolean if a field has been set.
func (o *Container) HasEnvironment() bool {
if o != nil && !IsNil(o.Environment) {
return true
}
return false
}
// SetEnvironment gets a reference to the given []ContainerEnvironmentInner and assigns it to the Environment field.
func (o *Container) SetEnvironment(v []ContainerEnvironmentInner) {
o.Environment = v
}
// GetSecrets returns the Secrets field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *Container) GetSecrets() []ContainerSecretsInner {
if o == nil {
var ret []ContainerSecretsInner
return ret
}
return o.Secrets
}
// GetSecretsOk returns a tuple with the Secrets 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 *Container) GetSecretsOk() ([]ContainerSecretsInner, bool) {
if o == nil || IsNil(o.Secrets) {
return nil, false
}
return o.Secrets, true
}
// HasSecrets returns a boolean if a field has been set.
func (o *Container) HasSecrets() bool {
if o != nil && !IsNil(o.Secrets) {
return true
}
return false
}
// SetSecrets gets a reference to the given []ContainerSecretsInner and assigns it to the Secrets field.
func (o *Container) SetSecrets(v []ContainerSecretsInner) {
o.Secrets = v
}
// GetHealthCheck returns the HealthCheck field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *Container) GetHealthCheck() ContainerHealthCheck {
if o == nil || IsNil(o.HealthCheck.Get()) {
var ret ContainerHealthCheck
return ret
}
return *o.HealthCheck.Get()
}
// GetHealthCheckOk returns a tuple with the HealthCheck 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 *Container) GetHealthCheckOk() (*ContainerHealthCheck, bool) {
if o == nil {
return nil, false
}
return o.HealthCheck.Get(), o.HealthCheck.IsSet()
}
// HasHealthCheck returns a boolean if a field has been set.
func (o *Container) HasHealthCheck() bool {
if o != nil && o.HealthCheck.IsSet() {
return true
}
return false
}
// SetHealthCheck gets a reference to the given NullableContainerHealthCheck and assigns it to the HealthCheck field.
func (o *Container) SetHealthCheck(v ContainerHealthCheck) {
o.HealthCheck.Set(&v)
}
// SetHealthCheckNil sets the value for HealthCheck to be an explicit nil
func (o *Container) SetHealthCheckNil() {
o.HealthCheck.Set(nil)
}
// UnsetHealthCheck ensures that no value is present for HealthCheck, not even an explicit nil
func (o *Container) UnsetHealthCheck() {
o.HealthCheck.Unset()
}
// GetDependsOn returns the DependsOn field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *Container) GetDependsOn() []ContainerDependsOnInner {
if o == nil {
var ret []ContainerDependsOnInner
return ret
}
return o.DependsOn
}
// GetDependsOnOk returns a tuple with the DependsOn 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 *Container) GetDependsOnOk() ([]ContainerDependsOnInner, bool) {
if o == nil || IsNil(o.DependsOn) {
return nil, false
}
return o.DependsOn, true
}
// HasDependsOn returns a boolean if a field has been set.
func (o *Container) HasDependsOn() bool {
if o != nil && !IsNil(o.DependsOn) {
return true
}
return false
}
// SetDependsOn gets a reference to the given []ContainerDependsOnInner and assigns it to the DependsOn field.
func (o *Container) SetDependsOn(v []ContainerDependsOnInner) {
o.DependsOn = v
}
// GetCommand returns the Command field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *Container) GetCommand() []string {
if o == nil {
var ret []string
return ret
}
return o.Command
}
// GetCommandOk returns a tuple with the Command 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 *Container) GetCommandOk() ([]string, bool) {
if o == nil || IsNil(o.Command) {
return nil, false
}
return o.Command, true
}
// HasCommand returns a boolean if a field has been set.
func (o *Container) HasCommand() bool {
if o != nil && !IsNil(o.Command) {
return true
}
return false
}
// SetCommand gets a reference to the given []string and assigns it to the Command field.
func (o *Container) SetCommand(v []string) {
o.Command = v
}
// GetEntryPoint returns the EntryPoint field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *Container) GetEntryPoint() []string {
if o == nil {
var ret []string
return ret
}
return o.EntryPoint
}
// GetEntryPointOk returns a tuple with the EntryPoint 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 *Container) GetEntryPointOk() ([]string, bool) {
if o == nil || IsNil(o.EntryPoint) {
return nil, false
}
return o.EntryPoint, true
}
// HasEntryPoint returns a boolean if a field has been set.
func (o *Container) HasEntryPoint() bool {
if o != nil && !IsNil(o.EntryPoint) {
return true
}
return false
}
// SetEntryPoint gets a reference to the given []string and assigns it to the EntryPoint field.
func (o *Container) SetEntryPoint(v []string) {
o.EntryPoint = v
}
// GetWorkingDirectory returns the WorkingDirectory field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *Container) GetWorkingDirectory() string {
if o == nil || IsNil(o.WorkingDirectory.Get()) {
var ret string
return ret
}
return *o.WorkingDirectory.Get()
}
// GetWorkingDirectoryOk returns a tuple with the WorkingDirectory 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 *Container) GetWorkingDirectoryOk() (*string, bool) {
if o == nil {
return nil, false
}
return o.WorkingDirectory.Get(), o.WorkingDirectory.IsSet()
}
// HasWorkingDirectory returns a boolean if a field has been set.
func (o *Container) HasWorkingDirectory() bool {
if o != nil && o.WorkingDirectory.IsSet() {
return true
}
return false
}
// SetWorkingDirectory gets a reference to the given NullableString and assigns it to the WorkingDirectory field.
func (o *Container) SetWorkingDirectory(v string) {
o.WorkingDirectory.Set(&v)
}
// SetWorkingDirectoryNil sets the value for WorkingDirectory to be an explicit nil
func (o *Container) SetWorkingDirectoryNil() {
o.WorkingDirectory.Set(nil)
}
// UnsetWorkingDirectory ensures that no value is present for WorkingDirectory, not even an explicit nil
func (o *Container) UnsetWorkingDirectory() {
o.WorkingDirectory.Unset()
}
// GetEssential returns the Essential field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *Container) GetEssential() bool {
if o == nil || IsNil(o.Essential.Get()) {
var ret bool
return ret
}
return *o.Essential.Get()
}
// GetEssentialOk returns a tuple with the Essential 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 *Container) GetEssentialOk() (*bool, bool) {
if o == nil {
return nil, false
}
return o.Essential.Get(), o.Essential.IsSet()
}
// HasEssential returns a boolean if a field has been set.
func (o *Container) HasEssential() bool {
if o != nil && o.Essential.IsSet() {
return true
}
return false
}
// SetEssential gets a reference to the given NullableBool and assigns it to the Essential field.
func (o *Container) SetEssential(v bool) {
o.Essential.Set(&v)
}
// SetEssentialNil sets the value for Essential to be an explicit nil
func (o *Container) SetEssentialNil() {
o.Essential.Set(nil)
}
// UnsetEssential ensures that no value is present for Essential, not even an explicit nil
func (o *Container) UnsetEssential() {
o.Essential.Unset()
}
// GetReadonlyRootFilesystem returns the ReadonlyRootFilesystem field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *Container) GetReadonlyRootFilesystem() bool {
if o == nil || IsNil(o.ReadonlyRootFilesystem.Get()) {
var ret bool
return ret
}
return *o.ReadonlyRootFilesystem.Get()
}
// GetReadonlyRootFilesystemOk returns a tuple with the ReadonlyRootFilesystem 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 *Container) GetReadonlyRootFilesystemOk() (*bool, bool) {
if o == nil {
return nil, false
}
return o.ReadonlyRootFilesystem.Get(), o.ReadonlyRootFilesystem.IsSet()
}
// HasReadonlyRootFilesystem returns a boolean if a field has been set.
func (o *Container) HasReadonlyRootFilesystem() bool {
if o != nil && o.ReadonlyRootFilesystem.IsSet() {
return true
}
return false
}
// SetReadonlyRootFilesystem gets a reference to the given NullableBool and assigns it to the ReadonlyRootFilesystem field.
func (o *Container) SetReadonlyRootFilesystem(v bool) {
o.ReadonlyRootFilesystem.Set(&v)
}
// SetReadonlyRootFilesystemNil sets the value for ReadonlyRootFilesystem to be an explicit nil
func (o *Container) SetReadonlyRootFilesystemNil() {
o.ReadonlyRootFilesystem.Set(nil)
}
// UnsetReadonlyRootFilesystem ensures that no value is present for ReadonlyRootFilesystem, not even an explicit nil
func (o *Container) UnsetReadonlyRootFilesystem() {
o.ReadonlyRootFilesystem.Unset()
}
// GetUser returns the User field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *Container) GetUser() string {
if o == nil || IsNil(o.User.Get()) {
var ret string
return ret
}
return *o.User.Get()
}
// GetUserOk returns a tuple with the User 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 *Container) GetUserOk() (*string, bool) {
if o == nil {
return nil, false
}
return o.User.Get(), o.User.IsSet()
}
// HasUser returns a boolean if a field has been set.
func (o *Container) HasUser() bool {
if o != nil && o.User.IsSet() {
return true
}
return false
}
// SetUser gets a reference to the given NullableString and assigns it to the User field.
func (o *Container) SetUser(v string) {
o.User.Set(&v)
}
// SetUserNil sets the value for User to be an explicit nil
func (o *Container) SetUserNil() {
o.User.Set(nil)
}
// UnsetUser ensures that no value is present for User, not even an explicit nil
func (o *Container) UnsetUser() {
o.User.Unset()
}
// GetOriginProtection returns the OriginProtection field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *Container) GetOriginProtection() bool {
if o == nil || IsNil(o.OriginProtection.Get()) {
var ret bool
return ret
}
return *o.OriginProtection.Get()
}
// GetOriginProtectionOk returns a tuple with the OriginProtection 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 *Container) GetOriginProtectionOk() (*bool, bool) {
if o == nil {
return nil, false
}
return o.OriginProtection.Get(), o.OriginProtection.IsSet()
}
// HasOriginProtection returns a boolean if a field has been set.
func (o *Container) HasOriginProtection() bool {
if o != nil && o.OriginProtection.IsSet() {
return true
}
return false
}
// SetOriginProtection gets a reference to the given NullableBool and assigns it to the OriginProtection field.
func (o *Container) SetOriginProtection(v bool) {
o.OriginProtection.Set(&v)
}
// SetOriginProtectionNil sets the value for OriginProtection to be an explicit nil
func (o *Container) SetOriginProtectionNil() {
o.OriginProtection.Set(nil)
}
// UnsetOriginProtection ensures that no value is present for OriginProtection, not even an explicit nil
func (o *Container) UnsetOriginProtection() {
o.OriginProtection.Unset()
}
// GetOriginProtectionConfig returns the OriginProtectionConfig field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *Container) GetOriginProtectionConfig() ContainerOriginProtectionConfig {
if o == nil || IsNil(o.OriginProtectionConfig.Get()) {
var ret ContainerOriginProtectionConfig
return ret
}
return *o.OriginProtectionConfig.Get()
}
// GetOriginProtectionConfigOk returns a tuple with the OriginProtectionConfig 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 *Container) GetOriginProtectionConfigOk() (*ContainerOriginProtectionConfig, bool) {
if o == nil {
return nil, false
}
return o.OriginProtectionConfig.Get(), o.OriginProtectionConfig.IsSet()
}
// HasOriginProtectionConfig returns a boolean if a field has been set.
func (o *Container) HasOriginProtectionConfig() bool {
if o != nil && o.OriginProtectionConfig.IsSet() {
return true
}
return false
}
// SetOriginProtectionConfig gets a reference to the given NullableContainerOriginProtectionConfig and assigns it to the OriginProtectionConfig field.
func (o *Container) SetOriginProtectionConfig(v ContainerOriginProtectionConfig) {
o.OriginProtectionConfig.Set(&v)
}
// SetOriginProtectionConfigNil sets the value for OriginProtectionConfig to be an explicit nil
func (o *Container) SetOriginProtectionConfigNil() {
o.OriginProtectionConfig.Set(nil)
}
// UnsetOriginProtectionConfig ensures that no value is present for OriginProtectionConfig, not even an explicit nil
func (o *Container) UnsetOriginProtectionConfig() {
o.OriginProtectionConfig.Unset()
}
func (o Container) MarshalJSON() ([]byte, error) {
toSerialize,err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o Container) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
toSerialize["name"] = o.Name
toSerialize["imageReference"] = o.ImageReference
if o.Cpu.IsSet() {
toSerialize["cpu"] = o.Cpu.Get()
}
if o.Memory.IsSet() {
toSerialize["memory"] = o.Memory.Get()
}
if o.MemoryReservation.IsSet() {
toSerialize["memoryReservation"] = o.MemoryReservation.Get()
}
if o.ExposedPorts != nil {
toSerialize["exposedPorts"] = o.ExposedPorts
}
if o.MountPoints != nil {
toSerialize["mountPoints"] = o.MountPoints
}
if o.Environment != nil {
toSerialize["environment"] = o.Environment
}
if o.Secrets != nil {
toSerialize["secrets"] = o.Secrets
}
if o.HealthCheck.IsSet() {
toSerialize["healthCheck"] = o.HealthCheck.Get()
}
if o.DependsOn != nil {
toSerialize["dependsOn"] = o.DependsOn
}
if o.Command != nil {
toSerialize["command"] = o.Command
}
if o.EntryPoint != nil {
toSerialize["entryPoint"] = o.EntryPoint
}
if o.WorkingDirectory.IsSet() {
toSerialize["workingDirectory"] = o.WorkingDirectory.Get()
}
if o.Essential.IsSet() {
toSerialize["essential"] = o.Essential.Get()
}
if o.ReadonlyRootFilesystem.IsSet() {
toSerialize["readonlyRootFilesystem"] = o.ReadonlyRootFilesystem.Get()
}
if o.User.IsSet() {
toSerialize["user"] = o.User.Get()
}
if o.OriginProtection.IsSet() {
toSerialize["originProtection"] = o.OriginProtection.Get()
}
if o.OriginProtectionConfig.IsSet() {
toSerialize["originProtectionConfig"] = o.OriginProtectionConfig.Get()
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *Container) UnmarshalJSON(data []byte) (err error) {
// This validates that all required properties are included in the JSON object
// by unmarshalling the object into a generic map with string keys and checking
// that every required field exists as a key in the generic map.
requiredProperties := []string{
"name",
"imageReference",
}
allProperties := make(map[string]interface{})
err = json.Unmarshal(data, &allProperties)
if err != nil {
return err;
}
for _, requiredProperty := range(requiredProperties) {
if _, exists := allProperties[requiredProperty]; !exists {
return fmt.Errorf("no value given for required property %v", requiredProperty)
}
}
varContainer := _Container{}
err = json.Unmarshal(data, &varContainer)
if err != nil {
return err
}
*o = Container(varContainer)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "name")
delete(additionalProperties, "imageReference")
delete(additionalProperties, "cpu")
delete(additionalProperties, "memory")
delete(additionalProperties, "memoryReservation")
delete(additionalProperties, "exposedPorts")
delete(additionalProperties, "mountPoints")
delete(additionalProperties, "environment")
delete(additionalProperties, "secrets")
delete(additionalProperties, "healthCheck")
delete(additionalProperties, "dependsOn")
delete(additionalProperties, "command")
delete(additionalProperties, "entryPoint")
delete(additionalProperties, "workingDirectory")
delete(additionalProperties, "essential")
delete(additionalProperties, "readonlyRootFilesystem")
delete(additionalProperties, "user")
delete(additionalProperties, "originProtection")
delete(additionalProperties, "originProtectionConfig")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableContainer struct {
value *Container
isSet bool
}
func (v NullableContainer) Get() *Container {
return v.value
}
func (v *NullableContainer) Set(val *Container) {
v.value = val
v.isSet = true
}
func (v NullableContainer) IsSet() bool {
return v.isSet
}
func (v *NullableContainer) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableContainer(val *Container) *NullableContainer {
return &NullableContainer{value: val, isSet: true}
}
func (v NullableContainer) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableContainer) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}