Newer
Older
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
/*
Package tapi is a generated package which contains definitions
of structs which represent a YANG schema. The generated schema can be
compressed by a series of transformations (compression was false
in this case).
This package was generated by /Users/mk/go/pkg/mod/github.com/openconfig/ygot@v0.8.7/genutil/names.go
using the following YANG input files:
- ../../models/tapi-topology@2019-03-31.yang
Imported modules were sourced from:
- ../../yang/...
*/
package tapi
import (
"encoding/json"
"fmt"
"reflect"
"github.com/openconfig/ygot/ygot"
"github.com/openconfig/goyang/pkg/yang"
"github.com/openconfig/ygot/ytypes"
)
// Binary is a type that is used for fields that have a YANG type of
// binary. It is used such that binary fields can be distinguished from
// leaf-lists of uint8s (which are mapped to []uint8, equivalent to
// []byte in reflection).
type Binary []byte
// YANGEmpty is a type that is used for fields that have a YANG type of
// empty. It is used such that empty fields can be distinguished from boolean fields
// in the generated code.
type YANGEmpty bool
var (
SchemaTree map[string]*yang.Entry
)
func init() {
var err error
if SchemaTree, err = UnzipSchema(); err != nil {
panic("schema error: " + err.Error())
}
}
// Schema returns the details of the generated schema.
func Schema() (*ytypes.Schema, error) {
uzp, err := UnzipSchema()
if err != nil {
return nil, fmt.Errorf("cannot unzip schema, %v", err)
}
return &ytypes.Schema{
Root: &Device{},
SchemaTree: uzp,
Unmarshal: Unmarshal,
}, nil
}
// UnzipSchema unzips the zipped schema and returns a map of yang.Entry nodes,
// keyed by the name of the struct that the yang.Entry describes the schema for.
func UnzipSchema() (map[string]*yang.Entry, error) {
var schemaTree map[string]*yang.Entry
var err error
if schemaTree, err = ygot.GzipToSchema(ySchema); err != nil {
return nil, fmt.Errorf("could not unzip the schema; %v", err)
}
return schemaTree, nil
}
// Unmarshal unmarshals data, which must be RFC7951 JSON format, into
// destStruct, which must be non-nil and the correct GoStruct type. It returns
// an error if the destStruct is not found in the schema or the data cannot be
// unmarshaled. The supplied options (opts) are used to control the behaviour
// of the unmarshal function - for example, determining whether errors are
// thrown for unknown fields in the input JSON.
func Unmarshal(data []byte, destStruct ygot.GoStruct, opts ...ytypes.UnmarshalOpt) error {
tn := reflect.TypeOf(destStruct).Elem().Name()
schema, ok := SchemaTree[tn]
if !ok {
return fmt.Errorf("could not find schema for type %s", tn )
}
var jsonTree interface{}
if err := json.Unmarshal([]byte(data), &jsonTree); err != nil {
return err
}
return ytypes.Unmarshal(schema, destStruct, jsonTree, opts...)
}
// Device represents the /device YANG schema element.
type Device struct {
Context *TapiCommon_Context `path:"context" module:"tapi-common"`
}
// IsYANGGoStruct ensures that Device implements the yang.GoStruct
// interface. This allows functions that need to handle this struct to
// identify it as being generated by ygen.
func (*Device) IsYANGGoStruct() {}
// Validate validates s against the YANG schema corresponding to its type.
func (t *Device) Validate(opts ...ygot.ValidationOption) error {
if err := ytypes.Validate(SchemaTree["Device"], t, opts...); err != nil {
return err
}
return nil
}
// ΛEnumTypeMap returns a map, keyed by YANG schema path, of the enumerated types
// that are included in the generated code.
func (t *Device) ΛEnumTypeMap() map[string][]reflect.Type { return ΛEnumTypes }
// TapiCommon_Context represents the /tapi-common/context YANG schema element.
type TapiCommon_Context struct {
Name map[string]*TapiCommon_Context_Name `path:"name" module:"tapi-common"`
ServiceInterfacePoint map[string]*TapiCommon_Context_ServiceInterfacePoint `path:"service-interface-point" module:"tapi-common"`
TopologyContext *TapiCommon_Context_TopologyContext `path:"topology-context" module:"tapi-topology"`
Uuid *string `path:"uuid" module:"tapi-common"`
}
// IsYANGGoStruct ensures that TapiCommon_Context implements the yang.GoStruct
// interface. This allows functions that need to handle this struct to
// identify it as being generated by ygen.
func (*TapiCommon_Context) IsYANGGoStruct() {}
// NewName creates a new entry in the Name list of the
// TapiCommon_Context struct. The keys of the list are populated from the input
// arguments.
func (t *TapiCommon_Context) NewName(ValueName string) (*TapiCommon_Context_Name, error){
// Initialise the list within the receiver struct if it has not already been
// created.
if t.Name == nil {
t.Name = make(map[string]*TapiCommon_Context_Name)
}
key := ValueName
// Ensure that this key has not already been used in the
// list. Keyed YANG lists do not allow duplicate keys to
// be created.
if _, ok := t.Name[key]; ok {
return nil, fmt.Errorf("duplicate key %v for list Name", key)
}
t.Name[key] = &TapiCommon_Context_Name{
ValueName: &ValueName,
}
return t.Name[key], nil
}
// NewServiceInterfacePoint creates a new entry in the ServiceInterfacePoint list of the
// TapiCommon_Context struct. The keys of the list are populated from the input
// arguments.
func (t *TapiCommon_Context) NewServiceInterfacePoint(Uuid string) (*TapiCommon_Context_ServiceInterfacePoint, error){
// Initialise the list within the receiver struct if it has not already been
// created.
if t.ServiceInterfacePoint == nil {
t.ServiceInterfacePoint = make(map[string]*TapiCommon_Context_ServiceInterfacePoint)
}
key := Uuid
// Ensure that this key has not already been used in the
// list. Keyed YANG lists do not allow duplicate keys to
// be created.
if _, ok := t.ServiceInterfacePoint[key]; ok {
return nil, fmt.Errorf("duplicate key %v for list ServiceInterfacePoint", key)
}
t.ServiceInterfacePoint[key] = &TapiCommon_Context_ServiceInterfacePoint{
Uuid: &Uuid,
}
return t.ServiceInterfacePoint[key], nil
}
// Validate validates s against the YANG schema corresponding to its type.
func (t *TapiCommon_Context) Validate(opts ...ygot.ValidationOption) error {
if err := ytypes.Validate(SchemaTree["TapiCommon_Context"], t, opts...); err != nil {
return err
}
return nil
}
// ΛEnumTypeMap returns a map, keyed by YANG schema path, of the enumerated types
// that are included in the generated code.
func (t *TapiCommon_Context) ΛEnumTypeMap() map[string][]reflect.Type { return ΛEnumTypes }
// TapiCommon_Context_Name represents the /tapi-common/context/name YANG schema element.
type TapiCommon_Context_Name struct {
Value *string `path:"value" module:"tapi-common"`
ValueName *string `path:"value-name" module:"tapi-common"`
}
// IsYANGGoStruct ensures that TapiCommon_Context_Name implements the yang.GoStruct
// interface. This allows functions that need to handle this struct to
// identify it as being generated by ygen.
func (*TapiCommon_Context_Name) IsYANGGoStruct() {}
// ΛListKeyMap returns the keys of the TapiCommon_Context_Name struct, which is a YANG list entry.
func (t *TapiCommon_Context_Name) ΛListKeyMap() (map[string]interface{}, error) {
if t.ValueName == nil {
return nil, fmt.Errorf("nil value for key ValueName")
}
return map[string]interface{}{
"value-name": *t.ValueName,
}, nil
}
// Validate validates s against the YANG schema corresponding to its type.
func (t *TapiCommon_Context_Name) Validate(opts ...ygot.ValidationOption) error {
if err := ytypes.Validate(SchemaTree["TapiCommon_Context_Name"], t, opts...); err != nil {
return err
}
return nil
}
// ΛEnumTypeMap returns a map, keyed by YANG schema path, of the enumerated types
// that are included in the generated code.
func (t *TapiCommon_Context_Name) ΛEnumTypeMap() map[string][]reflect.Type { return ΛEnumTypes }
// TapiCommon_Context_ServiceInterfacePoint represents the /tapi-common/context/service-interface-point YANG schema element.
type TapiCommon_Context_ServiceInterfacePoint struct {
AdministrativeState E_TapiCommon_AdministrativeState `path:"administrative-state" module:"tapi-common"`
AvailableCapacity *TapiCommon_Context_ServiceInterfacePoint_AvailableCapacity `path:"available-capacity" module:"tapi-common"`
Direction E_TapiCommon_PortDirection `path:"direction" module:"tapi-common"`
LayerProtocolName E_TapiCommon_LayerProtocolName `path:"layer-protocol-name" module:"tapi-common"`
LifecycleState E_TapiCommon_LifecycleState `path:"lifecycle-state" module:"tapi-common"`
Name map[string]*TapiCommon_Context_ServiceInterfacePoint_Name `path:"name" module:"tapi-common"`
OperationalState E_TapiCommon_OperationalState `path:"operational-state" module:"tapi-common"`
SupportedLayerProtocolQualifier []E_TapiCommon_LayerProtocolQualifier `path:"supported-layer-protocol-qualifier" module:"tapi-common"`
TotalPotentialCapacity *TapiCommon_Context_ServiceInterfacePoint_TotalPotentialCapacity `path:"total-potential-capacity" module:"tapi-common"`
Uuid *string `path:"uuid" module:"tapi-common"`
}
// IsYANGGoStruct ensures that TapiCommon_Context_ServiceInterfacePoint implements the yang.GoStruct
// interface. This allows functions that need to handle this struct to
// identify it as being generated by ygen.
func (*TapiCommon_Context_ServiceInterfacePoint) IsYANGGoStruct() {}
// NewName creates a new entry in the Name list of the
// TapiCommon_Context_ServiceInterfacePoint struct. The keys of the list are populated from the input
// arguments.
func (t *TapiCommon_Context_ServiceInterfacePoint) NewName(ValueName string) (*TapiCommon_Context_ServiceInterfacePoint_Name, error){
// Initialise the list within the receiver struct if it has not already been
// created.
if t.Name == nil {
t.Name = make(map[string]*TapiCommon_Context_ServiceInterfacePoint_Name)
}
key := ValueName
// Ensure that this key has not already been used in the
// list. Keyed YANG lists do not allow duplicate keys to
// be created.
if _, ok := t.Name[key]; ok {
return nil, fmt.Errorf("duplicate key %v for list Name", key)
}
t.Name[key] = &TapiCommon_Context_ServiceInterfacePoint_Name{
ValueName: &ValueName,
}
return t.Name[key], nil
}
// ΛListKeyMap returns the keys of the TapiCommon_Context_ServiceInterfacePoint struct, which is a YANG list entry.
func (t *TapiCommon_Context_ServiceInterfacePoint) ΛListKeyMap() (map[string]interface{}, error) {
if t.Uuid == nil {
return nil, fmt.Errorf("nil value for key Uuid")
}
return map[string]interface{}{
"uuid": *t.Uuid,
}, nil
}
// Validate validates s against the YANG schema corresponding to its type.
func (t *TapiCommon_Context_ServiceInterfacePoint) Validate(opts ...ygot.ValidationOption) error {
if err := ytypes.Validate(SchemaTree["TapiCommon_Context_ServiceInterfacePoint"], t, opts...); err != nil {
return err
}
return nil
}
// ΛEnumTypeMap returns a map, keyed by YANG schema path, of the enumerated types
// that are included in the generated code.
func (t *TapiCommon_Context_ServiceInterfacePoint) ΛEnumTypeMap() map[string][]reflect.Type { return ΛEnumTypes }
// TapiCommon_Context_ServiceInterfacePoint_AvailableCapacity represents the /tapi-common/context/service-interface-point/available-capacity YANG schema element.
type TapiCommon_Context_ServiceInterfacePoint_AvailableCapacity struct {
TotalSize *TapiCommon_Context_ServiceInterfacePoint_AvailableCapacity_TotalSize `path:"total-size" module:"tapi-common"`
}
// IsYANGGoStruct ensures that TapiCommon_Context_ServiceInterfacePoint_AvailableCapacity implements the yang.GoStruct
// interface. This allows functions that need to handle this struct to
// identify it as being generated by ygen.
func (*TapiCommon_Context_ServiceInterfacePoint_AvailableCapacity) IsYANGGoStruct() {}
// Validate validates s against the YANG schema corresponding to its type.
func (t *TapiCommon_Context_ServiceInterfacePoint_AvailableCapacity) Validate(opts ...ygot.ValidationOption) error {
if err := ytypes.Validate(SchemaTree["TapiCommon_Context_ServiceInterfacePoint_AvailableCapacity"], t, opts...); err != nil {
return err
}
return nil
}
// ΛEnumTypeMap returns a map, keyed by YANG schema path, of the enumerated types
// that are included in the generated code.
func (t *TapiCommon_Context_ServiceInterfacePoint_AvailableCapacity) ΛEnumTypeMap() map[string][]reflect.Type { return ΛEnumTypes }
// TapiCommon_Context_ServiceInterfacePoint_AvailableCapacity_TotalSize represents the /tapi-common/context/service-interface-point/available-capacity/total-size YANG schema element.
type TapiCommon_Context_ServiceInterfacePoint_AvailableCapacity_TotalSize struct {
Unit E_TapiCommon_CapacityUnit `path:"unit" module:"tapi-common"`
Value *uint64 `path:"value" module:"tapi-common"`
}
// IsYANGGoStruct ensures that TapiCommon_Context_ServiceInterfacePoint_AvailableCapacity_TotalSize implements the yang.GoStruct
// interface. This allows functions that need to handle this struct to
// identify it as being generated by ygen.
func (*TapiCommon_Context_ServiceInterfacePoint_AvailableCapacity_TotalSize) IsYANGGoStruct() {}
// Validate validates s against the YANG schema corresponding to its type.
func (t *TapiCommon_Context_ServiceInterfacePoint_AvailableCapacity_TotalSize) Validate(opts ...ygot.ValidationOption) error {
if err := ytypes.Validate(SchemaTree["TapiCommon_Context_ServiceInterfacePoint_AvailableCapacity_TotalSize"], t, opts...); err != nil {
return err
}
return nil
}
// ΛEnumTypeMap returns a map, keyed by YANG schema path, of the enumerated types
// that are included in the generated code.
func (t *TapiCommon_Context_ServiceInterfacePoint_AvailableCapacity_TotalSize) ΛEnumTypeMap() map[string][]reflect.Type { return ΛEnumTypes }
// TapiCommon_Context_ServiceInterfacePoint_Name represents the /tapi-common/context/service-interface-point/name YANG schema element.
type TapiCommon_Context_ServiceInterfacePoint_Name struct {
Value *string `path:"value" module:"tapi-common"`
ValueName *string `path:"value-name" module:"tapi-common"`
}
// IsYANGGoStruct ensures that TapiCommon_Context_ServiceInterfacePoint_Name implements the yang.GoStruct
// interface. This allows functions that need to handle this struct to
// identify it as being generated by ygen.
func (*TapiCommon_Context_ServiceInterfacePoint_Name) IsYANGGoStruct() {}
// ΛListKeyMap returns the keys of the TapiCommon_Context_ServiceInterfacePoint_Name struct, which is a YANG list entry.
func (t *TapiCommon_Context_ServiceInterfacePoint_Name) ΛListKeyMap() (map[string]interface{}, error) {
if t.ValueName == nil {
return nil, fmt.Errorf("nil value for key ValueName")
}
return map[string]interface{}{
"value-name": *t.ValueName,
}, nil
}
// Validate validates s against the YANG schema corresponding to its type.
func (t *TapiCommon_Context_ServiceInterfacePoint_Name) Validate(opts ...ygot.ValidationOption) error {
if err := ytypes.Validate(SchemaTree["TapiCommon_Context_ServiceInterfacePoint_Name"], t, opts...); err != nil {
return err
}
return nil
}
// ΛEnumTypeMap returns a map, keyed by YANG schema path, of the enumerated types
// that are included in the generated code.
func (t *TapiCommon_Context_ServiceInterfacePoint_Name) ΛEnumTypeMap() map[string][]reflect.Type { return ΛEnumTypes }
// TapiCommon_Context_ServiceInterfacePoint_TotalPotentialCapacity represents the /tapi-common/context/service-interface-point/total-potential-capacity YANG schema element.
type TapiCommon_Context_ServiceInterfacePoint_TotalPotentialCapacity struct {
TotalSize *TapiCommon_Context_ServiceInterfacePoint_TotalPotentialCapacity_TotalSize `path:"total-size" module:"tapi-common"`
}
// IsYANGGoStruct ensures that TapiCommon_Context_ServiceInterfacePoint_TotalPotentialCapacity implements the yang.GoStruct
// interface. This allows functions that need to handle this struct to
// identify it as being generated by ygen.
func (*TapiCommon_Context_ServiceInterfacePoint_TotalPotentialCapacity) IsYANGGoStruct() {}
// Validate validates s against the YANG schema corresponding to its type.
func (t *TapiCommon_Context_ServiceInterfacePoint_TotalPotentialCapacity) Validate(opts ...ygot.ValidationOption) error {
if err := ytypes.Validate(SchemaTree["TapiCommon_Context_ServiceInterfacePoint_TotalPotentialCapacity"], t, opts...); err != nil {
return err
}
return nil
}
// ΛEnumTypeMap returns a map, keyed by YANG schema path, of the enumerated types
// that are included in the generated code.
func (t *TapiCommon_Context_ServiceInterfacePoint_TotalPotentialCapacity) ΛEnumTypeMap() map[string][]reflect.Type { return ΛEnumTypes }
// TapiCommon_Context_ServiceInterfacePoint_TotalPotentialCapacity_TotalSize represents the /tapi-common/context/service-interface-point/total-potential-capacity/total-size YANG schema element.
type TapiCommon_Context_ServiceInterfacePoint_TotalPotentialCapacity_TotalSize struct {
Unit E_TapiCommon_CapacityUnit `path:"unit" module:"tapi-common"`
Value *uint64 `path:"value" module:"tapi-common"`
}
// IsYANGGoStruct ensures that TapiCommon_Context_ServiceInterfacePoint_TotalPotentialCapacity_TotalSize implements the yang.GoStruct
// interface. This allows functions that need to handle this struct to
// identify it as being generated by ygen.
func (*TapiCommon_Context_ServiceInterfacePoint_TotalPotentialCapacity_TotalSize) IsYANGGoStruct() {}
// Validate validates s against the YANG schema corresponding to its type.
func (t *TapiCommon_Context_ServiceInterfacePoint_TotalPotentialCapacity_TotalSize) Validate(opts ...ygot.ValidationOption) error {
if err := ytypes.Validate(SchemaTree["TapiCommon_Context_ServiceInterfacePoint_TotalPotentialCapacity_TotalSize"], t, opts...); err != nil {
return err
}
return nil
}
// ΛEnumTypeMap returns a map, keyed by YANG schema path, of the enumerated types
// that are included in the generated code.
func (t *TapiCommon_Context_ServiceInterfacePoint_TotalPotentialCapacity_TotalSize) ΛEnumTypeMap() map[string][]reflect.Type { return ΛEnumTypes }
// TapiCommon_Context_TopologyContext represents the /tapi-common/context/topology-context YANG schema element.
type TapiCommon_Context_TopologyContext struct {
NwTopologyService *TapiCommon_Context_TopologyContext_NwTopologyService `path:"nw-topology-service" module:"tapi-topology"`
Topology map[string]*TapiCommon_Context_TopologyContext_Topology `path:"topology" module:"tapi-topology"`
}
// IsYANGGoStruct ensures that TapiCommon_Context_TopologyContext implements the yang.GoStruct
// interface. This allows functions that need to handle this struct to
// identify it as being generated by ygen.
func (*TapiCommon_Context_TopologyContext) IsYANGGoStruct() {}
// NewTopology creates a new entry in the Topology list of the
// TapiCommon_Context_TopologyContext struct. The keys of the list are populated from the input
// arguments.
func (t *TapiCommon_Context_TopologyContext) NewTopology(Uuid string) (*TapiCommon_Context_TopologyContext_Topology, error){
// Initialise the list within the receiver struct if it has not already been
// created.
if t.Topology == nil {
t.Topology = make(map[string]*TapiCommon_Context_TopologyContext_Topology)
}
key := Uuid
// Ensure that this key has not already been used in the
// list. Keyed YANG lists do not allow duplicate keys to
// be created.
if _, ok := t.Topology[key]; ok {
return nil, fmt.Errorf("duplicate key %v for list Topology", key)
}
t.Topology[key] = &TapiCommon_Context_TopologyContext_Topology{
Uuid: &Uuid,
}
return t.Topology[key], nil
}
// Validate validates s against the YANG schema corresponding to its type.
func (t *TapiCommon_Context_TopologyContext) Validate(opts ...ygot.ValidationOption) error {
if err := ytypes.Validate(SchemaTree["TapiCommon_Context_TopologyContext"], t, opts...); err != nil {
return err
}
return nil
}
// ΛEnumTypeMap returns a map, keyed by YANG schema path, of the enumerated types
// that are included in the generated code.
func (t *TapiCommon_Context_TopologyContext) ΛEnumTypeMap() map[string][]reflect.Type { return ΛEnumTypes }
// TapiCommon_Context_TopologyContext_NwTopologyService represents the /tapi-common/context/topology-context/nw-topology-service YANG schema element.
type TapiCommon_Context_TopologyContext_NwTopologyService struct {
Name map[string]*TapiCommon_Context_TopologyContext_NwTopologyService_Name `path:"name" module:"tapi-topology"`
Topology map[string]*TapiCommon_Context_TopologyContext_NwTopologyService_Topology `path:"topology" module:"tapi-topology"`
Uuid *string `path:"uuid" module:"tapi-topology"`
}
// IsYANGGoStruct ensures that TapiCommon_Context_TopologyContext_NwTopologyService implements the yang.GoStruct
// interface. This allows functions that need to handle this struct to
// identify it as being generated by ygen.
func (*TapiCommon_Context_TopologyContext_NwTopologyService) IsYANGGoStruct() {}
// NewName creates a new entry in the Name list of the
// TapiCommon_Context_TopologyContext_NwTopologyService struct. The keys of the list are populated from the input
// arguments.
func (t *TapiCommon_Context_TopologyContext_NwTopologyService) NewName(ValueName string) (*TapiCommon_Context_TopologyContext_NwTopologyService_Name, error){
// Initialise the list within the receiver struct if it has not already been
// created.
if t.Name == nil {
t.Name = make(map[string]*TapiCommon_Context_TopologyContext_NwTopologyService_Name)
}
key := ValueName
// Ensure that this key has not already been used in the
// list. Keyed YANG lists do not allow duplicate keys to
// be created.
if _, ok := t.Name[key]; ok {
return nil, fmt.Errorf("duplicate key %v for list Name", key)
}
t.Name[key] = &TapiCommon_Context_TopologyContext_NwTopologyService_Name{
ValueName: &ValueName,
}
return t.Name[key], nil
}
// NewTopology creates a new entry in the Topology list of the
// TapiCommon_Context_TopologyContext_NwTopologyService struct. The keys of the list are populated from the input
// arguments.
func (t *TapiCommon_Context_TopologyContext_NwTopologyService) NewTopology(TopologyUuid string) (*TapiCommon_Context_TopologyContext_NwTopologyService_Topology, error){
// Initialise the list within the receiver struct if it has not already been
// created.
if t.Topology == nil {
t.Topology = make(map[string]*TapiCommon_Context_TopologyContext_NwTopologyService_Topology)
}
key := TopologyUuid
// Ensure that this key has not already been used in the
// list. Keyed YANG lists do not allow duplicate keys to
// be created.
if _, ok := t.Topology[key]; ok {
return nil, fmt.Errorf("duplicate key %v for list Topology", key)
}
t.Topology[key] = &TapiCommon_Context_TopologyContext_NwTopologyService_Topology{
TopologyUuid: &TopologyUuid,
}
return t.Topology[key], nil
}
// Validate validates s against the YANG schema corresponding to its type.
func (t *TapiCommon_Context_TopologyContext_NwTopologyService) Validate(opts ...ygot.ValidationOption) error {
if err := ytypes.Validate(SchemaTree["TapiCommon_Context_TopologyContext_NwTopologyService"], t, opts...); err != nil {
return err
}
return nil
}
// ΛEnumTypeMap returns a map, keyed by YANG schema path, of the enumerated types
// that are included in the generated code.
func (t *TapiCommon_Context_TopologyContext_NwTopologyService) ΛEnumTypeMap() map[string][]reflect.Type { return ΛEnumTypes }
// TapiCommon_Context_TopologyContext_NwTopologyService_Name represents the /tapi-common/context/topology-context/nw-topology-service/name YANG schema element.
type TapiCommon_Context_TopologyContext_NwTopologyService_Name struct {
Value *string `path:"value" module:"tapi-topology"`
ValueName *string `path:"value-name" module:"tapi-topology"`
}
// IsYANGGoStruct ensures that TapiCommon_Context_TopologyContext_NwTopologyService_Name implements the yang.GoStruct
// interface. This allows functions that need to handle this struct to
// identify it as being generated by ygen.
func (*TapiCommon_Context_TopologyContext_NwTopologyService_Name) IsYANGGoStruct() {}
// ΛListKeyMap returns the keys of the TapiCommon_Context_TopologyContext_NwTopologyService_Name struct, which is a YANG list entry.
func (t *TapiCommon_Context_TopologyContext_NwTopologyService_Name) ΛListKeyMap() (map[string]interface{}, error) {
if t.ValueName == nil {
return nil, fmt.Errorf("nil value for key ValueName")
}
return map[string]interface{}{
"value-name": *t.ValueName,
}, nil
}
// Validate validates s against the YANG schema corresponding to its type.
func (t *TapiCommon_Context_TopologyContext_NwTopologyService_Name) Validate(opts ...ygot.ValidationOption) error {
if err := ytypes.Validate(SchemaTree["TapiCommon_Context_TopologyContext_NwTopologyService_Name"], t, opts...); err != nil {
return err
}
return nil
}
// ΛEnumTypeMap returns a map, keyed by YANG schema path, of the enumerated types
// that are included in the generated code.
func (t *TapiCommon_Context_TopologyContext_NwTopologyService_Name) ΛEnumTypeMap() map[string][]reflect.Type { return ΛEnumTypes }
// TapiCommon_Context_TopologyContext_NwTopologyService_Topology represents the /tapi-common/context/topology-context/nw-topology-service/topology YANG schema element.
type TapiCommon_Context_TopologyContext_NwTopologyService_Topology struct {
TopologyUuid *string `path:"topology-uuid" module:"tapi-topology"`
}
// IsYANGGoStruct ensures that TapiCommon_Context_TopologyContext_NwTopologyService_Topology implements the yang.GoStruct
// interface. This allows functions that need to handle this struct to
// identify it as being generated by ygen.
func (*TapiCommon_Context_TopologyContext_NwTopologyService_Topology) IsYANGGoStruct() {}
// ΛListKeyMap returns the keys of the TapiCommon_Context_TopologyContext_NwTopologyService_Topology struct, which is a YANG list entry.
func (t *TapiCommon_Context_TopologyContext_NwTopologyService_Topology) ΛListKeyMap() (map[string]interface{}, error) {
if t.TopologyUuid == nil {
return nil, fmt.Errorf("nil value for key TopologyUuid")
}
return map[string]interface{}{
"topology-uuid": *t.TopologyUuid,
}, nil
}
// Validate validates s against the YANG schema corresponding to its type.
func (t *TapiCommon_Context_TopologyContext_NwTopologyService_Topology) Validate(opts ...ygot.ValidationOption) error {
if err := ytypes.Validate(SchemaTree["TapiCommon_Context_TopologyContext_NwTopologyService_Topology"], t, opts...); err != nil {
return err
}
return nil
}
// ΛEnumTypeMap returns a map, keyed by YANG schema path, of the enumerated types
// that are included in the generated code.
func (t *TapiCommon_Context_TopologyContext_NwTopologyService_Topology) ΛEnumTypeMap() map[string][]reflect.Type { return ΛEnumTypes }
// TapiCommon_Context_TopologyContext_Topology represents the /tapi-common/context/topology-context/topology YANG schema element.
type TapiCommon_Context_TopologyContext_Topology struct {
BoundaryNodeEdgePoint map[TapiCommon_Context_TopologyContext_Topology_BoundaryNodeEdgePoint_Key]*TapiCommon_Context_TopologyContext_Topology_BoundaryNodeEdgePoint `path:"boundary-node-edge-point" module:"tapi-topology"`
LayerProtocolName []E_TapiTopology_LayerProtocolName `path:"layer-protocol-name" module:"tapi-topology"`
Link map[string]*TapiCommon_Context_TopologyContext_Topology_Link `path:"link" module:"tapi-topology"`
Name map[string]*TapiCommon_Context_TopologyContext_Topology_Name `path:"name" module:"tapi-topology"`
Node map[string]*TapiCommon_Context_TopologyContext_Topology_Node `path:"node" module:"tapi-topology"`
Uuid *string `path:"uuid" module:"tapi-topology"`
}
// IsYANGGoStruct ensures that TapiCommon_Context_TopologyContext_Topology implements the yang.GoStruct
// interface. This allows functions that need to handle this struct to
// identify it as being generated by ygen.
func (*TapiCommon_Context_TopologyContext_Topology) IsYANGGoStruct() {}
// TapiCommon_Context_TopologyContext_Topology_BoundaryNodeEdgePoint_Key represents the key for list BoundaryNodeEdgePoint of element /tapi-common/context/topology-context/topology.
type TapiCommon_Context_TopologyContext_Topology_BoundaryNodeEdgePoint_Key struct {
TopologyUuid string `path:"topology-uuid"`
NodeUuid string `path:"node-uuid"`
NodeEdgePointUuid string `path:"node-edge-point-uuid"`
}
// NewBoundaryNodeEdgePoint creates a new entry in the BoundaryNodeEdgePoint list of the
// TapiCommon_Context_TopologyContext_Topology struct. The keys of the list are populated from the input
// arguments.
func (t *TapiCommon_Context_TopologyContext_Topology) NewBoundaryNodeEdgePoint(TopologyUuid string, NodeUuid string, NodeEdgePointUuid string) (*TapiCommon_Context_TopologyContext_Topology_BoundaryNodeEdgePoint, error){
// Initialise the list within the receiver struct if it has not already been
// created.
if t.BoundaryNodeEdgePoint == nil {
t.BoundaryNodeEdgePoint = make(map[TapiCommon_Context_TopologyContext_Topology_BoundaryNodeEdgePoint_Key]*TapiCommon_Context_TopologyContext_Topology_BoundaryNodeEdgePoint)
}
key := TapiCommon_Context_TopologyContext_Topology_BoundaryNodeEdgePoint_Key{
TopologyUuid: TopologyUuid,
NodeUuid: NodeUuid,
NodeEdgePointUuid: NodeEdgePointUuid,
}
// Ensure that this key has not already been used in the
// list. Keyed YANG lists do not allow duplicate keys to
// be created.
if _, ok := t.BoundaryNodeEdgePoint[key]; ok {
return nil, fmt.Errorf("duplicate key %v for list BoundaryNodeEdgePoint", key)
}
t.BoundaryNodeEdgePoint[key] = &TapiCommon_Context_TopologyContext_Topology_BoundaryNodeEdgePoint{
TopologyUuid: &TopologyUuid,
NodeUuid: &NodeUuid,
NodeEdgePointUuid: &NodeEdgePointUuid,
}
return t.BoundaryNodeEdgePoint[key], nil
}
// NewLink creates a new entry in the Link list of the
// TapiCommon_Context_TopologyContext_Topology struct. The keys of the list are populated from the input
// arguments.
func (t *TapiCommon_Context_TopologyContext_Topology) NewLink(Uuid string) (*TapiCommon_Context_TopologyContext_Topology_Link, error){
// Initialise the list within the receiver struct if it has not already been
// created.
if t.Link == nil {
t.Link = make(map[string]*TapiCommon_Context_TopologyContext_Topology_Link)
}
key := Uuid
// Ensure that this key has not already been used in the
// list. Keyed YANG lists do not allow duplicate keys to
// be created.
if _, ok := t.Link[key]; ok {
return nil, fmt.Errorf("duplicate key %v for list Link", key)
}
t.Link[key] = &TapiCommon_Context_TopologyContext_Topology_Link{
Uuid: &Uuid,
}
return t.Link[key], nil
}
// NewName creates a new entry in the Name list of the
// TapiCommon_Context_TopologyContext_Topology struct. The keys of the list are populated from the input
// arguments.
func (t *TapiCommon_Context_TopologyContext_Topology) NewName(ValueName string) (*TapiCommon_Context_TopologyContext_Topology_Name, error){
// Initialise the list within the receiver struct if it has not already been
// created.
if t.Name == nil {
t.Name = make(map[string]*TapiCommon_Context_TopologyContext_Topology_Name)
}
key := ValueName
// Ensure that this key has not already been used in the
// list. Keyed YANG lists do not allow duplicate keys to
// be created.
if _, ok := t.Name[key]; ok {
return nil, fmt.Errorf("duplicate key %v for list Name", key)
}
t.Name[key] = &TapiCommon_Context_TopologyContext_Topology_Name{
ValueName: &ValueName,
}
return t.Name[key], nil
}
// NewNode creates a new entry in the Node list of the
// TapiCommon_Context_TopologyContext_Topology struct. The keys of the list are populated from the input
// arguments.
func (t *TapiCommon_Context_TopologyContext_Topology) NewNode(Uuid string) (*TapiCommon_Context_TopologyContext_Topology_Node, error){
// Initialise the list within the receiver struct if it has not already been
// created.
if t.Node == nil {
t.Node = make(map[string]*TapiCommon_Context_TopologyContext_Topology_Node)
}
key := Uuid
// Ensure that this key has not already been used in the
// list. Keyed YANG lists do not allow duplicate keys to
// be created.
if _, ok := t.Node[key]; ok {
return nil, fmt.Errorf("duplicate key %v for list Node", key)
}
t.Node[key] = &TapiCommon_Context_TopologyContext_Topology_Node{
Uuid: &Uuid,
}
return t.Node[key], nil
}
// ΛListKeyMap returns the keys of the TapiCommon_Context_TopologyContext_Topology struct, which is a YANG list entry.
func (t *TapiCommon_Context_TopologyContext_Topology) ΛListKeyMap() (map[string]interface{}, error) {
if t.Uuid == nil {
return nil, fmt.Errorf("nil value for key Uuid")
}
return map[string]interface{}{
"uuid": *t.Uuid,
}, nil
}
// Validate validates s against the YANG schema corresponding to its type.
func (t *TapiCommon_Context_TopologyContext_Topology) Validate(opts ...ygot.ValidationOption) error {
if err := ytypes.Validate(SchemaTree["TapiCommon_Context_TopologyContext_Topology"], t, opts...); err != nil {
return err
}
return nil
}
// ΛEnumTypeMap returns a map, keyed by YANG schema path, of the enumerated types
// that are included in the generated code.
func (t *TapiCommon_Context_TopologyContext_Topology) ΛEnumTypeMap() map[string][]reflect.Type { return ΛEnumTypes }
// TapiCommon_Context_TopologyContext_Topology_BoundaryNodeEdgePoint represents the /tapi-common/context/topology-context/topology/boundary-node-edge-point YANG schema element.
type TapiCommon_Context_TopologyContext_Topology_BoundaryNodeEdgePoint struct {
NodeEdgePointUuid *string `path:"node-edge-point-uuid" module:"tapi-topology"`
NodeUuid *string `path:"node-uuid" module:"tapi-topology"`
TopologyUuid *string `path:"topology-uuid" module:"tapi-topology"`
}
// IsYANGGoStruct ensures that TapiCommon_Context_TopologyContext_Topology_BoundaryNodeEdgePoint implements the yang.GoStruct
// interface. This allows functions that need to handle this struct to
// identify it as being generated by ygen.
func (*TapiCommon_Context_TopologyContext_Topology_BoundaryNodeEdgePoint) IsYANGGoStruct() {}
// ΛListKeyMap returns the keys of the TapiCommon_Context_TopologyContext_Topology_BoundaryNodeEdgePoint struct, which is a YANG list entry.
func (t *TapiCommon_Context_TopologyContext_Topology_BoundaryNodeEdgePoint) ΛListKeyMap() (map[string]interface{}, error) {
if t.NodeEdgePointUuid == nil {
return nil, fmt.Errorf("nil value for key NodeEdgePointUuid")
}
if t.NodeUuid == nil {
return nil, fmt.Errorf("nil value for key NodeUuid")
}
if t.TopologyUuid == nil {
return nil, fmt.Errorf("nil value for key TopologyUuid")
}
return map[string]interface{}{
"node-edge-point-uuid": *t.NodeEdgePointUuid,
"node-uuid": *t.NodeUuid,
"topology-uuid": *t.TopologyUuid,
}, nil
}
// Validate validates s against the YANG schema corresponding to its type.
func (t *TapiCommon_Context_TopologyContext_Topology_BoundaryNodeEdgePoint) Validate(opts ...ygot.ValidationOption) error {
if err := ytypes.Validate(SchemaTree["TapiCommon_Context_TopologyContext_Topology_BoundaryNodeEdgePoint"], t, opts...); err != nil {
return err
}
return nil
}
// ΛEnumTypeMap returns a map, keyed by YANG schema path, of the enumerated types
// that are included in the generated code.
func (t *TapiCommon_Context_TopologyContext_Topology_BoundaryNodeEdgePoint) ΛEnumTypeMap() map[string][]reflect.Type { return ΛEnumTypes }
// TapiCommon_Context_TopologyContext_Topology_Link represents the /tapi-common/context/topology-context/topology/link YANG schema element.
type TapiCommon_Context_TopologyContext_Topology_Link struct {
AdministrativeState E_TapiCommon_AdministrativeState `path:"administrative-state" module:"tapi-topology"`
AvailableCapacity *TapiCommon_Context_TopologyContext_Topology_Link_AvailableCapacity `path:"available-capacity" module:"tapi-topology"`
CostCharacteristic map[string]*TapiCommon_Context_TopologyContext_Topology_Link_CostCharacteristic `path:"cost-characteristic" module:"tapi-topology"`
DeliveryOrderCharacteristic *string `path:"delivery-order-characteristic" module:"tapi-topology"`
Direction E_TapiTopology_ForwardingDirection `path:"direction" module:"tapi-topology"`
ErrorCharacteristic *string `path:"error-characteristic" module:"tapi-topology"`
LatencyCharacteristic map[string]*TapiCommon_Context_TopologyContext_Topology_Link_LatencyCharacteristic `path:"latency-characteristic" module:"tapi-topology"`
LayerProtocolName []E_TapiTopology_LayerProtocolName `path:"layer-protocol-name" module:"tapi-topology"`
LifecycleState E_TapiCommon_LifecycleState `path:"lifecycle-state" module:"tapi-topology"`
LossCharacteristic *string `path:"loss-characteristic" module:"tapi-topology"`
Name map[string]*TapiCommon_Context_TopologyContext_Topology_Link_Name `path:"name" module:"tapi-topology"`
NodeEdgePoint map[TapiCommon_Context_TopologyContext_Topology_Link_NodeEdgePoint_Key]*TapiCommon_Context_TopologyContext_Topology_Link_NodeEdgePoint `path:"node-edge-point" module:"tapi-topology"`
OperationalState E_TapiCommon_OperationalState `path:"operational-state" module:"tapi-topology"`
RepeatDeliveryCharacteristic *string `path:"repeat-delivery-characteristic" module:"tapi-topology"`
ResilienceType *TapiCommon_Context_TopologyContext_Topology_Link_ResilienceType `path:"resilience-type" module:"tapi-topology"`
RiskCharacteristic map[string]*TapiCommon_Context_TopologyContext_Topology_Link_RiskCharacteristic `path:"risk-characteristic" module:"tapi-topology"`
ServerIntegrityProcessCharacteristic *string `path:"server-integrity-process-characteristic" module:"tapi-topology"`
TotalPotentialCapacity *TapiCommon_Context_TopologyContext_Topology_Link_TotalPotentialCapacity `path:"total-potential-capacity" module:"tapi-topology"`
TransitionedLayerProtocolName []string `path:"transitioned-layer-protocol-name" module:"tapi-topology"`
UnavailableTimeCharacteristic *string `path:"unavailable-time-characteristic" module:"tapi-topology"`
Uuid *string `path:"uuid" module:"tapi-topology"`
ValidationMechanism map[string]*TapiCommon_Context_TopologyContext_Topology_Link_ValidationMechanism `path:"validation-mechanism" module:"tapi-topology"`
}
// IsYANGGoStruct ensures that TapiCommon_Context_TopologyContext_Topology_Link implements the yang.GoStruct
// interface. This allows functions that need to handle this struct to
// identify it as being generated by ygen.
func (*TapiCommon_Context_TopologyContext_Topology_Link) IsYANGGoStruct() {}
// TapiCommon_Context_TopologyContext_Topology_Link_NodeEdgePoint_Key represents the key for list NodeEdgePoint of element /tapi-common/context/topology-context/topology/link.
type TapiCommon_Context_TopologyContext_Topology_Link_NodeEdgePoint_Key struct {
TopologyUuid string `path:"topology-uuid"`
NodeUuid string `path:"node-uuid"`
NodeEdgePointUuid string `path:"node-edge-point-uuid"`
}
// NewCostCharacteristic creates a new entry in the CostCharacteristic list of the
// TapiCommon_Context_TopologyContext_Topology_Link struct. The keys of the list are populated from the input
// arguments.
func (t *TapiCommon_Context_TopologyContext_Topology_Link) NewCostCharacteristic(CostName string) (*TapiCommon_Context_TopologyContext_Topology_Link_CostCharacteristic, error){
// Initialise the list within the receiver struct if it has not already been
// created.
if t.CostCharacteristic == nil {
t.CostCharacteristic = make(map[string]*TapiCommon_Context_TopologyContext_Topology_Link_CostCharacteristic)
}
key := CostName
// Ensure that this key has not already been used in the
// list. Keyed YANG lists do not allow duplicate keys to
// be created.
if _, ok := t.CostCharacteristic[key]; ok {
return nil, fmt.Errorf("duplicate key %v for list CostCharacteristic", key)
}
t.CostCharacteristic[key] = &TapiCommon_Context_TopologyContext_Topology_Link_CostCharacteristic{
CostName: &CostName,
}
return t.CostCharacteristic[key], nil
}
// NewLatencyCharacteristic creates a new entry in the LatencyCharacteristic list of the
// TapiCommon_Context_TopologyContext_Topology_Link struct. The keys of the list are populated from the input
// arguments.
func (t *TapiCommon_Context_TopologyContext_Topology_Link) NewLatencyCharacteristic(TrafficPropertyName string) (*TapiCommon_Context_TopologyContext_Topology_Link_LatencyCharacteristic, error){
// Initialise the list within the receiver struct if it has not already been
// created.
if t.LatencyCharacteristic == nil {
t.LatencyCharacteristic = make(map[string]*TapiCommon_Context_TopologyContext_Topology_Link_LatencyCharacteristic)
}
key := TrafficPropertyName
// Ensure that this key has not already been used in the
// list. Keyed YANG lists do not allow duplicate keys to
// be created.
if _, ok := t.LatencyCharacteristic[key]; ok {
return nil, fmt.Errorf("duplicate key %v for list LatencyCharacteristic", key)
}
t.LatencyCharacteristic[key] = &TapiCommon_Context_TopologyContext_Topology_Link_LatencyCharacteristic{
TrafficPropertyName: &TrafficPropertyName,
}
return t.LatencyCharacteristic[key], nil
}
// NewName creates a new entry in the Name list of the
// TapiCommon_Context_TopologyContext_Topology_Link struct. The keys of the list are populated from the input
// arguments.
func (t *TapiCommon_Context_TopologyContext_Topology_Link) NewName(ValueName string) (*TapiCommon_Context_TopologyContext_Topology_Link_Name, error){
// Initialise the list within the receiver struct if it has not already been
// created.
if t.Name == nil {
t.Name = make(map[string]*TapiCommon_Context_TopologyContext_Topology_Link_Name)
}
key := ValueName
// Ensure that this key has not already been used in the
// list. Keyed YANG lists do not allow duplicate keys to
// be created.
if _, ok := t.Name[key]; ok {
return nil, fmt.Errorf("duplicate key %v for list Name", key)
}
t.Name[key] = &TapiCommon_Context_TopologyContext_Topology_Link_Name{
ValueName: &ValueName,
}
return t.Name[key], nil
}
// NewNodeEdgePoint creates a new entry in the NodeEdgePoint list of the
// TapiCommon_Context_TopologyContext_Topology_Link struct. The keys of the list are populated from the input
// arguments.
func (t *TapiCommon_Context_TopologyContext_Topology_Link) NewNodeEdgePoint(TopologyUuid string, NodeUuid string, NodeEdgePointUuid string) (*TapiCommon_Context_TopologyContext_Topology_Link_NodeEdgePoint, error){
// Initialise the list within the receiver struct if it has not already been
// created.
if t.NodeEdgePoint == nil {
t.NodeEdgePoint = make(map[TapiCommon_Context_TopologyContext_Topology_Link_NodeEdgePoint_Key]*TapiCommon_Context_TopologyContext_Topology_Link_NodeEdgePoint)
}
key := TapiCommon_Context_TopologyContext_Topology_Link_NodeEdgePoint_Key{
TopologyUuid: TopologyUuid,
NodeUuid: NodeUuid,
NodeEdgePointUuid: NodeEdgePointUuid,
}
// Ensure that this key has not already been used in the
// list. Keyed YANG lists do not allow duplicate keys to
// be created.
if _, ok := t.NodeEdgePoint[key]; ok {
return nil, fmt.Errorf("duplicate key %v for list NodeEdgePoint", key)
}
t.NodeEdgePoint[key] = &TapiCommon_Context_TopologyContext_Topology_Link_NodeEdgePoint{
TopologyUuid: &TopologyUuid,
NodeUuid: &NodeUuid,
NodeEdgePointUuid: &NodeEdgePointUuid,
}
return t.NodeEdgePoint[key], nil
}
// NewRiskCharacteristic creates a new entry in the RiskCharacteristic list of the
// TapiCommon_Context_TopologyContext_Topology_Link struct. The keys of the list are populated from the input
// arguments.
func (t *TapiCommon_Context_TopologyContext_Topology_Link) NewRiskCharacteristic(RiskCharacteristicName string) (*TapiCommon_Context_TopologyContext_Topology_Link_RiskCharacteristic, error){
// Initialise the list within the receiver struct if it has not already been
// created.
if t.RiskCharacteristic == nil {
t.RiskCharacteristic = make(map[string]*TapiCommon_Context_TopologyContext_Topology_Link_RiskCharacteristic)
}
key := RiskCharacteristicName
// Ensure that this key has not already been used in the
// list. Keyed YANG lists do not allow duplicate keys to
// be created.