blob: b4cf100ab647b766e49ffb0db9252a2ee376b25c [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// NestedIPAddress Nat inside
31// swagger:model NestedIPAddress
32type NestedIPAddress struct {
33
34 // Address
35 //
36 // IPv4 or IPv6 address (with mask)
37 // Required: true
38 Address *string `json:"address"`
39
40 // Family
41 // Read Only: true
42 Family int64 `json:"family,omitempty"`
43
44 // ID
45 // Read Only: true
46 ID int64 `json:"id,omitempty"`
47
48 // Url
49 // Read Only: true
50 URL strfmt.URI `json:"url,omitempty"`
51}
52
53// Validate validates this nested IP address
54func (m *NestedIPAddress) Validate(formats strfmt.Registry) error {
55 var res []error
56
57 if err := m.validateAddress(formats); err != nil {
58 // prop
59 res = append(res, err)
60 }
61
62 if len(res) > 0 {
63 return errors.CompositeValidationError(res...)
64 }
65 return nil
66}
67
68func (m *NestedIPAddress) validateAddress(formats strfmt.Registry) error {
69
70 if err := validate.Required("address", "body", m.Address); err != nil {
71 return err
72 }
73
74 return nil
75}
76
77// MarshalBinary interface implementation
78func (m *NestedIPAddress) MarshalBinary() ([]byte, error) {
79 if m == nil {
80 return nil, nil
81 }
82 return swag.WriteJSON(m)
83}
84
85// UnmarshalBinary interface implementation
86func (m *NestedIPAddress) UnmarshalBinary(b []byte) error {
87 var res NestedIPAddress
88 if err := swag.ReadJSON(b, &res); err != nil {
89 return err
90 }
91 *m = res
92 return nil
93}