github.com/kubearmor/cilium@v1.6.12/api/v1/server/restapi/policy/get_identity_id_parameters.go (about) 1 // Code generated by go-swagger; DO NOT EDIT. 2 3 package policy 4 5 // This file was generated by the swagger tool. 6 // Editing this file might prove futile when you re-run the swagger generate command 7 8 import ( 9 "net/http" 10 11 "github.com/go-openapi/errors" 12 "github.com/go-openapi/runtime/middleware" 13 14 strfmt "github.com/go-openapi/strfmt" 15 ) 16 17 // NewGetIdentityIDParams creates a new GetIdentityIDParams object 18 // no default values defined in spec. 19 func NewGetIdentityIDParams() GetIdentityIDParams { 20 21 return GetIdentityIDParams{} 22 } 23 24 // GetIdentityIDParams contains all the bound params for the get identity ID operation 25 // typically these are obtained from a http.Request 26 // 27 // swagger:parameters GetIdentityID 28 type GetIdentityIDParams struct { 29 30 // HTTP Request Object 31 HTTPRequest *http.Request `json:"-"` 32 33 /*Cluster wide unique identifier of a security identity. 34 35 Required: true 36 In: path 37 */ 38 ID string 39 } 40 41 // BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface 42 // for simple values it will use straight method calls. 43 // 44 // To ensure default values, the struct must have been initialized with NewGetIdentityIDParams() beforehand. 45 func (o *GetIdentityIDParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { 46 var res []error 47 48 o.HTTPRequest = r 49 50 rID, rhkID, _ := route.Params.GetOK("id") 51 if err := o.bindID(rID, rhkID, route.Formats); err != nil { 52 res = append(res, err) 53 } 54 55 if len(res) > 0 { 56 return errors.CompositeValidationError(res...) 57 } 58 return nil 59 } 60 61 // bindID binds and validates parameter ID from path. 62 func (o *GetIdentityIDParams) bindID(rawData []string, hasKey bool, formats strfmt.Registry) error { 63 var raw string 64 if len(rawData) > 0 { 65 raw = rawData[len(rawData)-1] 66 } 67 68 // Required: true 69 // Parameter is provided by construction from the route 70 71 o.ID = raw 72 73 return nil 74 }