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