// Code generated by go-swagger; DO NOT EDIT.

package template_set

// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the generate command

import (
	"net/http"

	"github.com/go-openapi/runtime/middleware"
)

// DeleteTemplateSetHandlerFunc turns a function with the right signature into a delete template set handler
type DeleteTemplateSetHandlerFunc func(DeleteTemplateSetParams) middleware.Responder

// Handle executing the request and returning a response
func (fn DeleteTemplateSetHandlerFunc) Handle(params DeleteTemplateSetParams) middleware.Responder {
	return fn(params)
}

// DeleteTemplateSetHandler interface for that can handle valid delete template set params
type DeleteTemplateSetHandler interface {
	Handle(DeleteTemplateSetParams) middleware.Responder
}

// NewDeleteTemplateSet creates a new http.Handler for the delete template set operation
func NewDeleteTemplateSet(ctx *middleware.Context, handler DeleteTemplateSetHandler) *DeleteTemplateSet {
	return &DeleteTemplateSet{Context: ctx, Handler: handler}
}

/*DeleteTemplateSet swagger:route DELETE /template_sets/{setKey} template_set deleteTemplateSet

deletes specified template set

*/
type DeleteTemplateSet struct {
	Context *middleware.Context
	Handler DeleteTemplateSetHandler
}

func (o *DeleteTemplateSet) ServeHTTP(rw http.ResponseWriter, r *http.Request) {
	route, rCtx, _ := o.Context.RouteInfo(r)
	if rCtx != nil {
		r = rCtx
	}
	var Params = NewDeleteTemplateSetParams()

	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(Params) // actually handle the request

	o.Context.Respond(rw, r, route.Produces, route, res)

}
