influxdb/restapi/operations/patch_sources_id_users_user...

56 lines
2.0 KiB
Go

package operations
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the generate command
import (
"net/http"
context "golang.org/x/net/context"
middleware "github.com/go-openapi/runtime/middleware"
)
// PatchSourcesIDUsersUserIDHandlerFunc turns a function with the right signature into a patch sources ID users user ID handler
type PatchSourcesIDUsersUserIDHandlerFunc func(context.Context, PatchSourcesIDUsersUserIDParams) middleware.Responder
// Handle executing the request and returning a response
func (fn PatchSourcesIDUsersUserIDHandlerFunc) Handle(ctx context.Context, params PatchSourcesIDUsersUserIDParams) middleware.Responder {
return fn(ctx, params)
}
// PatchSourcesIDUsersUserIDHandler interface for that can handle valid patch sources ID users user ID params
type PatchSourcesIDUsersUserIDHandler interface {
Handle(context.Context, PatchSourcesIDUsersUserIDParams) middleware.Responder
}
// NewPatchSourcesIDUsersUserID creates a new http.Handler for the patch sources ID users user ID operation
func NewPatchSourcesIDUsersUserID(ctx *middleware.Context, handler PatchSourcesIDUsersUserIDHandler) *PatchSourcesIDUsersUserID {
return &PatchSourcesIDUsersUserID{Context: ctx, Handler: handler}
}
/*PatchSourcesIDUsersUserID swagger:route PATCH /sources/{id}/users/{user_id} patchSourcesIdUsersUserId
Update user configuration
*/
type PatchSourcesIDUsersUserID struct {
Context *middleware.Context
Handler PatchSourcesIDUsersUserIDHandler
}
func (o *PatchSourcesIDUsersUserID) ServeHTTP(rw http.ResponseWriter, r *http.Request) {
route, _ := o.Context.RouteInfo(r)
var Params = NewPatchSourcesIDUsersUserIDParams()
if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params
o.Context.Respond(rw, r, route.Produces, route, err)
return
}
res := o.Handler.Handle(context.Background(), Params) // actually handle the request
o.Context.Respond(rw, r, route.Produces, route, res)
}