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 | "strconv" |
| 24 | |
| 25 | strfmt "github.com/go-openapi/strfmt" |
| 26 | |
| 27 | "github.com/go-openapi/errors" |
| 28 | "github.com/go-openapi/swag" |
| 29 | ) |
| 30 | |
| 31 | // IPAMVlansListOKBodyResults ipam vlans list o k body results |
| 32 | // swagger:model ipamVlansListOKBodyResults |
| 33 | type IPAMVlansListOKBodyResults []*VLAN |
| 34 | |
| 35 | // Validate validates this ipam vlans list o k body results |
| 36 | func (m IPAMVlansListOKBodyResults) Validate(formats strfmt.Registry) error { |
| 37 | var res []error |
| 38 | |
| 39 | for i := 0; i < len(m); i++ { |
| 40 | |
| 41 | if swag.IsZero(m[i]) { // not required |
| 42 | continue |
| 43 | } |
| 44 | |
| 45 | if m[i] != nil { |
| 46 | |
| 47 | if err := m[i].Validate(formats); err != nil { |
| 48 | if ve, ok := err.(*errors.Validation); ok { |
| 49 | return ve.ValidateName(strconv.Itoa(i)) |
| 50 | } |
| 51 | return err |
| 52 | } |
| 53 | } |
| 54 | |
| 55 | } |
| 56 | |
| 57 | if len(res) > 0 { |
| 58 | return errors.CompositeValidationError(res...) |
| 59 | } |
| 60 | return nil |
| 61 | } |