Skip to content
Snippets Groups Projects
Commit 2b6568db authored by Manuel Kieweg's avatar Manuel Kieweg
Browse files

Merge branch 'yang-openapi' into 'master'

v0.1.0

See merge request cocsn/cocsn-api!2
parents ee8612f6 0d83a0e6
No related branches found
No related tags found
No related merge requests found
Showing
with 1829 additions and 4 deletions
.idea/
...@@ -6,8 +6,8 @@ import ( ...@@ -6,8 +6,8 @@ import (
"log" "log"
"os" "os"
"code.fbi.h-da.de/cocsn/cocsn-api/restapi" "code.fbi.h-da.de/cocsn/cocsn-api/api/restapi"
"code.fbi.h-da.de/cocsn/cocsn-api/restapi/operations" "code.fbi.h-da.de/cocsn/cocsn-api/api/restapi/operations"
"github.com/go-openapi/loads" "github.com/go-openapi/loads"
flags "github.com/jessevdk/go-flags" flags "github.com/jessevdk/go-flags"
) )
...@@ -27,8 +27,8 @@ func main() { ...@@ -27,8 +27,8 @@ func main() {
defer server.Shutdown() defer server.Shutdown()
parser := flags.NewParser(server, flags.Default) parser := flags.NewParser(server, flags.Default)
parser.ShortDescription = "CoCSN" parser.ShortDescription = "cocsn"
parser.LongDescription = "Simple RESTCONF API" parser.LongDescription = "This YANG module represents the CoCSN API"
server.ConfigureFlags() server.ConfigureFlags()
for _, optsGroup := range api.CommandLineOptionsGroups { for _, optsGroup := range api.CommandLineOptionsGroups {
_, err := parser.AddGroup(optsGroup.ShortDescription, optsGroup.LongDescription, optsGroup.Options) _, err := parser.AddGroup(optsGroup.ShortDescription, optsGroup.LongDescription, optsGroup.Options)
......
// Code generated by go-swagger; DO NOT EDIT.
package models
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"github.com/go-openapi/strfmt"
"github.com/go-openapi/swag"
)
// Data data
//
// swagger:model data
type Data struct {
// This resource represents the combined configuration and state data resources that can be accessed by a client and cannot be created or deleted by the client. See RESTCONF RFC 8040 for further information.
IetfRestconfData interface{} `json:"ietf-restconf:data,omitempty"`
}
// Validate validates this data
func (m *Data) Validate(formats strfmt.Registry) error {
return nil
}
// MarshalBinary interface implementation
func (m *Data) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *Data) UnmarshalBinary(b []byte) error {
var res Data
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}
// Code generated by go-swagger; DO NOT EDIT.
package models
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"strconv"
"github.com/go-openapi/errors"
"github.com/go-openapi/strfmt"
"github.com/go-openapi/swag"
)
// DataCocsnArpTable data cocsn arp table
//
// swagger:model data_cocsn_arp-table
type DataCocsnArpTable struct {
// cocsn arp table
CocsnArpTable *DataCocsnArpTableCocsnArpTable `json:"cocsn:arp-table,omitempty"`
}
// Validate validates this data cocsn arp table
func (m *DataCocsnArpTable) Validate(formats strfmt.Registry) error {
var res []error
if err := m.validateCocsnArpTable(formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *DataCocsnArpTable) validateCocsnArpTable(formats strfmt.Registry) error {
if swag.IsZero(m.CocsnArpTable) { // not required
return nil
}
if m.CocsnArpTable != nil {
if err := m.CocsnArpTable.Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("cocsn:arp-table")
}
return err
}
}
return nil
}
// MarshalBinary interface implementation
func (m *DataCocsnArpTable) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *DataCocsnArpTable) UnmarshalBinary(b []byte) error {
var res DataCocsnArpTable
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}
// DataCocsnArpTableCocsnArpTable (non-presence)
//
// swagger:model DataCocsnArpTableCocsnArpTable
type DataCocsnArpTableCocsnArpTable struct {
// (list)
ArpEntry []*DataCocsnArpTableCocsnArpTableArpEntryItems0 `json:"arp-entry"`
}
// Validate validates this data cocsn arp table cocsn arp table
func (m *DataCocsnArpTableCocsnArpTable) Validate(formats strfmt.Registry) error {
var res []error
if err := m.validateArpEntry(formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *DataCocsnArpTableCocsnArpTable) validateArpEntry(formats strfmt.Registry) error {
if swag.IsZero(m.ArpEntry) { // not required
return nil
}
for i := 0; i < len(m.ArpEntry); i++ {
if swag.IsZero(m.ArpEntry[i]) { // not required
continue
}
if m.ArpEntry[i] != nil {
if err := m.ArpEntry[i].Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("cocsn:arp-table" + "." + "arp-entry" + "." + strconv.Itoa(i))
}
return err
}
}
}
return nil
}
// MarshalBinary interface implementation
func (m *DataCocsnArpTableCocsnArpTable) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *DataCocsnArpTableCocsnArpTable) UnmarshalBinary(b []byte) error {
var res DataCocsnArpTableCocsnArpTable
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}
// DataCocsnArpTableCocsnArpTableArpEntryItems0 data cocsn arp table cocsn arp table arp entry items0
//
// swagger:model DataCocsnArpTableCocsnArpTableArpEntryItems0
type DataCocsnArpTableCocsnArpTableArpEntryItems0 struct {
// IP address of the arp entry (leaf)
Address string `json:"address,omitempty"`
// Interface of the arp entry (leaf)
Interface string `json:"interface,omitempty"`
// MAC address of the arp entry (leaf)
PhsAddress string `json:"phs-address,omitempty"`
}
// Validate validates this data cocsn arp table cocsn arp table arp entry items0
func (m *DataCocsnArpTableCocsnArpTableArpEntryItems0) Validate(formats strfmt.Registry) error {
return nil
}
// MarshalBinary interface implementation
func (m *DataCocsnArpTableCocsnArpTableArpEntryItems0) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *DataCocsnArpTableCocsnArpTableArpEntryItems0) UnmarshalBinary(b []byte) error {
var res DataCocsnArpTableCocsnArpTableArpEntryItems0
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}
// Code generated by go-swagger; DO NOT EDIT.
package models
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"strconv"
"github.com/go-openapi/errors"
"github.com/go-openapi/strfmt"
"github.com/go-openapi/swag"
)
// DataCocsnArpTableArpEntry data cocsn arp table arp entry
//
// swagger:model data_cocsn_arp-table_arp-entry
type DataCocsnArpTableArpEntry struct {
// (list)
CocsnArpEntry []*DataCocsnArpTableArpEntryCocsnArpEntryItems0 `json:"cocsn:arp-entry"`
}
// Validate validates this data cocsn arp table arp entry
func (m *DataCocsnArpTableArpEntry) Validate(formats strfmt.Registry) error {
var res []error
if err := m.validateCocsnArpEntry(formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *DataCocsnArpTableArpEntry) validateCocsnArpEntry(formats strfmt.Registry) error {
if swag.IsZero(m.CocsnArpEntry) { // not required
return nil
}
for i := 0; i < len(m.CocsnArpEntry); i++ {
if swag.IsZero(m.CocsnArpEntry[i]) { // not required
continue
}
if m.CocsnArpEntry[i] != nil {
if err := m.CocsnArpEntry[i].Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("cocsn:arp-entry" + "." + strconv.Itoa(i))
}
return err
}
}
}
return nil
}
// MarshalBinary interface implementation
func (m *DataCocsnArpTableArpEntry) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *DataCocsnArpTableArpEntry) UnmarshalBinary(b []byte) error {
var res DataCocsnArpTableArpEntry
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}
// DataCocsnArpTableArpEntryCocsnArpEntryItems0 data cocsn arp table arp entry cocsn arp entry items0
//
// swagger:model DataCocsnArpTableArpEntryCocsnArpEntryItems0
type DataCocsnArpTableArpEntryCocsnArpEntryItems0 struct {
// IP address of the arp entry (leaf)
Address string `json:"address,omitempty"`
// Interface of the arp entry (leaf)
Interface string `json:"interface,omitempty"`
// MAC address of the arp entry (leaf)
PhsAddress string `json:"phs-address,omitempty"`
}
// Validate validates this data cocsn arp table arp entry cocsn arp entry items0
func (m *DataCocsnArpTableArpEntryCocsnArpEntryItems0) Validate(formats strfmt.Registry) error {
return nil
}
// MarshalBinary interface implementation
func (m *DataCocsnArpTableArpEntryCocsnArpEntryItems0) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *DataCocsnArpTableArpEntryCocsnArpEntryItems0) UnmarshalBinary(b []byte) error {
var res DataCocsnArpTableArpEntryCocsnArpEntryItems0
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}
// Code generated by go-swagger; DO NOT EDIT.
package models
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"strconv"
"github.com/go-openapi/errors"
"github.com/go-openapi/strfmt"
"github.com/go-openapi/swag"
)
// DataCocsnArpTableArpEntryArpEntryAddress data cocsn arp table arp entry arp entry address
//
// swagger:model data_cocsn_arp-table_arp-entry_arp-entry-address
type DataCocsnArpTableArpEntryArpEntryAddress struct {
// (list)
CocsnArpEntry []*DataCocsnArpTableArpEntryArpEntryAddressCocsnArpEntryItems0 `json:"cocsn:arp-entry"`
}
// Validate validates this data cocsn arp table arp entry arp entry address
func (m *DataCocsnArpTableArpEntryArpEntryAddress) Validate(formats strfmt.Registry) error {
var res []error
if err := m.validateCocsnArpEntry(formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *DataCocsnArpTableArpEntryArpEntryAddress) validateCocsnArpEntry(formats strfmt.Registry) error {
if swag.IsZero(m.CocsnArpEntry) { // not required
return nil
}
for i := 0; i < len(m.CocsnArpEntry); i++ {
if swag.IsZero(m.CocsnArpEntry[i]) { // not required
continue
}
if m.CocsnArpEntry[i] != nil {
if err := m.CocsnArpEntry[i].Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("cocsn:arp-entry" + "." + strconv.Itoa(i))
}
return err
}
}
}
return nil
}
// MarshalBinary interface implementation
func (m *DataCocsnArpTableArpEntryArpEntryAddress) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *DataCocsnArpTableArpEntryArpEntryAddress) UnmarshalBinary(b []byte) error {
var res DataCocsnArpTableArpEntryArpEntryAddress
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}
// DataCocsnArpTableArpEntryArpEntryAddressCocsnArpEntryItems0 data cocsn arp table arp entry arp entry address cocsn arp entry items0
//
// swagger:model DataCocsnArpTableArpEntryArpEntryAddressCocsnArpEntryItems0
type DataCocsnArpTableArpEntryArpEntryAddressCocsnArpEntryItems0 struct {
// IP address of the arp entry (leaf)
Address string `json:"address,omitempty"`
// Interface of the arp entry (leaf)
Interface string `json:"interface,omitempty"`
// MAC address of the arp entry (leaf)
PhsAddress string `json:"phs-address,omitempty"`
}
// Validate validates this data cocsn arp table arp entry arp entry address cocsn arp entry items0
func (m *DataCocsnArpTableArpEntryArpEntryAddressCocsnArpEntryItems0) Validate(formats strfmt.Registry) error {
return nil
}
// MarshalBinary interface implementation
func (m *DataCocsnArpTableArpEntryArpEntryAddressCocsnArpEntryItems0) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *DataCocsnArpTableArpEntryArpEntryAddressCocsnArpEntryItems0) UnmarshalBinary(b []byte) error {
var res DataCocsnArpTableArpEntryArpEntryAddressCocsnArpEntryItems0
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}
// Code generated by go-swagger; DO NOT EDIT.
package models
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"github.com/go-openapi/strfmt"
"github.com/go-openapi/swag"
)
// DataCocsnArpTableArpEntryArpEntryAddressAddress data cocsn arp table arp entry arp entry address address
//
// swagger:model data_cocsn_arp-table_arp-entry_arp-entry-address_address
type DataCocsnArpTableArpEntryArpEntryAddressAddress struct {
// IP address of the arp entry (leaf)
CocsnAddress string `json:"cocsn:address,omitempty"`
}
// Validate validates this data cocsn arp table arp entry arp entry address address
func (m *DataCocsnArpTableArpEntryArpEntryAddressAddress) Validate(formats strfmt.Registry) error {
return nil
}
// MarshalBinary interface implementation
func (m *DataCocsnArpTableArpEntryArpEntryAddressAddress) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *DataCocsnArpTableArpEntryArpEntryAddressAddress) UnmarshalBinary(b []byte) error {
var res DataCocsnArpTableArpEntryArpEntryAddressAddress
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}
// Code generated by go-swagger; DO NOT EDIT.
package models
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"github.com/go-openapi/strfmt"
"github.com/go-openapi/swag"
)
// DataCocsnArpTableArpEntryArpEntryAddressInterface data cocsn arp table arp entry arp entry address interface
//
// swagger:model data_cocsn_arp-table_arp-entry_arp-entry-address_interface
type DataCocsnArpTableArpEntryArpEntryAddressInterface struct {
// Interface of the arp entry (leaf)
CocsnInterface string `json:"cocsn:interface,omitempty"`
}
// Validate validates this data cocsn arp table arp entry arp entry address interface
func (m *DataCocsnArpTableArpEntryArpEntryAddressInterface) Validate(formats strfmt.Registry) error {
return nil
}
// MarshalBinary interface implementation
func (m *DataCocsnArpTableArpEntryArpEntryAddressInterface) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *DataCocsnArpTableArpEntryArpEntryAddressInterface) UnmarshalBinary(b []byte) error {
var res DataCocsnArpTableArpEntryArpEntryAddressInterface
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}
// Code generated by go-swagger; DO NOT EDIT.
package models
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"github.com/go-openapi/strfmt"
"github.com/go-openapi/swag"
)
// DataCocsnArpTableArpEntryArpEntryAddressPhsAddress data cocsn arp table arp entry arp entry address phs address
//
// swagger:model data_cocsn_arp-table_arp-entry_arp-entry-address_phs-address
type DataCocsnArpTableArpEntryArpEntryAddressPhsAddress struct {
// MAC address of the arp entry (leaf)
CocsnPhsAddress string `json:"cocsn:phs-address,omitempty"`
}
// Validate validates this data cocsn arp table arp entry arp entry address phs address
func (m *DataCocsnArpTableArpEntryArpEntryAddressPhsAddress) Validate(formats strfmt.Registry) error {
return nil
}
// MarshalBinary interface implementation
func (m *DataCocsnArpTableArpEntryArpEntryAddressPhsAddress) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *DataCocsnArpTableArpEntryArpEntryAddressPhsAddress) UnmarshalBinary(b []byte) error {
var res DataCocsnArpTableArpEntryArpEntryAddressPhsAddress
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}
// Code generated by go-swagger; DO NOT EDIT.
package models
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"strconv"
"github.com/go-openapi/errors"
"github.com/go-openapi/strfmt"
"github.com/go-openapi/swag"
)
// DataCocsnArpTablePost data cocsn arp table post
//
// swagger:model data_cocsn_arp-table-post
type DataCocsnArpTablePost struct {
// (list)
CocsnArpEntry []*DataCocsnArpTablePostCocsnArpEntryItems0 `json:"cocsn:arp-entry"`
}
// Validate validates this data cocsn arp table post
func (m *DataCocsnArpTablePost) Validate(formats strfmt.Registry) error {
var res []error
if err := m.validateCocsnArpEntry(formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *DataCocsnArpTablePost) validateCocsnArpEntry(formats strfmt.Registry) error {
if swag.IsZero(m.CocsnArpEntry) { // not required
return nil
}
for i := 0; i < len(m.CocsnArpEntry); i++ {
if swag.IsZero(m.CocsnArpEntry[i]) { // not required
continue
}
if m.CocsnArpEntry[i] != nil {
if err := m.CocsnArpEntry[i].Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("cocsn:arp-entry" + "." + strconv.Itoa(i))
}
return err
}
}
}
return nil
}
// MarshalBinary interface implementation
func (m *DataCocsnArpTablePost) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *DataCocsnArpTablePost) UnmarshalBinary(b []byte) error {
var res DataCocsnArpTablePost
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}
// DataCocsnArpTablePostCocsnArpEntryItems0 data cocsn arp table post cocsn arp entry items0
//
// swagger:model DataCocsnArpTablePostCocsnArpEntryItems0
type DataCocsnArpTablePostCocsnArpEntryItems0 struct {
// IP address of the arp entry (leaf)
Address string `json:"address,omitempty"`
// Interface of the arp entry (leaf)
Interface string `json:"interface,omitempty"`
// MAC address of the arp entry (leaf)
PhsAddress string `json:"phs-address,omitempty"`
}
// Validate validates this data cocsn arp table post cocsn arp entry items0
func (m *DataCocsnArpTablePostCocsnArpEntryItems0) Validate(formats strfmt.Registry) error {
return nil
}
// MarshalBinary interface implementation
func (m *DataCocsnArpTablePostCocsnArpEntryItems0) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *DataCocsnArpTablePostCocsnArpEntryItems0) UnmarshalBinary(b []byte) error {
var res DataCocsnArpTablePostCocsnArpEntryItems0
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}
// Code generated by go-swagger; DO NOT EDIT.
package models
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"encoding/json"
"strconv"
"github.com/go-openapi/errors"
"github.com/go-openapi/strfmt"
"github.com/go-openapi/swag"
"github.com/go-openapi/validate"
)
// DataCocsnInterfaces data cocsn interfaces
//
// swagger:model data_cocsn_interfaces
type DataCocsnInterfaces struct {
// cocsn interfaces
CocsnInterfaces *DataCocsnInterfacesCocsnInterfaces `json:"cocsn:interfaces,omitempty"`
}
// Validate validates this data cocsn interfaces
func (m *DataCocsnInterfaces) Validate(formats strfmt.Registry) error {
var res []error
if err := m.validateCocsnInterfaces(formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *DataCocsnInterfaces) validateCocsnInterfaces(formats strfmt.Registry) error {
if swag.IsZero(m.CocsnInterfaces) { // not required
return nil
}
if m.CocsnInterfaces != nil {
if err := m.CocsnInterfaces.Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("cocsn:interfaces")
}
return err
}
}
return nil
}
// MarshalBinary interface implementation
func (m *DataCocsnInterfaces) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *DataCocsnInterfaces) UnmarshalBinary(b []byte) error {
var res DataCocsnInterfaces
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}
// DataCocsnInterfacesCocsnInterfaces (non-presence)
//
// swagger:model DataCocsnInterfacesCocsnInterfaces
type DataCocsnInterfacesCocsnInterfaces struct {
// (list)
Interface []*DataCocsnInterfacesCocsnInterfacesInterfaceItems0 `json:"interface"`
}
// Validate validates this data cocsn interfaces cocsn interfaces
func (m *DataCocsnInterfacesCocsnInterfaces) Validate(formats strfmt.Registry) error {
var res []error
if err := m.validateInterface(formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *DataCocsnInterfacesCocsnInterfaces) validateInterface(formats strfmt.Registry) error {
if swag.IsZero(m.Interface) { // not required
return nil
}
for i := 0; i < len(m.Interface); i++ {
if swag.IsZero(m.Interface[i]) { // not required
continue
}
if m.Interface[i] != nil {
if err := m.Interface[i].Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("cocsn:interfaces" + "." + "interface" + "." + strconv.Itoa(i))
}
return err
}
}
}
return nil
}
// MarshalBinary interface implementation
func (m *DataCocsnInterfacesCocsnInterfaces) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *DataCocsnInterfacesCocsnInterfaces) UnmarshalBinary(b []byte) error {
var res DataCocsnInterfacesCocsnInterfaces
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}
// DataCocsnInterfacesCocsnInterfacesInterfaceItems0 data cocsn interfaces cocsn interfaces interface items0
//
// swagger:model DataCocsnInterfacesCocsnInterfacesInterfaceItems0
type DataCocsnInterfacesCocsnInterfacesInterfaceItems0 struct {
// addresses
Addresses []string `json:"addresses"`
// Enable or disable the interface. Example value: true (leaf)
Enabled bool `json:"enabled,omitempty"`
// Interface name. Example value: en0 (leaf)
Name string `json:"name,omitempty"`
// Describes whether the interface is physically up or down (leaf)
// Enum: [up down]
OperStatus *string `json:"oper-status,omitempty"`
// The interface's address at its protocol sub-layer. For
// example, for an 802.x interface, this object normally
// contains a Media Access Control (MAC) address. The
// interface's media-specific modules must define the bit
// and byte ordering and the format of the value of this
// object. For interfaces that do not have such an address
// (e.g., a serial line), this node is not present. (leaf)
PhysAddress string `json:"phys-address,omitempty"`
}
// Validate validates this data cocsn interfaces cocsn interfaces interface items0
func (m *DataCocsnInterfacesCocsnInterfacesInterfaceItems0) Validate(formats strfmt.Registry) error {
var res []error
if err := m.validateOperStatus(formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
var dataCocsnInterfacesCocsnInterfacesInterfaceItems0TypeOperStatusPropEnum []interface{}
func init() {
var res []string
if err := json.Unmarshal([]byte(`["up","down"]`), &res); err != nil {
panic(err)
}
for _, v := range res {
dataCocsnInterfacesCocsnInterfacesInterfaceItems0TypeOperStatusPropEnum = append(dataCocsnInterfacesCocsnInterfacesInterfaceItems0TypeOperStatusPropEnum, v)
}
}
const (
// DataCocsnInterfacesCocsnInterfacesInterfaceItems0OperStatusUp captures enum value "up"
DataCocsnInterfacesCocsnInterfacesInterfaceItems0OperStatusUp string = "up"
// DataCocsnInterfacesCocsnInterfacesInterfaceItems0OperStatusDown captures enum value "down"
DataCocsnInterfacesCocsnInterfacesInterfaceItems0OperStatusDown string = "down"
)
// prop value enum
func (m *DataCocsnInterfacesCocsnInterfacesInterfaceItems0) validateOperStatusEnum(path, location string, value string) error {
if err := validate.EnumCase(path, location, value, dataCocsnInterfacesCocsnInterfacesInterfaceItems0TypeOperStatusPropEnum, true); err != nil {
return err
}
return nil
}
func (m *DataCocsnInterfacesCocsnInterfacesInterfaceItems0) validateOperStatus(formats strfmt.Registry) error {
if swag.IsZero(m.OperStatus) { // not required
return nil
}
// value enum
if err := m.validateOperStatusEnum("oper-status", "body", *m.OperStatus); err != nil {
return err
}
return nil
}
// MarshalBinary interface implementation
func (m *DataCocsnInterfacesCocsnInterfacesInterfaceItems0) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *DataCocsnInterfacesCocsnInterfacesInterfaceItems0) UnmarshalBinary(b []byte) error {
var res DataCocsnInterfacesCocsnInterfacesInterfaceItems0
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}
// Code generated by go-swagger; DO NOT EDIT.
package models
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"encoding/json"
"strconv"
"github.com/go-openapi/errors"
"github.com/go-openapi/strfmt"
"github.com/go-openapi/swag"
"github.com/go-openapi/validate"
)
// DataCocsnInterfacesInterface data cocsn interfaces interface
//
// swagger:model data_cocsn_interfaces_interface
type DataCocsnInterfacesInterface struct {
// (list)
CocsnInterface []*DataCocsnInterfacesInterfaceCocsnInterfaceItems0 `json:"cocsn:interface"`
}
// Validate validates this data cocsn interfaces interface
func (m *DataCocsnInterfacesInterface) Validate(formats strfmt.Registry) error {
var res []error
if err := m.validateCocsnInterface(formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *DataCocsnInterfacesInterface) validateCocsnInterface(formats strfmt.Registry) error {
if swag.IsZero(m.CocsnInterface) { // not required
return nil
}
for i := 0; i < len(m.CocsnInterface); i++ {
if swag.IsZero(m.CocsnInterface[i]) { // not required
continue
}
if m.CocsnInterface[i] != nil {
if err := m.CocsnInterface[i].Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("cocsn:interface" + "." + strconv.Itoa(i))
}
return err
}
}
}
return nil
}
// MarshalBinary interface implementation
func (m *DataCocsnInterfacesInterface) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *DataCocsnInterfacesInterface) UnmarshalBinary(b []byte) error {
var res DataCocsnInterfacesInterface
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}
// DataCocsnInterfacesInterfaceCocsnInterfaceItems0 data cocsn interfaces interface cocsn interface items0
//
// swagger:model DataCocsnInterfacesInterfaceCocsnInterfaceItems0
type DataCocsnInterfacesInterfaceCocsnInterfaceItems0 struct {
// addresses
Addresses []string `json:"addresses"`
// Enable or disable the interface. Example value: true (leaf)
Enabled bool `json:"enabled,omitempty"`
// Interface name. Example value: en0 (leaf)
Name string `json:"name,omitempty"`
// Describes whether the interface is physically up or down (leaf)
// Enum: [up down]
OperStatus *string `json:"oper-status,omitempty"`
// The interface's address at its protocol sub-layer. For
// example, for an 802.x interface, this object normally
// contains a Media Access Control (MAC) address. The
// interface's media-specific modules must define the bit
// and byte ordering and the format of the value of this
// object. For interfaces that do not have such an address
// (e.g., a serial line), this node is not present. (leaf)
PhysAddress string `json:"phys-address,omitempty"`
}
// Validate validates this data cocsn interfaces interface cocsn interface items0
func (m *DataCocsnInterfacesInterfaceCocsnInterfaceItems0) Validate(formats strfmt.Registry) error {
var res []error
if err := m.validateOperStatus(formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
var dataCocsnInterfacesInterfaceCocsnInterfaceItems0TypeOperStatusPropEnum []interface{}
func init() {
var res []string
if err := json.Unmarshal([]byte(`["up","down"]`), &res); err != nil {
panic(err)
}
for _, v := range res {
dataCocsnInterfacesInterfaceCocsnInterfaceItems0TypeOperStatusPropEnum = append(dataCocsnInterfacesInterfaceCocsnInterfaceItems0TypeOperStatusPropEnum, v)
}
}
const (
// DataCocsnInterfacesInterfaceCocsnInterfaceItems0OperStatusUp captures enum value "up"
DataCocsnInterfacesInterfaceCocsnInterfaceItems0OperStatusUp string = "up"
// DataCocsnInterfacesInterfaceCocsnInterfaceItems0OperStatusDown captures enum value "down"
DataCocsnInterfacesInterfaceCocsnInterfaceItems0OperStatusDown string = "down"
)
// prop value enum
func (m *DataCocsnInterfacesInterfaceCocsnInterfaceItems0) validateOperStatusEnum(path, location string, value string) error {
if err := validate.EnumCase(path, location, value, dataCocsnInterfacesInterfaceCocsnInterfaceItems0TypeOperStatusPropEnum, true); err != nil {
return err
}
return nil
}
func (m *DataCocsnInterfacesInterfaceCocsnInterfaceItems0) validateOperStatus(formats strfmt.Registry) error {
if swag.IsZero(m.OperStatus) { // not required
return nil
}
// value enum
if err := m.validateOperStatusEnum("oper-status", "body", *m.OperStatus); err != nil {
return err
}
return nil
}
// MarshalBinary interface implementation
func (m *DataCocsnInterfacesInterfaceCocsnInterfaceItems0) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *DataCocsnInterfacesInterfaceCocsnInterfaceItems0) UnmarshalBinary(b []byte) error {
var res DataCocsnInterfacesInterfaceCocsnInterfaceItems0
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}
// Code generated by go-swagger; DO NOT EDIT.
package models
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"encoding/json"
"strconv"
"github.com/go-openapi/errors"
"github.com/go-openapi/strfmt"
"github.com/go-openapi/swag"
"github.com/go-openapi/validate"
)
// DataCocsnInterfacesInterfaceInterfaceName data cocsn interfaces interface interface name
//
// swagger:model data_cocsn_interfaces_interface_interface-name
type DataCocsnInterfacesInterfaceInterfaceName struct {
// (list)
CocsnInterface []*DataCocsnInterfacesInterfaceInterfaceNameCocsnInterfaceItems0 `json:"cocsn:interface"`
}
// Validate validates this data cocsn interfaces interface interface name
func (m *DataCocsnInterfacesInterfaceInterfaceName) Validate(formats strfmt.Registry) error {
var res []error
if err := m.validateCocsnInterface(formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *DataCocsnInterfacesInterfaceInterfaceName) validateCocsnInterface(formats strfmt.Registry) error {
if swag.IsZero(m.CocsnInterface) { // not required
return nil
}
for i := 0; i < len(m.CocsnInterface); i++ {
if swag.IsZero(m.CocsnInterface[i]) { // not required
continue
}
if m.CocsnInterface[i] != nil {
if err := m.CocsnInterface[i].Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("cocsn:interface" + "." + strconv.Itoa(i))
}
return err
}
}
}
return nil
}
// MarshalBinary interface implementation
func (m *DataCocsnInterfacesInterfaceInterfaceName) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *DataCocsnInterfacesInterfaceInterfaceName) UnmarshalBinary(b []byte) error {
var res DataCocsnInterfacesInterfaceInterfaceName
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}
// DataCocsnInterfacesInterfaceInterfaceNameCocsnInterfaceItems0 data cocsn interfaces interface interface name cocsn interface items0
//
// swagger:model DataCocsnInterfacesInterfaceInterfaceNameCocsnInterfaceItems0
type DataCocsnInterfacesInterfaceInterfaceNameCocsnInterfaceItems0 struct {
// addresses
Addresses []string `json:"addresses"`
// Enable or disable the interface. Example value: true (leaf)
Enabled bool `json:"enabled,omitempty"`
// Interface name. Example value: en0 (leaf)
Name string `json:"name,omitempty"`
// Describes whether the interface is physically up or down (leaf)
// Enum: [up down]
OperStatus *string `json:"oper-status,omitempty"`
// The interface's address at its protocol sub-layer. For
// example, for an 802.x interface, this object normally
// contains a Media Access Control (MAC) address. The
// interface's media-specific modules must define the bit
// and byte ordering and the format of the value of this
// object. For interfaces that do not have such an address
// (e.g., a serial line), this node is not present. (leaf)
PhysAddress string `json:"phys-address,omitempty"`
}
// Validate validates this data cocsn interfaces interface interface name cocsn interface items0
func (m *DataCocsnInterfacesInterfaceInterfaceNameCocsnInterfaceItems0) Validate(formats strfmt.Registry) error {
var res []error
if err := m.validateOperStatus(formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
var dataCocsnInterfacesInterfaceInterfaceNameCocsnInterfaceItems0TypeOperStatusPropEnum []interface{}
func init() {
var res []string
if err := json.Unmarshal([]byte(`["up","down"]`), &res); err != nil {
panic(err)
}
for _, v := range res {
dataCocsnInterfacesInterfaceInterfaceNameCocsnInterfaceItems0TypeOperStatusPropEnum = append(dataCocsnInterfacesInterfaceInterfaceNameCocsnInterfaceItems0TypeOperStatusPropEnum, v)
}
}
const (
// DataCocsnInterfacesInterfaceInterfaceNameCocsnInterfaceItems0OperStatusUp captures enum value "up"
DataCocsnInterfacesInterfaceInterfaceNameCocsnInterfaceItems0OperStatusUp string = "up"
// DataCocsnInterfacesInterfaceInterfaceNameCocsnInterfaceItems0OperStatusDown captures enum value "down"
DataCocsnInterfacesInterfaceInterfaceNameCocsnInterfaceItems0OperStatusDown string = "down"
)
// prop value enum
func (m *DataCocsnInterfacesInterfaceInterfaceNameCocsnInterfaceItems0) validateOperStatusEnum(path, location string, value string) error {
if err := validate.EnumCase(path, location, value, dataCocsnInterfacesInterfaceInterfaceNameCocsnInterfaceItems0TypeOperStatusPropEnum, true); err != nil {
return err
}
return nil
}
func (m *DataCocsnInterfacesInterfaceInterfaceNameCocsnInterfaceItems0) validateOperStatus(formats strfmt.Registry) error {
if swag.IsZero(m.OperStatus) { // not required
return nil
}
// value enum
if err := m.validateOperStatusEnum("oper-status", "body", *m.OperStatus); err != nil {
return err
}
return nil
}
// MarshalBinary interface implementation
func (m *DataCocsnInterfacesInterfaceInterfaceNameCocsnInterfaceItems0) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *DataCocsnInterfacesInterfaceInterfaceNameCocsnInterfaceItems0) UnmarshalBinary(b []byte) error {
var res DataCocsnInterfacesInterfaceInterfaceNameCocsnInterfaceItems0
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}
// Code generated by go-swagger; DO NOT EDIT.
package models
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"github.com/go-openapi/strfmt"
"github.com/go-openapi/swag"
)
// DataCocsnInterfacesInterfaceInterfaceNameAddresses data cocsn interfaces interface interface name addresses
//
// swagger:model data_cocsn_interfaces_interface_interface-name_addresses
type DataCocsnInterfacesInterfaceInterfaceNameAddresses struct {
// cocsn addresses
CocsnAddresses []string `json:"cocsn:addresses"`
}
// Validate validates this data cocsn interfaces interface interface name addresses
func (m *DataCocsnInterfacesInterfaceInterfaceNameAddresses) Validate(formats strfmt.Registry) error {
return nil
}
// MarshalBinary interface implementation
func (m *DataCocsnInterfacesInterfaceInterfaceNameAddresses) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *DataCocsnInterfacesInterfaceInterfaceNameAddresses) UnmarshalBinary(b []byte) error {
var res DataCocsnInterfacesInterfaceInterfaceNameAddresses
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}
// Code generated by go-swagger; DO NOT EDIT.
package models
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"github.com/go-openapi/strfmt"
"github.com/go-openapi/swag"
)
// DataCocsnInterfacesInterfaceInterfaceNameAddressesAddressesID data cocsn interfaces interface interface name addresses addresses id
//
// swagger:model data_cocsn_interfaces_interface_interface-name_addresses_addresses-id
type DataCocsnInterfacesInterfaceInterfaceNameAddressesAddressesID struct {
// cocsn addresses
CocsnAddresses []string `json:"cocsn:addresses"`
}
// Validate validates this data cocsn interfaces interface interface name addresses addresses id
func (m *DataCocsnInterfacesInterfaceInterfaceNameAddressesAddressesID) Validate(formats strfmt.Registry) error {
return nil
}
// MarshalBinary interface implementation
func (m *DataCocsnInterfacesInterfaceInterfaceNameAddressesAddressesID) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *DataCocsnInterfacesInterfaceInterfaceNameAddressesAddressesID) UnmarshalBinary(b []byte) error {
var res DataCocsnInterfacesInterfaceInterfaceNameAddressesAddressesID
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}
// Code generated by go-swagger; DO NOT EDIT.
package models
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"github.com/go-openapi/strfmt"
"github.com/go-openapi/swag"
)
// DataCocsnInterfacesInterfaceInterfaceNameEnabled data cocsn interfaces interface interface name enabled
//
// swagger:model data_cocsn_interfaces_interface_interface-name_enabled
type DataCocsnInterfacesInterfaceInterfaceNameEnabled struct {
// Enable or disable the interface. Example value: true (leaf)
CocsnEnabled bool `json:"cocsn:enabled,omitempty"`
}
// Validate validates this data cocsn interfaces interface interface name enabled
func (m *DataCocsnInterfacesInterfaceInterfaceNameEnabled) Validate(formats strfmt.Registry) error {
return nil
}
// MarshalBinary interface implementation
func (m *DataCocsnInterfacesInterfaceInterfaceNameEnabled) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *DataCocsnInterfacesInterfaceInterfaceNameEnabled) UnmarshalBinary(b []byte) error {
var res DataCocsnInterfacesInterfaceInterfaceNameEnabled
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}
// Code generated by go-swagger; DO NOT EDIT.
package models
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"github.com/go-openapi/strfmt"
"github.com/go-openapi/swag"
)
// DataCocsnInterfacesInterfaceInterfaceNameName data cocsn interfaces interface interface name name
//
// swagger:model data_cocsn_interfaces_interface_interface-name_name
type DataCocsnInterfacesInterfaceInterfaceNameName struct {
// Interface name. Example value: en0 (leaf)
CocsnName string `json:"cocsn:name,omitempty"`
}
// Validate validates this data cocsn interfaces interface interface name name
func (m *DataCocsnInterfacesInterfaceInterfaceNameName) Validate(formats strfmt.Registry) error {
return nil
}
// MarshalBinary interface implementation
func (m *DataCocsnInterfacesInterfaceInterfaceNameName) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *DataCocsnInterfacesInterfaceInterfaceNameName) UnmarshalBinary(b []byte) error {
var res DataCocsnInterfacesInterfaceInterfaceNameName
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}
// Code generated by go-swagger; DO NOT EDIT.
package models
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"encoding/json"
"github.com/go-openapi/errors"
"github.com/go-openapi/strfmt"
"github.com/go-openapi/swag"
"github.com/go-openapi/validate"
)
// DataCocsnInterfacesInterfaceInterfaceNameOperStatus data cocsn interfaces interface interface name oper status
//
// swagger:model data_cocsn_interfaces_interface_interface-name_oper-status
type DataCocsnInterfacesInterfaceInterfaceNameOperStatus struct {
// Describes whether the interface is physically up or down (leaf)
// Enum: [up down]
CocsnOperStatus *string `json:"cocsn:oper-status,omitempty"`
}
// Validate validates this data cocsn interfaces interface interface name oper status
func (m *DataCocsnInterfacesInterfaceInterfaceNameOperStatus) Validate(formats strfmt.Registry) error {
var res []error
if err := m.validateCocsnOperStatus(formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
var dataCocsnInterfacesInterfaceInterfaceNameOperStatusTypeCocsnOperStatusPropEnum []interface{}
func init() {
var res []string
if err := json.Unmarshal([]byte(`["up","down"]`), &res); err != nil {
panic(err)
}
for _, v := range res {
dataCocsnInterfacesInterfaceInterfaceNameOperStatusTypeCocsnOperStatusPropEnum = append(dataCocsnInterfacesInterfaceInterfaceNameOperStatusTypeCocsnOperStatusPropEnum, v)
}
}
const (
// DataCocsnInterfacesInterfaceInterfaceNameOperStatusCocsnOperStatusUp captures enum value "up"
DataCocsnInterfacesInterfaceInterfaceNameOperStatusCocsnOperStatusUp string = "up"
// DataCocsnInterfacesInterfaceInterfaceNameOperStatusCocsnOperStatusDown captures enum value "down"
DataCocsnInterfacesInterfaceInterfaceNameOperStatusCocsnOperStatusDown string = "down"
)
// prop value enum
func (m *DataCocsnInterfacesInterfaceInterfaceNameOperStatus) validateCocsnOperStatusEnum(path, location string, value string) error {
if err := validate.EnumCase(path, location, value, dataCocsnInterfacesInterfaceInterfaceNameOperStatusTypeCocsnOperStatusPropEnum, true); err != nil {
return err
}
return nil
}
func (m *DataCocsnInterfacesInterfaceInterfaceNameOperStatus) validateCocsnOperStatus(formats strfmt.Registry) error {
if swag.IsZero(m.CocsnOperStatus) { // not required
return nil
}
// value enum
if err := m.validateCocsnOperStatusEnum("cocsn:oper-status", "body", *m.CocsnOperStatus); err != nil {
return err
}
return nil
}
// MarshalBinary interface implementation
func (m *DataCocsnInterfacesInterfaceInterfaceNameOperStatus) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *DataCocsnInterfacesInterfaceInterfaceNameOperStatus) UnmarshalBinary(b []byte) error {
var res DataCocsnInterfacesInterfaceInterfaceNameOperStatus
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}
// Code generated by go-swagger; DO NOT EDIT.
package models
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"github.com/go-openapi/strfmt"
"github.com/go-openapi/swag"
)
// DataCocsnInterfacesInterfaceInterfaceNamePhysAddress data cocsn interfaces interface interface name phys address
//
// swagger:model data_cocsn_interfaces_interface_interface-name_phys-address
type DataCocsnInterfacesInterfaceInterfaceNamePhysAddress struct {
// The interface's address at its protocol sub-layer. For
// example, for an 802.x interface, this object normally
// contains a Media Access Control (MAC) address. The
// interface's media-specific modules must define the bit
// and byte ordering and the format of the value of this
// object. For interfaces that do not have such an address
// (e.g., a serial line), this node is not present. (leaf)
CocsnPhysAddress string `json:"cocsn:phys-address,omitempty"`
}
// Validate validates this data cocsn interfaces interface interface name phys address
func (m *DataCocsnInterfacesInterfaceInterfaceNamePhysAddress) Validate(formats strfmt.Registry) error {
return nil
}
// MarshalBinary interface implementation
func (m *DataCocsnInterfacesInterfaceInterfaceNamePhysAddress) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *DataCocsnInterfacesInterfaceInterfaceNamePhysAddress) UnmarshalBinary(b []byte) error {
var res DataCocsnInterfacesInterfaceInterfaceNamePhysAddress
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}
// Code generated by go-swagger; DO NOT EDIT.
package models
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"encoding/json"
"strconv"
"github.com/go-openapi/errors"
"github.com/go-openapi/strfmt"
"github.com/go-openapi/swag"
"github.com/go-openapi/validate"
)
// DataCocsnInterfacesPost data cocsn interfaces post
//
// swagger:model data_cocsn_interfaces-post
type DataCocsnInterfacesPost struct {
// (list)
CocsnInterface []*DataCocsnInterfacesPostCocsnInterfaceItems0 `json:"cocsn:interface"`
}
// Validate validates this data cocsn interfaces post
func (m *DataCocsnInterfacesPost) Validate(formats strfmt.Registry) error {
var res []error
if err := m.validateCocsnInterface(formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *DataCocsnInterfacesPost) validateCocsnInterface(formats strfmt.Registry) error {
if swag.IsZero(m.CocsnInterface) { // not required
return nil
}
for i := 0; i < len(m.CocsnInterface); i++ {
if swag.IsZero(m.CocsnInterface[i]) { // not required
continue
}
if m.CocsnInterface[i] != nil {
if err := m.CocsnInterface[i].Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("cocsn:interface" + "." + strconv.Itoa(i))
}
return err
}
}
}
return nil
}
// MarshalBinary interface implementation
func (m *DataCocsnInterfacesPost) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *DataCocsnInterfacesPost) UnmarshalBinary(b []byte) error {
var res DataCocsnInterfacesPost
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}
// DataCocsnInterfacesPostCocsnInterfaceItems0 data cocsn interfaces post cocsn interface items0
//
// swagger:model DataCocsnInterfacesPostCocsnInterfaceItems0
type DataCocsnInterfacesPostCocsnInterfaceItems0 struct {
// addresses
Addresses []string `json:"addresses"`
// Enable or disable the interface. Example value: true (leaf)
Enabled bool `json:"enabled,omitempty"`
// Interface name. Example value: en0 (leaf)
Name string `json:"name,omitempty"`
// Describes whether the interface is physically up or down (leaf)
// Enum: [up down]
OperStatus *string `json:"oper-status,omitempty"`
// The interface's address at its protocol sub-layer. For
// example, for an 802.x interface, this object normally
// contains a Media Access Control (MAC) address. The
// interface's media-specific modules must define the bit
// and byte ordering and the format of the value of this
// object. For interfaces that do not have such an address
// (e.g., a serial line), this node is not present. (leaf)
PhysAddress string `json:"phys-address,omitempty"`
}
// Validate validates this data cocsn interfaces post cocsn interface items0
func (m *DataCocsnInterfacesPostCocsnInterfaceItems0) Validate(formats strfmt.Registry) error {
var res []error
if err := m.validateOperStatus(formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
var dataCocsnInterfacesPostCocsnInterfaceItems0TypeOperStatusPropEnum []interface{}
func init() {
var res []string
if err := json.Unmarshal([]byte(`["up","down"]`), &res); err != nil {
panic(err)
}
for _, v := range res {
dataCocsnInterfacesPostCocsnInterfaceItems0TypeOperStatusPropEnum = append(dataCocsnInterfacesPostCocsnInterfaceItems0TypeOperStatusPropEnum, v)
}
}
const (
// DataCocsnInterfacesPostCocsnInterfaceItems0OperStatusUp captures enum value "up"
DataCocsnInterfacesPostCocsnInterfaceItems0OperStatusUp string = "up"
// DataCocsnInterfacesPostCocsnInterfaceItems0OperStatusDown captures enum value "down"
DataCocsnInterfacesPostCocsnInterfaceItems0OperStatusDown string = "down"
)
// prop value enum
func (m *DataCocsnInterfacesPostCocsnInterfaceItems0) validateOperStatusEnum(path, location string, value string) error {
if err := validate.EnumCase(path, location, value, dataCocsnInterfacesPostCocsnInterfaceItems0TypeOperStatusPropEnum, true); err != nil {
return err
}
return nil
}
func (m *DataCocsnInterfacesPostCocsnInterfaceItems0) validateOperStatus(formats strfmt.Registry) error {
if swag.IsZero(m.OperStatus) { // not required
return nil
}
// value enum
if err := m.validateOperStatusEnum("oper-status", "body", *m.OperStatus); err != nil {
return err
}
return nil
}
// MarshalBinary interface implementation
func (m *DataCocsnInterfacesPostCocsnInterfaceItems0) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *DataCocsnInterfacesPostCocsnInterfaceItems0) UnmarshalBinary(b []byte) error {
var res DataCocsnInterfacesPostCocsnInterfaceItems0
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment