func (o *FerretServerAPI) RegisterProducer(mediaType string, producer runtime.Producer) {
	o.customProducers[mediaType] = producer
}
RegisterProducer allows you to add (or override) a producer for a media type.
package operations
import (
	"fmt"
	"net/http"
	"strings"
	errors "github.com/go-openapi/errors"
	loads "github.com/go-openapi/loads"
	runtime "github.com/go-openapi/runtime"
	middleware "github.com/go-openapi/runtime/middleware"
	security "github.com/go-openapi/runtime/security"
	spec "github.com/go-openapi/spec"
	strfmt "github.com/go-openapi/strfmt"
	"github.com/go-openapi/swag"
)
func NewFerretServerAPI(spec *loads.Document) *FerretServerAPI {
	return &FerretServerAPI{
		handlers:            make(map[string]map[string]http.Handler),
		formats:             strfmt.Default,
		defaultConsumes:     "application/json",
		defaultProduces:     "application/json",
		customConsumers:     make(map[string]runtime.Consumer),
		customProducers:     make(map[string]runtime.Producer),
		ServerShutdown:      func() {},
		spec:                spec,
		ServeError:          errors.ServeError,
		BasicAuthenticator:  security.BasicAuth,
		APIKeyAuthenticator: security.APIKeyAuth,
		BearerAuthenticator: security.BearerAuth,
		JSONConsumer:        runtime.JSONConsumer(),
		JSONProducer:        runtime.JSONProducer(),
		CreateExecutionHandler: CreateExecutionHandlerFunc(func(params CreateExecutionParams) middleware.Responder {
			return middleware.NotImplemented("operation CreateExecution has not yet been implemented")
		}),
		CreateProjectHandler: CreateProjectHandlerFunc(func(params CreateProjectParams) middleware.Responder {
			return middleware.NotImplemented("operation CreateProject has not yet been implemented")
		}),
		CreateScriptHandler: CreateScriptHandlerFunc(func(params CreateScriptParams) middleware.Responder {
			return middleware.NotImplemented("operation CreateScript has not yet been implemented")
		}),
		DeleteExecutionHandler: DeleteExecutionHandlerFunc(func(params DeleteExecutionParams) middleware.Responder {
			return middleware.NotImplemented("operation DeleteExecution has not yet been implemented")
		}),
		DeleteProjectHandler: DeleteProjectHandlerFunc(func(params DeleteProjectParams) middleware.Responder {
			return middleware.NotImplemented("operation DeleteProject has not yet been implemented")
		}),
		DeleteScriptHandler: DeleteScriptHandlerFunc(func(params DeleteScriptParams) middleware.Responder {
			return middleware.NotImplemented("operation DeleteScript has not yet been implemented")
		}),
		DeleteScriptDataHandler: DeleteScriptDataHandlerFunc(func(params DeleteScriptDataParams) middleware.Responder {
			return middleware.NotImplemented("operation DeleteScriptData has not yet been implemented")
		}),
		FindExecutionsHandler: FindExecutionsHandlerFunc(func(params FindExecutionsParams) middleware.Responder {
			return middleware.NotImplemented("operation FindExecutions has not yet been implemented")
		}),
		FindProjectDataHandler: FindProjectDataHandlerFunc(func(params FindProjectDataParams) middleware.Responder {
			return middleware.NotImplemented("operation FindProjectData has not yet been implemented")
		}),
		FindProjectsHandler: FindProjectsHandlerFunc(func(params FindProjectsParams) middleware.Responder {
			return middleware.NotImplemented("operation FindProjects has not yet been implemented")
		}),
		FindScriptDataHandler: FindScriptDataHandlerFunc(func(params FindScriptDataParams) middleware.Responder {
			return middleware.NotImplemented("operation FindScriptData has not yet been implemented")
		}),
		FindScriptsHandler: FindScriptsHandlerFunc(func(params FindScriptsParams) middleware.Responder {
			return middleware.NotImplemented("operation FindScripts has not yet been implemented")
		}),
		GetExecutionHandler: GetExecutionHandlerFunc(func(params GetExecutionParams) middleware.Responder {
			return middleware.NotImplemented("operation GetExecution has not yet been implemented")
		}),
		GetProjectHandler: GetProjectHandlerFunc(func(params GetProjectParams) middleware.Responder {
			return middleware.NotImplemented("operation GetProject has not yet been implemented")
		}),
		GetScriptHandler: GetScriptHandlerFunc(func(params GetScriptParams) middleware.Responder {
			return middleware.NotImplemented("operation GetScript has not yet been implemented")
		}),
		GetScriptDataHandler: GetScriptDataHandlerFunc(func(params GetScriptDataParams) middleware.Responder {
			return middleware.NotImplemented("operation GetScriptData has not yet been implemented")
		}),
		UpdateProjectHandler: UpdateProjectHandlerFunc(func(params UpdateProjectParams) middleware.Responder {
			return middleware.NotImplemented("operation UpdateProject has not yet been implemented")
		}),
		UpdateScriptHandler: UpdateScriptHandlerFunc(func(params UpdateScriptParams) middleware.Responder {
			return middleware.NotImplemented("operation UpdateScript has not yet been implemented")
		}),
		UpdateScriptDataHandler: UpdateScriptDataHandlerFunc(func(params UpdateScriptDataParams) middleware.Responder {
			return middleware.NotImplemented("operation UpdateScriptData has not yet been implemented")
		}),
	}
}
type FerretServerAPI struct {
	spec            *loads.Document
	context         *middleware.Context
	handlers        map[string]map[string]http.Handler
	formats         strfmt.Registry
	customConsumers map[string]runtime.Consumer
	customProducers map[string]runtime.Producer
	defaultConsumes string
	defaultProduces string
	Middleware      func(middleware.Builder) http.Handler
	BasicAuthenticator func(security.UserPassAuthentication) runtime.Authenticator
	APIKeyAuthenticator func(string, string, security.TokenAuthentication) runtime.Authenticator
	BearerAuthenticator func(string, security.ScopedTokenAuthentication) runtime.Authenticator
	JSONConsumer runtime.Consumer
	JSONProducer runtime.Producer
	CreateExecutionHandler CreateExecutionHandler
	CreateProjectHandler CreateProjectHandler
	CreateScriptHandler CreateScriptHandler
	DeleteExecutionHandler DeleteExecutionHandler
	DeleteProjectHandler DeleteProjectHandler
	DeleteScriptHandler DeleteScriptHandler
	DeleteScriptDataHandler DeleteScriptDataHandler
	FindExecutionsHandler FindExecutionsHandler
	FindProjectDataHandler FindProjectDataHandler
	FindProjectsHandler FindProjectsHandler
	FindScriptDataHandler FindScriptDataHandler
	FindScriptsHandler FindScriptsHandler
	GetExecutionHandler GetExecutionHandler
	GetProjectHandler GetProjectHandler
	GetScriptHandler GetScriptHandler
	GetScriptDataHandler GetScriptDataHandler
	UpdateProjectHandler UpdateProjectHandler
	UpdateScriptHandler UpdateScriptHandler
	UpdateScriptDataHandler UpdateScriptDataHandler
	ServeError func(http.ResponseWriter, *http.Request, error)
	ServerShutdown func()
	CommandLineOptionsGroups []swag.CommandLineOptionsGroup
	Logger func(string, ...interface{})
}
func (o *FerretServerAPI) SetDefaultProduces(mediaType string) {
	o.defaultProduces = mediaType
}
func (o *FerretServerAPI) SetDefaultConsumes(mediaType string) {
	o.defaultConsumes = mediaType
}
func (o *FerretServerAPI) SetSpec(spec *loads.Document) {
	o.spec = spec
}
func (o *FerretServerAPI) DefaultProduces() string {
	return o.defaultProduces
}
func (o *FerretServerAPI) DefaultConsumes() string {
	return o.defaultConsumes
}
func (o *FerretServerAPI) Formats() strfmt.Registry {
	return o.formats
}
func (o *FerretServerAPI) RegisterFormat(name string, format strfmt.Format, validator strfmt.Validator) {
	o.formats.Add(name, format, validator)
}
func (o *FerretServerAPI) Validate() error {
	var unregistered []string
	if o.JSONConsumer == nil {
		unregistered = append(unregistered, "JSONConsumer")
	}
	if o.JSONProducer == nil {
		unregistered = append(unregistered, "JSONProducer")
	}
	if o.CreateExecutionHandler == nil {
		unregistered = append(unregistered, "CreateExecutionHandler")
	}
	if o.CreateProjectHandler == nil {
		unregistered = append(unregistered, "CreateProjectHandler")
	}
	if o.CreateScriptHandler == nil {
		unregistered = append(unregistered, "CreateScriptHandler")
	}
	if o.DeleteExecutionHandler == nil {
		unregistered = append(unregistered, "DeleteExecutionHandler")
	}
	if o.DeleteProjectHandler == nil {
		unregistered = append(unregistered, "DeleteProjectHandler")
	}
	if o.DeleteScriptHandler == nil {
		unregistered = append(unregistered, "DeleteScriptHandler")
	}
	if o.DeleteScriptDataHandler == nil {
		unregistered = append(unregistered, "DeleteScriptDataHandler")
	}
	if o.FindExecutionsHandler == nil {
		unregistered = append(unregistered, "FindExecutionsHandler")
	}
	if o.FindProjectDataHandler == nil {
		unregistered = append(unregistered, "FindProjectDataHandler")
	}
	if o.FindProjectsHandler == nil {
		unregistered = append(unregistered, "FindProjectsHandler")
	}
	if o.FindScriptDataHandler == nil {
		unregistered = append(unregistered, "FindScriptDataHandler")
	}
	if o.FindScriptsHandler == nil {
		unregistered = append(unregistered, "FindScriptsHandler")
	}
	if o.GetExecutionHandler == nil {
		unregistered = append(unregistered, "GetExecutionHandler")
	}
	if o.GetProjectHandler == nil {
		unregistered = append(unregistered, "GetProjectHandler")
	}
	if o.GetScriptHandler == nil {
		unregistered = append(unregistered, "GetScriptHandler")
	}
	if o.GetScriptDataHandler == nil {
		unregistered = append(unregistered, "GetScriptDataHandler")
	}
	if o.UpdateProjectHandler == nil {
		unregistered = append(unregistered, "UpdateProjectHandler")
	}
	if o.UpdateScriptHandler == nil {
		unregistered = append(unregistered, "UpdateScriptHandler")
	}
	if o.UpdateScriptDataHandler == nil {
		unregistered = append(unregistered, "UpdateScriptDataHandler")
	}
	if len(unregistered) > 0 {
		return fmt.Errorf("missing registration: %s", strings.Join(unregistered, ", "))
	}
	return nil
}
func (o *FerretServerAPI) ServeErrorFor(operationID string) func(http.ResponseWriter, *http.Request, error) {
	return o.ServeError
}
func (o *FerretServerAPI) AuthenticatorsFor(schemes map[string]spec.SecurityScheme) map[string]runtime.Authenticator {
	return nil
}
func (o *FerretServerAPI) Authorizer() runtime.Authorizer {
	return nil
}
func (o *FerretServerAPI) ConsumersFor(mediaTypes []string) map[string]runtime.Consumer {
	result := make(map[string]runtime.Consumer)
	for _, mt := range mediaTypes {
		switch mt {
		case "application/json":
			result["application/json"] = o.JSONConsumer
		}
		if c, ok := o.customConsumers[mt]; ok {
			result[mt] = c
		}
	}
	return result
}
func (o *FerretServerAPI) ProducersFor(mediaTypes []string) map[string]runtime.Producer {
	result := make(map[string]runtime.Producer)
	for _, mt := range mediaTypes {
		switch mt {
		case "application/json":
			result["application/json"] = o.JSONProducer
		}
		if p, ok := o.customProducers[mt]; ok {
			result[mt] = p
		}
	}
	return result
}
func (o *FerretServerAPI) HandlerFor(method, path string) (http.Handler, bool) {
	if o.handlers == nil {
		return nil, false
	}
	um := strings.ToUpper(method)
	if _, ok := o.handlers[um]; !ok {
		return nil, false
	}
	if path == "/" {
		path = ""
	}
	h, ok := o.handlers[um][path]
	return h, ok
}
func (o *FerretServerAPI) Context() *middleware.Context {
	if o.context == nil {
		o.context = middleware.NewRoutableContext(o.spec, o, nil)
	}
	return o.context
}
func (o *FerretServerAPI) initHandlerCache() {
	o.Context()  
	if o.handlers == nil {
		o.handlers = make(map[string]map[string]http.Handler)
	}
	if o.handlers["POST"] == nil {
		o.handlers["POST"] = make(map[string]http.Handler)
	}
	o.handlers["POST"]["/projects/{projectId}/exec"] = NewCreateExecution(o.context, o.CreateExecutionHandler)
	if o.handlers["POST"] == nil {
		o.handlers["POST"] = make(map[string]http.Handler)
	}
	o.handlers["POST"]["/projects"] = NewCreateProject(o.context, o.CreateProjectHandler)
	if o.handlers["POST"] == nil {
		o.handlers["POST"] = make(map[string]http.Handler)
	}
	o.handlers["POST"]["/projects/{projectId}/scripts"] = NewCreateScript(o.context, o.CreateScriptHandler)
	if o.handlers["DELETE"] == nil {
		o.handlers["DELETE"] = make(map[string]http.Handler)
	}
	o.handlers["DELETE"]["/projects/{projectId}/exec/{jobID}"] = NewDeleteExecution(o.context, o.DeleteExecutionHandler)
	if o.handlers["DELETE"] == nil {
		o.handlers["DELETE"] = make(map[string]http.Handler)
	}
	o.handlers["DELETE"]["/projects/{projectId}"] = NewDeleteProject(o.context, o.DeleteProjectHandler)
	if o.handlers["DELETE"] == nil {
		o.handlers["DELETE"] = make(map[string]http.Handler)
	}
	o.handlers["DELETE"]["/projects/{projectId}/scripts/{scriptId}"] = NewDeleteScript(o.context, o.DeleteScriptHandler)
	if o.handlers["DELETE"] == nil {
		o.handlers["DELETE"] = make(map[string]http.Handler)
	}
	o.handlers["DELETE"]["/projects/{projectId}/data/{scriptId}/{dataId}"] = NewDeleteScriptData(o.context, o.DeleteScriptDataHandler)
	if o.handlers["GET"] == nil {
		o.handlers["GET"] = make(map[string]http.Handler)
	}
	o.handlers["GET"]["/projects/{projectId}/exec"] = NewFindExecutions(o.context, o.FindExecutionsHandler)
	if o.handlers["GET"] == nil {
		o.handlers["GET"] = make(map[string]http.Handler)
	}
	o.handlers["GET"]["/projects/{projectId}/data"] = NewFindProjectData(o.context, o.FindProjectDataHandler)
	if o.handlers["GET"] == nil {
		o.handlers["GET"] = make(map[string]http.Handler)
	}
	o.handlers["GET"]["/projects"] = NewFindProjects(o.context, o.FindProjectsHandler)
	if o.handlers["GET"] == nil {
		o.handlers["GET"] = make(map[string]http.Handler)
	}
	o.handlers["GET"]["/projects/{projectId}/data/{scriptId}"] = NewFindScriptData(o.context, o.FindScriptDataHandler)
	if o.handlers["GET"] == nil {
		o.handlers["GET"] = make(map[string]http.Handler)
	}
	o.handlers["GET"]["/projects/{projectId}/scripts"] = NewFindScripts(o.context, o.FindScriptsHandler)
	if o.handlers["GET"] == nil {
		o.handlers["GET"] = make(map[string]http.Handler)
	}
	o.handlers["GET"]["/projects/{projectId}/exec/{jobID}"] = NewGetExecution(o.context, o.GetExecutionHandler)
	if o.handlers["GET"] == nil {
		o.handlers["GET"] = make(map[string]http.Handler)
	}
	o.handlers["GET"]["/projects/{projectId}"] = NewGetProject(o.context, o.GetProjectHandler)
	if o.handlers["GET"] == nil {
		o.handlers["GET"] = make(map[string]http.Handler)
	}
	o.handlers["GET"]["/projects/{projectId}/scripts/{scriptId}"] = NewGetScript(o.context, o.GetScriptHandler)
	if o.handlers["GET"] == nil {
		o.handlers["GET"] = make(map[string]http.Handler)
	}
	o.handlers["GET"]["/projects/{projectId}/data/{scriptId}/{dataId}"] = NewGetScriptData(o.context, o.GetScriptDataHandler)
	if o.handlers["PUT"] == nil {
		o.handlers["PUT"] = make(map[string]http.Handler)
	}
	o.handlers["PUT"]["/projects/{projectId}"] = NewUpdateProject(o.context, o.UpdateProjectHandler)
	if o.handlers["PUT"] == nil {
		o.handlers["PUT"] = make(map[string]http.Handler)
	}
	o.handlers["PUT"]["/projects/{projectId}/scripts/{scriptId}"] = NewUpdateScript(o.context, o.UpdateScriptHandler)
	if o.handlers["PUT"] == nil {
		o.handlers["PUT"] = make(map[string]http.Handler)
	}
	o.handlers["PUT"]["/projects/{projectId}/data/{scriptId}/{dataId}"] = NewUpdateScriptData(o.context, o.UpdateScriptDataHandler)
}
func (o *FerretServerAPI) Serve(builder middleware.Builder) http.Handler {
	o.Init()
	if o.Middleware != nil {
		return o.Middleware(builder)
	}
	return o.context.APIHandler(builder)
}
func (o *FerretServerAPI) Init() {
	if len(o.handlers) == 0 {
		o.initHandlerCache()
	}
}
func (o *FerretServerAPI) RegisterConsumer(mediaType string, consumer runtime.Consumer) {
	o.customConsumers[mediaType] = consumer
}