github.com/digitalocean/go-netbox@v0.0.2/netbox/models/interface.go (about)

     1  // Code generated by go-swagger; DO NOT EDIT.
     2  
     3  // Copyright 2020 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  
    18  package models
    19  
    20  // This file was generated by the swagger tool.
    21  // Editing this file might prove futile when you re-run the swagger generate command
    22  
    23  import (
    24  	"context"
    25  	"encoding/json"
    26  	"strconv"
    27  
    28  	"github.com/go-openapi/errors"
    29  	"github.com/go-openapi/strfmt"
    30  	"github.com/go-openapi/swag"
    31  	"github.com/go-openapi/validate"
    32  )
    33  
    34  // Interface interface
    35  //
    36  // swagger:model Interface
    37  type Interface struct {
    38  
    39  	// occupied
    40  	// Read Only: true
    41  	Occupied *bool `json:"_occupied,omitempty"`
    42  
    43  	// cable
    44  	Cable *NestedCable `json:"cable,omitempty"`
    45  
    46  	// Cable peer
    47  	//
    48  	//
    49  	// Return the appropriate serializer for the cable termination model.
    50  	//
    51  	// Read Only: true
    52  	CablePeer map[string]*string `json:"cable_peer,omitempty"`
    53  
    54  	// Cable peer type
    55  	// Read Only: true
    56  	CablePeerType string `json:"cable_peer_type,omitempty"`
    57  
    58  	// Connected endpoint
    59  	//
    60  	//
    61  	// Return the appropriate serializer for the type of connected object.
    62  	//
    63  	// Read Only: true
    64  	ConnectedEndpoint map[string]*string `json:"connected_endpoint,omitempty"`
    65  
    66  	// Connected endpoint reachable
    67  	// Read Only: true
    68  	ConnectedEndpointReachable *bool `json:"connected_endpoint_reachable,omitempty"`
    69  
    70  	// Connected endpoint type
    71  	// Read Only: true
    72  	ConnectedEndpointType string `json:"connected_endpoint_type,omitempty"`
    73  
    74  	// Count ipaddresses
    75  	// Read Only: true
    76  	CountIpaddresses int64 `json:"count_ipaddresses,omitempty"`
    77  
    78  	// Created
    79  	// Read Only: true
    80  	// Format: date
    81  	Created strfmt.Date `json:"created,omitempty"`
    82  
    83  	// Custom fields
    84  	CustomFields interface{} `json:"custom_fields,omitempty"`
    85  
    86  	// Description
    87  	// Max Length: 200
    88  	Description string `json:"description,omitempty"`
    89  
    90  	// device
    91  	// Required: true
    92  	Device *NestedDevice `json:"device"`
    93  
    94  	// Display
    95  	// Read Only: true
    96  	Display string `json:"display,omitempty"`
    97  
    98  	// Enabled
    99  	Enabled bool `json:"enabled,omitempty"`
   100  
   101  	// Id
   102  	// Read Only: true
   103  	ID int64 `json:"id,omitempty"`
   104  
   105  	// Label
   106  	//
   107  	// Physical label
   108  	// Max Length: 64
   109  	Label string `json:"label,omitempty"`
   110  
   111  	// lag
   112  	Lag *NestedInterface `json:"lag,omitempty"`
   113  
   114  	// Last updated
   115  	// Read Only: true
   116  	// Format: date-time
   117  	LastUpdated strfmt.DateTime `json:"last_updated,omitempty"`
   118  
   119  	// MAC Address
   120  	MacAddress *string `json:"mac_address,omitempty"`
   121  
   122  	// Mark connected
   123  	//
   124  	// Treat as if a cable is connected
   125  	MarkConnected bool `json:"mark_connected,omitempty"`
   126  
   127  	// Management only
   128  	//
   129  	// This interface is used only for out-of-band management
   130  	MgmtOnly bool `json:"mgmt_only,omitempty"`
   131  
   132  	// mode
   133  	Mode *InterfaceMode `json:"mode,omitempty"`
   134  
   135  	// MTU
   136  	// Maximum: 65536
   137  	// Minimum: 1
   138  	Mtu *int64 `json:"mtu,omitempty"`
   139  
   140  	// Name
   141  	// Required: true
   142  	// Max Length: 64
   143  	// Min Length: 1
   144  	Name *string `json:"name"`
   145  
   146  	// parent
   147  	Parent *NestedInterface `json:"parent,omitempty"`
   148  
   149  	// tagged vlans
   150  	// Unique: true
   151  	TaggedVlans []*NestedVLAN `json:"tagged_vlans"`
   152  
   153  	// tags
   154  	Tags []*NestedTag `json:"tags"`
   155  
   156  	// type
   157  	// Required: true
   158  	Type *InterfaceType `json:"type"`
   159  
   160  	// untagged vlan
   161  	UntaggedVlan *NestedVLAN `json:"untagged_vlan,omitempty"`
   162  
   163  	// Url
   164  	// Read Only: true
   165  	// Format: uri
   166  	URL strfmt.URI `json:"url,omitempty"`
   167  }
   168  
   169  // Validate validates this interface
   170  func (m *Interface) Validate(formats strfmt.Registry) error {
   171  	var res []error
   172  
   173  	if err := m.validateCable(formats); err != nil {
   174  		res = append(res, err)
   175  	}
   176  
   177  	if err := m.validateCreated(formats); err != nil {
   178  		res = append(res, err)
   179  	}
   180  
   181  	if err := m.validateDescription(formats); err != nil {
   182  		res = append(res, err)
   183  	}
   184  
   185  	if err := m.validateDevice(formats); err != nil {
   186  		res = append(res, err)
   187  	}
   188  
   189  	if err := m.validateLabel(formats); err != nil {
   190  		res = append(res, err)
   191  	}
   192  
   193  	if err := m.validateLag(formats); err != nil {
   194  		res = append(res, err)
   195  	}
   196  
   197  	if err := m.validateLastUpdated(formats); err != nil {
   198  		res = append(res, err)
   199  	}
   200  
   201  	if err := m.validateMode(formats); err != nil {
   202  		res = append(res, err)
   203  	}
   204  
   205  	if err := m.validateMtu(formats); err != nil {
   206  		res = append(res, err)
   207  	}
   208  
   209  	if err := m.validateName(formats); err != nil {
   210  		res = append(res, err)
   211  	}
   212  
   213  	if err := m.validateParent(formats); err != nil {
   214  		res = append(res, err)
   215  	}
   216  
   217  	if err := m.validateTaggedVlans(formats); err != nil {
   218  		res = append(res, err)
   219  	}
   220  
   221  	if err := m.validateTags(formats); err != nil {
   222  		res = append(res, err)
   223  	}
   224  
   225  	if err := m.validateType(formats); err != nil {
   226  		res = append(res, err)
   227  	}
   228  
   229  	if err := m.validateUntaggedVlan(formats); err != nil {
   230  		res = append(res, err)
   231  	}
   232  
   233  	if err := m.validateURL(formats); err != nil {
   234  		res = append(res, err)
   235  	}
   236  
   237  	if len(res) > 0 {
   238  		return errors.CompositeValidationError(res...)
   239  	}
   240  	return nil
   241  }
   242  
   243  func (m *Interface) validateCable(formats strfmt.Registry) error {
   244  	if swag.IsZero(m.Cable) { // not required
   245  		return nil
   246  	}
   247  
   248  	if m.Cable != nil {
   249  		if err := m.Cable.Validate(formats); err != nil {
   250  			if ve, ok := err.(*errors.Validation); ok {
   251  				return ve.ValidateName("cable")
   252  			} else if ce, ok := err.(*errors.CompositeError); ok {
   253  				return ce.ValidateName("cable")
   254  			}
   255  			return err
   256  		}
   257  	}
   258  
   259  	return nil
   260  }
   261  
   262  func (m *Interface) validateCreated(formats strfmt.Registry) error {
   263  	if swag.IsZero(m.Created) { // not required
   264  		return nil
   265  	}
   266  
   267  	if err := validate.FormatOf("created", "body", "date", m.Created.String(), formats); err != nil {
   268  		return err
   269  	}
   270  
   271  	return nil
   272  }
   273  
   274  func (m *Interface) validateDescription(formats strfmt.Registry) error {
   275  	if swag.IsZero(m.Description) { // not required
   276  		return nil
   277  	}
   278  
   279  	if err := validate.MaxLength("description", "body", m.Description, 200); err != nil {
   280  		return err
   281  	}
   282  
   283  	return nil
   284  }
   285  
   286  func (m *Interface) validateDevice(formats strfmt.Registry) error {
   287  
   288  	if err := validate.Required("device", "body", m.Device); err != nil {
   289  		return err
   290  	}
   291  
   292  	if m.Device != nil {
   293  		if err := m.Device.Validate(formats); err != nil {
   294  			if ve, ok := err.(*errors.Validation); ok {
   295  				return ve.ValidateName("device")
   296  			} else if ce, ok := err.(*errors.CompositeError); ok {
   297  				return ce.ValidateName("device")
   298  			}
   299  			return err
   300  		}
   301  	}
   302  
   303  	return nil
   304  }
   305  
   306  func (m *Interface) validateLabel(formats strfmt.Registry) error {
   307  	if swag.IsZero(m.Label) { // not required
   308  		return nil
   309  	}
   310  
   311  	if err := validate.MaxLength("label", "body", m.Label, 64); err != nil {
   312  		return err
   313  	}
   314  
   315  	return nil
   316  }
   317  
   318  func (m *Interface) validateLag(formats strfmt.Registry) error {
   319  	if swag.IsZero(m.Lag) { // not required
   320  		return nil
   321  	}
   322  
   323  	if m.Lag != nil {
   324  		if err := m.Lag.Validate(formats); err != nil {
   325  			if ve, ok := err.(*errors.Validation); ok {
   326  				return ve.ValidateName("lag")
   327  			} else if ce, ok := err.(*errors.CompositeError); ok {
   328  				return ce.ValidateName("lag")
   329  			}
   330  			return err
   331  		}
   332  	}
   333  
   334  	return nil
   335  }
   336  
   337  func (m *Interface) validateLastUpdated(formats strfmt.Registry) error {
   338  	if swag.IsZero(m.LastUpdated) { // not required
   339  		return nil
   340  	}
   341  
   342  	if err := validate.FormatOf("last_updated", "body", "date-time", m.LastUpdated.String(), formats); err != nil {
   343  		return err
   344  	}
   345  
   346  	return nil
   347  }
   348  
   349  func (m *Interface) validateMode(formats strfmt.Registry) error {
   350  	if swag.IsZero(m.Mode) { // not required
   351  		return nil
   352  	}
   353  
   354  	if m.Mode != nil {
   355  		if err := m.Mode.Validate(formats); err != nil {
   356  			if ve, ok := err.(*errors.Validation); ok {
   357  				return ve.ValidateName("mode")
   358  			} else if ce, ok := err.(*errors.CompositeError); ok {
   359  				return ce.ValidateName("mode")
   360  			}
   361  			return err
   362  		}
   363  	}
   364  
   365  	return nil
   366  }
   367  
   368  func (m *Interface) validateMtu(formats strfmt.Registry) error {
   369  	if swag.IsZero(m.Mtu) { // not required
   370  		return nil
   371  	}
   372  
   373  	if err := validate.MinimumInt("mtu", "body", *m.Mtu, 1, false); err != nil {
   374  		return err
   375  	}
   376  
   377  	if err := validate.MaximumInt("mtu", "body", *m.Mtu, 65536, false); err != nil {
   378  		return err
   379  	}
   380  
   381  	return nil
   382  }
   383  
   384  func (m *Interface) validateName(formats strfmt.Registry) error {
   385  
   386  	if err := validate.Required("name", "body", m.Name); err != nil {
   387  		return err
   388  	}
   389  
   390  	if err := validate.MinLength("name", "body", *m.Name, 1); err != nil {
   391  		return err
   392  	}
   393  
   394  	if err := validate.MaxLength("name", "body", *m.Name, 64); err != nil {
   395  		return err
   396  	}
   397  
   398  	return nil
   399  }
   400  
   401  func (m *Interface) validateParent(formats strfmt.Registry) error {
   402  	if swag.IsZero(m.Parent) { // not required
   403  		return nil
   404  	}
   405  
   406  	if m.Parent != nil {
   407  		if err := m.Parent.Validate(formats); err != nil {
   408  			if ve, ok := err.(*errors.Validation); ok {
   409  				return ve.ValidateName("parent")
   410  			} else if ce, ok := err.(*errors.CompositeError); ok {
   411  				return ce.ValidateName("parent")
   412  			}
   413  			return err
   414  		}
   415  	}
   416  
   417  	return nil
   418  }
   419  
   420  func (m *Interface) validateTaggedVlans(formats strfmt.Registry) error {
   421  	if swag.IsZero(m.TaggedVlans) { // not required
   422  		return nil
   423  	}
   424  
   425  	if err := validate.UniqueItems("tagged_vlans", "body", m.TaggedVlans); err != nil {
   426  		return err
   427  	}
   428  
   429  	for i := 0; i < len(m.TaggedVlans); i++ {
   430  		if swag.IsZero(m.TaggedVlans[i]) { // not required
   431  			continue
   432  		}
   433  
   434  		if m.TaggedVlans[i] != nil {
   435  			if err := m.TaggedVlans[i].Validate(formats); err != nil {
   436  				if ve, ok := err.(*errors.Validation); ok {
   437  					return ve.ValidateName("tagged_vlans" + "." + strconv.Itoa(i))
   438  				} else if ce, ok := err.(*errors.CompositeError); ok {
   439  					return ce.ValidateName("tagged_vlans" + "." + strconv.Itoa(i))
   440  				}
   441  				return err
   442  			}
   443  		}
   444  
   445  	}
   446  
   447  	return nil
   448  }
   449  
   450  func (m *Interface) validateTags(formats strfmt.Registry) error {
   451  	if swag.IsZero(m.Tags) { // not required
   452  		return nil
   453  	}
   454  
   455  	for i := 0; i < len(m.Tags); i++ {
   456  		if swag.IsZero(m.Tags[i]) { // not required
   457  			continue
   458  		}
   459  
   460  		if m.Tags[i] != nil {
   461  			if err := m.Tags[i].Validate(formats); err != nil {
   462  				if ve, ok := err.(*errors.Validation); ok {
   463  					return ve.ValidateName("tags" + "." + strconv.Itoa(i))
   464  				} else if ce, ok := err.(*errors.CompositeError); ok {
   465  					return ce.ValidateName("tags" + "." + strconv.Itoa(i))
   466  				}
   467  				return err
   468  			}
   469  		}
   470  
   471  	}
   472  
   473  	return nil
   474  }
   475  
   476  func (m *Interface) validateType(formats strfmt.Registry) error {
   477  
   478  	if err := validate.Required("type", "body", m.Type); err != nil {
   479  		return err
   480  	}
   481  
   482  	if m.Type != nil {
   483  		if err := m.Type.Validate(formats); err != nil {
   484  			if ve, ok := err.(*errors.Validation); ok {
   485  				return ve.ValidateName("type")
   486  			} else if ce, ok := err.(*errors.CompositeError); ok {
   487  				return ce.ValidateName("type")
   488  			}
   489  			return err
   490  		}
   491  	}
   492  
   493  	return nil
   494  }
   495  
   496  func (m *Interface) validateUntaggedVlan(formats strfmt.Registry) error {
   497  	if swag.IsZero(m.UntaggedVlan) { // not required
   498  		return nil
   499  	}
   500  
   501  	if m.UntaggedVlan != nil {
   502  		if err := m.UntaggedVlan.Validate(formats); err != nil {
   503  			if ve, ok := err.(*errors.Validation); ok {
   504  				return ve.ValidateName("untagged_vlan")
   505  			} else if ce, ok := err.(*errors.CompositeError); ok {
   506  				return ce.ValidateName("untagged_vlan")
   507  			}
   508  			return err
   509  		}
   510  	}
   511  
   512  	return nil
   513  }
   514  
   515  func (m *Interface) validateURL(formats strfmt.Registry) error {
   516  	if swag.IsZero(m.URL) { // not required
   517  		return nil
   518  	}
   519  
   520  	if err := validate.FormatOf("url", "body", "uri", m.URL.String(), formats); err != nil {
   521  		return err
   522  	}
   523  
   524  	return nil
   525  }
   526  
   527  // ContextValidate validate this interface based on the context it is used
   528  func (m *Interface) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
   529  	var res []error
   530  
   531  	if err := m.contextValidateOccupied(ctx, formats); err != nil {
   532  		res = append(res, err)
   533  	}
   534  
   535  	if err := m.contextValidateCable(ctx, formats); err != nil {
   536  		res = append(res, err)
   537  	}
   538  
   539  	if err := m.contextValidateCablePeer(ctx, formats); err != nil {
   540  		res = append(res, err)
   541  	}
   542  
   543  	if err := m.contextValidateCablePeerType(ctx, formats); err != nil {
   544  		res = append(res, err)
   545  	}
   546  
   547  	if err := m.contextValidateConnectedEndpoint(ctx, formats); err != nil {
   548  		res = append(res, err)
   549  	}
   550  
   551  	if err := m.contextValidateConnectedEndpointReachable(ctx, formats); err != nil {
   552  		res = append(res, err)
   553  	}
   554  
   555  	if err := m.contextValidateConnectedEndpointType(ctx, formats); err != nil {
   556  		res = append(res, err)
   557  	}
   558  
   559  	if err := m.contextValidateCountIpaddresses(ctx, formats); err != nil {
   560  		res = append(res, err)
   561  	}
   562  
   563  	if err := m.contextValidateCreated(ctx, formats); err != nil {
   564  		res = append(res, err)
   565  	}
   566  
   567  	if err := m.contextValidateDevice(ctx, formats); err != nil {
   568  		res = append(res, err)
   569  	}
   570  
   571  	if err := m.contextValidateDisplay(ctx, formats); err != nil {
   572  		res = append(res, err)
   573  	}
   574  
   575  	if err := m.contextValidateID(ctx, formats); err != nil {
   576  		res = append(res, err)
   577  	}
   578  
   579  	if err := m.contextValidateLag(ctx, formats); err != nil {
   580  		res = append(res, err)
   581  	}
   582  
   583  	if err := m.contextValidateLastUpdated(ctx, formats); err != nil {
   584  		res = append(res, err)
   585  	}
   586  
   587  	if err := m.contextValidateMode(ctx, formats); err != nil {
   588  		res = append(res, err)
   589  	}
   590  
   591  	if err := m.contextValidateParent(ctx, formats); err != nil {
   592  		res = append(res, err)
   593  	}
   594  
   595  	if err := m.contextValidateTaggedVlans(ctx, formats); err != nil {
   596  		res = append(res, err)
   597  	}
   598  
   599  	if err := m.contextValidateTags(ctx, formats); err != nil {
   600  		res = append(res, err)
   601  	}
   602  
   603  	if err := m.contextValidateType(ctx, formats); err != nil {
   604  		res = append(res, err)
   605  	}
   606  
   607  	if err := m.contextValidateUntaggedVlan(ctx, formats); err != nil {
   608  		res = append(res, err)
   609  	}
   610  
   611  	if err := m.contextValidateURL(ctx, formats); err != nil {
   612  		res = append(res, err)
   613  	}
   614  
   615  	if len(res) > 0 {
   616  		return errors.CompositeValidationError(res...)
   617  	}
   618  	return nil
   619  }
   620  
   621  func (m *Interface) contextValidateOccupied(ctx context.Context, formats strfmt.Registry) error {
   622  
   623  	if err := validate.ReadOnly(ctx, "_occupied", "body", m.Occupied); err != nil {
   624  		return err
   625  	}
   626  
   627  	return nil
   628  }
   629  
   630  func (m *Interface) contextValidateCable(ctx context.Context, formats strfmt.Registry) error {
   631  
   632  	if m.Cable != nil {
   633  		if err := m.Cable.ContextValidate(ctx, formats); err != nil {
   634  			if ve, ok := err.(*errors.Validation); ok {
   635  				return ve.ValidateName("cable")
   636  			} else if ce, ok := err.(*errors.CompositeError); ok {
   637  				return ce.ValidateName("cable")
   638  			}
   639  			return err
   640  		}
   641  	}
   642  
   643  	return nil
   644  }
   645  
   646  func (m *Interface) contextValidateCablePeer(ctx context.Context, formats strfmt.Registry) error {
   647  
   648  	return nil
   649  }
   650  
   651  func (m *Interface) contextValidateCablePeerType(ctx context.Context, formats strfmt.Registry) error {
   652  
   653  	if err := validate.ReadOnly(ctx, "cable_peer_type", "body", string(m.CablePeerType)); err != nil {
   654  		return err
   655  	}
   656  
   657  	return nil
   658  }
   659  
   660  func (m *Interface) contextValidateConnectedEndpoint(ctx context.Context, formats strfmt.Registry) error {
   661  
   662  	return nil
   663  }
   664  
   665  func (m *Interface) contextValidateConnectedEndpointReachable(ctx context.Context, formats strfmt.Registry) error {
   666  
   667  	if err := validate.ReadOnly(ctx, "connected_endpoint_reachable", "body", m.ConnectedEndpointReachable); err != nil {
   668  		return err
   669  	}
   670  
   671  	return nil
   672  }
   673  
   674  func (m *Interface) contextValidateConnectedEndpointType(ctx context.Context, formats strfmt.Registry) error {
   675  
   676  	if err := validate.ReadOnly(ctx, "connected_endpoint_type", "body", string(m.ConnectedEndpointType)); err != nil {
   677  		return err
   678  	}
   679  
   680  	return nil
   681  }
   682  
   683  func (m *Interface) contextValidateCountIpaddresses(ctx context.Context, formats strfmt.Registry) error {
   684  
   685  	if err := validate.ReadOnly(ctx, "count_ipaddresses", "body", int64(m.CountIpaddresses)); err != nil {
   686  		return err
   687  	}
   688  
   689  	return nil
   690  }
   691  
   692  func (m *Interface) contextValidateCreated(ctx context.Context, formats strfmt.Registry) error {
   693  
   694  	if err := validate.ReadOnly(ctx, "created", "body", strfmt.Date(m.Created)); err != nil {
   695  		return err
   696  	}
   697  
   698  	return nil
   699  }
   700  
   701  func (m *Interface) contextValidateDevice(ctx context.Context, formats strfmt.Registry) error {
   702  
   703  	if m.Device != nil {
   704  		if err := m.Device.ContextValidate(ctx, formats); err != nil {
   705  			if ve, ok := err.(*errors.Validation); ok {
   706  				return ve.ValidateName("device")
   707  			} else if ce, ok := err.(*errors.CompositeError); ok {
   708  				return ce.ValidateName("device")
   709  			}
   710  			return err
   711  		}
   712  	}
   713  
   714  	return nil
   715  }
   716  
   717  func (m *Interface) contextValidateDisplay(ctx context.Context, formats strfmt.Registry) error {
   718  
   719  	if err := validate.ReadOnly(ctx, "display", "body", string(m.Display)); err != nil {
   720  		return err
   721  	}
   722  
   723  	return nil
   724  }
   725  
   726  func (m *Interface) contextValidateID(ctx context.Context, formats strfmt.Registry) error {
   727  
   728  	if err := validate.ReadOnly(ctx, "id", "body", int64(m.ID)); err != nil {
   729  		return err
   730  	}
   731  
   732  	return nil
   733  }
   734  
   735  func (m *Interface) contextValidateLag(ctx context.Context, formats strfmt.Registry) error {
   736  
   737  	if m.Lag != nil {
   738  		if err := m.Lag.ContextValidate(ctx, formats); err != nil {
   739  			if ve, ok := err.(*errors.Validation); ok {
   740  				return ve.ValidateName("lag")
   741  			} else if ce, ok := err.(*errors.CompositeError); ok {
   742  				return ce.ValidateName("lag")
   743  			}
   744  			return err
   745  		}
   746  	}
   747  
   748  	return nil
   749  }
   750  
   751  func (m *Interface) contextValidateLastUpdated(ctx context.Context, formats strfmt.Registry) error {
   752  
   753  	if err := validate.ReadOnly(ctx, "last_updated", "body", strfmt.DateTime(m.LastUpdated)); err != nil {
   754  		return err
   755  	}
   756  
   757  	return nil
   758  }
   759  
   760  func (m *Interface) contextValidateMode(ctx context.Context, formats strfmt.Registry) error {
   761  
   762  	if m.Mode != nil {
   763  		if err := m.Mode.ContextValidate(ctx, formats); err != nil {
   764  			if ve, ok := err.(*errors.Validation); ok {
   765  				return ve.ValidateName("mode")
   766  			} else if ce, ok := err.(*errors.CompositeError); ok {
   767  				return ce.ValidateName("mode")
   768  			}
   769  			return err
   770  		}
   771  	}
   772  
   773  	return nil
   774  }
   775  
   776  func (m *Interface) contextValidateParent(ctx context.Context, formats strfmt.Registry) error {
   777  
   778  	if m.Parent != nil {
   779  		if err := m.Parent.ContextValidate(ctx, formats); err != nil {
   780  			if ve, ok := err.(*errors.Validation); ok {
   781  				return ve.ValidateName("parent")
   782  			} else if ce, ok := err.(*errors.CompositeError); ok {
   783  				return ce.ValidateName("parent")
   784  			}
   785  			return err
   786  		}
   787  	}
   788  
   789  	return nil
   790  }
   791  
   792  func (m *Interface) contextValidateTaggedVlans(ctx context.Context, formats strfmt.Registry) error {
   793  
   794  	for i := 0; i < len(m.TaggedVlans); i++ {
   795  
   796  		if m.TaggedVlans[i] != nil {
   797  			if err := m.TaggedVlans[i].ContextValidate(ctx, formats); err != nil {
   798  				if ve, ok := err.(*errors.Validation); ok {
   799  					return ve.ValidateName("tagged_vlans" + "." + strconv.Itoa(i))
   800  				} else if ce, ok := err.(*errors.CompositeError); ok {
   801  					return ce.ValidateName("tagged_vlans" + "." + strconv.Itoa(i))
   802  				}
   803  				return err
   804  			}
   805  		}
   806  
   807  	}
   808  
   809  	return nil
   810  }
   811  
   812  func (m *Interface) contextValidateTags(ctx context.Context, formats strfmt.Registry) error {
   813  
   814  	for i := 0; i < len(m.Tags); i++ {
   815  
   816  		if m.Tags[i] != nil {
   817  			if err := m.Tags[i].ContextValidate(ctx, formats); err != nil {
   818  				if ve, ok := err.(*errors.Validation); ok {
   819  					return ve.ValidateName("tags" + "." + strconv.Itoa(i))
   820  				} else if ce, ok := err.(*errors.CompositeError); ok {
   821  					return ce.ValidateName("tags" + "." + strconv.Itoa(i))
   822  				}
   823  				return err
   824  			}
   825  		}
   826  
   827  	}
   828  
   829  	return nil
   830  }
   831  
   832  func (m *Interface) contextValidateType(ctx context.Context, formats strfmt.Registry) error {
   833  
   834  	if m.Type != nil {
   835  		if err := m.Type.ContextValidate(ctx, formats); err != nil {
   836  			if ve, ok := err.(*errors.Validation); ok {
   837  				return ve.ValidateName("type")
   838  			} else if ce, ok := err.(*errors.CompositeError); ok {
   839  				return ce.ValidateName("type")
   840  			}
   841  			return err
   842  		}
   843  	}
   844  
   845  	return nil
   846  }
   847  
   848  func (m *Interface) contextValidateUntaggedVlan(ctx context.Context, formats strfmt.Registry) error {
   849  
   850  	if m.UntaggedVlan != nil {
   851  		if err := m.UntaggedVlan.ContextValidate(ctx, formats); err != nil {
   852  			if ve, ok := err.(*errors.Validation); ok {
   853  				return ve.ValidateName("untagged_vlan")
   854  			} else if ce, ok := err.(*errors.CompositeError); ok {
   855  				return ce.ValidateName("untagged_vlan")
   856  			}
   857  			return err
   858  		}
   859  	}
   860  
   861  	return nil
   862  }
   863  
   864  func (m *Interface) contextValidateURL(ctx context.Context, formats strfmt.Registry) error {
   865  
   866  	if err := validate.ReadOnly(ctx, "url", "body", strfmt.URI(m.URL)); err != nil {
   867  		return err
   868  	}
   869  
   870  	return nil
   871  }
   872  
   873  // MarshalBinary interface implementation
   874  func (m *Interface) MarshalBinary() ([]byte, error) {
   875  	if m == nil {
   876  		return nil, nil
   877  	}
   878  	return swag.WriteJSON(m)
   879  }
   880  
   881  // UnmarshalBinary interface implementation
   882  func (m *Interface) UnmarshalBinary(b []byte) error {
   883  	var res Interface
   884  	if err := swag.ReadJSON(b, &res); err != nil {
   885  		return err
   886  	}
   887  	*m = res
   888  	return nil
   889  }
   890  
   891  // InterfaceMode Mode
   892  //
   893  // swagger:model InterfaceMode
   894  type InterfaceMode struct {
   895  
   896  	// label
   897  	// Required: true
   898  	// Enum: [Access Tagged Tagged (All)]
   899  	Label *string `json:"label"`
   900  
   901  	// value
   902  	// Required: true
   903  	// Enum: [access tagged tagged-all]
   904  	Value *string `json:"value"`
   905  }
   906  
   907  // Validate validates this interface mode
   908  func (m *InterfaceMode) Validate(formats strfmt.Registry) error {
   909  	var res []error
   910  
   911  	if err := m.validateLabel(formats); err != nil {
   912  		res = append(res, err)
   913  	}
   914  
   915  	if err := m.validateValue(formats); err != nil {
   916  		res = append(res, err)
   917  	}
   918  
   919  	if len(res) > 0 {
   920  		return errors.CompositeValidationError(res...)
   921  	}
   922  	return nil
   923  }
   924  
   925  var interfaceModeTypeLabelPropEnum []interface{}
   926  
   927  func init() {
   928  	var res []string
   929  	if err := json.Unmarshal([]byte(`["Access","Tagged","Tagged (All)"]`), &res); err != nil {
   930  		panic(err)
   931  	}
   932  	for _, v := range res {
   933  		interfaceModeTypeLabelPropEnum = append(interfaceModeTypeLabelPropEnum, v)
   934  	}
   935  }
   936  
   937  const (
   938  
   939  	// InterfaceModeLabelAccess captures enum value "Access"
   940  	InterfaceModeLabelAccess string = "Access"
   941  
   942  	// InterfaceModeLabelTagged captures enum value "Tagged"
   943  	InterfaceModeLabelTagged string = "Tagged"
   944  
   945  	// InterfaceModeLabelTaggedAll captures enum value "Tagged (All)"
   946  	InterfaceModeLabelTaggedAll string = "Tagged (All)"
   947  )
   948  
   949  // prop value enum
   950  func (m *InterfaceMode) validateLabelEnum(path, location string, value string) error {
   951  	if err := validate.EnumCase(path, location, value, interfaceModeTypeLabelPropEnum, true); err != nil {
   952  		return err
   953  	}
   954  	return nil
   955  }
   956  
   957  func (m *InterfaceMode) validateLabel(formats strfmt.Registry) error {
   958  
   959  	if err := validate.Required("mode"+"."+"label", "body", m.Label); err != nil {
   960  		return err
   961  	}
   962  
   963  	// value enum
   964  	if err := m.validateLabelEnum("mode"+"."+"label", "body", *m.Label); err != nil {
   965  		return err
   966  	}
   967  
   968  	return nil
   969  }
   970  
   971  var interfaceModeTypeValuePropEnum []interface{}
   972  
   973  func init() {
   974  	var res []string
   975  	if err := json.Unmarshal([]byte(`["access","tagged","tagged-all"]`), &res); err != nil {
   976  		panic(err)
   977  	}
   978  	for _, v := range res {
   979  		interfaceModeTypeValuePropEnum = append(interfaceModeTypeValuePropEnum, v)
   980  	}
   981  }
   982  
   983  const (
   984  
   985  	// InterfaceModeValueAccess captures enum value "access"
   986  	InterfaceModeValueAccess string = "access"
   987  
   988  	// InterfaceModeValueTagged captures enum value "tagged"
   989  	InterfaceModeValueTagged string = "tagged"
   990  
   991  	// InterfaceModeValueTaggedDashAll captures enum value "tagged-all"
   992  	InterfaceModeValueTaggedDashAll string = "tagged-all"
   993  )
   994  
   995  // prop value enum
   996  func (m *InterfaceMode) validateValueEnum(path, location string, value string) error {
   997  	if err := validate.EnumCase(path, location, value, interfaceModeTypeValuePropEnum, true); err != nil {
   998  		return err
   999  	}
  1000  	return nil
  1001  }
  1002  
  1003  func (m *InterfaceMode) validateValue(formats strfmt.Registry) error {
  1004  
  1005  	if err := validate.Required("mode"+"."+"value", "body", m.Value); err != nil {
  1006  		return err
  1007  	}
  1008  
  1009  	// value enum
  1010  	if err := m.validateValueEnum("mode"+"."+"value", "body", *m.Value); err != nil {
  1011  		return err
  1012  	}
  1013  
  1014  	return nil
  1015  }
  1016  
  1017  // ContextValidate validates this interface mode based on context it is used
  1018  func (m *InterfaceMode) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
  1019  	return nil
  1020  }
  1021  
  1022  // MarshalBinary interface implementation
  1023  func (m *InterfaceMode) MarshalBinary() ([]byte, error) {
  1024  	if m == nil {
  1025  		return nil, nil
  1026  	}
  1027  	return swag.WriteJSON(m)
  1028  }
  1029  
  1030  // UnmarshalBinary interface implementation
  1031  func (m *InterfaceMode) UnmarshalBinary(b []byte) error {
  1032  	var res InterfaceMode
  1033  	if err := swag.ReadJSON(b, &res); err != nil {
  1034  		return err
  1035  	}
  1036  	*m = res
  1037  	return nil
  1038  }
  1039  
  1040  // InterfaceType Type
  1041  //
  1042  // swagger:model InterfaceType
  1043  type InterfaceType struct {
  1044  
  1045  	// label
  1046  	// Required: true
  1047  	// Enum: [Virtual Link Aggregation Group (LAG) 100BASE-TX (10/100ME) 1000BASE-T (1GE) 2.5GBASE-T (2.5GE) 5GBASE-T (5GE) 10GBASE-T (10GE) 10GBASE-CX4 (10GE) GBIC (1GE) SFP (1GE) SFP+ (10GE) XFP (10GE) XENPAK (10GE) X2 (10GE) SFP28 (25GE) SFP56 (50GE) QSFP+ (40GE) QSFP28 (50GE) CFP (100GE) CFP2 (100GE) CFP2 (200GE) CFP4 (100GE) Cisco CPAK (100GE) QSFP28 (100GE) QSFP56 (200GE) QSFP-DD (400GE) OSFP (400GE) IEEE 802.11a IEEE 802.11b/g IEEE 802.11n IEEE 802.11ac IEEE 802.11ad IEEE 802.11ax GSM CDMA LTE OC-3/STM-1 OC-12/STM-4 OC-48/STM-16 OC-192/STM-64 OC-768/STM-256 OC-1920/STM-640 OC-3840/STM-1234 SFP (1GFC) SFP (2GFC) SFP (4GFC) SFP+ (8GFC) SFP+ (16GFC) SFP28 (32GFC) QSFP+ (64GFC) QSFP28 (128GFC) SDR (2 Gbps) DDR (4 Gbps) QDR (8 Gbps) FDR10 (10 Gbps) FDR (13.5 Gbps) EDR (25 Gbps) HDR (50 Gbps) NDR (100 Gbps) XDR (250 Gbps) T1 (1.544 Mbps) E1 (2.048 Mbps) T3 (45 Mbps) E3 (34 Mbps) Cisco StackWise Cisco StackWise Plus Cisco FlexStack Cisco FlexStack Plus Juniper VCP Extreme SummitStack Extreme SummitStack-128 Extreme SummitStack-256 Extreme SummitStack-512 Other]
  1048  	Label *string `json:"label"`
  1049  
  1050  	// value
  1051  	// Required: true
  1052  	// Enum: [virtual lag 100base-tx 1000base-t 2.5gbase-t 5gbase-t 10gbase-t 10gbase-cx4 1000base-x-gbic 1000base-x-sfp 10gbase-x-sfpp 10gbase-x-xfp 10gbase-x-xenpak 10gbase-x-x2 25gbase-x-sfp28 50gbase-x-sfp56 40gbase-x-qsfpp 50gbase-x-sfp28 100gbase-x-cfp 100gbase-x-cfp2 200gbase-x-cfp2 100gbase-x-cfp4 100gbase-x-cpak 100gbase-x-qsfp28 200gbase-x-qsfp56 400gbase-x-qsfpdd 400gbase-x-osfp ieee802.11a ieee802.11g ieee802.11n ieee802.11ac ieee802.11ad ieee802.11ax gsm cdma lte sonet-oc3 sonet-oc12 sonet-oc48 sonet-oc192 sonet-oc768 sonet-oc1920 sonet-oc3840 1gfc-sfp 2gfc-sfp 4gfc-sfp 8gfc-sfpp 16gfc-sfpp 32gfc-sfp28 64gfc-qsfpp 128gfc-sfp28 infiniband-sdr infiniband-ddr infiniband-qdr infiniband-fdr10 infiniband-fdr infiniband-edr infiniband-hdr infiniband-ndr infiniband-xdr t1 e1 t3 e3 cisco-stackwise cisco-stackwise-plus cisco-flexstack cisco-flexstack-plus juniper-vcp extreme-summitstack extreme-summitstack-128 extreme-summitstack-256 extreme-summitstack-512 other]
  1053  	Value *string `json:"value"`
  1054  }
  1055  
  1056  // Validate validates this interface type
  1057  func (m *InterfaceType) Validate(formats strfmt.Registry) error {
  1058  	var res []error
  1059  
  1060  	if err := m.validateLabel(formats); err != nil {
  1061  		res = append(res, err)
  1062  	}
  1063  
  1064  	if err := m.validateValue(formats); err != nil {
  1065  		res = append(res, err)
  1066  	}
  1067  
  1068  	if len(res) > 0 {
  1069  		return errors.CompositeValidationError(res...)
  1070  	}
  1071  	return nil
  1072  }
  1073  
  1074  var interfaceTypeTypeLabelPropEnum []interface{}
  1075  
  1076  func init() {
  1077  	var res []string
  1078  	if err := json.Unmarshal([]byte(`["Virtual","Link Aggregation Group (LAG)","100BASE-TX (10/100ME)","1000BASE-T (1GE)","2.5GBASE-T (2.5GE)","5GBASE-T (5GE)","10GBASE-T (10GE)","10GBASE-CX4 (10GE)","GBIC (1GE)","SFP (1GE)","SFP+ (10GE)","XFP (10GE)","XENPAK (10GE)","X2 (10GE)","SFP28 (25GE)","SFP56 (50GE)","QSFP+ (40GE)","QSFP28 (50GE)","CFP (100GE)","CFP2 (100GE)","CFP2 (200GE)","CFP4 (100GE)","Cisco CPAK (100GE)","QSFP28 (100GE)","QSFP56 (200GE)","QSFP-DD (400GE)","OSFP (400GE)","IEEE 802.11a","IEEE 802.11b/g","IEEE 802.11n","IEEE 802.11ac","IEEE 802.11ad","IEEE 802.11ax","GSM","CDMA","LTE","OC-3/STM-1","OC-12/STM-4","OC-48/STM-16","OC-192/STM-64","OC-768/STM-256","OC-1920/STM-640","OC-3840/STM-1234","SFP (1GFC)","SFP (2GFC)","SFP (4GFC)","SFP+ (8GFC)","SFP+ (16GFC)","SFP28 (32GFC)","QSFP+ (64GFC)","QSFP28 (128GFC)","SDR (2 Gbps)","DDR (4 Gbps)","QDR (8 Gbps)","FDR10 (10 Gbps)","FDR (13.5 Gbps)","EDR (25 Gbps)","HDR (50 Gbps)","NDR (100 Gbps)","XDR (250 Gbps)","T1 (1.544 Mbps)","E1 (2.048 Mbps)","T3 (45 Mbps)","E3 (34 Mbps)","Cisco StackWise","Cisco StackWise Plus","Cisco FlexStack","Cisco FlexStack Plus","Juniper VCP","Extreme SummitStack","Extreme SummitStack-128","Extreme SummitStack-256","Extreme SummitStack-512","Other"]`), &res); err != nil {
  1079  		panic(err)
  1080  	}
  1081  	for _, v := range res {
  1082  		interfaceTypeTypeLabelPropEnum = append(interfaceTypeTypeLabelPropEnum, v)
  1083  	}
  1084  }
  1085  
  1086  const (
  1087  
  1088  	// InterfaceTypeLabelVirtual captures enum value "Virtual"
  1089  	InterfaceTypeLabelVirtual string = "Virtual"
  1090  
  1091  	// InterfaceTypeLabelLinkAggregationGroupLAG captures enum value "Link Aggregation Group (LAG)"
  1092  	InterfaceTypeLabelLinkAggregationGroupLAG string = "Link Aggregation Group (LAG)"
  1093  
  1094  	// InterfaceTypeLabelNr100BASEDashTX10100ME captures enum value "100BASE-TX (10/100ME)"
  1095  	InterfaceTypeLabelNr100BASEDashTX10100ME string = "100BASE-TX (10/100ME)"
  1096  
  1097  	// InterfaceTypeLabelNr1000BASEDashT1GE captures enum value "1000BASE-T (1GE)"
  1098  	InterfaceTypeLabelNr1000BASEDashT1GE string = "1000BASE-T (1GE)"
  1099  
  1100  	// InterfaceTypeLabelNr2Dot5GBASEDashT2Dot5GE captures enum value "2.5GBASE-T (2.5GE)"
  1101  	InterfaceTypeLabelNr2Dot5GBASEDashT2Dot5GE string = "2.5GBASE-T (2.5GE)"
  1102  
  1103  	// InterfaceTypeLabelNr5GBASEDashT5GE captures enum value "5GBASE-T (5GE)"
  1104  	InterfaceTypeLabelNr5GBASEDashT5GE string = "5GBASE-T (5GE)"
  1105  
  1106  	// InterfaceTypeLabelNr10GBASEDashT10GE captures enum value "10GBASE-T (10GE)"
  1107  	InterfaceTypeLabelNr10GBASEDashT10GE string = "10GBASE-T (10GE)"
  1108  
  1109  	// InterfaceTypeLabelNr10GBASEDashCX410GE captures enum value "10GBASE-CX4 (10GE)"
  1110  	InterfaceTypeLabelNr10GBASEDashCX410GE string = "10GBASE-CX4 (10GE)"
  1111  
  1112  	// InterfaceTypeLabelGBIC1GE captures enum value "GBIC (1GE)"
  1113  	InterfaceTypeLabelGBIC1GE string = "GBIC (1GE)"
  1114  
  1115  	// InterfaceTypeLabelSFP1GE captures enum value "SFP (1GE)"
  1116  	InterfaceTypeLabelSFP1GE string = "SFP (1GE)"
  1117  
  1118  	// InterfaceTypeLabelSFPPlus10GE captures enum value "SFP+ (10GE)"
  1119  	InterfaceTypeLabelSFPPlus10GE string = "SFP+ (10GE)"
  1120  
  1121  	// InterfaceTypeLabelXFP10GE captures enum value "XFP (10GE)"
  1122  	InterfaceTypeLabelXFP10GE string = "XFP (10GE)"
  1123  
  1124  	// InterfaceTypeLabelXENPAK10GE captures enum value "XENPAK (10GE)"
  1125  	InterfaceTypeLabelXENPAK10GE string = "XENPAK (10GE)"
  1126  
  1127  	// InterfaceTypeLabelX210GE captures enum value "X2 (10GE)"
  1128  	InterfaceTypeLabelX210GE string = "X2 (10GE)"
  1129  
  1130  	// InterfaceTypeLabelSFP2825GE captures enum value "SFP28 (25GE)"
  1131  	InterfaceTypeLabelSFP2825GE string = "SFP28 (25GE)"
  1132  
  1133  	// InterfaceTypeLabelSFP5650GE captures enum value "SFP56 (50GE)"
  1134  	InterfaceTypeLabelSFP5650GE string = "SFP56 (50GE)"
  1135  
  1136  	// InterfaceTypeLabelQSFPPlus40GE captures enum value "QSFP+ (40GE)"
  1137  	InterfaceTypeLabelQSFPPlus40GE string = "QSFP+ (40GE)"
  1138  
  1139  	// InterfaceTypeLabelQSFP2850GE captures enum value "QSFP28 (50GE)"
  1140  	InterfaceTypeLabelQSFP2850GE string = "QSFP28 (50GE)"
  1141  
  1142  	// InterfaceTypeLabelCFP100GE captures enum value "CFP (100GE)"
  1143  	InterfaceTypeLabelCFP100GE string = "CFP (100GE)"
  1144  
  1145  	// InterfaceTypeLabelCFP2100GE captures enum value "CFP2 (100GE)"
  1146  	InterfaceTypeLabelCFP2100GE string = "CFP2 (100GE)"
  1147  
  1148  	// InterfaceTypeLabelCFP2200GE captures enum value "CFP2 (200GE)"
  1149  	InterfaceTypeLabelCFP2200GE string = "CFP2 (200GE)"
  1150  
  1151  	// InterfaceTypeLabelCFP4100GE captures enum value "CFP4 (100GE)"
  1152  	InterfaceTypeLabelCFP4100GE string = "CFP4 (100GE)"
  1153  
  1154  	// InterfaceTypeLabelCiscoCPAK100GE captures enum value "Cisco CPAK (100GE)"
  1155  	InterfaceTypeLabelCiscoCPAK100GE string = "Cisco CPAK (100GE)"
  1156  
  1157  	// InterfaceTypeLabelQSFP28100GE captures enum value "QSFP28 (100GE)"
  1158  	InterfaceTypeLabelQSFP28100GE string = "QSFP28 (100GE)"
  1159  
  1160  	// InterfaceTypeLabelQSFP56200GE captures enum value "QSFP56 (200GE)"
  1161  	InterfaceTypeLabelQSFP56200GE string = "QSFP56 (200GE)"
  1162  
  1163  	// InterfaceTypeLabelQSFPDashDD400GE captures enum value "QSFP-DD (400GE)"
  1164  	InterfaceTypeLabelQSFPDashDD400GE string = "QSFP-DD (400GE)"
  1165  
  1166  	// InterfaceTypeLabelOSFP400GE captures enum value "OSFP (400GE)"
  1167  	InterfaceTypeLabelOSFP400GE string = "OSFP (400GE)"
  1168  
  1169  	// InterfaceTypeLabelIEEE802Dot11a captures enum value "IEEE 802.11a"
  1170  	InterfaceTypeLabelIEEE802Dot11a string = "IEEE 802.11a"
  1171  
  1172  	// InterfaceTypeLabelIEEE802Dot11bg captures enum value "IEEE 802.11b/g"
  1173  	InterfaceTypeLabelIEEE802Dot11bg string = "IEEE 802.11b/g"
  1174  
  1175  	// InterfaceTypeLabelIEEE802Dot11n captures enum value "IEEE 802.11n"
  1176  	InterfaceTypeLabelIEEE802Dot11n string = "IEEE 802.11n"
  1177  
  1178  	// InterfaceTypeLabelIEEE802Dot11ac captures enum value "IEEE 802.11ac"
  1179  	InterfaceTypeLabelIEEE802Dot11ac string = "IEEE 802.11ac"
  1180  
  1181  	// InterfaceTypeLabelIEEE802Dot11ad captures enum value "IEEE 802.11ad"
  1182  	InterfaceTypeLabelIEEE802Dot11ad string = "IEEE 802.11ad"
  1183  
  1184  	// InterfaceTypeLabelIEEE802Dot11ax captures enum value "IEEE 802.11ax"
  1185  	InterfaceTypeLabelIEEE802Dot11ax string = "IEEE 802.11ax"
  1186  
  1187  	// InterfaceTypeLabelGSM captures enum value "GSM"
  1188  	InterfaceTypeLabelGSM string = "GSM"
  1189  
  1190  	// InterfaceTypeLabelCDMA captures enum value "CDMA"
  1191  	InterfaceTypeLabelCDMA string = "CDMA"
  1192  
  1193  	// InterfaceTypeLabelLTE captures enum value "LTE"
  1194  	InterfaceTypeLabelLTE string = "LTE"
  1195  
  1196  	// InterfaceTypeLabelOCDash3STMDash1 captures enum value "OC-3/STM-1"
  1197  	InterfaceTypeLabelOCDash3STMDash1 string = "OC-3/STM-1"
  1198  
  1199  	// InterfaceTypeLabelOCDash12STMDash4 captures enum value "OC-12/STM-4"
  1200  	InterfaceTypeLabelOCDash12STMDash4 string = "OC-12/STM-4"
  1201  
  1202  	// InterfaceTypeLabelOCDash48STMDash16 captures enum value "OC-48/STM-16"
  1203  	InterfaceTypeLabelOCDash48STMDash16 string = "OC-48/STM-16"
  1204  
  1205  	// InterfaceTypeLabelOCDash192STMDash64 captures enum value "OC-192/STM-64"
  1206  	InterfaceTypeLabelOCDash192STMDash64 string = "OC-192/STM-64"
  1207  
  1208  	// InterfaceTypeLabelOCDash768STMDash256 captures enum value "OC-768/STM-256"
  1209  	InterfaceTypeLabelOCDash768STMDash256 string = "OC-768/STM-256"
  1210  
  1211  	// InterfaceTypeLabelOCDash1920STMDash640 captures enum value "OC-1920/STM-640"
  1212  	InterfaceTypeLabelOCDash1920STMDash640 string = "OC-1920/STM-640"
  1213  
  1214  	// InterfaceTypeLabelOCDash3840STMDash1234 captures enum value "OC-3840/STM-1234"
  1215  	InterfaceTypeLabelOCDash3840STMDash1234 string = "OC-3840/STM-1234"
  1216  
  1217  	// InterfaceTypeLabelSFP1GFC captures enum value "SFP (1GFC)"
  1218  	InterfaceTypeLabelSFP1GFC string = "SFP (1GFC)"
  1219  
  1220  	// InterfaceTypeLabelSFP2GFC captures enum value "SFP (2GFC)"
  1221  	InterfaceTypeLabelSFP2GFC string = "SFP (2GFC)"
  1222  
  1223  	// InterfaceTypeLabelSFP4GFC captures enum value "SFP (4GFC)"
  1224  	InterfaceTypeLabelSFP4GFC string = "SFP (4GFC)"
  1225  
  1226  	// InterfaceTypeLabelSFPPlus8GFC captures enum value "SFP+ (8GFC)"
  1227  	InterfaceTypeLabelSFPPlus8GFC string = "SFP+ (8GFC)"
  1228  
  1229  	// InterfaceTypeLabelSFPPlus16GFC captures enum value "SFP+ (16GFC)"
  1230  	InterfaceTypeLabelSFPPlus16GFC string = "SFP+ (16GFC)"
  1231  
  1232  	// InterfaceTypeLabelSFP2832GFC captures enum value "SFP28 (32GFC)"
  1233  	InterfaceTypeLabelSFP2832GFC string = "SFP28 (32GFC)"
  1234  
  1235  	// InterfaceTypeLabelQSFPPlus64GFC captures enum value "QSFP+ (64GFC)"
  1236  	InterfaceTypeLabelQSFPPlus64GFC string = "QSFP+ (64GFC)"
  1237  
  1238  	// InterfaceTypeLabelQSFP28128GFC captures enum value "QSFP28 (128GFC)"
  1239  	InterfaceTypeLabelQSFP28128GFC string = "QSFP28 (128GFC)"
  1240  
  1241  	// InterfaceTypeLabelSDR2Gbps captures enum value "SDR (2 Gbps)"
  1242  	InterfaceTypeLabelSDR2Gbps string = "SDR (2 Gbps)"
  1243  
  1244  	// InterfaceTypeLabelDDR4Gbps captures enum value "DDR (4 Gbps)"
  1245  	InterfaceTypeLabelDDR4Gbps string = "DDR (4 Gbps)"
  1246  
  1247  	// InterfaceTypeLabelQDR8Gbps captures enum value "QDR (8 Gbps)"
  1248  	InterfaceTypeLabelQDR8Gbps string = "QDR (8 Gbps)"
  1249  
  1250  	// InterfaceTypeLabelFDR1010Gbps captures enum value "FDR10 (10 Gbps)"
  1251  	InterfaceTypeLabelFDR1010Gbps string = "FDR10 (10 Gbps)"
  1252  
  1253  	// InterfaceTypeLabelFDR13Dot5Gbps captures enum value "FDR (13.5 Gbps)"
  1254  	InterfaceTypeLabelFDR13Dot5Gbps string = "FDR (13.5 Gbps)"
  1255  
  1256  	// InterfaceTypeLabelEDR25Gbps captures enum value "EDR (25 Gbps)"
  1257  	InterfaceTypeLabelEDR25Gbps string = "EDR (25 Gbps)"
  1258  
  1259  	// InterfaceTypeLabelHDR50Gbps captures enum value "HDR (50 Gbps)"
  1260  	InterfaceTypeLabelHDR50Gbps string = "HDR (50 Gbps)"
  1261  
  1262  	// InterfaceTypeLabelNDR100Gbps captures enum value "NDR (100 Gbps)"
  1263  	InterfaceTypeLabelNDR100Gbps string = "NDR (100 Gbps)"
  1264  
  1265  	// InterfaceTypeLabelXDR250Gbps captures enum value "XDR (250 Gbps)"
  1266  	InterfaceTypeLabelXDR250Gbps string = "XDR (250 Gbps)"
  1267  
  1268  	// InterfaceTypeLabelT11Dot544Mbps captures enum value "T1 (1.544 Mbps)"
  1269  	InterfaceTypeLabelT11Dot544Mbps string = "T1 (1.544 Mbps)"
  1270  
  1271  	// InterfaceTypeLabelE12Dot048Mbps captures enum value "E1 (2.048 Mbps)"
  1272  	InterfaceTypeLabelE12Dot048Mbps string = "E1 (2.048 Mbps)"
  1273  
  1274  	// InterfaceTypeLabelT345Mbps captures enum value "T3 (45 Mbps)"
  1275  	InterfaceTypeLabelT345Mbps string = "T3 (45 Mbps)"
  1276  
  1277  	// InterfaceTypeLabelE334Mbps captures enum value "E3 (34 Mbps)"
  1278  	InterfaceTypeLabelE334Mbps string = "E3 (34 Mbps)"
  1279  
  1280  	// InterfaceTypeLabelCiscoStackWise captures enum value "Cisco StackWise"
  1281  	InterfaceTypeLabelCiscoStackWise string = "Cisco StackWise"
  1282  
  1283  	// InterfaceTypeLabelCiscoStackWisePlus captures enum value "Cisco StackWise Plus"
  1284  	InterfaceTypeLabelCiscoStackWisePlus string = "Cisco StackWise Plus"
  1285  
  1286  	// InterfaceTypeLabelCiscoFlexStack captures enum value "Cisco FlexStack"
  1287  	InterfaceTypeLabelCiscoFlexStack string = "Cisco FlexStack"
  1288  
  1289  	// InterfaceTypeLabelCiscoFlexStackPlus captures enum value "Cisco FlexStack Plus"
  1290  	InterfaceTypeLabelCiscoFlexStackPlus string = "Cisco FlexStack Plus"
  1291  
  1292  	// InterfaceTypeLabelJuniperVCP captures enum value "Juniper VCP"
  1293  	InterfaceTypeLabelJuniperVCP string = "Juniper VCP"
  1294  
  1295  	// InterfaceTypeLabelExtremeSummitStack captures enum value "Extreme SummitStack"
  1296  	InterfaceTypeLabelExtremeSummitStack string = "Extreme SummitStack"
  1297  
  1298  	// InterfaceTypeLabelExtremeSummitStackDash128 captures enum value "Extreme SummitStack-128"
  1299  	InterfaceTypeLabelExtremeSummitStackDash128 string = "Extreme SummitStack-128"
  1300  
  1301  	// InterfaceTypeLabelExtremeSummitStackDash256 captures enum value "Extreme SummitStack-256"
  1302  	InterfaceTypeLabelExtremeSummitStackDash256 string = "Extreme SummitStack-256"
  1303  
  1304  	// InterfaceTypeLabelExtremeSummitStackDash512 captures enum value "Extreme SummitStack-512"
  1305  	InterfaceTypeLabelExtremeSummitStackDash512 string = "Extreme SummitStack-512"
  1306  
  1307  	// InterfaceTypeLabelOther captures enum value "Other"
  1308  	InterfaceTypeLabelOther string = "Other"
  1309  )
  1310  
  1311  // prop value enum
  1312  func (m *InterfaceType) validateLabelEnum(path, location string, value string) error {
  1313  	if err := validate.EnumCase(path, location, value, interfaceTypeTypeLabelPropEnum, true); err != nil {
  1314  		return err
  1315  	}
  1316  	return nil
  1317  }
  1318  
  1319  func (m *InterfaceType) validateLabel(formats strfmt.Registry) error {
  1320  
  1321  	if err := validate.Required("type"+"."+"label", "body", m.Label); err != nil {
  1322  		return err
  1323  	}
  1324  
  1325  	// value enum
  1326  	if err := m.validateLabelEnum("type"+"."+"label", "body", *m.Label); err != nil {
  1327  		return err
  1328  	}
  1329  
  1330  	return nil
  1331  }
  1332  
  1333  var interfaceTypeTypeValuePropEnum []interface{}
  1334  
  1335  func init() {
  1336  	var res []string
  1337  	if err := json.Unmarshal([]byte(`["virtual","lag","100base-tx","1000base-t","2.5gbase-t","5gbase-t","10gbase-t","10gbase-cx4","1000base-x-gbic","1000base-x-sfp","10gbase-x-sfpp","10gbase-x-xfp","10gbase-x-xenpak","10gbase-x-x2","25gbase-x-sfp28","50gbase-x-sfp56","40gbase-x-qsfpp","50gbase-x-sfp28","100gbase-x-cfp","100gbase-x-cfp2","200gbase-x-cfp2","100gbase-x-cfp4","100gbase-x-cpak","100gbase-x-qsfp28","200gbase-x-qsfp56","400gbase-x-qsfpdd","400gbase-x-osfp","ieee802.11a","ieee802.11g","ieee802.11n","ieee802.11ac","ieee802.11ad","ieee802.11ax","gsm","cdma","lte","sonet-oc3","sonet-oc12","sonet-oc48","sonet-oc192","sonet-oc768","sonet-oc1920","sonet-oc3840","1gfc-sfp","2gfc-sfp","4gfc-sfp","8gfc-sfpp","16gfc-sfpp","32gfc-sfp28","64gfc-qsfpp","128gfc-sfp28","infiniband-sdr","infiniband-ddr","infiniband-qdr","infiniband-fdr10","infiniband-fdr","infiniband-edr","infiniband-hdr","infiniband-ndr","infiniband-xdr","t1","e1","t3","e3","cisco-stackwise","cisco-stackwise-plus","cisco-flexstack","cisco-flexstack-plus","juniper-vcp","extreme-summitstack","extreme-summitstack-128","extreme-summitstack-256","extreme-summitstack-512","other"]`), &res); err != nil {
  1338  		panic(err)
  1339  	}
  1340  	for _, v := range res {
  1341  		interfaceTypeTypeValuePropEnum = append(interfaceTypeTypeValuePropEnum, v)
  1342  	}
  1343  }
  1344  
  1345  const (
  1346  
  1347  	// InterfaceTypeValueVirtual captures enum value "virtual"
  1348  	InterfaceTypeValueVirtual string = "virtual"
  1349  
  1350  	// InterfaceTypeValueLag captures enum value "lag"
  1351  	InterfaceTypeValueLag string = "lag"
  1352  
  1353  	// InterfaceTypeValueNr100baseDashTx captures enum value "100base-tx"
  1354  	InterfaceTypeValueNr100baseDashTx string = "100base-tx"
  1355  
  1356  	// InterfaceTypeValueNr1000baseDasht captures enum value "1000base-t"
  1357  	InterfaceTypeValueNr1000baseDasht string = "1000base-t"
  1358  
  1359  	// InterfaceTypeValueNr2Dot5gbaseDasht captures enum value "2.5gbase-t"
  1360  	InterfaceTypeValueNr2Dot5gbaseDasht string = "2.5gbase-t"
  1361  
  1362  	// InterfaceTypeValueNr5gbaseDasht captures enum value "5gbase-t"
  1363  	InterfaceTypeValueNr5gbaseDasht string = "5gbase-t"
  1364  
  1365  	// InterfaceTypeValueNr10gbaseDasht captures enum value "10gbase-t"
  1366  	InterfaceTypeValueNr10gbaseDasht string = "10gbase-t"
  1367  
  1368  	// InterfaceTypeValueNr10gbaseDashCx4 captures enum value "10gbase-cx4"
  1369  	InterfaceTypeValueNr10gbaseDashCx4 string = "10gbase-cx4"
  1370  
  1371  	// InterfaceTypeValueNr1000baseDashxDashGbic captures enum value "1000base-x-gbic"
  1372  	InterfaceTypeValueNr1000baseDashxDashGbic string = "1000base-x-gbic"
  1373  
  1374  	// InterfaceTypeValueNr1000baseDashxDashSfp captures enum value "1000base-x-sfp"
  1375  	InterfaceTypeValueNr1000baseDashxDashSfp string = "1000base-x-sfp"
  1376  
  1377  	// InterfaceTypeValueNr10gbaseDashxDashSfpp captures enum value "10gbase-x-sfpp"
  1378  	InterfaceTypeValueNr10gbaseDashxDashSfpp string = "10gbase-x-sfpp"
  1379  
  1380  	// InterfaceTypeValueNr10gbaseDashxDashXfp captures enum value "10gbase-x-xfp"
  1381  	InterfaceTypeValueNr10gbaseDashxDashXfp string = "10gbase-x-xfp"
  1382  
  1383  	// InterfaceTypeValueNr10gbaseDashxDashXenpak captures enum value "10gbase-x-xenpak"
  1384  	InterfaceTypeValueNr10gbaseDashxDashXenpak string = "10gbase-x-xenpak"
  1385  
  1386  	// InterfaceTypeValueNr10gbaseDashxDashX2 captures enum value "10gbase-x-x2"
  1387  	InterfaceTypeValueNr10gbaseDashxDashX2 string = "10gbase-x-x2"
  1388  
  1389  	// InterfaceTypeValueNr25gbaseDashxDashSfp28 captures enum value "25gbase-x-sfp28"
  1390  	InterfaceTypeValueNr25gbaseDashxDashSfp28 string = "25gbase-x-sfp28"
  1391  
  1392  	// InterfaceTypeValueNr50gbaseDashxDashSfp56 captures enum value "50gbase-x-sfp56"
  1393  	InterfaceTypeValueNr50gbaseDashxDashSfp56 string = "50gbase-x-sfp56"
  1394  
  1395  	// InterfaceTypeValueNr40gbaseDashxDashQsfpp captures enum value "40gbase-x-qsfpp"
  1396  	InterfaceTypeValueNr40gbaseDashxDashQsfpp string = "40gbase-x-qsfpp"
  1397  
  1398  	// InterfaceTypeValueNr50gbaseDashxDashSfp28 captures enum value "50gbase-x-sfp28"
  1399  	InterfaceTypeValueNr50gbaseDashxDashSfp28 string = "50gbase-x-sfp28"
  1400  
  1401  	// InterfaceTypeValueNr100gbaseDashxDashCfp captures enum value "100gbase-x-cfp"
  1402  	InterfaceTypeValueNr100gbaseDashxDashCfp string = "100gbase-x-cfp"
  1403  
  1404  	// InterfaceTypeValueNr100gbaseDashxDashCfp2 captures enum value "100gbase-x-cfp2"
  1405  	InterfaceTypeValueNr100gbaseDashxDashCfp2 string = "100gbase-x-cfp2"
  1406  
  1407  	// InterfaceTypeValueNr200gbaseDashxDashCfp2 captures enum value "200gbase-x-cfp2"
  1408  	InterfaceTypeValueNr200gbaseDashxDashCfp2 string = "200gbase-x-cfp2"
  1409  
  1410  	// InterfaceTypeValueNr100gbaseDashxDashCfp4 captures enum value "100gbase-x-cfp4"
  1411  	InterfaceTypeValueNr100gbaseDashxDashCfp4 string = "100gbase-x-cfp4"
  1412  
  1413  	// InterfaceTypeValueNr100gbaseDashxDashCpak captures enum value "100gbase-x-cpak"
  1414  	InterfaceTypeValueNr100gbaseDashxDashCpak string = "100gbase-x-cpak"
  1415  
  1416  	// InterfaceTypeValueNr100gbaseDashxDashQsfp28 captures enum value "100gbase-x-qsfp28"
  1417  	InterfaceTypeValueNr100gbaseDashxDashQsfp28 string = "100gbase-x-qsfp28"
  1418  
  1419  	// InterfaceTypeValueNr200gbaseDashxDashQsfp56 captures enum value "200gbase-x-qsfp56"
  1420  	InterfaceTypeValueNr200gbaseDashxDashQsfp56 string = "200gbase-x-qsfp56"
  1421  
  1422  	// InterfaceTypeValueNr400gbaseDashxDashQsfpdd captures enum value "400gbase-x-qsfpdd"
  1423  	InterfaceTypeValueNr400gbaseDashxDashQsfpdd string = "400gbase-x-qsfpdd"
  1424  
  1425  	// InterfaceTypeValueNr400gbaseDashxDashOsfp captures enum value "400gbase-x-osfp"
  1426  	InterfaceTypeValueNr400gbaseDashxDashOsfp string = "400gbase-x-osfp"
  1427  
  1428  	// InterfaceTypeValueIeee802Dot11a captures enum value "ieee802.11a"
  1429  	InterfaceTypeValueIeee802Dot11a string = "ieee802.11a"
  1430  
  1431  	// InterfaceTypeValueIeee802Dot11g captures enum value "ieee802.11g"
  1432  	InterfaceTypeValueIeee802Dot11g string = "ieee802.11g"
  1433  
  1434  	// InterfaceTypeValueIeee802Dot11n captures enum value "ieee802.11n"
  1435  	InterfaceTypeValueIeee802Dot11n string = "ieee802.11n"
  1436  
  1437  	// InterfaceTypeValueIeee802Dot11ac captures enum value "ieee802.11ac"
  1438  	InterfaceTypeValueIeee802Dot11ac string = "ieee802.11ac"
  1439  
  1440  	// InterfaceTypeValueIeee802Dot11ad captures enum value "ieee802.11ad"
  1441  	InterfaceTypeValueIeee802Dot11ad string = "ieee802.11ad"
  1442  
  1443  	// InterfaceTypeValueIeee802Dot11ax captures enum value "ieee802.11ax"
  1444  	InterfaceTypeValueIeee802Dot11ax string = "ieee802.11ax"
  1445  
  1446  	// InterfaceTypeValueGsm captures enum value "gsm"
  1447  	InterfaceTypeValueGsm string = "gsm"
  1448  
  1449  	// InterfaceTypeValueCdma captures enum value "cdma"
  1450  	InterfaceTypeValueCdma string = "cdma"
  1451  
  1452  	// InterfaceTypeValueLte captures enum value "lte"
  1453  	InterfaceTypeValueLte string = "lte"
  1454  
  1455  	// InterfaceTypeValueSonetDashOc3 captures enum value "sonet-oc3"
  1456  	InterfaceTypeValueSonetDashOc3 string = "sonet-oc3"
  1457  
  1458  	// InterfaceTypeValueSonetDashOc12 captures enum value "sonet-oc12"
  1459  	InterfaceTypeValueSonetDashOc12 string = "sonet-oc12"
  1460  
  1461  	// InterfaceTypeValueSonetDashOc48 captures enum value "sonet-oc48"
  1462  	InterfaceTypeValueSonetDashOc48 string = "sonet-oc48"
  1463  
  1464  	// InterfaceTypeValueSonetDashOc192 captures enum value "sonet-oc192"
  1465  	InterfaceTypeValueSonetDashOc192 string = "sonet-oc192"
  1466  
  1467  	// InterfaceTypeValueSonetDashOc768 captures enum value "sonet-oc768"
  1468  	InterfaceTypeValueSonetDashOc768 string = "sonet-oc768"
  1469  
  1470  	// InterfaceTypeValueSonetDashOc1920 captures enum value "sonet-oc1920"
  1471  	InterfaceTypeValueSonetDashOc1920 string = "sonet-oc1920"
  1472  
  1473  	// InterfaceTypeValueSonetDashOc3840 captures enum value "sonet-oc3840"
  1474  	InterfaceTypeValueSonetDashOc3840 string = "sonet-oc3840"
  1475  
  1476  	// InterfaceTypeValueNr1gfcDashSfp captures enum value "1gfc-sfp"
  1477  	InterfaceTypeValueNr1gfcDashSfp string = "1gfc-sfp"
  1478  
  1479  	// InterfaceTypeValueNr2gfcDashSfp captures enum value "2gfc-sfp"
  1480  	InterfaceTypeValueNr2gfcDashSfp string = "2gfc-sfp"
  1481  
  1482  	// InterfaceTypeValueNr4gfcDashSfp captures enum value "4gfc-sfp"
  1483  	InterfaceTypeValueNr4gfcDashSfp string = "4gfc-sfp"
  1484  
  1485  	// InterfaceTypeValueNr8gfcDashSfpp captures enum value "8gfc-sfpp"
  1486  	InterfaceTypeValueNr8gfcDashSfpp string = "8gfc-sfpp"
  1487  
  1488  	// InterfaceTypeValueNr16gfcDashSfpp captures enum value "16gfc-sfpp"
  1489  	InterfaceTypeValueNr16gfcDashSfpp string = "16gfc-sfpp"
  1490  
  1491  	// InterfaceTypeValueNr32gfcDashSfp28 captures enum value "32gfc-sfp28"
  1492  	InterfaceTypeValueNr32gfcDashSfp28 string = "32gfc-sfp28"
  1493  
  1494  	// InterfaceTypeValueNr64gfcDashQsfpp captures enum value "64gfc-qsfpp"
  1495  	InterfaceTypeValueNr64gfcDashQsfpp string = "64gfc-qsfpp"
  1496  
  1497  	// InterfaceTypeValueNr128gfcDashSfp28 captures enum value "128gfc-sfp28"
  1498  	InterfaceTypeValueNr128gfcDashSfp28 string = "128gfc-sfp28"
  1499  
  1500  	// InterfaceTypeValueInfinibandDashSdr captures enum value "infiniband-sdr"
  1501  	InterfaceTypeValueInfinibandDashSdr string = "infiniband-sdr"
  1502  
  1503  	// InterfaceTypeValueInfinibandDashDdr captures enum value "infiniband-ddr"
  1504  	InterfaceTypeValueInfinibandDashDdr string = "infiniband-ddr"
  1505  
  1506  	// InterfaceTypeValueInfinibandDashQdr captures enum value "infiniband-qdr"
  1507  	InterfaceTypeValueInfinibandDashQdr string = "infiniband-qdr"
  1508  
  1509  	// InterfaceTypeValueInfinibandDashFdr10 captures enum value "infiniband-fdr10"
  1510  	InterfaceTypeValueInfinibandDashFdr10 string = "infiniband-fdr10"
  1511  
  1512  	// InterfaceTypeValueInfinibandDashFdr captures enum value "infiniband-fdr"
  1513  	InterfaceTypeValueInfinibandDashFdr string = "infiniband-fdr"
  1514  
  1515  	// InterfaceTypeValueInfinibandDashEdr captures enum value "infiniband-edr"
  1516  	InterfaceTypeValueInfinibandDashEdr string = "infiniband-edr"
  1517  
  1518  	// InterfaceTypeValueInfinibandDashHdr captures enum value "infiniband-hdr"
  1519  	InterfaceTypeValueInfinibandDashHdr string = "infiniband-hdr"
  1520  
  1521  	// InterfaceTypeValueInfinibandDashNdr captures enum value "infiniband-ndr"
  1522  	InterfaceTypeValueInfinibandDashNdr string = "infiniband-ndr"
  1523  
  1524  	// InterfaceTypeValueInfinibandDashXdr captures enum value "infiniband-xdr"
  1525  	InterfaceTypeValueInfinibandDashXdr string = "infiniband-xdr"
  1526  
  1527  	// InterfaceTypeValueT1 captures enum value "t1"
  1528  	InterfaceTypeValueT1 string = "t1"
  1529  
  1530  	// InterfaceTypeValueE1 captures enum value "e1"
  1531  	InterfaceTypeValueE1 string = "e1"
  1532  
  1533  	// InterfaceTypeValueT3 captures enum value "t3"
  1534  	InterfaceTypeValueT3 string = "t3"
  1535  
  1536  	// InterfaceTypeValueE3 captures enum value "e3"
  1537  	InterfaceTypeValueE3 string = "e3"
  1538  
  1539  	// InterfaceTypeValueCiscoDashStackwise captures enum value "cisco-stackwise"
  1540  	InterfaceTypeValueCiscoDashStackwise string = "cisco-stackwise"
  1541  
  1542  	// InterfaceTypeValueCiscoDashStackwiseDashPlus captures enum value "cisco-stackwise-plus"
  1543  	InterfaceTypeValueCiscoDashStackwiseDashPlus string = "cisco-stackwise-plus"
  1544  
  1545  	// InterfaceTypeValueCiscoDashFlexstack captures enum value "cisco-flexstack"
  1546  	InterfaceTypeValueCiscoDashFlexstack string = "cisco-flexstack"
  1547  
  1548  	// InterfaceTypeValueCiscoDashFlexstackDashPlus captures enum value "cisco-flexstack-plus"
  1549  	InterfaceTypeValueCiscoDashFlexstackDashPlus string = "cisco-flexstack-plus"
  1550  
  1551  	// InterfaceTypeValueJuniperDashVcp captures enum value "juniper-vcp"
  1552  	InterfaceTypeValueJuniperDashVcp string = "juniper-vcp"
  1553  
  1554  	// InterfaceTypeValueExtremeDashSummitstack captures enum value "extreme-summitstack"
  1555  	InterfaceTypeValueExtremeDashSummitstack string = "extreme-summitstack"
  1556  
  1557  	// InterfaceTypeValueExtremeDashSummitstackDash128 captures enum value "extreme-summitstack-128"
  1558  	InterfaceTypeValueExtremeDashSummitstackDash128 string = "extreme-summitstack-128"
  1559  
  1560  	// InterfaceTypeValueExtremeDashSummitstackDash256 captures enum value "extreme-summitstack-256"
  1561  	InterfaceTypeValueExtremeDashSummitstackDash256 string = "extreme-summitstack-256"
  1562  
  1563  	// InterfaceTypeValueExtremeDashSummitstackDash512 captures enum value "extreme-summitstack-512"
  1564  	InterfaceTypeValueExtremeDashSummitstackDash512 string = "extreme-summitstack-512"
  1565  
  1566  	// InterfaceTypeValueOther captures enum value "other"
  1567  	InterfaceTypeValueOther string = "other"
  1568  )
  1569  
  1570  // prop value enum
  1571  func (m *InterfaceType) validateValueEnum(path, location string, value string) error {
  1572  	if err := validate.EnumCase(path, location, value, interfaceTypeTypeValuePropEnum, true); err != nil {
  1573  		return err
  1574  	}
  1575  	return nil
  1576  }
  1577  
  1578  func (m *InterfaceType) validateValue(formats strfmt.Registry) error {
  1579  
  1580  	if err := validate.Required("type"+"."+"value", "body", m.Value); err != nil {
  1581  		return err
  1582  	}
  1583  
  1584  	// value enum
  1585  	if err := m.validateValueEnum("type"+"."+"value", "body", *m.Value); err != nil {
  1586  		return err
  1587  	}
  1588  
  1589  	return nil
  1590  }
  1591  
  1592  // ContextValidate validates this interface type based on context it is used
  1593  func (m *InterfaceType) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
  1594  	return nil
  1595  }
  1596  
  1597  // MarshalBinary interface implementation
  1598  func (m *InterfaceType) MarshalBinary() ([]byte, error) {
  1599  	if m == nil {
  1600  		return nil, nil
  1601  	}
  1602  	return swag.WriteJSON(m)
  1603  }
  1604  
  1605  // UnmarshalBinary interface implementation
  1606  func (m *InterfaceType) UnmarshalBinary(b []byte) error {
  1607  	var res InterfaceType
  1608  	if err := swag.ReadJSON(b, &res); err != nil {
  1609  		return err
  1610  	}
  1611  	*m = res
  1612  	return nil
  1613  }