github.com/digitalocean/go-netbox@v0.0.2/netbox/models/rear_port_template.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 27 "github.com/go-openapi/errors" 28 "github.com/go-openapi/strfmt" 29 "github.com/go-openapi/swag" 30 "github.com/go-openapi/validate" 31 ) 32 33 // RearPortTemplate rear port template 34 // 35 // swagger:model RearPortTemplate 36 type RearPortTemplate struct { 37 38 // Created 39 // Read Only: true 40 // Format: date 41 Created strfmt.Date `json:"created,omitempty"` 42 43 // Description 44 // Max Length: 200 45 Description string `json:"description,omitempty"` 46 47 // device type 48 // Required: true 49 DeviceType *NestedDeviceType `json:"device_type"` 50 51 // Display 52 // Read Only: true 53 Display string `json:"display,omitempty"` 54 55 // Id 56 // Read Only: true 57 ID int64 `json:"id,omitempty"` 58 59 // Label 60 // 61 // Physical label 62 // Max Length: 64 63 Label string `json:"label,omitempty"` 64 65 // Last updated 66 // Read Only: true 67 // Format: date-time 68 LastUpdated strfmt.DateTime `json:"last_updated,omitempty"` 69 70 // Name 71 // Required: true 72 // Max Length: 64 73 // Min Length: 1 74 Name *string `json:"name"` 75 76 // Positions 77 // Maximum: 1024 78 // Minimum: 1 79 Positions int64 `json:"positions,omitempty"` 80 81 // type 82 // Required: true 83 Type *RearPortTemplateType `json:"type"` 84 85 // Url 86 // Read Only: true 87 // Format: uri 88 URL strfmt.URI `json:"url,omitempty"` 89 } 90 91 // Validate validates this rear port template 92 func (m *RearPortTemplate) Validate(formats strfmt.Registry) error { 93 var res []error 94 95 if err := m.validateCreated(formats); err != nil { 96 res = append(res, err) 97 } 98 99 if err := m.validateDescription(formats); err != nil { 100 res = append(res, err) 101 } 102 103 if err := m.validateDeviceType(formats); err != nil { 104 res = append(res, err) 105 } 106 107 if err := m.validateLabel(formats); err != nil { 108 res = append(res, err) 109 } 110 111 if err := m.validateLastUpdated(formats); err != nil { 112 res = append(res, err) 113 } 114 115 if err := m.validateName(formats); err != nil { 116 res = append(res, err) 117 } 118 119 if err := m.validatePositions(formats); err != nil { 120 res = append(res, err) 121 } 122 123 if err := m.validateType(formats); err != nil { 124 res = append(res, err) 125 } 126 127 if err := m.validateURL(formats); err != nil { 128 res = append(res, err) 129 } 130 131 if len(res) > 0 { 132 return errors.CompositeValidationError(res...) 133 } 134 return nil 135 } 136 137 func (m *RearPortTemplate) validateCreated(formats strfmt.Registry) error { 138 if swag.IsZero(m.Created) { // not required 139 return nil 140 } 141 142 if err := validate.FormatOf("created", "body", "date", m.Created.String(), formats); err != nil { 143 return err 144 } 145 146 return nil 147 } 148 149 func (m *RearPortTemplate) validateDescription(formats strfmt.Registry) error { 150 if swag.IsZero(m.Description) { // not required 151 return nil 152 } 153 154 if err := validate.MaxLength("description", "body", m.Description, 200); err != nil { 155 return err 156 } 157 158 return nil 159 } 160 161 func (m *RearPortTemplate) validateDeviceType(formats strfmt.Registry) error { 162 163 if err := validate.Required("device_type", "body", m.DeviceType); err != nil { 164 return err 165 } 166 167 if m.DeviceType != nil { 168 if err := m.DeviceType.Validate(formats); err != nil { 169 if ve, ok := err.(*errors.Validation); ok { 170 return ve.ValidateName("device_type") 171 } else if ce, ok := err.(*errors.CompositeError); ok { 172 return ce.ValidateName("device_type") 173 } 174 return err 175 } 176 } 177 178 return nil 179 } 180 181 func (m *RearPortTemplate) validateLabel(formats strfmt.Registry) error { 182 if swag.IsZero(m.Label) { // not required 183 return nil 184 } 185 186 if err := validate.MaxLength("label", "body", m.Label, 64); err != nil { 187 return err 188 } 189 190 return nil 191 } 192 193 func (m *RearPortTemplate) validateLastUpdated(formats strfmt.Registry) error { 194 if swag.IsZero(m.LastUpdated) { // not required 195 return nil 196 } 197 198 if err := validate.FormatOf("last_updated", "body", "date-time", m.LastUpdated.String(), formats); err != nil { 199 return err 200 } 201 202 return nil 203 } 204 205 func (m *RearPortTemplate) validateName(formats strfmt.Registry) error { 206 207 if err := validate.Required("name", "body", m.Name); err != nil { 208 return err 209 } 210 211 if err := validate.MinLength("name", "body", *m.Name, 1); err != nil { 212 return err 213 } 214 215 if err := validate.MaxLength("name", "body", *m.Name, 64); err != nil { 216 return err 217 } 218 219 return nil 220 } 221 222 func (m *RearPortTemplate) validatePositions(formats strfmt.Registry) error { 223 if swag.IsZero(m.Positions) { // not required 224 return nil 225 } 226 227 if err := validate.MinimumInt("positions", "body", m.Positions, 1, false); err != nil { 228 return err 229 } 230 231 if err := validate.MaximumInt("positions", "body", m.Positions, 1024, false); err != nil { 232 return err 233 } 234 235 return nil 236 } 237 238 func (m *RearPortTemplate) validateType(formats strfmt.Registry) error { 239 240 if err := validate.Required("type", "body", m.Type); err != nil { 241 return err 242 } 243 244 if m.Type != nil { 245 if err := m.Type.Validate(formats); err != nil { 246 if ve, ok := err.(*errors.Validation); ok { 247 return ve.ValidateName("type") 248 } else if ce, ok := err.(*errors.CompositeError); ok { 249 return ce.ValidateName("type") 250 } 251 return err 252 } 253 } 254 255 return nil 256 } 257 258 func (m *RearPortTemplate) validateURL(formats strfmt.Registry) error { 259 if swag.IsZero(m.URL) { // not required 260 return nil 261 } 262 263 if err := validate.FormatOf("url", "body", "uri", m.URL.String(), formats); err != nil { 264 return err 265 } 266 267 return nil 268 } 269 270 // ContextValidate validate this rear port template based on the context it is used 271 func (m *RearPortTemplate) ContextValidate(ctx context.Context, formats strfmt.Registry) error { 272 var res []error 273 274 if err := m.contextValidateCreated(ctx, formats); err != nil { 275 res = append(res, err) 276 } 277 278 if err := m.contextValidateDeviceType(ctx, formats); err != nil { 279 res = append(res, err) 280 } 281 282 if err := m.contextValidateDisplay(ctx, formats); err != nil { 283 res = append(res, err) 284 } 285 286 if err := m.contextValidateID(ctx, formats); err != nil { 287 res = append(res, err) 288 } 289 290 if err := m.contextValidateLastUpdated(ctx, formats); err != nil { 291 res = append(res, err) 292 } 293 294 if err := m.contextValidateType(ctx, formats); err != nil { 295 res = append(res, err) 296 } 297 298 if err := m.contextValidateURL(ctx, formats); err != nil { 299 res = append(res, err) 300 } 301 302 if len(res) > 0 { 303 return errors.CompositeValidationError(res...) 304 } 305 return nil 306 } 307 308 func (m *RearPortTemplate) contextValidateCreated(ctx context.Context, formats strfmt.Registry) error { 309 310 if err := validate.ReadOnly(ctx, "created", "body", strfmt.Date(m.Created)); err != nil { 311 return err 312 } 313 314 return nil 315 } 316 317 func (m *RearPortTemplate) contextValidateDeviceType(ctx context.Context, formats strfmt.Registry) error { 318 319 if m.DeviceType != nil { 320 if err := m.DeviceType.ContextValidate(ctx, formats); err != nil { 321 if ve, ok := err.(*errors.Validation); ok { 322 return ve.ValidateName("device_type") 323 } else if ce, ok := err.(*errors.CompositeError); ok { 324 return ce.ValidateName("device_type") 325 } 326 return err 327 } 328 } 329 330 return nil 331 } 332 333 func (m *RearPortTemplate) contextValidateDisplay(ctx context.Context, formats strfmt.Registry) error { 334 335 if err := validate.ReadOnly(ctx, "display", "body", string(m.Display)); err != nil { 336 return err 337 } 338 339 return nil 340 } 341 342 func (m *RearPortTemplate) contextValidateID(ctx context.Context, formats strfmt.Registry) error { 343 344 if err := validate.ReadOnly(ctx, "id", "body", int64(m.ID)); err != nil { 345 return err 346 } 347 348 return nil 349 } 350 351 func (m *RearPortTemplate) contextValidateLastUpdated(ctx context.Context, formats strfmt.Registry) error { 352 353 if err := validate.ReadOnly(ctx, "last_updated", "body", strfmt.DateTime(m.LastUpdated)); err != nil { 354 return err 355 } 356 357 return nil 358 } 359 360 func (m *RearPortTemplate) contextValidateType(ctx context.Context, formats strfmt.Registry) error { 361 362 if m.Type != nil { 363 if err := m.Type.ContextValidate(ctx, formats); err != nil { 364 if ve, ok := err.(*errors.Validation); ok { 365 return ve.ValidateName("type") 366 } else if ce, ok := err.(*errors.CompositeError); ok { 367 return ce.ValidateName("type") 368 } 369 return err 370 } 371 } 372 373 return nil 374 } 375 376 func (m *RearPortTemplate) contextValidateURL(ctx context.Context, formats strfmt.Registry) error { 377 378 if err := validate.ReadOnly(ctx, "url", "body", strfmt.URI(m.URL)); err != nil { 379 return err 380 } 381 382 return nil 383 } 384 385 // MarshalBinary interface implementation 386 func (m *RearPortTemplate) MarshalBinary() ([]byte, error) { 387 if m == nil { 388 return nil, nil 389 } 390 return swag.WriteJSON(m) 391 } 392 393 // UnmarshalBinary interface implementation 394 func (m *RearPortTemplate) UnmarshalBinary(b []byte) error { 395 var res RearPortTemplate 396 if err := swag.ReadJSON(b, &res); err != nil { 397 return err 398 } 399 *m = res 400 return nil 401 } 402 403 // RearPortTemplateType Type 404 // 405 // swagger:model RearPortTemplateType 406 type RearPortTemplateType struct { 407 408 // label 409 // Required: true 410 // 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] 411 Label *string `json:"label"` 412 413 // value 414 // Required: true 415 // 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] 416 Value *string `json:"value"` 417 } 418 419 // Validate validates this rear port template type 420 func (m *RearPortTemplateType) Validate(formats strfmt.Registry) error { 421 var res []error 422 423 if err := m.validateLabel(formats); err != nil { 424 res = append(res, err) 425 } 426 427 if err := m.validateValue(formats); err != nil { 428 res = append(res, err) 429 } 430 431 if len(res) > 0 { 432 return errors.CompositeValidationError(res...) 433 } 434 return nil 435 } 436 437 var rearPortTemplateTypeTypeLabelPropEnum []interface{} 438 439 func init() { 440 var res []string 441 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 { 442 panic(err) 443 } 444 for _, v := range res { 445 rearPortTemplateTypeTypeLabelPropEnum = append(rearPortTemplateTypeTypeLabelPropEnum, v) 446 } 447 } 448 449 const ( 450 451 // RearPortTemplateTypeLabelNr8P8C captures enum value "8P8C" 452 RearPortTemplateTypeLabelNr8P8C string = "8P8C" 453 454 // RearPortTemplateTypeLabelNr8P6C captures enum value "8P6C" 455 RearPortTemplateTypeLabelNr8P6C string = "8P6C" 456 457 // RearPortTemplateTypeLabelNr8P4C captures enum value "8P4C" 458 RearPortTemplateTypeLabelNr8P4C string = "8P4C" 459 460 // RearPortTemplateTypeLabelNr8P2C captures enum value "8P2C" 461 RearPortTemplateTypeLabelNr8P2C string = "8P2C" 462 463 // RearPortTemplateTypeLabelNr6P6C captures enum value "6P6C" 464 RearPortTemplateTypeLabelNr6P6C string = "6P6C" 465 466 // RearPortTemplateTypeLabelNr6P4C captures enum value "6P4C" 467 RearPortTemplateTypeLabelNr6P4C string = "6P4C" 468 469 // RearPortTemplateTypeLabelNr6P2C captures enum value "6P2C" 470 RearPortTemplateTypeLabelNr6P2C string = "6P2C" 471 472 // RearPortTemplateTypeLabelNr4P4C captures enum value "4P4C" 473 RearPortTemplateTypeLabelNr4P4C string = "4P4C" 474 475 // RearPortTemplateTypeLabelNr4P2C captures enum value "4P2C" 476 RearPortTemplateTypeLabelNr4P2C string = "4P2C" 477 478 // RearPortTemplateTypeLabelGG45 captures enum value "GG45" 479 RearPortTemplateTypeLabelGG45 string = "GG45" 480 481 // RearPortTemplateTypeLabelTERA4P captures enum value "TERA 4P" 482 RearPortTemplateTypeLabelTERA4P string = "TERA 4P" 483 484 // RearPortTemplateTypeLabelTERA2P captures enum value "TERA 2P" 485 RearPortTemplateTypeLabelTERA2P string = "TERA 2P" 486 487 // RearPortTemplateTypeLabelTERA1P captures enum value "TERA 1P" 488 RearPortTemplateTypeLabelTERA1P string = "TERA 1P" 489 490 // RearPortTemplateTypeLabelNr110Punch captures enum value "110 Punch" 491 RearPortTemplateTypeLabelNr110Punch string = "110 Punch" 492 493 // RearPortTemplateTypeLabelBNC captures enum value "BNC" 494 RearPortTemplateTypeLabelBNC string = "BNC" 495 496 // RearPortTemplateTypeLabelFConnector captures enum value "F Connector" 497 RearPortTemplateTypeLabelFConnector string = "F Connector" 498 499 // RearPortTemplateTypeLabelNConnector captures enum value "N Connector" 500 RearPortTemplateTypeLabelNConnector string = "N Connector" 501 502 // RearPortTemplateTypeLabelMRJ21 captures enum value "MRJ21" 503 RearPortTemplateTypeLabelMRJ21 string = "MRJ21" 504 505 // RearPortTemplateTypeLabelFC captures enum value "FC" 506 RearPortTemplateTypeLabelFC string = "FC" 507 508 // RearPortTemplateTypeLabelLC captures enum value "LC" 509 RearPortTemplateTypeLabelLC string = "LC" 510 511 // RearPortTemplateTypeLabelLCAPC captures enum value "LC/APC" 512 RearPortTemplateTypeLabelLCAPC string = "LC/APC" 513 514 // RearPortTemplateTypeLabelLSH captures enum value "LSH" 515 RearPortTemplateTypeLabelLSH string = "LSH" 516 517 // RearPortTemplateTypeLabelLSHAPC captures enum value "LSH/APC" 518 RearPortTemplateTypeLabelLSHAPC string = "LSH/APC" 519 520 // RearPortTemplateTypeLabelMPO captures enum value "MPO" 521 RearPortTemplateTypeLabelMPO string = "MPO" 522 523 // RearPortTemplateTypeLabelMTRJ captures enum value "MTRJ" 524 RearPortTemplateTypeLabelMTRJ string = "MTRJ" 525 526 // RearPortTemplateTypeLabelSC captures enum value "SC" 527 RearPortTemplateTypeLabelSC string = "SC" 528 529 // RearPortTemplateTypeLabelSCAPC captures enum value "SC/APC" 530 RearPortTemplateTypeLabelSCAPC string = "SC/APC" 531 532 // RearPortTemplateTypeLabelST captures enum value "ST" 533 RearPortTemplateTypeLabelST string = "ST" 534 535 // RearPortTemplateTypeLabelCS captures enum value "CS" 536 RearPortTemplateTypeLabelCS string = "CS" 537 538 // RearPortTemplateTypeLabelSN captures enum value "SN" 539 RearPortTemplateTypeLabelSN string = "SN" 540 541 // RearPortTemplateTypeLabelSplice captures enum value "Splice" 542 RearPortTemplateTypeLabelSplice string = "Splice" 543 ) 544 545 // prop value enum 546 func (m *RearPortTemplateType) validateLabelEnum(path, location string, value string) error { 547 if err := validate.EnumCase(path, location, value, rearPortTemplateTypeTypeLabelPropEnum, true); err != nil { 548 return err 549 } 550 return nil 551 } 552 553 func (m *RearPortTemplateType) validateLabel(formats strfmt.Registry) error { 554 555 if err := validate.Required("type"+"."+"label", "body", m.Label); err != nil { 556 return err 557 } 558 559 // value enum 560 if err := m.validateLabelEnum("type"+"."+"label", "body", *m.Label); err != nil { 561 return err 562 } 563 564 return nil 565 } 566 567 var rearPortTemplateTypeTypeValuePropEnum []interface{} 568 569 func init() { 570 var res []string 571 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 { 572 panic(err) 573 } 574 for _, v := range res { 575 rearPortTemplateTypeTypeValuePropEnum = append(rearPortTemplateTypeTypeValuePropEnum, v) 576 } 577 } 578 579 const ( 580 581 // RearPortTemplateTypeValueNr8p8c captures enum value "8p8c" 582 RearPortTemplateTypeValueNr8p8c string = "8p8c" 583 584 // RearPortTemplateTypeValueNr8p6c captures enum value "8p6c" 585 RearPortTemplateTypeValueNr8p6c string = "8p6c" 586 587 // RearPortTemplateTypeValueNr8p4c captures enum value "8p4c" 588 RearPortTemplateTypeValueNr8p4c string = "8p4c" 589 590 // RearPortTemplateTypeValueNr8p2c captures enum value "8p2c" 591 RearPortTemplateTypeValueNr8p2c string = "8p2c" 592 593 // RearPortTemplateTypeValueNr6p6c captures enum value "6p6c" 594 RearPortTemplateTypeValueNr6p6c string = "6p6c" 595 596 // RearPortTemplateTypeValueNr6p4c captures enum value "6p4c" 597 RearPortTemplateTypeValueNr6p4c string = "6p4c" 598 599 // RearPortTemplateTypeValueNr6p2c captures enum value "6p2c" 600 RearPortTemplateTypeValueNr6p2c string = "6p2c" 601 602 // RearPortTemplateTypeValueNr4p4c captures enum value "4p4c" 603 RearPortTemplateTypeValueNr4p4c string = "4p4c" 604 605 // RearPortTemplateTypeValueNr4p2c captures enum value "4p2c" 606 RearPortTemplateTypeValueNr4p2c string = "4p2c" 607 608 // RearPortTemplateTypeValueGg45 captures enum value "gg45" 609 RearPortTemplateTypeValueGg45 string = "gg45" 610 611 // RearPortTemplateTypeValueTeraDash4p captures enum value "tera-4p" 612 RearPortTemplateTypeValueTeraDash4p string = "tera-4p" 613 614 // RearPortTemplateTypeValueTeraDash2p captures enum value "tera-2p" 615 RearPortTemplateTypeValueTeraDash2p string = "tera-2p" 616 617 // RearPortTemplateTypeValueTeraDash1p captures enum value "tera-1p" 618 RearPortTemplateTypeValueTeraDash1p string = "tera-1p" 619 620 // RearPortTemplateTypeValueNr110DashPunch captures enum value "110-punch" 621 RearPortTemplateTypeValueNr110DashPunch string = "110-punch" 622 623 // RearPortTemplateTypeValueBnc captures enum value "bnc" 624 RearPortTemplateTypeValueBnc string = "bnc" 625 626 // RearPortTemplateTypeValueF captures enum value "f" 627 RearPortTemplateTypeValueF string = "f" 628 629 // RearPortTemplateTypeValueN captures enum value "n" 630 RearPortTemplateTypeValueN string = "n" 631 632 // RearPortTemplateTypeValueMrj21 captures enum value "mrj21" 633 RearPortTemplateTypeValueMrj21 string = "mrj21" 634 635 // RearPortTemplateTypeValueFc captures enum value "fc" 636 RearPortTemplateTypeValueFc string = "fc" 637 638 // RearPortTemplateTypeValueLc captures enum value "lc" 639 RearPortTemplateTypeValueLc string = "lc" 640 641 // RearPortTemplateTypeValueLcDashApc captures enum value "lc-apc" 642 RearPortTemplateTypeValueLcDashApc string = "lc-apc" 643 644 // RearPortTemplateTypeValueLsh captures enum value "lsh" 645 RearPortTemplateTypeValueLsh string = "lsh" 646 647 // RearPortTemplateTypeValueLshDashApc captures enum value "lsh-apc" 648 RearPortTemplateTypeValueLshDashApc string = "lsh-apc" 649 650 // RearPortTemplateTypeValueMpo captures enum value "mpo" 651 RearPortTemplateTypeValueMpo string = "mpo" 652 653 // RearPortTemplateTypeValueMtrj captures enum value "mtrj" 654 RearPortTemplateTypeValueMtrj string = "mtrj" 655 656 // RearPortTemplateTypeValueSc captures enum value "sc" 657 RearPortTemplateTypeValueSc string = "sc" 658 659 // RearPortTemplateTypeValueScDashApc captures enum value "sc-apc" 660 RearPortTemplateTypeValueScDashApc string = "sc-apc" 661 662 // RearPortTemplateTypeValueSt captures enum value "st" 663 RearPortTemplateTypeValueSt string = "st" 664 665 // RearPortTemplateTypeValueCs captures enum value "cs" 666 RearPortTemplateTypeValueCs string = "cs" 667 668 // RearPortTemplateTypeValueSn captures enum value "sn" 669 RearPortTemplateTypeValueSn string = "sn" 670 671 // RearPortTemplateTypeValueSplice captures enum value "splice" 672 RearPortTemplateTypeValueSplice string = "splice" 673 ) 674 675 // prop value enum 676 func (m *RearPortTemplateType) validateValueEnum(path, location string, value string) error { 677 if err := validate.EnumCase(path, location, value, rearPortTemplateTypeTypeValuePropEnum, true); err != nil { 678 return err 679 } 680 return nil 681 } 682 683 func (m *RearPortTemplateType) validateValue(formats strfmt.Registry) error { 684 685 if err := validate.Required("type"+"."+"value", "body", m.Value); err != nil { 686 return err 687 } 688 689 // value enum 690 if err := m.validateValueEnum("type"+"."+"value", "body", *m.Value); err != nil { 691 return err 692 } 693 694 return nil 695 } 696 697 // ContextValidate validates this rear port template type based on context it is used 698 func (m *RearPortTemplateType) ContextValidate(ctx context.Context, formats strfmt.Registry) error { 699 return nil 700 } 701 702 // MarshalBinary interface implementation 703 func (m *RearPortTemplateType) MarshalBinary() ([]byte, error) { 704 if m == nil { 705 return nil, nil 706 } 707 return swag.WriteJSON(m) 708 } 709 710 // UnmarshalBinary interface implementation 711 func (m *RearPortTemplateType) UnmarshalBinary(b []byte) error { 712 var res RearPortTemplateType 713 if err := swag.ReadJSON(b, &res); err != nil { 714 return err 715 } 716 *m = res 717 return nil 718 }