This repository has been archived by the owner on Aug 21, 2023. It is now read-only.
/
model_resources_generic_nrm.go
595 lines (509 loc) · 16.9 KB
/
model_resources_generic_nrm.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
/*
Provisioning MnS
OAS 3.0.1 definition of the Provisioning MnS © 2022, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved.
API version: 17.2.0
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package openapi_ProvMnS
import (
"encoding/json"
"fmt"
)
// ResourcesGenericNrm - struct for ResourcesGenericNrm
type ResourcesGenericNrm struct {
AlarmListSingle *AlarmListSingle
FileDownloadJobSingle *FileDownloadJobSingle
FileSingle *FileSingle
FilesSingle *FilesSingle
HeartbeatControlSingle *HeartbeatControlSingle
ManagedNFServiceSingle *ManagedNFServiceSingle
ManagementDataCollectionSingle *ManagementDataCollectionSingle
ManagementNodeSingle *ManagementNodeSingle
MeContextSingle *MeContextSingle
MnsAgentSingle *MnsAgentSingle
MnsInfoSingle *MnsInfoSingle
MnsRegistrySingle *MnsRegistrySingle
NtfSubscriptionControlSingle *NtfSubscriptionControlSingle
PerfMetricJobSingle *PerfMetricJobSingle
ThresholdMonitorSingle *ThresholdMonitorSingle
TraceJobSingle *TraceJobSingle
VsDataContainerSingle *VsDataContainerSingle
}
// AlarmListSingleAsResourcesGenericNrm is a convenience function that returns AlarmListSingle wrapped in ResourcesGenericNrm
func AlarmListSingleAsResourcesGenericNrm(v *AlarmListSingle) ResourcesGenericNrm {
return ResourcesGenericNrm{
AlarmListSingle: v,
}
}
// FileDownloadJobSingleAsResourcesGenericNrm is a convenience function that returns FileDownloadJobSingle wrapped in ResourcesGenericNrm
func FileDownloadJobSingleAsResourcesGenericNrm(v *FileDownloadJobSingle) ResourcesGenericNrm {
return ResourcesGenericNrm{
FileDownloadJobSingle: v,
}
}
// FileSingleAsResourcesGenericNrm is a convenience function that returns FileSingle wrapped in ResourcesGenericNrm
func FileSingleAsResourcesGenericNrm(v *FileSingle) ResourcesGenericNrm {
return ResourcesGenericNrm{
FileSingle: v,
}
}
// FilesSingleAsResourcesGenericNrm is a convenience function that returns FilesSingle wrapped in ResourcesGenericNrm
func FilesSingleAsResourcesGenericNrm(v *FilesSingle) ResourcesGenericNrm {
return ResourcesGenericNrm{
FilesSingle: v,
}
}
// HeartbeatControlSingleAsResourcesGenericNrm is a convenience function that returns HeartbeatControlSingle wrapped in ResourcesGenericNrm
func HeartbeatControlSingleAsResourcesGenericNrm(v *HeartbeatControlSingle) ResourcesGenericNrm {
return ResourcesGenericNrm{
HeartbeatControlSingle: v,
}
}
// ManagedNFServiceSingleAsResourcesGenericNrm is a convenience function that returns ManagedNFServiceSingle wrapped in ResourcesGenericNrm
func ManagedNFServiceSingleAsResourcesGenericNrm(v *ManagedNFServiceSingle) ResourcesGenericNrm {
return ResourcesGenericNrm{
ManagedNFServiceSingle: v,
}
}
// ManagementDataCollectionSingleAsResourcesGenericNrm is a convenience function that returns ManagementDataCollectionSingle wrapped in ResourcesGenericNrm
func ManagementDataCollectionSingleAsResourcesGenericNrm(v *ManagementDataCollectionSingle) ResourcesGenericNrm {
return ResourcesGenericNrm{
ManagementDataCollectionSingle: v,
}
}
// ManagementNodeSingleAsResourcesGenericNrm is a convenience function that returns ManagementNodeSingle wrapped in ResourcesGenericNrm
func ManagementNodeSingleAsResourcesGenericNrm(v *ManagementNodeSingle) ResourcesGenericNrm {
return ResourcesGenericNrm{
ManagementNodeSingle: v,
}
}
// MeContextSingleAsResourcesGenericNrm is a convenience function that returns MeContextSingle wrapped in ResourcesGenericNrm
func MeContextSingleAsResourcesGenericNrm(v *MeContextSingle) ResourcesGenericNrm {
return ResourcesGenericNrm{
MeContextSingle: v,
}
}
// MnsAgentSingleAsResourcesGenericNrm is a convenience function that returns MnsAgentSingle wrapped in ResourcesGenericNrm
func MnsAgentSingleAsResourcesGenericNrm(v *MnsAgentSingle) ResourcesGenericNrm {
return ResourcesGenericNrm{
MnsAgentSingle: v,
}
}
// MnsInfoSingleAsResourcesGenericNrm is a convenience function that returns MnsInfoSingle wrapped in ResourcesGenericNrm
func MnsInfoSingleAsResourcesGenericNrm(v *MnsInfoSingle) ResourcesGenericNrm {
return ResourcesGenericNrm{
MnsInfoSingle: v,
}
}
// MnsRegistrySingleAsResourcesGenericNrm is a convenience function that returns MnsRegistrySingle wrapped in ResourcesGenericNrm
func MnsRegistrySingleAsResourcesGenericNrm(v *MnsRegistrySingle) ResourcesGenericNrm {
return ResourcesGenericNrm{
MnsRegistrySingle: v,
}
}
// NtfSubscriptionControlSingleAsResourcesGenericNrm is a convenience function that returns NtfSubscriptionControlSingle wrapped in ResourcesGenericNrm
func NtfSubscriptionControlSingleAsResourcesGenericNrm(v *NtfSubscriptionControlSingle) ResourcesGenericNrm {
return ResourcesGenericNrm{
NtfSubscriptionControlSingle: v,
}
}
// PerfMetricJobSingleAsResourcesGenericNrm is a convenience function that returns PerfMetricJobSingle wrapped in ResourcesGenericNrm
func PerfMetricJobSingleAsResourcesGenericNrm(v *PerfMetricJobSingle) ResourcesGenericNrm {
return ResourcesGenericNrm{
PerfMetricJobSingle: v,
}
}
// ThresholdMonitorSingleAsResourcesGenericNrm is a convenience function that returns ThresholdMonitorSingle wrapped in ResourcesGenericNrm
func ThresholdMonitorSingleAsResourcesGenericNrm(v *ThresholdMonitorSingle) ResourcesGenericNrm {
return ResourcesGenericNrm{
ThresholdMonitorSingle: v,
}
}
// TraceJobSingleAsResourcesGenericNrm is a convenience function that returns TraceJobSingle wrapped in ResourcesGenericNrm
func TraceJobSingleAsResourcesGenericNrm(v *TraceJobSingle) ResourcesGenericNrm {
return ResourcesGenericNrm{
TraceJobSingle: v,
}
}
// VsDataContainerSingleAsResourcesGenericNrm is a convenience function that returns VsDataContainerSingle wrapped in ResourcesGenericNrm
func VsDataContainerSingleAsResourcesGenericNrm(v *VsDataContainerSingle) ResourcesGenericNrm {
return ResourcesGenericNrm{
VsDataContainerSingle: v,
}
}
// Unmarshal JSON data into one of the pointers in the struct
func (dst *ResourcesGenericNrm) UnmarshalJSON(data []byte) error {
var err error
match := 0
// try to unmarshal data into AlarmListSingle
err = newStrictDecoder(data).Decode(&dst.AlarmListSingle)
if err == nil {
jsonAlarmListSingle, _ := json.Marshal(dst.AlarmListSingle)
if string(jsonAlarmListSingle) == "{}" { // empty struct
dst.AlarmListSingle = nil
} else {
match++
}
} else {
dst.AlarmListSingle = nil
}
// try to unmarshal data into FileDownloadJobSingle
err = newStrictDecoder(data).Decode(&dst.FileDownloadJobSingle)
if err == nil {
jsonFileDownloadJobSingle, _ := json.Marshal(dst.FileDownloadJobSingle)
if string(jsonFileDownloadJobSingle) == "{}" { // empty struct
dst.FileDownloadJobSingle = nil
} else {
match++
}
} else {
dst.FileDownloadJobSingle = nil
}
// try to unmarshal data into FileSingle
err = newStrictDecoder(data).Decode(&dst.FileSingle)
if err == nil {
jsonFileSingle, _ := json.Marshal(dst.FileSingle)
if string(jsonFileSingle) == "{}" { // empty struct
dst.FileSingle = nil
} else {
match++
}
} else {
dst.FileSingle = nil
}
// try to unmarshal data into FilesSingle
err = newStrictDecoder(data).Decode(&dst.FilesSingle)
if err == nil {
jsonFilesSingle, _ := json.Marshal(dst.FilesSingle)
if string(jsonFilesSingle) == "{}" { // empty struct
dst.FilesSingle = nil
} else {
match++
}
} else {
dst.FilesSingle = nil
}
// try to unmarshal data into HeartbeatControlSingle
err = newStrictDecoder(data).Decode(&dst.HeartbeatControlSingle)
if err == nil {
jsonHeartbeatControlSingle, _ := json.Marshal(dst.HeartbeatControlSingle)
if string(jsonHeartbeatControlSingle) == "{}" { // empty struct
dst.HeartbeatControlSingle = nil
} else {
match++
}
} else {
dst.HeartbeatControlSingle = nil
}
// try to unmarshal data into ManagedNFServiceSingle
err = newStrictDecoder(data).Decode(&dst.ManagedNFServiceSingle)
if err == nil {
jsonManagedNFServiceSingle, _ := json.Marshal(dst.ManagedNFServiceSingle)
if string(jsonManagedNFServiceSingle) == "{}" { // empty struct
dst.ManagedNFServiceSingle = nil
} else {
match++
}
} else {
dst.ManagedNFServiceSingle = nil
}
// try to unmarshal data into ManagementDataCollectionSingle
err = newStrictDecoder(data).Decode(&dst.ManagementDataCollectionSingle)
if err == nil {
jsonManagementDataCollectionSingle, _ := json.Marshal(dst.ManagementDataCollectionSingle)
if string(jsonManagementDataCollectionSingle) == "{}" { // empty struct
dst.ManagementDataCollectionSingle = nil
} else {
match++
}
} else {
dst.ManagementDataCollectionSingle = nil
}
// try to unmarshal data into ManagementNodeSingle
err = newStrictDecoder(data).Decode(&dst.ManagementNodeSingle)
if err == nil {
jsonManagementNodeSingle, _ := json.Marshal(dst.ManagementNodeSingle)
if string(jsonManagementNodeSingle) == "{}" { // empty struct
dst.ManagementNodeSingle = nil
} else {
match++
}
} else {
dst.ManagementNodeSingle = nil
}
// try to unmarshal data into MeContextSingle
err = newStrictDecoder(data).Decode(&dst.MeContextSingle)
if err == nil {
jsonMeContextSingle, _ := json.Marshal(dst.MeContextSingle)
if string(jsonMeContextSingle) == "{}" { // empty struct
dst.MeContextSingle = nil
} else {
match++
}
} else {
dst.MeContextSingle = nil
}
// try to unmarshal data into MnsAgentSingle
err = newStrictDecoder(data).Decode(&dst.MnsAgentSingle)
if err == nil {
jsonMnsAgentSingle, _ := json.Marshal(dst.MnsAgentSingle)
if string(jsonMnsAgentSingle) == "{}" { // empty struct
dst.MnsAgentSingle = nil
} else {
match++
}
} else {
dst.MnsAgentSingle = nil
}
// try to unmarshal data into MnsInfoSingle
err = newStrictDecoder(data).Decode(&dst.MnsInfoSingle)
if err == nil {
jsonMnsInfoSingle, _ := json.Marshal(dst.MnsInfoSingle)
if string(jsonMnsInfoSingle) == "{}" { // empty struct
dst.MnsInfoSingle = nil
} else {
match++
}
} else {
dst.MnsInfoSingle = nil
}
// try to unmarshal data into MnsRegistrySingle
err = newStrictDecoder(data).Decode(&dst.MnsRegistrySingle)
if err == nil {
jsonMnsRegistrySingle, _ := json.Marshal(dst.MnsRegistrySingle)
if string(jsonMnsRegistrySingle) == "{}" { // empty struct
dst.MnsRegistrySingle = nil
} else {
match++
}
} else {
dst.MnsRegistrySingle = nil
}
// try to unmarshal data into NtfSubscriptionControlSingle
err = newStrictDecoder(data).Decode(&dst.NtfSubscriptionControlSingle)
if err == nil {
jsonNtfSubscriptionControlSingle, _ := json.Marshal(dst.NtfSubscriptionControlSingle)
if string(jsonNtfSubscriptionControlSingle) == "{}" { // empty struct
dst.NtfSubscriptionControlSingle = nil
} else {
match++
}
} else {
dst.NtfSubscriptionControlSingle = nil
}
// try to unmarshal data into PerfMetricJobSingle
err = newStrictDecoder(data).Decode(&dst.PerfMetricJobSingle)
if err == nil {
jsonPerfMetricJobSingle, _ := json.Marshal(dst.PerfMetricJobSingle)
if string(jsonPerfMetricJobSingle) == "{}" { // empty struct
dst.PerfMetricJobSingle = nil
} else {
match++
}
} else {
dst.PerfMetricJobSingle = nil
}
// try to unmarshal data into ThresholdMonitorSingle
err = newStrictDecoder(data).Decode(&dst.ThresholdMonitorSingle)
if err == nil {
jsonThresholdMonitorSingle, _ := json.Marshal(dst.ThresholdMonitorSingle)
if string(jsonThresholdMonitorSingle) == "{}" { // empty struct
dst.ThresholdMonitorSingle = nil
} else {
match++
}
} else {
dst.ThresholdMonitorSingle = nil
}
// try to unmarshal data into TraceJobSingle
err = newStrictDecoder(data).Decode(&dst.TraceJobSingle)
if err == nil {
jsonTraceJobSingle, _ := json.Marshal(dst.TraceJobSingle)
if string(jsonTraceJobSingle) == "{}" { // empty struct
dst.TraceJobSingle = nil
} else {
match++
}
} else {
dst.TraceJobSingle = nil
}
// try to unmarshal data into VsDataContainerSingle
err = newStrictDecoder(data).Decode(&dst.VsDataContainerSingle)
if err == nil {
jsonVsDataContainerSingle, _ := json.Marshal(dst.VsDataContainerSingle)
if string(jsonVsDataContainerSingle) == "{}" { // empty struct
dst.VsDataContainerSingle = nil
} else {
match++
}
} else {
dst.VsDataContainerSingle = nil
}
if match > 1 { // more than 1 match
// reset to nil
dst.AlarmListSingle = nil
dst.FileDownloadJobSingle = nil
dst.FileSingle = nil
dst.FilesSingle = nil
dst.HeartbeatControlSingle = nil
dst.ManagedNFServiceSingle = nil
dst.ManagementDataCollectionSingle = nil
dst.ManagementNodeSingle = nil
dst.MeContextSingle = nil
dst.MnsAgentSingle = nil
dst.MnsInfoSingle = nil
dst.MnsRegistrySingle = nil
dst.NtfSubscriptionControlSingle = nil
dst.PerfMetricJobSingle = nil
dst.ThresholdMonitorSingle = nil
dst.TraceJobSingle = nil
dst.VsDataContainerSingle = nil
return fmt.Errorf("data matches more than one schema in oneOf(ResourcesGenericNrm)")
} else if match == 1 {
return nil // exactly one match
} else { // no match
return fmt.Errorf("data failed to match schemas in oneOf(ResourcesGenericNrm)")
}
}
// Marshal data from the first non-nil pointers in the struct to JSON
func (src ResourcesGenericNrm) MarshalJSON() ([]byte, error) {
if src.AlarmListSingle != nil {
return json.Marshal(&src.AlarmListSingle)
}
if src.FileDownloadJobSingle != nil {
return json.Marshal(&src.FileDownloadJobSingle)
}
if src.FileSingle != nil {
return json.Marshal(&src.FileSingle)
}
if src.FilesSingle != nil {
return json.Marshal(&src.FilesSingle)
}
if src.HeartbeatControlSingle != nil {
return json.Marshal(&src.HeartbeatControlSingle)
}
if src.ManagedNFServiceSingle != nil {
return json.Marshal(&src.ManagedNFServiceSingle)
}
if src.ManagementDataCollectionSingle != nil {
return json.Marshal(&src.ManagementDataCollectionSingle)
}
if src.ManagementNodeSingle != nil {
return json.Marshal(&src.ManagementNodeSingle)
}
if src.MeContextSingle != nil {
return json.Marshal(&src.MeContextSingle)
}
if src.MnsAgentSingle != nil {
return json.Marshal(&src.MnsAgentSingle)
}
if src.MnsInfoSingle != nil {
return json.Marshal(&src.MnsInfoSingle)
}
if src.MnsRegistrySingle != nil {
return json.Marshal(&src.MnsRegistrySingle)
}
if src.NtfSubscriptionControlSingle != nil {
return json.Marshal(&src.NtfSubscriptionControlSingle)
}
if src.PerfMetricJobSingle != nil {
return json.Marshal(&src.PerfMetricJobSingle)
}
if src.ThresholdMonitorSingle != nil {
return json.Marshal(&src.ThresholdMonitorSingle)
}
if src.TraceJobSingle != nil {
return json.Marshal(&src.TraceJobSingle)
}
if src.VsDataContainerSingle != nil {
return json.Marshal(&src.VsDataContainerSingle)
}
return nil, nil // no data in oneOf schemas
}
// Get the actual instance
func (obj *ResourcesGenericNrm) GetActualInstance() interface{} {
if obj == nil {
return nil
}
if obj.AlarmListSingle != nil {
return obj.AlarmListSingle
}
if obj.FileDownloadJobSingle != nil {
return obj.FileDownloadJobSingle
}
if obj.FileSingle != nil {
return obj.FileSingle
}
if obj.FilesSingle != nil {
return obj.FilesSingle
}
if obj.HeartbeatControlSingle != nil {
return obj.HeartbeatControlSingle
}
if obj.ManagedNFServiceSingle != nil {
return obj.ManagedNFServiceSingle
}
if obj.ManagementDataCollectionSingle != nil {
return obj.ManagementDataCollectionSingle
}
if obj.ManagementNodeSingle != nil {
return obj.ManagementNodeSingle
}
if obj.MeContextSingle != nil {
return obj.MeContextSingle
}
if obj.MnsAgentSingle != nil {
return obj.MnsAgentSingle
}
if obj.MnsInfoSingle != nil {
return obj.MnsInfoSingle
}
if obj.MnsRegistrySingle != nil {
return obj.MnsRegistrySingle
}
if obj.NtfSubscriptionControlSingle != nil {
return obj.NtfSubscriptionControlSingle
}
if obj.PerfMetricJobSingle != nil {
return obj.PerfMetricJobSingle
}
if obj.ThresholdMonitorSingle != nil {
return obj.ThresholdMonitorSingle
}
if obj.TraceJobSingle != nil {
return obj.TraceJobSingle
}
if obj.VsDataContainerSingle != nil {
return obj.VsDataContainerSingle
}
// all schemas are nil
return nil
}
type NullableResourcesGenericNrm struct {
value *ResourcesGenericNrm
isSet bool
}
func (v NullableResourcesGenericNrm) Get() *ResourcesGenericNrm {
return v.value
}
func (v *NullableResourcesGenericNrm) Set(val *ResourcesGenericNrm) {
v.value = val
v.isSet = true
}
func (v NullableResourcesGenericNrm) IsSet() bool {
return v.isSet
}
func (v *NullableResourcesGenericNrm) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableResourcesGenericNrm(val *ResourcesGenericNrm) *NullableResourcesGenericNrm {
return &NullableResourcesGenericNrm{value: val, isSet: true}
}
func (v NullableResourcesGenericNrm) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableResourcesGenericNrm) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}