forked from netbox-community/go-netbox
-
Notifications
You must be signed in to change notification settings - Fork 0
/
power_port.go
1301 lines (950 loc) · 43.5 KB
/
power_port.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
// Code generated by go-swagger; DO NOT EDIT.
// Copyright 2020 The go-netbox Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
package models
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"context"
"encoding/json"
"strconv"
"github.com/go-openapi/errors"
"github.com/go-openapi/strfmt"
"github.com/go-openapi/swag"
"github.com/go-openapi/validate"
)
// PowerPort power port
//
// swagger:model PowerPort
type PowerPort struct {
// occupied
// Read Only: true
Occupied *bool `json:"_occupied,omitempty"`
// Allocated draw
//
// Allocated power draw (watts)
// Maximum: 32767
// Minimum: 1
AllocatedDraw *int64 `json:"allocated_draw,omitempty"`
// cable
Cable *NestedCable `json:"cable,omitempty"`
// Cable peer
//
//
// Return the appropriate serializer for the cable termination model.
//
// Read Only: true
CablePeer map[string]*string `json:"cable_peer,omitempty"`
// Cable peer type
// Read Only: true
CablePeerType string `json:"cable_peer_type,omitempty"`
// Connected endpoint
//
//
// Return the appropriate serializer for the type of connected object.
//
// Read Only: true
ConnectedEndpoint map[string]*string `json:"connected_endpoint,omitempty"`
// Connected endpoint reachable
// Read Only: true
ConnectedEndpointReachable *bool `json:"connected_endpoint_reachable,omitempty"`
// Connected endpoint type
// Read Only: true
ConnectedEndpointType string `json:"connected_endpoint_type,omitempty"`
// Created
// Read Only: true
// Format: date
Created strfmt.Date `json:"created,omitempty"`
// Custom fields
CustomFields interface{} `json:"custom_fields,omitempty"`
// Description
// Max Length: 200
Description string `json:"description,omitempty"`
// device
// Required: true
Device *NestedDevice `json:"device"`
// Display
// Read Only: true
Display string `json:"display,omitempty"`
// Id
// Read Only: true
ID int64 `json:"id,omitempty"`
// Label
//
// Physical label
// Max Length: 64
Label string `json:"label,omitempty"`
// Last updated
// Read Only: true
// Format: date-time
LastUpdated strfmt.DateTime `json:"last_updated,omitempty"`
// Mark connected
//
// Treat as if a cable is connected
MarkConnected bool `json:"mark_connected,omitempty"`
// Maximum draw
//
// Maximum power draw (watts)
// Maximum: 32767
// Minimum: 1
MaximumDraw *int64 `json:"maximum_draw,omitempty"`
// Name
// Required: true
// Max Length: 64
// Min Length: 1
Name *string `json:"name"`
// tags
Tags []*NestedTag `json:"tags"`
// type
Type *PowerPortType `json:"type,omitempty"`
// Url
// Read Only: true
// Format: uri
URL strfmt.URI `json:"url,omitempty"`
}
// Validate validates this power port
func (m *PowerPort) Validate(formats strfmt.Registry) error {
var res []error
if err := m.validateAllocatedDraw(formats); err != nil {
res = append(res, err)
}
if err := m.validateCable(formats); err != nil {
res = append(res, err)
}
if err := m.validateCreated(formats); err != nil {
res = append(res, err)
}
if err := m.validateDescription(formats); err != nil {
res = append(res, err)
}
if err := m.validateDevice(formats); err != nil {
res = append(res, err)
}
if err := m.validateLabel(formats); err != nil {
res = append(res, err)
}
if err := m.validateLastUpdated(formats); err != nil {
res = append(res, err)
}
if err := m.validateMaximumDraw(formats); err != nil {
res = append(res, err)
}
if err := m.validateName(formats); err != nil {
res = append(res, err)
}
if err := m.validateTags(formats); err != nil {
res = append(res, err)
}
if err := m.validateType(formats); err != nil {
res = append(res, err)
}
if err := m.validateURL(formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *PowerPort) validateAllocatedDraw(formats strfmt.Registry) error {
if swag.IsZero(m.AllocatedDraw) { // not required
return nil
}
if err := validate.MinimumInt("allocated_draw", "body", *m.AllocatedDraw, 1, false); err != nil {
return err
}
if err := validate.MaximumInt("allocated_draw", "body", *m.AllocatedDraw, 32767, false); err != nil {
return err
}
return nil
}
func (m *PowerPort) validateCable(formats strfmt.Registry) error {
if swag.IsZero(m.Cable) { // not required
return nil
}
if m.Cable != nil {
if err := m.Cable.Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("cable")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("cable")
}
return err
}
}
return nil
}
func (m *PowerPort) validateCreated(formats strfmt.Registry) error {
if swag.IsZero(m.Created) { // not required
return nil
}
if err := validate.FormatOf("created", "body", "date", m.Created.String(), formats); err != nil {
return err
}
return nil
}
func (m *PowerPort) validateDescription(formats strfmt.Registry) error {
if swag.IsZero(m.Description) { // not required
return nil
}
if err := validate.MaxLength("description", "body", m.Description, 200); err != nil {
return err
}
return nil
}
func (m *PowerPort) validateDevice(formats strfmt.Registry) error {
if err := validate.Required("device", "body", m.Device); err != nil {
return err
}
if m.Device != nil {
if err := m.Device.Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("device")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("device")
}
return err
}
}
return nil
}
func (m *PowerPort) validateLabel(formats strfmt.Registry) error {
if swag.IsZero(m.Label) { // not required
return nil
}
if err := validate.MaxLength("label", "body", m.Label, 64); err != nil {
return err
}
return nil
}
func (m *PowerPort) validateLastUpdated(formats strfmt.Registry) error {
if swag.IsZero(m.LastUpdated) { // not required
return nil
}
if err := validate.FormatOf("last_updated", "body", "date-time", m.LastUpdated.String(), formats); err != nil {
return err
}
return nil
}
func (m *PowerPort) validateMaximumDraw(formats strfmt.Registry) error {
if swag.IsZero(m.MaximumDraw) { // not required
return nil
}
if err := validate.MinimumInt("maximum_draw", "body", *m.MaximumDraw, 1, false); err != nil {
return err
}
if err := validate.MaximumInt("maximum_draw", "body", *m.MaximumDraw, 32767, false); err != nil {
return err
}
return nil
}
func (m *PowerPort) validateName(formats strfmt.Registry) error {
if err := validate.Required("name", "body", m.Name); err != nil {
return err
}
if err := validate.MinLength("name", "body", *m.Name, 1); err != nil {
return err
}
if err := validate.MaxLength("name", "body", *m.Name, 64); err != nil {
return err
}
return nil
}
func (m *PowerPort) validateTags(formats strfmt.Registry) error {
if swag.IsZero(m.Tags) { // not required
return nil
}
for i := 0; i < len(m.Tags); i++ {
if swag.IsZero(m.Tags[i]) { // not required
continue
}
if m.Tags[i] != nil {
if err := m.Tags[i].Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("tags" + "." + strconv.Itoa(i))
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("tags" + "." + strconv.Itoa(i))
}
return err
}
}
}
return nil
}
func (m *PowerPort) validateType(formats strfmt.Registry) error {
if swag.IsZero(m.Type) { // not required
return nil
}
if m.Type != nil {
if err := m.Type.Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("type")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("type")
}
return err
}
}
return nil
}
func (m *PowerPort) validateURL(formats strfmt.Registry) error {
if swag.IsZero(m.URL) { // not required
return nil
}
if err := validate.FormatOf("url", "body", "uri", m.URL.String(), formats); err != nil {
return err
}
return nil
}
// ContextValidate validate this power port based on the context it is used
func (m *PowerPort) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
var res []error
if err := m.contextValidateOccupied(ctx, formats); err != nil {
res = append(res, err)
}
if err := m.contextValidateCable(ctx, formats); err != nil {
res = append(res, err)
}
if err := m.contextValidateCablePeer(ctx, formats); err != nil {
res = append(res, err)
}
if err := m.contextValidateCablePeerType(ctx, formats); err != nil {
res = append(res, err)
}
if err := m.contextValidateConnectedEndpoint(ctx, formats); err != nil {
res = append(res, err)
}
if err := m.contextValidateConnectedEndpointReachable(ctx, formats); err != nil {
res = append(res, err)
}
if err := m.contextValidateConnectedEndpointType(ctx, formats); err != nil {
res = append(res, err)
}
if err := m.contextValidateCreated(ctx, formats); err != nil {
res = append(res, err)
}
if err := m.contextValidateDevice(ctx, formats); err != nil {
res = append(res, err)
}
if err := m.contextValidateDisplay(ctx, formats); err != nil {
res = append(res, err)
}
if err := m.contextValidateID(ctx, formats); err != nil {
res = append(res, err)
}
if err := m.contextValidateLastUpdated(ctx, formats); err != nil {
res = append(res, err)
}
if err := m.contextValidateTags(ctx, formats); err != nil {
res = append(res, err)
}
if err := m.contextValidateType(ctx, formats); err != nil {
res = append(res, err)
}
if err := m.contextValidateURL(ctx, formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *PowerPort) contextValidateOccupied(ctx context.Context, formats strfmt.Registry) error {
if err := validate.ReadOnly(ctx, "_occupied", "body", m.Occupied); err != nil {
return err
}
return nil
}
func (m *PowerPort) contextValidateCable(ctx context.Context, formats strfmt.Registry) error {
if m.Cable != nil {
if err := m.Cable.ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("cable")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("cable")
}
return err
}
}
return nil
}
func (m *PowerPort) contextValidateCablePeer(ctx context.Context, formats strfmt.Registry) error {
return nil
}
func (m *PowerPort) contextValidateCablePeerType(ctx context.Context, formats strfmt.Registry) error {
if err := validate.ReadOnly(ctx, "cable_peer_type", "body", string(m.CablePeerType)); err != nil {
return err
}
return nil
}
func (m *PowerPort) contextValidateConnectedEndpoint(ctx context.Context, formats strfmt.Registry) error {
return nil
}
func (m *PowerPort) contextValidateConnectedEndpointReachable(ctx context.Context, formats strfmt.Registry) error {
if err := validate.ReadOnly(ctx, "connected_endpoint_reachable", "body", m.ConnectedEndpointReachable); err != nil {
return err
}
return nil
}
func (m *PowerPort) contextValidateConnectedEndpointType(ctx context.Context, formats strfmt.Registry) error {
if err := validate.ReadOnly(ctx, "connected_endpoint_type", "body", string(m.ConnectedEndpointType)); err != nil {
return err
}
return nil
}
func (m *PowerPort) contextValidateCreated(ctx context.Context, formats strfmt.Registry) error {
if err := validate.ReadOnly(ctx, "created", "body", strfmt.Date(m.Created)); err != nil {
return err
}
return nil
}
func (m *PowerPort) contextValidateDevice(ctx context.Context, formats strfmt.Registry) error {
if m.Device != nil {
if err := m.Device.ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("device")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("device")
}
return err
}
}
return nil
}
func (m *PowerPort) contextValidateDisplay(ctx context.Context, formats strfmt.Registry) error {
if err := validate.ReadOnly(ctx, "display", "body", string(m.Display)); err != nil {
return err
}
return nil
}
func (m *PowerPort) contextValidateID(ctx context.Context, formats strfmt.Registry) error {
if err := validate.ReadOnly(ctx, "id", "body", int64(m.ID)); err != nil {
return err
}
return nil
}
func (m *PowerPort) contextValidateLastUpdated(ctx context.Context, formats strfmt.Registry) error {
if err := validate.ReadOnly(ctx, "last_updated", "body", strfmt.DateTime(m.LastUpdated)); err != nil {
return err
}
return nil
}
func (m *PowerPort) contextValidateTags(ctx context.Context, formats strfmt.Registry) error {
for i := 0; i < len(m.Tags); i++ {
if m.Tags[i] != nil {
if err := m.Tags[i].ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("tags" + "." + strconv.Itoa(i))
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("tags" + "." + strconv.Itoa(i))
}
return err
}
}
}
return nil
}
func (m *PowerPort) contextValidateType(ctx context.Context, formats strfmt.Registry) error {
if m.Type != nil {
if err := m.Type.ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("type")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("type")
}
return err
}
}
return nil
}
func (m *PowerPort) contextValidateURL(ctx context.Context, formats strfmt.Registry) error {
if err := validate.ReadOnly(ctx, "url", "body", strfmt.URI(m.URL)); err != nil {
return err
}
return nil
}
// MarshalBinary interface implementation
func (m *PowerPort) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *PowerPort) UnmarshalBinary(b []byte) error {
var res PowerPort
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}
// PowerPortType Type
//
// swagger:model PowerPortType
type PowerPortType struct {
// label
// Required: true
// Enum: [C6 C8 C14 C16 C20 C22 P+N+E 4H P+N+E 6H P+N+E 9H 2P+E 4H 2P+E 6H 2P+E 9H 3P+E 4H 3P+E 6H 3P+E 9H 3P+N+E 4H 3P+N+E 6H 3P+N+E 9H NEMA 1-15P NEMA 5-15P NEMA 5-20P NEMA 5-30P NEMA 5-50P NEMA 6-15P NEMA 6-20P NEMA 6-30P NEMA 6-50P NEMA 10-30P NEMA 10-50P NEMA 14-20P NEMA 14-30P NEMA 14-50P NEMA 14-60P NEMA 15-15P NEMA 15-20P NEMA 15-30P NEMA 15-50P NEMA 15-60P NEMA L1-15P NEMA L5-15P NEMA L5-20P NEMA L5-30P NEMA L5-50P NEMA L6-15P NEMA L6-20P NEMA L6-30P NEMA L6-50P NEMA L10-30P NEMA L14-20P NEMA L14-30P NEMA L14-50P NEMA L14-60P NEMA L15-20P NEMA L15-30P NEMA L15-50P NEMA L15-60P NEMA L21-20P NEMA L21-30P CS6361C CS6365C CS8165C CS8265C CS8365C CS8465C ITA Type E (CEE 7/5) ITA Type F (CEE 7/4) ITA Type E/F (CEE 7/7) ITA Type G (BS 1363) ITA Type H ITA Type I ITA Type J ITA Type K ITA Type L (CEI 23-50) ITA Type M (BS 546) ITA Type N ITA Type O USB Type A USB Type B USB Type C USB Mini A USB Mini B USB Micro A USB Micro B USB 3.0 Type B USB 3.0 Micro B DC Terminal Saf-D-Grid Hardwired]
Label *string `json:"label"`
// value
// Required: true
// Enum: [iec-60320-c6 iec-60320-c8 iec-60320-c14 iec-60320-c16 iec-60320-c20 iec-60320-c22 iec-60309-p-n-e-4h iec-60309-p-n-e-6h iec-60309-p-n-e-9h iec-60309-2p-e-4h iec-60309-2p-e-6h iec-60309-2p-e-9h iec-60309-3p-e-4h iec-60309-3p-e-6h iec-60309-3p-e-9h iec-60309-3p-n-e-4h iec-60309-3p-n-e-6h iec-60309-3p-n-e-9h nema-1-15p nema-5-15p nema-5-20p nema-5-30p nema-5-50p nema-6-15p nema-6-20p nema-6-30p nema-6-50p nema-10-30p nema-10-50p nema-14-20p nema-14-30p nema-14-50p nema-14-60p nema-15-15p nema-15-20p nema-15-30p nema-15-50p nema-15-60p nema-l1-15p nema-l5-15p nema-l5-20p nema-l5-30p nema-l5-50p nema-l6-15p nema-l6-20p nema-l6-30p nema-l6-50p nema-l10-30p nema-l14-20p nema-l14-30p nema-l14-50p nema-l14-60p nema-l15-20p nema-l15-30p nema-l15-50p nema-l15-60p nema-l21-20p nema-l21-30p cs6361c cs6365c cs8165c cs8265c cs8365c cs8465c ita-e ita-f ita-ef ita-g ita-h ita-i ita-j ita-k ita-l ita-m ita-n ita-o usb-a usb-b usb-c usb-mini-a usb-mini-b usb-micro-a usb-micro-b usb-3-b usb-3-micro-b dc-terminal saf-d-grid hardwired]
Value *string `json:"value"`
}
// Validate validates this power port type
func (m *PowerPortType) Validate(formats strfmt.Registry) error {
var res []error
if err := m.validateLabel(formats); err != nil {
res = append(res, err)
}
if err := m.validateValue(formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
var powerPortTypeTypeLabelPropEnum []interface{}
func init() {
var res []string
if err := json.Unmarshal([]byte(`["C6","C8","C14","C16","C20","C22","P+N+E 4H","P+N+E 6H","P+N+E 9H","2P+E 4H","2P+E 6H","2P+E 9H","3P+E 4H","3P+E 6H","3P+E 9H","3P+N+E 4H","3P+N+E 6H","3P+N+E 9H","NEMA 1-15P","NEMA 5-15P","NEMA 5-20P","NEMA 5-30P","NEMA 5-50P","NEMA 6-15P","NEMA 6-20P","NEMA 6-30P","NEMA 6-50P","NEMA 10-30P","NEMA 10-50P","NEMA 14-20P","NEMA 14-30P","NEMA 14-50P","NEMA 14-60P","NEMA 15-15P","NEMA 15-20P","NEMA 15-30P","NEMA 15-50P","NEMA 15-60P","NEMA L1-15P","NEMA L5-15P","NEMA L5-20P","NEMA L5-30P","NEMA L5-50P","NEMA L6-15P","NEMA L6-20P","NEMA L6-30P","NEMA L6-50P","NEMA L10-30P","NEMA L14-20P","NEMA L14-30P","NEMA L14-50P","NEMA L14-60P","NEMA L15-20P","NEMA L15-30P","NEMA L15-50P","NEMA L15-60P","NEMA L21-20P","NEMA L21-30P","CS6361C","CS6365C","CS8165C","CS8265C","CS8365C","CS8465C","ITA Type E (CEE 7/5)","ITA Type F (CEE 7/4)","ITA Type E/F (CEE 7/7)","ITA Type G (BS 1363)","ITA Type H","ITA Type I","ITA Type J","ITA Type K","ITA Type L (CEI 23-50)","ITA Type M (BS 546)","ITA Type N","ITA Type O","USB Type A","USB Type B","USB Type C","USB Mini A","USB Mini B","USB Micro A","USB Micro B","USB 3.0 Type B","USB 3.0 Micro B","DC Terminal","Saf-D-Grid","Hardwired"]`), &res); err != nil {
panic(err)
}
for _, v := range res {
powerPortTypeTypeLabelPropEnum = append(powerPortTypeTypeLabelPropEnum, v)
}
}
const (
// PowerPortTypeLabelC6 captures enum value "C6"
PowerPortTypeLabelC6 string = "C6"
// PowerPortTypeLabelC8 captures enum value "C8"
PowerPortTypeLabelC8 string = "C8"
// PowerPortTypeLabelC14 captures enum value "C14"
PowerPortTypeLabelC14 string = "C14"
// PowerPortTypeLabelC16 captures enum value "C16"
PowerPortTypeLabelC16 string = "C16"
// PowerPortTypeLabelC20 captures enum value "C20"
PowerPortTypeLabelC20 string = "C20"
// PowerPortTypeLabelC22 captures enum value "C22"
PowerPortTypeLabelC22 string = "C22"
// PowerPortTypeLabelPPlusNPlusE4H captures enum value "P+N+E 4H"
PowerPortTypeLabelPPlusNPlusE4H string = "P+N+E 4H"
// PowerPortTypeLabelPPlusNPlusE6H captures enum value "P+N+E 6H"
PowerPortTypeLabelPPlusNPlusE6H string = "P+N+E 6H"
// PowerPortTypeLabelPPlusNPlusE9H captures enum value "P+N+E 9H"
PowerPortTypeLabelPPlusNPlusE9H string = "P+N+E 9H"
// PowerPortTypeLabelNr2PPlusE4H captures enum value "2P+E 4H"
PowerPortTypeLabelNr2PPlusE4H string = "2P+E 4H"
// PowerPortTypeLabelNr2PPlusE6H captures enum value "2P+E 6H"
PowerPortTypeLabelNr2PPlusE6H string = "2P+E 6H"
// PowerPortTypeLabelNr2PPlusE9H captures enum value "2P+E 9H"
PowerPortTypeLabelNr2PPlusE9H string = "2P+E 9H"
// PowerPortTypeLabelNr3PPlusE4H captures enum value "3P+E 4H"
PowerPortTypeLabelNr3PPlusE4H string = "3P+E 4H"
// PowerPortTypeLabelNr3PPlusE6H captures enum value "3P+E 6H"
PowerPortTypeLabelNr3PPlusE6H string = "3P+E 6H"
// PowerPortTypeLabelNr3PPlusE9H captures enum value "3P+E 9H"
PowerPortTypeLabelNr3PPlusE9H string = "3P+E 9H"
// PowerPortTypeLabelNr3PPlusNPlusE4H captures enum value "3P+N+E 4H"
PowerPortTypeLabelNr3PPlusNPlusE4H string = "3P+N+E 4H"
// PowerPortTypeLabelNr3PPlusNPlusE6H captures enum value "3P+N+E 6H"
PowerPortTypeLabelNr3PPlusNPlusE6H string = "3P+N+E 6H"
// PowerPortTypeLabelNr3PPlusNPlusE9H captures enum value "3P+N+E 9H"
PowerPortTypeLabelNr3PPlusNPlusE9H string = "3P+N+E 9H"
// PowerPortTypeLabelNEMA1Dash15P captures enum value "NEMA 1-15P"
PowerPortTypeLabelNEMA1Dash15P string = "NEMA 1-15P"
// PowerPortTypeLabelNEMA5Dash15P captures enum value "NEMA 5-15P"
PowerPortTypeLabelNEMA5Dash15P string = "NEMA 5-15P"
// PowerPortTypeLabelNEMA5Dash20P captures enum value "NEMA 5-20P"
PowerPortTypeLabelNEMA5Dash20P string = "NEMA 5-20P"
// PowerPortTypeLabelNEMA5Dash30P captures enum value "NEMA 5-30P"
PowerPortTypeLabelNEMA5Dash30P string = "NEMA 5-30P"
// PowerPortTypeLabelNEMA5Dash50P captures enum value "NEMA 5-50P"
PowerPortTypeLabelNEMA5Dash50P string = "NEMA 5-50P"
// PowerPortTypeLabelNEMA6Dash15P captures enum value "NEMA 6-15P"
PowerPortTypeLabelNEMA6Dash15P string = "NEMA 6-15P"
// PowerPortTypeLabelNEMA6Dash20P captures enum value "NEMA 6-20P"
PowerPortTypeLabelNEMA6Dash20P string = "NEMA 6-20P"
// PowerPortTypeLabelNEMA6Dash30P captures enum value "NEMA 6-30P"
PowerPortTypeLabelNEMA6Dash30P string = "NEMA 6-30P"
// PowerPortTypeLabelNEMA6Dash50P captures enum value "NEMA 6-50P"
PowerPortTypeLabelNEMA6Dash50P string = "NEMA 6-50P"
// PowerPortTypeLabelNEMA10Dash30P captures enum value "NEMA 10-30P"
PowerPortTypeLabelNEMA10Dash30P string = "NEMA 10-30P"
// PowerPortTypeLabelNEMA10Dash50P captures enum value "NEMA 10-50P"
PowerPortTypeLabelNEMA10Dash50P string = "NEMA 10-50P"
// PowerPortTypeLabelNEMA14Dash20P captures enum value "NEMA 14-20P"
PowerPortTypeLabelNEMA14Dash20P string = "NEMA 14-20P"
// PowerPortTypeLabelNEMA14Dash30P captures enum value "NEMA 14-30P"
PowerPortTypeLabelNEMA14Dash30P string = "NEMA 14-30P"
// PowerPortTypeLabelNEMA14Dash50P captures enum value "NEMA 14-50P"
PowerPortTypeLabelNEMA14Dash50P string = "NEMA 14-50P"
// PowerPortTypeLabelNEMA14Dash60P captures enum value "NEMA 14-60P"
PowerPortTypeLabelNEMA14Dash60P string = "NEMA 14-60P"
// PowerPortTypeLabelNEMA15Dash15P captures enum value "NEMA 15-15P"
PowerPortTypeLabelNEMA15Dash15P string = "NEMA 15-15P"
// PowerPortTypeLabelNEMA15Dash20P captures enum value "NEMA 15-20P"
PowerPortTypeLabelNEMA15Dash20P string = "NEMA 15-20P"
// PowerPortTypeLabelNEMA15Dash30P captures enum value "NEMA 15-30P"
PowerPortTypeLabelNEMA15Dash30P string = "NEMA 15-30P"
// PowerPortTypeLabelNEMA15Dash50P captures enum value "NEMA 15-50P"
PowerPortTypeLabelNEMA15Dash50P string = "NEMA 15-50P"
// PowerPortTypeLabelNEMA15Dash60P captures enum value "NEMA 15-60P"
PowerPortTypeLabelNEMA15Dash60P string = "NEMA 15-60P"
// PowerPortTypeLabelNEMAL1Dash15P captures enum value "NEMA L1-15P"
PowerPortTypeLabelNEMAL1Dash15P string = "NEMA L1-15P"
// PowerPortTypeLabelNEMAL5Dash15P captures enum value "NEMA L5-15P"
PowerPortTypeLabelNEMAL5Dash15P string = "NEMA L5-15P"
// PowerPortTypeLabelNEMAL5Dash20P captures enum value "NEMA L5-20P"
PowerPortTypeLabelNEMAL5Dash20P string = "NEMA L5-20P"
// PowerPortTypeLabelNEMAL5Dash30P captures enum value "NEMA L5-30P"
PowerPortTypeLabelNEMAL5Dash30P string = "NEMA L5-30P"
// PowerPortTypeLabelNEMAL5Dash50P captures enum value "NEMA L5-50P"
PowerPortTypeLabelNEMAL5Dash50P string = "NEMA L5-50P"
// PowerPortTypeLabelNEMAL6Dash15P captures enum value "NEMA L6-15P"
PowerPortTypeLabelNEMAL6Dash15P string = "NEMA L6-15P"
// PowerPortTypeLabelNEMAL6Dash20P captures enum value "NEMA L6-20P"
PowerPortTypeLabelNEMAL6Dash20P string = "NEMA L6-20P"
// PowerPortTypeLabelNEMAL6Dash30P captures enum value "NEMA L6-30P"
PowerPortTypeLabelNEMAL6Dash30P string = "NEMA L6-30P"
// PowerPortTypeLabelNEMAL6Dash50P captures enum value "NEMA L6-50P"
PowerPortTypeLabelNEMAL6Dash50P string = "NEMA L6-50P"
// PowerPortTypeLabelNEMAL10Dash30P captures enum value "NEMA L10-30P"
PowerPortTypeLabelNEMAL10Dash30P string = "NEMA L10-30P"
// PowerPortTypeLabelNEMAL14Dash20P captures enum value "NEMA L14-20P"
PowerPortTypeLabelNEMAL14Dash20P string = "NEMA L14-20P"
// PowerPortTypeLabelNEMAL14Dash30P captures enum value "NEMA L14-30P"
PowerPortTypeLabelNEMAL14Dash30P string = "NEMA L14-30P"
// PowerPortTypeLabelNEMAL14Dash50P captures enum value "NEMA L14-50P"
PowerPortTypeLabelNEMAL14Dash50P string = "NEMA L14-50P"
// PowerPortTypeLabelNEMAL14Dash60P captures enum value "NEMA L14-60P"
PowerPortTypeLabelNEMAL14Dash60P string = "NEMA L14-60P"
// PowerPortTypeLabelNEMAL15Dash20P captures enum value "NEMA L15-20P"
PowerPortTypeLabelNEMAL15Dash20P string = "NEMA L15-20P"
// PowerPortTypeLabelNEMAL15Dash30P captures enum value "NEMA L15-30P"
PowerPortTypeLabelNEMAL15Dash30P string = "NEMA L15-30P"
// PowerPortTypeLabelNEMAL15Dash50P captures enum value "NEMA L15-50P"
PowerPortTypeLabelNEMAL15Dash50P string = "NEMA L15-50P"
// PowerPortTypeLabelNEMAL15Dash60P captures enum value "NEMA L15-60P"
PowerPortTypeLabelNEMAL15Dash60P string = "NEMA L15-60P"
// PowerPortTypeLabelNEMAL21Dash20P captures enum value "NEMA L21-20P"
PowerPortTypeLabelNEMAL21Dash20P string = "NEMA L21-20P"
// PowerPortTypeLabelNEMAL21Dash30P captures enum value "NEMA L21-30P"
PowerPortTypeLabelNEMAL21Dash30P string = "NEMA L21-30P"
// PowerPortTypeLabelCS6361C captures enum value "CS6361C"
PowerPortTypeLabelCS6361C string = "CS6361C"
// PowerPortTypeLabelCS6365C captures enum value "CS6365C"
PowerPortTypeLabelCS6365C string = "CS6365C"
// PowerPortTypeLabelCS8165C captures enum value "CS8165C"
PowerPortTypeLabelCS8165C string = "CS8165C"
// PowerPortTypeLabelCS8265C captures enum value "CS8265C"
PowerPortTypeLabelCS8265C string = "CS8265C"
// PowerPortTypeLabelCS8365C captures enum value "CS8365C"
PowerPortTypeLabelCS8365C string = "CS8365C"
// PowerPortTypeLabelCS8465C captures enum value "CS8465C"
PowerPortTypeLabelCS8465C string = "CS8465C"
// PowerPortTypeLabelITATypeECEE75 captures enum value "ITA Type E (CEE 7/5)"
PowerPortTypeLabelITATypeECEE75 string = "ITA Type E (CEE 7/5)"
// PowerPortTypeLabelITATypeFCEE74 captures enum value "ITA Type F (CEE 7/4)"
PowerPortTypeLabelITATypeFCEE74 string = "ITA Type F (CEE 7/4)"
// PowerPortTypeLabelITATypeEFCEE77 captures enum value "ITA Type E/F (CEE 7/7)"
PowerPortTypeLabelITATypeEFCEE77 string = "ITA Type E/F (CEE 7/7)"
// PowerPortTypeLabelITATypeGBS1363 captures enum value "ITA Type G (BS 1363)"
PowerPortTypeLabelITATypeGBS1363 string = "ITA Type G (BS 1363)"
// PowerPortTypeLabelITATypeH captures enum value "ITA Type H"
PowerPortTypeLabelITATypeH string = "ITA Type H"
// PowerPortTypeLabelITATypeI captures enum value "ITA Type I"
PowerPortTypeLabelITATypeI string = "ITA Type I"
// PowerPortTypeLabelITATypeJ captures enum value "ITA Type J"
PowerPortTypeLabelITATypeJ string = "ITA Type J"
// PowerPortTypeLabelITATypeK captures enum value "ITA Type K"
PowerPortTypeLabelITATypeK string = "ITA Type K"
// PowerPortTypeLabelITATypeLCEI23Dash50 captures enum value "ITA Type L (CEI 23-50)"
PowerPortTypeLabelITATypeLCEI23Dash50 string = "ITA Type L (CEI 23-50)"
// PowerPortTypeLabelITATypeMBS546 captures enum value "ITA Type M (BS 546)"
PowerPortTypeLabelITATypeMBS546 string = "ITA Type M (BS 546)"
// PowerPortTypeLabelITATypeN captures enum value "ITA Type N"
PowerPortTypeLabelITATypeN string = "ITA Type N"
// PowerPortTypeLabelITATypeO captures enum value "ITA Type O"
PowerPortTypeLabelITATypeO string = "ITA Type O"
// PowerPortTypeLabelUSBTypeA captures enum value "USB Type A"
PowerPortTypeLabelUSBTypeA string = "USB Type A"
// PowerPortTypeLabelUSBTypeB captures enum value "USB Type B"
PowerPortTypeLabelUSBTypeB string = "USB Type B"
// PowerPortTypeLabelUSBTypeC captures enum value "USB Type C"
PowerPortTypeLabelUSBTypeC string = "USB Type C"
// PowerPortTypeLabelUSBMiniA captures enum value "USB Mini A"
PowerPortTypeLabelUSBMiniA string = "USB Mini A"
// PowerPortTypeLabelUSBMiniB captures enum value "USB Mini B"
PowerPortTypeLabelUSBMiniB string = "USB Mini B"
// PowerPortTypeLabelUSBMicroA captures enum value "USB Micro A"
PowerPortTypeLabelUSBMicroA string = "USB Micro A"
// PowerPortTypeLabelUSBMicroB captures enum value "USB Micro B"
PowerPortTypeLabelUSBMicroB string = "USB Micro B"
// PowerPortTypeLabelUSB3Dot0TypeB captures enum value "USB 3.0 Type B"
PowerPortTypeLabelUSB3Dot0TypeB string = "USB 3.0 Type B"
// PowerPortTypeLabelUSB3Dot0MicroB captures enum value "USB 3.0 Micro B"
PowerPortTypeLabelUSB3Dot0MicroB string = "USB 3.0 Micro B"
// PowerPortTypeLabelDCTerminal captures enum value "DC Terminal"
PowerPortTypeLabelDCTerminal string = "DC Terminal"
// PowerPortTypeLabelSafDashDDashGrid captures enum value "Saf-D-Grid"
PowerPortTypeLabelSafDashDDashGrid string = "Saf-D-Grid"
// PowerPortTypeLabelHardwired captures enum value "Hardwired"
PowerPortTypeLabelHardwired string = "Hardwired"
)
// prop value enum
func (m *PowerPortType) validateLabelEnum(path, location string, value string) error {
if err := validate.EnumCase(path, location, value, powerPortTypeTypeLabelPropEnum, true); err != nil {
return err
}
return nil
}
func (m *PowerPortType) validateLabel(formats strfmt.Registry) error {
if err := validate.Required("type"+"."+"label", "body", m.Label); err != nil {
return err
}
// value enum
if err := m.validateLabelEnum("type"+"."+"label", "body", *m.Label); err != nil {
return err
}
return nil
}
var powerPortTypeTypeValuePropEnum []interface{}
func init() {
var res []string
if err := json.Unmarshal([]byte(`["iec-60320-c6","iec-60320-c8","iec-60320-c14","iec-60320-c16","iec-60320-c20","iec-60320-c22","iec-60309-p-n-e-4h","iec-60309-p-n-e-6h","iec-60309-p-n-e-9h","iec-60309-2p-e-4h","iec-60309-2p-e-6h","iec-60309-2p-e-9h","iec-60309-3p-e-4h","iec-60309-3p-e-6h","iec-60309-3p-e-9h","iec-60309-3p-n-e-4h","iec-60309-3p-n-e-6h","iec-60309-3p-n-e-9h","nema-1-15p","nema-5-15p","nema-5-20p","nema-5-30p","nema-5-50p","nema-6-15p","nema-6-20p","nema-6-30p","nema-6-50p","nema-10-30p","nema-10-50p","nema-14-20p","nema-14-30p","nema-14-50p","nema-14-60p","nema-15-15p","nema-15-20p","nema-15-30p","nema-15-50p","nema-15-60p","nema-l1-15p","nema-l5-15p","nema-l5-20p","nema-l5-30p","nema-l5-50p","nema-l6-15p","nema-l6-20p","nema-l6-30p","nema-l6-50p","nema-l10-30p","nema-l14-20p","nema-l14-30p","nema-l14-50p","nema-l14-60p","nema-l15-20p","nema-l15-30p","nema-l15-50p","nema-l15-60p","nema-l21-20p","nema-l21-30p","cs6361c","cs6365c","cs8165c","cs8265c","cs8365c","cs8465c","ita-e","ita-f","ita-ef","ita-g","ita-h","ita-i","ita-j","ita-k","ita-l","ita-m","ita-n","ita-o","usb-a","usb-b","usb-c","usb-mini-a","usb-mini-b","usb-micro-a","usb-micro-b","usb-3-b","usb-3-micro-b","dc-terminal","saf-d-grid","hardwired"]`), &res); err != nil {
panic(err)
}
for _, v := range res {
powerPortTypeTypeValuePropEnum = append(powerPortTypeTypeValuePropEnum, v)
}
}
const (
// PowerPortTypeValueIecDash60320DashC6 captures enum value "iec-60320-c6"
PowerPortTypeValueIecDash60320DashC6 string = "iec-60320-c6"
// PowerPortTypeValueIecDash60320DashC8 captures enum value "iec-60320-c8"
PowerPortTypeValueIecDash60320DashC8 string = "iec-60320-c8"
// PowerPortTypeValueIecDash60320DashC14 captures enum value "iec-60320-c14"
PowerPortTypeValueIecDash60320DashC14 string = "iec-60320-c14"