1 // Code generated by go-swagger; DO NOT EDIT.
5 // This file was generated by the swagger tool.
6 // Editing this file might prove futile when you re-run the swagger generate command
11 "github.com/go-openapi/errors"
12 "github.com/go-openapi/runtime/middleware"
13 "github.com/go-openapi/swag"
15 strfmt "github.com/go-openapi/strfmt"
18 // NewUnsubscribeParams creates a new UnsubscribeParams object
19 // no default values defined in spec.
20 func NewUnsubscribeParams() UnsubscribeParams {
22 return UnsubscribeParams{}
25 // UnsubscribeParams contains all the bound params for the unsubscribe operation
26 // typically these are obtained from a http.Request
28 // swagger:parameters Unsubscribe
29 type UnsubscribeParams struct {
31 // HTTP Request Object
32 HTTPRequest *http.Request `json:"-"`
34 /*The subscriptionId to be unsubscribed
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.
44 // To ensure default values, the struct must have been initialized with NewUnsubscribeParams() beforehand.
45 func (o *UnsubscribeParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error {
50 rSubscriptionID, rhkSubscriptionID, _ := route.Params.GetOK("subscriptionId")
51 if err := o.bindSubscriptionID(rSubscriptionID, rhkSubscriptionID, route.Formats); err != nil {
52 res = append(res, err)
56 return errors.CompositeValidationError(res...)
61 // bindSubscriptionID binds and validates parameter SubscriptionID from path.
62 func (o *UnsubscribeParams) bindSubscriptionID(rawData []string, hasKey bool, formats strfmt.Registry) error {
65 raw = rawData[len(rawData)-1]
69 // Parameter is provided by construction from the route
71 value, err := swag.ConvertInt64(raw)
73 return errors.InvalidType("subscriptionId", "path", "int64", raw)
75 o.SubscriptionID = value