blob: d7c05566dc4fc587dc12c808a8e5f2f0f4e2b2aa [file] [log] [blame]
Serge Bazanskicc25bdf2018-10-25 14:02:58 +02001// Code generated by go-swagger; DO NOT EDIT.
2
3// Copyright 2018 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
17package models
18
19// This file was generated by the swagger tool.
20// Editing this file might prove futile when you re-run the swagger generate command
21
22import (
23 strfmt "github.com/go-openapi/strfmt"
24
25 "github.com/go-openapi/errors"
26 "github.com/go-openapi/swag"
27 "github.com/go-openapi/validate"
28)
29
30// NestedVRF Vrf
31// swagger:model NestedVRF
32type NestedVRF struct {
33
34 // ID
35 // Read Only: true
36 ID int64 `json:"id,omitempty"`
37
38 // Name
39 // Required: true
40 // Max Length: 50
41 Name *string `json:"name"`
42
43 // Route distinguisher
44 // Required: true
45 // Max Length: 21
46 Rd *string `json:"rd"`
47
48 // Url
49 // Read Only: true
50 URL strfmt.URI `json:"url,omitempty"`
51}
52
53// Validate validates this nested v r f
54func (m *NestedVRF) Validate(formats strfmt.Registry) error {
55 var res []error
56
57 if err := m.validateName(formats); err != nil {
58 // prop
59 res = append(res, err)
60 }
61
62 if err := m.validateRd(formats); err != nil {
63 // prop
64 res = append(res, err)
65 }
66
67 if len(res) > 0 {
68 return errors.CompositeValidationError(res...)
69 }
70 return nil
71}
72
73func (m *NestedVRF) validateName(formats strfmt.Registry) error {
74
75 if err := validate.Required("name", "body", m.Name); err != nil {
76 return err
77 }
78
79 if err := validate.MaxLength("name", "body", string(*m.Name), 50); err != nil {
80 return err
81 }
82
83 return nil
84}
85
86func (m *NestedVRF) validateRd(formats strfmt.Registry) error {
87
88 if err := validate.Required("rd", "body", m.Rd); err != nil {
89 return err
90 }
91
92 if err := validate.MaxLength("rd", "body", string(*m.Rd), 21); err != nil {
93 return err
94 }
95
96 return nil
97}
98
99// MarshalBinary interface implementation
100func (m *NestedVRF) MarshalBinary() ([]byte, error) {
101 if m == nil {
102 return nil, nil
103 }
104 return swag.WriteJSON(m)
105}
106
107// UnmarshalBinary interface implementation
108func (m *NestedVRF) UnmarshalBinary(b []byte) error {
109 var res NestedVRF
110 if err := swag.ReadJSON(b, &res); err != nil {
111 return err
112 }
113 *m = res
114 return nil
115}