forked from netbox-community/go-netbox
-
Notifications
You must be signed in to change notification settings - Fork 0
/
model_config_context.go
1068 lines (909 loc) · 28 KB
/
model_config_context.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
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
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
/*
NetBox REST API
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
API version: 3.7.1 (3.7)
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package netbox
import (
"encoding/json"
"fmt"
"time"
)
// checks if the ConfigContext type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &ConfigContext{}
// ConfigContext Extends the built-in ModelSerializer to enforce calling full_clean() on a copy of the associated instance during validation. (DRF does not do this by default; see https://github.com/encode/django-rest-framework/issues/3144)
type ConfigContext struct {
Id int32 `json:"id"`
Url string `json:"url"`
Display string `json:"display"`
Name string `json:"name"`
Weight *int32 `json:"weight,omitempty"`
Description *string `json:"description,omitempty"`
IsActive *bool `json:"is_active,omitempty"`
Regions []int32 `json:"regions,omitempty"`
SiteGroups []int32 `json:"site_groups,omitempty"`
Sites []int32 `json:"sites,omitempty"`
Locations []int32 `json:"locations,omitempty"`
DeviceTypes []int32 `json:"device_types,omitempty"`
Roles []int32 `json:"roles,omitempty"`
Platforms []int32 `json:"platforms,omitempty"`
ClusterTypes []int32 `json:"cluster_types,omitempty"`
ClusterGroups []int32 `json:"cluster_groups,omitempty"`
Clusters []int32 `json:"clusters,omitempty"`
TenantGroups []int32 `json:"tenant_groups,omitempty"`
Tenants []int32 `json:"tenants,omitempty"`
Tags []string `json:"tags,omitempty"`
DataSource *NestedDataSource `json:"data_source,omitempty"`
// Path to remote file (relative to data source root)
DataPath string `json:"data_path"`
DataFile NestedDataFile `json:"data_file"`
DataSynced NullableTime `json:"data_synced"`
Data interface{} `json:"data"`
Created NullableTime `json:"created"`
LastUpdated NullableTime `json:"last_updated"`
AdditionalProperties map[string]interface{}
}
type _ConfigContext ConfigContext
// NewConfigContext instantiates a new ConfigContext 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 NewConfigContext(id int32, url string, display string, name string, dataPath string, dataFile NestedDataFile, dataSynced NullableTime, data interface{}, created NullableTime, lastUpdated NullableTime) *ConfigContext {
this := ConfigContext{}
this.Id = id
this.Url = url
this.Display = display
this.Name = name
this.DataPath = dataPath
this.DataFile = dataFile
this.DataSynced = dataSynced
this.Data = data
this.Created = created
this.LastUpdated = lastUpdated
return &this
}
// NewConfigContextWithDefaults instantiates a new ConfigContext 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 NewConfigContextWithDefaults() *ConfigContext {
this := ConfigContext{}
return &this
}
// GetId returns the Id field value
func (o *ConfigContext) GetId() int32 {
if o == nil {
var ret int32
return ret
}
return o.Id
}
// GetIdOk returns a tuple with the Id field value
// and a boolean to check if the value has been set.
func (o *ConfigContext) GetIdOk() (*int32, bool) {
if o == nil {
return nil, false
}
return &o.Id, true
}
// SetId sets field value
func (o *ConfigContext) SetId(v int32) {
o.Id = v
}
// GetUrl returns the Url field value
func (o *ConfigContext) GetUrl() string {
if o == nil {
var ret string
return ret
}
return o.Url
}
// GetUrlOk returns a tuple with the Url field value
// and a boolean to check if the value has been set.
func (o *ConfigContext) GetUrlOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.Url, true
}
// SetUrl sets field value
func (o *ConfigContext) SetUrl(v string) {
o.Url = v
}
// GetDisplay returns the Display field value
func (o *ConfigContext) GetDisplay() string {
if o == nil {
var ret string
return ret
}
return o.Display
}
// GetDisplayOk returns a tuple with the Display field value
// and a boolean to check if the value has been set.
func (o *ConfigContext) GetDisplayOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.Display, true
}
// SetDisplay sets field value
func (o *ConfigContext) SetDisplay(v string) {
o.Display = v
}
// GetName returns the Name field value
func (o *ConfigContext) 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 *ConfigContext) GetNameOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.Name, true
}
// SetName sets field value
func (o *ConfigContext) SetName(v string) {
o.Name = v
}
// GetWeight returns the Weight field value if set, zero value otherwise.
func (o *ConfigContext) GetWeight() int32 {
if o == nil || IsNil(o.Weight) {
var ret int32
return ret
}
return *o.Weight
}
// GetWeightOk returns a tuple with the Weight field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ConfigContext) GetWeightOk() (*int32, bool) {
if o == nil || IsNil(o.Weight) {
return nil, false
}
return o.Weight, true
}
// HasWeight returns a boolean if a field has been set.
func (o *ConfigContext) HasWeight() bool {
if o != nil && !IsNil(o.Weight) {
return true
}
return false
}
// SetWeight gets a reference to the given int32 and assigns it to the Weight field.
func (o *ConfigContext) SetWeight(v int32) {
o.Weight = &v
}
// GetDescription returns the Description field value if set, zero value otherwise.
func (o *ConfigContext) GetDescription() string {
if o == nil || IsNil(o.Description) {
var ret string
return ret
}
return *o.Description
}
// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ConfigContext) GetDescriptionOk() (*string, bool) {
if o == nil || IsNil(o.Description) {
return nil, false
}
return o.Description, true
}
// HasDescription returns a boolean if a field has been set.
func (o *ConfigContext) HasDescription() bool {
if o != nil && !IsNil(o.Description) {
return true
}
return false
}
// SetDescription gets a reference to the given string and assigns it to the Description field.
func (o *ConfigContext) SetDescription(v string) {
o.Description = &v
}
// GetIsActive returns the IsActive field value if set, zero value otherwise.
func (o *ConfigContext) GetIsActive() bool {
if o == nil || IsNil(o.IsActive) {
var ret bool
return ret
}
return *o.IsActive
}
// GetIsActiveOk returns a tuple with the IsActive field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ConfigContext) GetIsActiveOk() (*bool, bool) {
if o == nil || IsNil(o.IsActive) {
return nil, false
}
return o.IsActive, true
}
// HasIsActive returns a boolean if a field has been set.
func (o *ConfigContext) HasIsActive() bool {
if o != nil && !IsNil(o.IsActive) {
return true
}
return false
}
// SetIsActive gets a reference to the given bool and assigns it to the IsActive field.
func (o *ConfigContext) SetIsActive(v bool) {
o.IsActive = &v
}
// GetRegions returns the Regions field value if set, zero value otherwise.
func (o *ConfigContext) GetRegions() []int32 {
if o == nil || IsNil(o.Regions) {
var ret []int32
return ret
}
return o.Regions
}
// GetRegionsOk returns a tuple with the Regions field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ConfigContext) GetRegionsOk() ([]int32, bool) {
if o == nil || IsNil(o.Regions) {
return nil, false
}
return o.Regions, true
}
// HasRegions returns a boolean if a field has been set.
func (o *ConfigContext) HasRegions() bool {
if o != nil && !IsNil(o.Regions) {
return true
}
return false
}
// SetRegions gets a reference to the given []int32 and assigns it to the Regions field.
func (o *ConfigContext) SetRegions(v []int32) {
o.Regions = v
}
// GetSiteGroups returns the SiteGroups field value if set, zero value otherwise.
func (o *ConfigContext) GetSiteGroups() []int32 {
if o == nil || IsNil(o.SiteGroups) {
var ret []int32
return ret
}
return o.SiteGroups
}
// GetSiteGroupsOk returns a tuple with the SiteGroups field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ConfigContext) GetSiteGroupsOk() ([]int32, bool) {
if o == nil || IsNil(o.SiteGroups) {
return nil, false
}
return o.SiteGroups, true
}
// HasSiteGroups returns a boolean if a field has been set.
func (o *ConfigContext) HasSiteGroups() bool {
if o != nil && !IsNil(o.SiteGroups) {
return true
}
return false
}
// SetSiteGroups gets a reference to the given []int32 and assigns it to the SiteGroups field.
func (o *ConfigContext) SetSiteGroups(v []int32) {
o.SiteGroups = v
}
// GetSites returns the Sites field value if set, zero value otherwise.
func (o *ConfigContext) GetSites() []int32 {
if o == nil || IsNil(o.Sites) {
var ret []int32
return ret
}
return o.Sites
}
// GetSitesOk returns a tuple with the Sites field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ConfigContext) GetSitesOk() ([]int32, bool) {
if o == nil || IsNil(o.Sites) {
return nil, false
}
return o.Sites, true
}
// HasSites returns a boolean if a field has been set.
func (o *ConfigContext) HasSites() bool {
if o != nil && !IsNil(o.Sites) {
return true
}
return false
}
// SetSites gets a reference to the given []int32 and assigns it to the Sites field.
func (o *ConfigContext) SetSites(v []int32) {
o.Sites = v
}
// GetLocations returns the Locations field value if set, zero value otherwise.
func (o *ConfigContext) GetLocations() []int32 {
if o == nil || IsNil(o.Locations) {
var ret []int32
return ret
}
return o.Locations
}
// GetLocationsOk returns a tuple with the Locations field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ConfigContext) GetLocationsOk() ([]int32, bool) {
if o == nil || IsNil(o.Locations) {
return nil, false
}
return o.Locations, true
}
// HasLocations returns a boolean if a field has been set.
func (o *ConfigContext) HasLocations() bool {
if o != nil && !IsNil(o.Locations) {
return true
}
return false
}
// SetLocations gets a reference to the given []int32 and assigns it to the Locations field.
func (o *ConfigContext) SetLocations(v []int32) {
o.Locations = v
}
// GetDeviceTypes returns the DeviceTypes field value if set, zero value otherwise.
func (o *ConfigContext) GetDeviceTypes() []int32 {
if o == nil || IsNil(o.DeviceTypes) {
var ret []int32
return ret
}
return o.DeviceTypes
}
// GetDeviceTypesOk returns a tuple with the DeviceTypes field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ConfigContext) GetDeviceTypesOk() ([]int32, bool) {
if o == nil || IsNil(o.DeviceTypes) {
return nil, false
}
return o.DeviceTypes, true
}
// HasDeviceTypes returns a boolean if a field has been set.
func (o *ConfigContext) HasDeviceTypes() bool {
if o != nil && !IsNil(o.DeviceTypes) {
return true
}
return false
}
// SetDeviceTypes gets a reference to the given []int32 and assigns it to the DeviceTypes field.
func (o *ConfigContext) SetDeviceTypes(v []int32) {
o.DeviceTypes = v
}
// GetRoles returns the Roles field value if set, zero value otherwise.
func (o *ConfigContext) GetRoles() []int32 {
if o == nil || IsNil(o.Roles) {
var ret []int32
return ret
}
return o.Roles
}
// GetRolesOk returns a tuple with the Roles field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ConfigContext) GetRolesOk() ([]int32, bool) {
if o == nil || IsNil(o.Roles) {
return nil, false
}
return o.Roles, true
}
// HasRoles returns a boolean if a field has been set.
func (o *ConfigContext) HasRoles() bool {
if o != nil && !IsNil(o.Roles) {
return true
}
return false
}
// SetRoles gets a reference to the given []int32 and assigns it to the Roles field.
func (o *ConfigContext) SetRoles(v []int32) {
o.Roles = v
}
// GetPlatforms returns the Platforms field value if set, zero value otherwise.
func (o *ConfigContext) GetPlatforms() []int32 {
if o == nil || IsNil(o.Platforms) {
var ret []int32
return ret
}
return o.Platforms
}
// GetPlatformsOk returns a tuple with the Platforms field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ConfigContext) GetPlatformsOk() ([]int32, bool) {
if o == nil || IsNil(o.Platforms) {
return nil, false
}
return o.Platforms, true
}
// HasPlatforms returns a boolean if a field has been set.
func (o *ConfigContext) HasPlatforms() bool {
if o != nil && !IsNil(o.Platforms) {
return true
}
return false
}
// SetPlatforms gets a reference to the given []int32 and assigns it to the Platforms field.
func (o *ConfigContext) SetPlatforms(v []int32) {
o.Platforms = v
}
// GetClusterTypes returns the ClusterTypes field value if set, zero value otherwise.
func (o *ConfigContext) GetClusterTypes() []int32 {
if o == nil || IsNil(o.ClusterTypes) {
var ret []int32
return ret
}
return o.ClusterTypes
}
// GetClusterTypesOk returns a tuple with the ClusterTypes field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ConfigContext) GetClusterTypesOk() ([]int32, bool) {
if o == nil || IsNil(o.ClusterTypes) {
return nil, false
}
return o.ClusterTypes, true
}
// HasClusterTypes returns a boolean if a field has been set.
func (o *ConfigContext) HasClusterTypes() bool {
if o != nil && !IsNil(o.ClusterTypes) {
return true
}
return false
}
// SetClusterTypes gets a reference to the given []int32 and assigns it to the ClusterTypes field.
func (o *ConfigContext) SetClusterTypes(v []int32) {
o.ClusterTypes = v
}
// GetClusterGroups returns the ClusterGroups field value if set, zero value otherwise.
func (o *ConfigContext) GetClusterGroups() []int32 {
if o == nil || IsNil(o.ClusterGroups) {
var ret []int32
return ret
}
return o.ClusterGroups
}
// GetClusterGroupsOk returns a tuple with the ClusterGroups field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ConfigContext) GetClusterGroupsOk() ([]int32, bool) {
if o == nil || IsNil(o.ClusterGroups) {
return nil, false
}
return o.ClusterGroups, true
}
// HasClusterGroups returns a boolean if a field has been set.
func (o *ConfigContext) HasClusterGroups() bool {
if o != nil && !IsNil(o.ClusterGroups) {
return true
}
return false
}
// SetClusterGroups gets a reference to the given []int32 and assigns it to the ClusterGroups field.
func (o *ConfigContext) SetClusterGroups(v []int32) {
o.ClusterGroups = v
}
// GetClusters returns the Clusters field value if set, zero value otherwise.
func (o *ConfigContext) GetClusters() []int32 {
if o == nil || IsNil(o.Clusters) {
var ret []int32
return ret
}
return o.Clusters
}
// GetClustersOk returns a tuple with the Clusters field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ConfigContext) GetClustersOk() ([]int32, bool) {
if o == nil || IsNil(o.Clusters) {
return nil, false
}
return o.Clusters, true
}
// HasClusters returns a boolean if a field has been set.
func (o *ConfigContext) HasClusters() bool {
if o != nil && !IsNil(o.Clusters) {
return true
}
return false
}
// SetClusters gets a reference to the given []int32 and assigns it to the Clusters field.
func (o *ConfigContext) SetClusters(v []int32) {
o.Clusters = v
}
// GetTenantGroups returns the TenantGroups field value if set, zero value otherwise.
func (o *ConfigContext) GetTenantGroups() []int32 {
if o == nil || IsNil(o.TenantGroups) {
var ret []int32
return ret
}
return o.TenantGroups
}
// GetTenantGroupsOk returns a tuple with the TenantGroups field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ConfigContext) GetTenantGroupsOk() ([]int32, bool) {
if o == nil || IsNil(o.TenantGroups) {
return nil, false
}
return o.TenantGroups, true
}
// HasTenantGroups returns a boolean if a field has been set.
func (o *ConfigContext) HasTenantGroups() bool {
if o != nil && !IsNil(o.TenantGroups) {
return true
}
return false
}
// SetTenantGroups gets a reference to the given []int32 and assigns it to the TenantGroups field.
func (o *ConfigContext) SetTenantGroups(v []int32) {
o.TenantGroups = v
}
// GetTenants returns the Tenants field value if set, zero value otherwise.
func (o *ConfigContext) GetTenants() []int32 {
if o == nil || IsNil(o.Tenants) {
var ret []int32
return ret
}
return o.Tenants
}
// GetTenantsOk returns a tuple with the Tenants field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ConfigContext) GetTenantsOk() ([]int32, bool) {
if o == nil || IsNil(o.Tenants) {
return nil, false
}
return o.Tenants, true
}
// HasTenants returns a boolean if a field has been set.
func (o *ConfigContext) HasTenants() bool {
if o != nil && !IsNil(o.Tenants) {
return true
}
return false
}
// SetTenants gets a reference to the given []int32 and assigns it to the Tenants field.
func (o *ConfigContext) SetTenants(v []int32) {
o.Tenants = v
}
// GetTags returns the Tags field value if set, zero value otherwise.
func (o *ConfigContext) GetTags() []string {
if o == nil || IsNil(o.Tags) {
var ret []string
return ret
}
return o.Tags
}
// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ConfigContext) GetTagsOk() ([]string, bool) {
if o == nil || IsNil(o.Tags) {
return nil, false
}
return o.Tags, true
}
// HasTags returns a boolean if a field has been set.
func (o *ConfigContext) HasTags() bool {
if o != nil && !IsNil(o.Tags) {
return true
}
return false
}
// SetTags gets a reference to the given []string and assigns it to the Tags field.
func (o *ConfigContext) SetTags(v []string) {
o.Tags = v
}
// GetDataSource returns the DataSource field value if set, zero value otherwise.
func (o *ConfigContext) GetDataSource() NestedDataSource {
if o == nil || IsNil(o.DataSource) {
var ret NestedDataSource
return ret
}
return *o.DataSource
}
// GetDataSourceOk returns a tuple with the DataSource field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ConfigContext) GetDataSourceOk() (*NestedDataSource, bool) {
if o == nil || IsNil(o.DataSource) {
return nil, false
}
return o.DataSource, true
}
// HasDataSource returns a boolean if a field has been set.
func (o *ConfigContext) HasDataSource() bool {
if o != nil && !IsNil(o.DataSource) {
return true
}
return false
}
// SetDataSource gets a reference to the given NestedDataSource and assigns it to the DataSource field.
func (o *ConfigContext) SetDataSource(v NestedDataSource) {
o.DataSource = &v
}
// GetDataPath returns the DataPath field value
func (o *ConfigContext) GetDataPath() string {
if o == nil {
var ret string
return ret
}
return o.DataPath
}
// GetDataPathOk returns a tuple with the DataPath field value
// and a boolean to check if the value has been set.
func (o *ConfigContext) GetDataPathOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.DataPath, true
}
// SetDataPath sets field value
func (o *ConfigContext) SetDataPath(v string) {
o.DataPath = v
}
// GetDataFile returns the DataFile field value
func (o *ConfigContext) GetDataFile() NestedDataFile {
if o == nil {
var ret NestedDataFile
return ret
}
return o.DataFile
}
// GetDataFileOk returns a tuple with the DataFile field value
// and a boolean to check if the value has been set.
func (o *ConfigContext) GetDataFileOk() (*NestedDataFile, bool) {
if o == nil {
return nil, false
}
return &o.DataFile, true
}
// SetDataFile sets field value
func (o *ConfigContext) SetDataFile(v NestedDataFile) {
o.DataFile = v
}
// GetDataSynced returns the DataSynced field value
// If the value is explicit nil, the zero value for time.Time will be returned
func (o *ConfigContext) GetDataSynced() time.Time {
if o == nil || o.DataSynced.Get() == nil {
var ret time.Time
return ret
}
return *o.DataSynced.Get()
}
// GetDataSyncedOk returns a tuple with the DataSynced field value
// 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 *ConfigContext) GetDataSyncedOk() (*time.Time, bool) {
if o == nil {
return nil, false
}
return o.DataSynced.Get(), o.DataSynced.IsSet()
}
// SetDataSynced sets field value
func (o *ConfigContext) SetDataSynced(v time.Time) {
o.DataSynced.Set(&v)
}
// GetData returns the Data field value
// If the value is explicit nil, the zero value for interface{} will be returned
func (o *ConfigContext) GetData() interface{} {
if o == nil {
var ret interface{}
return ret
}
return o.Data
}
// GetDataOk returns a tuple with the Data field value
// 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 *ConfigContext) GetDataOk() (*interface{}, bool) {
if o == nil || IsNil(o.Data) {
return nil, false
}
return &o.Data, true
}
// SetData sets field value
func (o *ConfigContext) SetData(v interface{}) {
o.Data = v
}
// GetCreated returns the Created field value
// If the value is explicit nil, the zero value for time.Time will be returned
func (o *ConfigContext) GetCreated() time.Time {
if o == nil || o.Created.Get() == nil {
var ret time.Time
return ret
}
return *o.Created.Get()
}
// GetCreatedOk returns a tuple with the Created field value
// 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 *ConfigContext) GetCreatedOk() (*time.Time, bool) {
if o == nil {
return nil, false
}
return o.Created.Get(), o.Created.IsSet()
}
// SetCreated sets field value
func (o *ConfigContext) SetCreated(v time.Time) {
o.Created.Set(&v)
}
// GetLastUpdated returns the LastUpdated field value
// If the value is explicit nil, the zero value for time.Time will be returned
func (o *ConfigContext) GetLastUpdated() time.Time {
if o == nil || o.LastUpdated.Get() == nil {
var ret time.Time
return ret
}
return *o.LastUpdated.Get()
}
// GetLastUpdatedOk returns a tuple with the LastUpdated field value
// 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 *ConfigContext) GetLastUpdatedOk() (*time.Time, bool) {
if o == nil {
return nil, false
}
return o.LastUpdated.Get(), o.LastUpdated.IsSet()
}
// SetLastUpdated sets field value
func (o *ConfigContext) SetLastUpdated(v time.Time) {
o.LastUpdated.Set(&v)
}
func (o ConfigContext) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o ConfigContext) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
toSerialize["id"] = o.Id
toSerialize["url"] = o.Url
toSerialize["display"] = o.Display
toSerialize["name"] = o.Name
if !IsNil(o.Weight) {
toSerialize["weight"] = o.Weight
}
if !IsNil(o.Description) {
toSerialize["description"] = o.Description
}
if !IsNil(o.IsActive) {
toSerialize["is_active"] = o.IsActive
}
if !IsNil(o.Regions) {
toSerialize["regions"] = o.Regions
}
if !IsNil(o.SiteGroups) {
toSerialize["site_groups"] = o.SiteGroups
}
if !IsNil(o.Sites) {
toSerialize["sites"] = o.Sites
}
if !IsNil(o.Locations) {
toSerialize["locations"] = o.Locations
}
if !IsNil(o.DeviceTypes) {
toSerialize["device_types"] = o.DeviceTypes
}
if !IsNil(o.Roles) {
toSerialize["roles"] = o.Roles
}
if !IsNil(o.Platforms) {
toSerialize["platforms"] = o.Platforms
}
if !IsNil(o.ClusterTypes) {
toSerialize["cluster_types"] = o.ClusterTypes
}
if !IsNil(o.ClusterGroups) {
toSerialize["cluster_groups"] = o.ClusterGroups
}
if !IsNil(o.Clusters) {
toSerialize["clusters"] = o.Clusters
}
if !IsNil(o.TenantGroups) {
toSerialize["tenant_groups"] = o.TenantGroups
}
if !IsNil(o.Tenants) {
toSerialize["tenants"] = o.Tenants
}
if !IsNil(o.Tags) {
toSerialize["tags"] = o.Tags
}
if !IsNil(o.DataSource) {
toSerialize["data_source"] = o.DataSource
}
toSerialize["data_path"] = o.DataPath
toSerialize["data_file"] = o.DataFile
toSerialize["data_synced"] = o.DataSynced.Get()
if o.Data != nil {
toSerialize["data"] = o.Data
}
toSerialize["created"] = o.Created.Get()
toSerialize["last_updated"] = o.LastUpdated.Get()
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *ConfigContext) 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{
"id",
"url",
"display",
"name",
"data_path",
"data_file",
"data_synced",
"data",
"created",
"last_updated",
}
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)
}
}
varConfigContext := _ConfigContext{}
err = json.Unmarshal(data, &varConfigContext)
if err != nil {
return err
}
*o = ConfigContext(varConfigContext)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {