github.com/cilium/cilium@v1.16.2/api/v1/models/bgp_route_policy_prefix_match.go (about) 1 // Code generated by go-swagger; DO NOT EDIT. 2 3 // Copyright Authors of Cilium 4 // SPDX-License-Identifier: Apache-2.0 5 6 package models 7 8 // This file was generated by the swagger tool. 9 // Editing this file might prove futile when you re-run the swagger generate command 10 11 import ( 12 "context" 13 14 "github.com/go-openapi/strfmt" 15 "github.com/go-openapi/swag" 16 ) 17 18 // BgpRoutePolicyPrefixMatch Matches a CIDR prefix in a BGP route policy 19 // 20 // swagger:model BgpRoutePolicyPrefixMatch 21 type BgpRoutePolicyPrefixMatch struct { 22 23 // CIDR prefix to match with 24 Cidr string `json:"cidr,omitempty"` 25 26 // Maximal prefix length that will match if it falls under CIDR 27 PrefixLenMax int64 `json:"prefix-len-max,omitempty"` 28 29 // Minimal prefix length that will match if it falls under CIDR 30 PrefixLenMin int64 `json:"prefix-len-min,omitempty"` 31 } 32 33 // Validate validates this bgp route policy prefix match 34 func (m *BgpRoutePolicyPrefixMatch) Validate(formats strfmt.Registry) error { 35 return nil 36 } 37 38 // ContextValidate validates this bgp route policy prefix match based on context it is used 39 func (m *BgpRoutePolicyPrefixMatch) ContextValidate(ctx context.Context, formats strfmt.Registry) error { 40 return nil 41 } 42 43 // MarshalBinary interface implementation 44 func (m *BgpRoutePolicyPrefixMatch) MarshalBinary() ([]byte, error) { 45 if m == nil { 46 return nil, nil 47 } 48 return swag.WriteJSON(m) 49 } 50 51 // UnmarshalBinary interface implementation 52 func (m *BgpRoutePolicyPrefixMatch) UnmarshalBinary(b []byte) error { 53 var res BgpRoutePolicyPrefixMatch 54 if err := swag.ReadJSON(b, &res); err != nil { 55 return err 56 } 57 *m = res 58 return nil 59 }