github.com/cilium/cilium@v1.16.2/api/v1/server/restapi/policy/delete_fqdn_cache_parameters.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 policy 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 "net/http" 13 14 "github.com/go-openapi/errors" 15 "github.com/go-openapi/runtime" 16 "github.com/go-openapi/runtime/middleware" 17 "github.com/go-openapi/strfmt" 18 ) 19 20 // NewDeleteFqdnCacheParams creates a new DeleteFqdnCacheParams object 21 // 22 // There are no default values defined in the spec. 23 func NewDeleteFqdnCacheParams() DeleteFqdnCacheParams { 24 25 return DeleteFqdnCacheParams{} 26 } 27 28 // DeleteFqdnCacheParams contains all the bound params for the delete fqdn cache operation 29 // typically these are obtained from a http.Request 30 // 31 // swagger:parameters DeleteFqdnCache 32 type DeleteFqdnCacheParams struct { 33 34 // HTTP Request Object 35 HTTPRequest *http.Request `json:"-"` 36 37 /*A toFQDNs compatible matchPattern expression 38 In: query 39 */ 40 Matchpattern *string 41 } 42 43 // BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface 44 // for simple values it will use straight method calls. 45 // 46 // To ensure default values, the struct must have been initialized with NewDeleteFqdnCacheParams() beforehand. 47 func (o *DeleteFqdnCacheParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { 48 var res []error 49 50 o.HTTPRequest = r 51 52 qs := runtime.Values(r.URL.Query()) 53 54 qMatchpattern, qhkMatchpattern, _ := qs.GetOK("matchpattern") 55 if err := o.bindMatchpattern(qMatchpattern, qhkMatchpattern, route.Formats); err != nil { 56 res = append(res, err) 57 } 58 if len(res) > 0 { 59 return errors.CompositeValidationError(res...) 60 } 61 return nil 62 } 63 64 // bindMatchpattern binds and validates parameter Matchpattern from query. 65 func (o *DeleteFqdnCacheParams) bindMatchpattern(rawData []string, hasKey bool, formats strfmt.Registry) error { 66 var raw string 67 if len(rawData) > 0 { 68 raw = rawData[len(rawData)-1] 69 } 70 71 // Required: false 72 // AllowEmptyValue: false 73 74 if raw == "" { // empty values pass all other validations 75 return nil 76 } 77 o.Matchpattern = &raw 78 79 return nil 80 }