Serge Bazanski | cc25bdf | 2018-10-25 14:02:58 +0200 | [diff] [blame] | 1 | // 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 | |
| 17 | package 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 | |
| 22 | import ( |
| 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 | // VirtualizationInterfacesListOKBody virtualization interfaces list o k body |
| 31 | // swagger:model virtualizationInterfacesListOKBody |
| 32 | type VirtualizationInterfacesListOKBody struct { |
| 33 | |
| 34 | // count |
| 35 | // Required: true |
| 36 | Count *int64 `json:"count"` |
| 37 | |
| 38 | // next |
| 39 | Next *strfmt.URI `json:"next,omitempty"` |
| 40 | |
| 41 | // previous |
| 42 | Previous *strfmt.URI `json:"previous,omitempty"` |
| 43 | |
| 44 | // results |
| 45 | // Required: true |
| 46 | Results VirtualizationInterfacesListOKBodyResults `json:"results"` |
| 47 | } |
| 48 | |
| 49 | // Validate validates this virtualization interfaces list o k body |
| 50 | func (m *VirtualizationInterfacesListOKBody) Validate(formats strfmt.Registry) error { |
| 51 | var res []error |
| 52 | |
| 53 | if err := m.validateCount(formats); err != nil { |
| 54 | // prop |
| 55 | res = append(res, err) |
| 56 | } |
| 57 | |
| 58 | if err := m.validateResults(formats); err != nil { |
| 59 | // prop |
| 60 | res = append(res, err) |
| 61 | } |
| 62 | |
| 63 | if len(res) > 0 { |
| 64 | return errors.CompositeValidationError(res...) |
| 65 | } |
| 66 | return nil |
| 67 | } |
| 68 | |
| 69 | func (m *VirtualizationInterfacesListOKBody) validateCount(formats strfmt.Registry) error { |
| 70 | |
| 71 | if err := validate.Required("count", "body", m.Count); err != nil { |
| 72 | return err |
| 73 | } |
| 74 | |
| 75 | return nil |
| 76 | } |
| 77 | |
| 78 | func (m *VirtualizationInterfacesListOKBody) validateResults(formats strfmt.Registry) error { |
| 79 | |
| 80 | if err := validate.Required("results", "body", m.Results); err != nil { |
| 81 | return err |
| 82 | } |
| 83 | |
| 84 | if err := m.Results.Validate(formats); err != nil { |
| 85 | if ve, ok := err.(*errors.Validation); ok { |
| 86 | return ve.ValidateName("results") |
| 87 | } |
| 88 | return err |
| 89 | } |
| 90 | |
| 91 | return nil |
| 92 | } |
| 93 | |
| 94 | // MarshalBinary interface implementation |
| 95 | func (m *VirtualizationInterfacesListOKBody) MarshalBinary() ([]byte, error) { |
| 96 | if m == nil { |
| 97 | return nil, nil |
| 98 | } |
| 99 | return swag.WriteJSON(m) |
| 100 | } |
| 101 | |
| 102 | // UnmarshalBinary interface implementation |
| 103 | func (m *VirtualizationInterfacesListOKBody) UnmarshalBinary(b []byte) error { |
| 104 | var res VirtualizationInterfacesListOKBody |
| 105 | if err := swag.ReadJSON(b, &res); err != nil { |
| 106 | return err |
| 107 | } |
| 108 | *m = res |
| 109 | return nil |
| 110 | } |