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