github.com/digitalocean/go-netbox@v0.0.2/netbox/models/front_port.go (about) 1 // Code generated by go-swagger; DO NOT EDIT. 2 3 // Copyright 2020 The go-netbox Authors. 4 // 5 // Licensed under the Apache License, Version 2.0 (the "License"); 6 // you may not use this file except in compliance with the License. 7 // You may obtain a copy of the License at 8 // 9 // http://www.apache.org/licenses/LICENSE-2.0 10 // 11 // Unless required by applicable law or agreed to in writing, software 12 // distributed under the License is distributed on an "AS IS" BASIS, 13 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 // See the License for the specific language governing permissions and 15 // limitations under the License. 16 // 17 18 package models 19 20 // This file was generated by the swagger tool. 21 // Editing this file might prove futile when you re-run the swagger generate command 22 23 import ( 24 "context" 25 "encoding/json" 26 "strconv" 27 28 "github.com/go-openapi/errors" 29 "github.com/go-openapi/strfmt" 30 "github.com/go-openapi/swag" 31 "github.com/go-openapi/validate" 32 ) 33 34 // FrontPort front port 35 // 36 // swagger:model FrontPort 37 type FrontPort struct { 38 39 // occupied 40 // Read Only: true 41 Occupied *bool `json:"_occupied,omitempty"` 42 43 // cable 44 Cable *NestedCable `json:"cable,omitempty"` 45 46 // Cable peer 47 // 48 // 49 // Return the appropriate serializer for the cable termination model. 50 // 51 // Read Only: true 52 CablePeer map[string]*string `json:"cable_peer,omitempty"` 53 54 // Cable peer type 55 // Read Only: true 56 CablePeerType string `json:"cable_peer_type,omitempty"` 57 58 // Created 59 // Read Only: true 60 // Format: date 61 Created strfmt.Date `json:"created,omitempty"` 62 63 // Custom fields 64 CustomFields interface{} `json:"custom_fields,omitempty"` 65 66 // Description 67 // Max Length: 200 68 Description string `json:"description,omitempty"` 69 70 // device 71 // Required: true 72 Device *NestedDevice `json:"device"` 73 74 // Display 75 // Read Only: true 76 Display string `json:"display,omitempty"` 77 78 // Id 79 // Read Only: true 80 ID int64 `json:"id,omitempty"` 81 82 // Label 83 // 84 // Physical label 85 // Max Length: 64 86 Label string `json:"label,omitempty"` 87 88 // Last updated 89 // Read Only: true 90 // Format: date-time 91 LastUpdated strfmt.DateTime `json:"last_updated,omitempty"` 92 93 // Mark connected 94 // 95 // Treat as if a cable is connected 96 MarkConnected bool `json:"mark_connected,omitempty"` 97 98 // Name 99 // Required: true 100 // Max Length: 64 101 // Min Length: 1 102 Name *string `json:"name"` 103 104 // rear port 105 // Required: true 106 RearPort *FrontPortRearPort `json:"rear_port"` 107 108 // Rear port position 109 // Maximum: 1024 110 // Minimum: 1 111 RearPortPosition int64 `json:"rear_port_position,omitempty"` 112 113 // tags 114 Tags []*NestedTag `json:"tags"` 115 116 // type 117 // Required: true 118 Type *FrontPortType `json:"type"` 119 120 // Url 121 // Read Only: true 122 // Format: uri 123 URL strfmt.URI `json:"url,omitempty"` 124 } 125 126 // Validate validates this front port 127 func (m *FrontPort) Validate(formats strfmt.Registry) error { 128 var res []error 129 130 if err := m.validateCable(formats); err != nil { 131 res = append(res, err) 132 } 133 134 if err := m.validateCreated(formats); err != nil { 135 res = append(res, err) 136 } 137 138 if err := m.validateDescription(formats); err != nil { 139 res = append(res, err) 140 } 141 142 if err := m.validateDevice(formats); err != nil { 143 res = append(res, err) 144 } 145 146 if err := m.validateLabel(formats); err != nil { 147 res = append(res, err) 148 } 149 150 if err := m.validateLastUpdated(formats); err != nil { 151 res = append(res, err) 152 } 153 154 if err := m.validateName(formats); err != nil { 155 res = append(res, err) 156 } 157 158 if err := m.validateRearPort(formats); err != nil { 159 res = append(res, err) 160 } 161 162 if err := m.validateRearPortPosition(formats); err != nil { 163 res = append(res, err) 164 } 165 166 if err := m.validateTags(formats); err != nil { 167 res = append(res, err) 168 } 169 170 if err := m.validateType(formats); err != nil { 171 res = append(res, err) 172 } 173 174 if err := m.validateURL(formats); err != nil { 175 res = append(res, err) 176 } 177 178 if len(res) > 0 { 179 return errors.CompositeValidationError(res...) 180 } 181 return nil 182 } 183 184 func (m *FrontPort) validateCable(formats strfmt.Registry) error { 185 if swag.IsZero(m.Cable) { // not required 186 return nil 187 } 188 189 if m.Cable != nil { 190 if err := m.Cable.Validate(formats); err != nil { 191 if ve, ok := err.(*errors.Validation); ok { 192 return ve.ValidateName("cable") 193 } else if ce, ok := err.(*errors.CompositeError); ok { 194 return ce.ValidateName("cable") 195 } 196 return err 197 } 198 } 199 200 return nil 201 } 202 203 func (m *FrontPort) validateCreated(formats strfmt.Registry) error { 204 if swag.IsZero(m.Created) { // not required 205 return nil 206 } 207 208 if err := validate.FormatOf("created", "body", "date", m.Created.String(), formats); err != nil { 209 return err 210 } 211 212 return nil 213 } 214 215 func (m *FrontPort) validateDescription(formats strfmt.Registry) error { 216 if swag.IsZero(m.Description) { // not required 217 return nil 218 } 219 220 if err := validate.MaxLength("description", "body", m.Description, 200); err != nil { 221 return err 222 } 223 224 return nil 225 } 226 227 func (m *FrontPort) validateDevice(formats strfmt.Registry) error { 228 229 if err := validate.Required("device", "body", m.Device); err != nil { 230 return err 231 } 232 233 if m.Device != nil { 234 if err := m.Device.Validate(formats); err != nil { 235 if ve, ok := err.(*errors.Validation); ok { 236 return ve.ValidateName("device") 237 } else if ce, ok := err.(*errors.CompositeError); ok { 238 return ce.ValidateName("device") 239 } 240 return err 241 } 242 } 243 244 return nil 245 } 246 247 func (m *FrontPort) validateLabel(formats strfmt.Registry) error { 248 if swag.IsZero(m.Label) { // not required 249 return nil 250 } 251 252 if err := validate.MaxLength("label", "body", m.Label, 64); err != nil { 253 return err 254 } 255 256 return nil 257 } 258 259 func (m *FrontPort) validateLastUpdated(formats strfmt.Registry) error { 260 if swag.IsZero(m.LastUpdated) { // not required 261 return nil 262 } 263 264 if err := validate.FormatOf("last_updated", "body", "date-time", m.LastUpdated.String(), formats); err != nil { 265 return err 266 } 267 268 return nil 269 } 270 271 func (m *FrontPort) validateName(formats strfmt.Registry) error { 272 273 if err := validate.Required("name", "body", m.Name); err != nil { 274 return err 275 } 276 277 if err := validate.MinLength("name", "body", *m.Name, 1); err != nil { 278 return err 279 } 280 281 if err := validate.MaxLength("name", "body", *m.Name, 64); err != nil { 282 return err 283 } 284 285 return nil 286 } 287 288 func (m *FrontPort) validateRearPort(formats strfmt.Registry) error { 289 290 if err := validate.Required("rear_port", "body", m.RearPort); err != nil { 291 return err 292 } 293 294 if m.RearPort != nil { 295 if err := m.RearPort.Validate(formats); err != nil { 296 if ve, ok := err.(*errors.Validation); ok { 297 return ve.ValidateName("rear_port") 298 } else if ce, ok := err.(*errors.CompositeError); ok { 299 return ce.ValidateName("rear_port") 300 } 301 return err 302 } 303 } 304 305 return nil 306 } 307 308 func (m *FrontPort) validateRearPortPosition(formats strfmt.Registry) error { 309 if swag.IsZero(m.RearPortPosition) { // not required 310 return nil 311 } 312 313 if err := validate.MinimumInt("rear_port_position", "body", m.RearPortPosition, 1, false); err != nil { 314 return err 315 } 316 317 if err := validate.MaximumInt("rear_port_position", "body", m.RearPortPosition, 1024, false); err != nil { 318 return err 319 } 320 321 return nil 322 } 323 324 func (m *FrontPort) validateTags(formats strfmt.Registry) error { 325 if swag.IsZero(m.Tags) { // not required 326 return nil 327 } 328 329 for i := 0; i < len(m.Tags); i++ { 330 if swag.IsZero(m.Tags[i]) { // not required 331 continue 332 } 333 334 if m.Tags[i] != nil { 335 if err := m.Tags[i].Validate(formats); err != nil { 336 if ve, ok := err.(*errors.Validation); ok { 337 return ve.ValidateName("tags" + "." + strconv.Itoa(i)) 338 } else if ce, ok := err.(*errors.CompositeError); ok { 339 return ce.ValidateName("tags" + "." + strconv.Itoa(i)) 340 } 341 return err 342 } 343 } 344 345 } 346 347 return nil 348 } 349 350 func (m *FrontPort) validateType(formats strfmt.Registry) error { 351 352 if err := validate.Required("type", "body", m.Type); err != nil { 353 return err 354 } 355 356 if m.Type != nil { 357 if err := m.Type.Validate(formats); err != nil { 358 if ve, ok := err.(*errors.Validation); ok { 359 return ve.ValidateName("type") 360 } else if ce, ok := err.(*errors.CompositeError); ok { 361 return ce.ValidateName("type") 362 } 363 return err 364 } 365 } 366 367 return nil 368 } 369 370 func (m *FrontPort) validateURL(formats strfmt.Registry) error { 371 if swag.IsZero(m.URL) { // not required 372 return nil 373 } 374 375 if err := validate.FormatOf("url", "body", "uri", m.URL.String(), formats); err != nil { 376 return err 377 } 378 379 return nil 380 } 381 382 // ContextValidate validate this front port based on the context it is used 383 func (m *FrontPort) ContextValidate(ctx context.Context, formats strfmt.Registry) error { 384 var res []error 385 386 if err := m.contextValidateOccupied(ctx, formats); err != nil { 387 res = append(res, err) 388 } 389 390 if err := m.contextValidateCable(ctx, formats); err != nil { 391 res = append(res, err) 392 } 393 394 if err := m.contextValidateCablePeer(ctx, formats); err != nil { 395 res = append(res, err) 396 } 397 398 if err := m.contextValidateCablePeerType(ctx, formats); err != nil { 399 res = append(res, err) 400 } 401 402 if err := m.contextValidateCreated(ctx, formats); err != nil { 403 res = append(res, err) 404 } 405 406 if err := m.contextValidateDevice(ctx, formats); err != nil { 407 res = append(res, err) 408 } 409 410 if err := m.contextValidateDisplay(ctx, formats); err != nil { 411 res = append(res, err) 412 } 413 414 if err := m.contextValidateID(ctx, formats); err != nil { 415 res = append(res, err) 416 } 417 418 if err := m.contextValidateLastUpdated(ctx, formats); err != nil { 419 res = append(res, err) 420 } 421 422 if err := m.contextValidateRearPort(ctx, formats); err != nil { 423 res = append(res, err) 424 } 425 426 if err := m.contextValidateTags(ctx, formats); err != nil { 427 res = append(res, err) 428 } 429 430 if err := m.contextValidateType(ctx, formats); err != nil { 431 res = append(res, err) 432 } 433 434 if err := m.contextValidateURL(ctx, formats); err != nil { 435 res = append(res, err) 436 } 437 438 if len(res) > 0 { 439 return errors.CompositeValidationError(res...) 440 } 441 return nil 442 } 443 444 func (m *FrontPort) contextValidateOccupied(ctx context.Context, formats strfmt.Registry) error { 445 446 if err := validate.ReadOnly(ctx, "_occupied", "body", m.Occupied); err != nil { 447 return err 448 } 449 450 return nil 451 } 452 453 func (m *FrontPort) contextValidateCable(ctx context.Context, formats strfmt.Registry) error { 454 455 if m.Cable != nil { 456 if err := m.Cable.ContextValidate(ctx, formats); err != nil { 457 if ve, ok := err.(*errors.Validation); ok { 458 return ve.ValidateName("cable") 459 } else if ce, ok := err.(*errors.CompositeError); ok { 460 return ce.ValidateName("cable") 461 } 462 return err 463 } 464 } 465 466 return nil 467 } 468 469 func (m *FrontPort) contextValidateCablePeer(ctx context.Context, formats strfmt.Registry) error { 470 471 return nil 472 } 473 474 func (m *FrontPort) contextValidateCablePeerType(ctx context.Context, formats strfmt.Registry) error { 475 476 if err := validate.ReadOnly(ctx, "cable_peer_type", "body", string(m.CablePeerType)); err != nil { 477 return err 478 } 479 480 return nil 481 } 482 483 func (m *FrontPort) contextValidateCreated(ctx context.Context, formats strfmt.Registry) error { 484 485 if err := validate.ReadOnly(ctx, "created", "body", strfmt.Date(m.Created)); err != nil { 486 return err 487 } 488 489 return nil 490 } 491 492 func (m *FrontPort) contextValidateDevice(ctx context.Context, formats strfmt.Registry) error { 493 494 if m.Device != nil { 495 if err := m.Device.ContextValidate(ctx, formats); err != nil { 496 if ve, ok := err.(*errors.Validation); ok { 497 return ve.ValidateName("device") 498 } else if ce, ok := err.(*errors.CompositeError); ok { 499 return ce.ValidateName("device") 500 } 501 return err 502 } 503 } 504 505 return nil 506 } 507 508 func (m *FrontPort) contextValidateDisplay(ctx context.Context, formats strfmt.Registry) error { 509 510 if err := validate.ReadOnly(ctx, "display", "body", string(m.Display)); err != nil { 511 return err 512 } 513 514 return nil 515 } 516 517 func (m *FrontPort) contextValidateID(ctx context.Context, formats strfmt.Registry) error { 518 519 if err := validate.ReadOnly(ctx, "id", "body", int64(m.ID)); err != nil { 520 return err 521 } 522 523 return nil 524 } 525 526 func (m *FrontPort) contextValidateLastUpdated(ctx context.Context, formats strfmt.Registry) error { 527 528 if err := validate.ReadOnly(ctx, "last_updated", "body", strfmt.DateTime(m.LastUpdated)); err != nil { 529 return err 530 } 531 532 return nil 533 } 534 535 func (m *FrontPort) contextValidateRearPort(ctx context.Context, formats strfmt.Registry) error { 536 537 if m.RearPort != nil { 538 if err := m.RearPort.ContextValidate(ctx, formats); err != nil { 539 if ve, ok := err.(*errors.Validation); ok { 540 return ve.ValidateName("rear_port") 541 } else if ce, ok := err.(*errors.CompositeError); ok { 542 return ce.ValidateName("rear_port") 543 } 544 return err 545 } 546 } 547 548 return nil 549 } 550 551 func (m *FrontPort) contextValidateTags(ctx context.Context, formats strfmt.Registry) error { 552 553 for i := 0; i < len(m.Tags); i++ { 554 555 if m.Tags[i] != nil { 556 if err := m.Tags[i].ContextValidate(ctx, formats); err != nil { 557 if ve, ok := err.(*errors.Validation); ok { 558 return ve.ValidateName("tags" + "." + strconv.Itoa(i)) 559 } else if ce, ok := err.(*errors.CompositeError); ok { 560 return ce.ValidateName("tags" + "." + strconv.Itoa(i)) 561 } 562 return err 563 } 564 } 565 566 } 567 568 return nil 569 } 570 571 func (m *FrontPort) contextValidateType(ctx context.Context, formats strfmt.Registry) error { 572 573 if m.Type != nil { 574 if err := m.Type.ContextValidate(ctx, formats); err != nil { 575 if ve, ok := err.(*errors.Validation); ok { 576 return ve.ValidateName("type") 577 } else if ce, ok := err.(*errors.CompositeError); ok { 578 return ce.ValidateName("type") 579 } 580 return err 581 } 582 } 583 584 return nil 585 } 586 587 func (m *FrontPort) contextValidateURL(ctx context.Context, formats strfmt.Registry) error { 588 589 if err := validate.ReadOnly(ctx, "url", "body", strfmt.URI(m.URL)); err != nil { 590 return err 591 } 592 593 return nil 594 } 595 596 // MarshalBinary interface implementation 597 func (m *FrontPort) MarshalBinary() ([]byte, error) { 598 if m == nil { 599 return nil, nil 600 } 601 return swag.WriteJSON(m) 602 } 603 604 // UnmarshalBinary interface implementation 605 func (m *FrontPort) UnmarshalBinary(b []byte) error { 606 var res FrontPort 607 if err := swag.ReadJSON(b, &res); err != nil { 608 return err 609 } 610 *m = res 611 return nil 612 } 613 614 // FrontPortType Type 615 // 616 // swagger:model FrontPortType 617 type FrontPortType struct { 618 619 // label 620 // Required: true 621 // Enum: [8P8C 8P6C 8P4C 8P2C 6P6C 6P4C 6P2C 4P4C 4P2C GG45 TERA 4P TERA 2P TERA 1P 110 Punch BNC F Connector N Connector MRJ21 FC LC LC/APC LSH LSH/APC MPO MTRJ SC SC/APC ST CS SN Splice] 622 Label *string `json:"label"` 623 624 // value 625 // Required: true 626 // Enum: [8p8c 8p6c 8p4c 8p2c 6p6c 6p4c 6p2c 4p4c 4p2c gg45 tera-4p tera-2p tera-1p 110-punch bnc f n mrj21 fc lc lc-apc lsh lsh-apc mpo mtrj sc sc-apc st cs sn splice] 627 Value *string `json:"value"` 628 } 629 630 // Validate validates this front port type 631 func (m *FrontPortType) Validate(formats strfmt.Registry) error { 632 var res []error 633 634 if err := m.validateLabel(formats); err != nil { 635 res = append(res, err) 636 } 637 638 if err := m.validateValue(formats); err != nil { 639 res = append(res, err) 640 } 641 642 if len(res) > 0 { 643 return errors.CompositeValidationError(res...) 644 } 645 return nil 646 } 647 648 var frontPortTypeTypeLabelPropEnum []interface{} 649 650 func init() { 651 var res []string 652 if err := json.Unmarshal([]byte(`["8P8C","8P6C","8P4C","8P2C","6P6C","6P4C","6P2C","4P4C","4P2C","GG45","TERA 4P","TERA 2P","TERA 1P","110 Punch","BNC","F Connector","N Connector","MRJ21","FC","LC","LC/APC","LSH","LSH/APC","MPO","MTRJ","SC","SC/APC","ST","CS","SN","Splice"]`), &res); err != nil { 653 panic(err) 654 } 655 for _, v := range res { 656 frontPortTypeTypeLabelPropEnum = append(frontPortTypeTypeLabelPropEnum, v) 657 } 658 } 659 660 const ( 661 662 // FrontPortTypeLabelNr8P8C captures enum value "8P8C" 663 FrontPortTypeLabelNr8P8C string = "8P8C" 664 665 // FrontPortTypeLabelNr8P6C captures enum value "8P6C" 666 FrontPortTypeLabelNr8P6C string = "8P6C" 667 668 // FrontPortTypeLabelNr8P4C captures enum value "8P4C" 669 FrontPortTypeLabelNr8P4C string = "8P4C" 670 671 // FrontPortTypeLabelNr8P2C captures enum value "8P2C" 672 FrontPortTypeLabelNr8P2C string = "8P2C" 673 674 // FrontPortTypeLabelNr6P6C captures enum value "6P6C" 675 FrontPortTypeLabelNr6P6C string = "6P6C" 676 677 // FrontPortTypeLabelNr6P4C captures enum value "6P4C" 678 FrontPortTypeLabelNr6P4C string = "6P4C" 679 680 // FrontPortTypeLabelNr6P2C captures enum value "6P2C" 681 FrontPortTypeLabelNr6P2C string = "6P2C" 682 683 // FrontPortTypeLabelNr4P4C captures enum value "4P4C" 684 FrontPortTypeLabelNr4P4C string = "4P4C" 685 686 // FrontPortTypeLabelNr4P2C captures enum value "4P2C" 687 FrontPortTypeLabelNr4P2C string = "4P2C" 688 689 // FrontPortTypeLabelGG45 captures enum value "GG45" 690 FrontPortTypeLabelGG45 string = "GG45" 691 692 // FrontPortTypeLabelTERA4P captures enum value "TERA 4P" 693 FrontPortTypeLabelTERA4P string = "TERA 4P" 694 695 // FrontPortTypeLabelTERA2P captures enum value "TERA 2P" 696 FrontPortTypeLabelTERA2P string = "TERA 2P" 697 698 // FrontPortTypeLabelTERA1P captures enum value "TERA 1P" 699 FrontPortTypeLabelTERA1P string = "TERA 1P" 700 701 // FrontPortTypeLabelNr110Punch captures enum value "110 Punch" 702 FrontPortTypeLabelNr110Punch string = "110 Punch" 703 704 // FrontPortTypeLabelBNC captures enum value "BNC" 705 FrontPortTypeLabelBNC string = "BNC" 706 707 // FrontPortTypeLabelFConnector captures enum value "F Connector" 708 FrontPortTypeLabelFConnector string = "F Connector" 709 710 // FrontPortTypeLabelNConnector captures enum value "N Connector" 711 FrontPortTypeLabelNConnector string = "N Connector" 712 713 // FrontPortTypeLabelMRJ21 captures enum value "MRJ21" 714 FrontPortTypeLabelMRJ21 string = "MRJ21" 715 716 // FrontPortTypeLabelFC captures enum value "FC" 717 FrontPortTypeLabelFC string = "FC" 718 719 // FrontPortTypeLabelLC captures enum value "LC" 720 FrontPortTypeLabelLC string = "LC" 721 722 // FrontPortTypeLabelLCAPC captures enum value "LC/APC" 723 FrontPortTypeLabelLCAPC string = "LC/APC" 724 725 // FrontPortTypeLabelLSH captures enum value "LSH" 726 FrontPortTypeLabelLSH string = "LSH" 727 728 // FrontPortTypeLabelLSHAPC captures enum value "LSH/APC" 729 FrontPortTypeLabelLSHAPC string = "LSH/APC" 730 731 // FrontPortTypeLabelMPO captures enum value "MPO" 732 FrontPortTypeLabelMPO string = "MPO" 733 734 // FrontPortTypeLabelMTRJ captures enum value "MTRJ" 735 FrontPortTypeLabelMTRJ string = "MTRJ" 736 737 // FrontPortTypeLabelSC captures enum value "SC" 738 FrontPortTypeLabelSC string = "SC" 739 740 // FrontPortTypeLabelSCAPC captures enum value "SC/APC" 741 FrontPortTypeLabelSCAPC string = "SC/APC" 742 743 // FrontPortTypeLabelST captures enum value "ST" 744 FrontPortTypeLabelST string = "ST" 745 746 // FrontPortTypeLabelCS captures enum value "CS" 747 FrontPortTypeLabelCS string = "CS" 748 749 // FrontPortTypeLabelSN captures enum value "SN" 750 FrontPortTypeLabelSN string = "SN" 751 752 // FrontPortTypeLabelSplice captures enum value "Splice" 753 FrontPortTypeLabelSplice string = "Splice" 754 ) 755 756 // prop value enum 757 func (m *FrontPortType) validateLabelEnum(path, location string, value string) error { 758 if err := validate.EnumCase(path, location, value, frontPortTypeTypeLabelPropEnum, true); err != nil { 759 return err 760 } 761 return nil 762 } 763 764 func (m *FrontPortType) validateLabel(formats strfmt.Registry) error { 765 766 if err := validate.Required("type"+"."+"label", "body", m.Label); err != nil { 767 return err 768 } 769 770 // value enum 771 if err := m.validateLabelEnum("type"+"."+"label", "body", *m.Label); err != nil { 772 return err 773 } 774 775 return nil 776 } 777 778 var frontPortTypeTypeValuePropEnum []interface{} 779 780 func init() { 781 var res []string 782 if err := json.Unmarshal([]byte(`["8p8c","8p6c","8p4c","8p2c","6p6c","6p4c","6p2c","4p4c","4p2c","gg45","tera-4p","tera-2p","tera-1p","110-punch","bnc","f","n","mrj21","fc","lc","lc-apc","lsh","lsh-apc","mpo","mtrj","sc","sc-apc","st","cs","sn","splice"]`), &res); err != nil { 783 panic(err) 784 } 785 for _, v := range res { 786 frontPortTypeTypeValuePropEnum = append(frontPortTypeTypeValuePropEnum, v) 787 } 788 } 789 790 const ( 791 792 // FrontPortTypeValueNr8p8c captures enum value "8p8c" 793 FrontPortTypeValueNr8p8c string = "8p8c" 794 795 // FrontPortTypeValueNr8p6c captures enum value "8p6c" 796 FrontPortTypeValueNr8p6c string = "8p6c" 797 798 // FrontPortTypeValueNr8p4c captures enum value "8p4c" 799 FrontPortTypeValueNr8p4c string = "8p4c" 800 801 // FrontPortTypeValueNr8p2c captures enum value "8p2c" 802 FrontPortTypeValueNr8p2c string = "8p2c" 803 804 // FrontPortTypeValueNr6p6c captures enum value "6p6c" 805 FrontPortTypeValueNr6p6c string = "6p6c" 806 807 // FrontPortTypeValueNr6p4c captures enum value "6p4c" 808 FrontPortTypeValueNr6p4c string = "6p4c" 809 810 // FrontPortTypeValueNr6p2c captures enum value "6p2c" 811 FrontPortTypeValueNr6p2c string = "6p2c" 812 813 // FrontPortTypeValueNr4p4c captures enum value "4p4c" 814 FrontPortTypeValueNr4p4c string = "4p4c" 815 816 // FrontPortTypeValueNr4p2c captures enum value "4p2c" 817 FrontPortTypeValueNr4p2c string = "4p2c" 818 819 // FrontPortTypeValueGg45 captures enum value "gg45" 820 FrontPortTypeValueGg45 string = "gg45" 821 822 // FrontPortTypeValueTeraDash4p captures enum value "tera-4p" 823 FrontPortTypeValueTeraDash4p string = "tera-4p" 824 825 // FrontPortTypeValueTeraDash2p captures enum value "tera-2p" 826 FrontPortTypeValueTeraDash2p string = "tera-2p" 827 828 // FrontPortTypeValueTeraDash1p captures enum value "tera-1p" 829 FrontPortTypeValueTeraDash1p string = "tera-1p" 830 831 // FrontPortTypeValueNr110DashPunch captures enum value "110-punch" 832 FrontPortTypeValueNr110DashPunch string = "110-punch" 833 834 // FrontPortTypeValueBnc captures enum value "bnc" 835 FrontPortTypeValueBnc string = "bnc" 836 837 // FrontPortTypeValueF captures enum value "f" 838 FrontPortTypeValueF string = "f" 839 840 // FrontPortTypeValueN captures enum value "n" 841 FrontPortTypeValueN string = "n" 842 843 // FrontPortTypeValueMrj21 captures enum value "mrj21" 844 FrontPortTypeValueMrj21 string = "mrj21" 845 846 // FrontPortTypeValueFc captures enum value "fc" 847 FrontPortTypeValueFc string = "fc" 848 849 // FrontPortTypeValueLc captures enum value "lc" 850 FrontPortTypeValueLc string = "lc" 851 852 // FrontPortTypeValueLcDashApc captures enum value "lc-apc" 853 FrontPortTypeValueLcDashApc string = "lc-apc" 854 855 // FrontPortTypeValueLsh captures enum value "lsh" 856 FrontPortTypeValueLsh string = "lsh" 857 858 // FrontPortTypeValueLshDashApc captures enum value "lsh-apc" 859 FrontPortTypeValueLshDashApc string = "lsh-apc" 860 861 // FrontPortTypeValueMpo captures enum value "mpo" 862 FrontPortTypeValueMpo string = "mpo" 863 864 // FrontPortTypeValueMtrj captures enum value "mtrj" 865 FrontPortTypeValueMtrj string = "mtrj" 866 867 // FrontPortTypeValueSc captures enum value "sc" 868 FrontPortTypeValueSc string = "sc" 869 870 // FrontPortTypeValueScDashApc captures enum value "sc-apc" 871 FrontPortTypeValueScDashApc string = "sc-apc" 872 873 // FrontPortTypeValueSt captures enum value "st" 874 FrontPortTypeValueSt string = "st" 875 876 // FrontPortTypeValueCs captures enum value "cs" 877 FrontPortTypeValueCs string = "cs" 878 879 // FrontPortTypeValueSn captures enum value "sn" 880 FrontPortTypeValueSn string = "sn" 881 882 // FrontPortTypeValueSplice captures enum value "splice" 883 FrontPortTypeValueSplice string = "splice" 884 ) 885 886 // prop value enum 887 func (m *FrontPortType) validateValueEnum(path, location string, value string) error { 888 if err := validate.EnumCase(path, location, value, frontPortTypeTypeValuePropEnum, true); err != nil { 889 return err 890 } 891 return nil 892 } 893 894 func (m *FrontPortType) validateValue(formats strfmt.Registry) error { 895 896 if err := validate.Required("type"+"."+"value", "body", m.Value); err != nil { 897 return err 898 } 899 900 // value enum 901 if err := m.validateValueEnum("type"+"."+"value", "body", *m.Value); err != nil { 902 return err 903 } 904 905 return nil 906 } 907 908 // ContextValidate validates this front port type based on context it is used 909 func (m *FrontPortType) ContextValidate(ctx context.Context, formats strfmt.Registry) error { 910 return nil 911 } 912 913 // MarshalBinary interface implementation 914 func (m *FrontPortType) MarshalBinary() ([]byte, error) { 915 if m == nil { 916 return nil, nil 917 } 918 return swag.WriteJSON(m) 919 } 920 921 // UnmarshalBinary interface implementation 922 func (m *FrontPortType) UnmarshalBinary(b []byte) error { 923 var res FrontPortType 924 if err := swag.ReadJSON(b, &res); err != nil { 925 return err 926 } 927 *m = res 928 return nil 929 }