func unmarshalCreateListsPayload(ctx context.Context, service *goa.Service, req *http.Request) error {
	payload := &rankList{}
	if err := service.DecodeRequest(req, payload); err != nil {
		return err
	}
	payload.Finalize()
	if err := payload.Validate(); err != nil {
		goa.ContextRequest(ctx).Payload = payload
		return err
	}
	goa.ContextRequest(ctx).Payload = payload.Publicize()
	return nil
}
unmarshalCreateListsPayload unmarshals the request body into the context request data Payload field.
package app
import (
	"context"
	"net/http"
	"github.com/goadesign/goa"
	"github.com/goadesign/goa/cors"
	"github.com/goadesign/goa/encoding/msgpack"
)
func initService(service *goa.Service) {
	service.Encoder.Register(goa.NewJSONEncoder, "application/json")
	service.Encoder.Register(msgpack.NewEncoder, "application/msgpack")
	service.Decoder.Register(goa.NewJSONDecoder, "application/json")
	service.Decoder.Register(msgpack.NewDecoder, "application/msgpack")
	service.Encoder.Register(goa.NewJSONEncoder, "*/*")
	service.Decoder.Register(goa.NewJSONDecoder, "*/*")
}
type BackupController interface {
	goa.Muxer
	Delete(*DeleteBackupContext) error
	Status(*StatusBackupContext) error
}
func MountBackupController(service *goa.Service, ctrl BackupController) {
	initService(service)
	var h goa.Handler
	h = func(ctx context.Context, rw http.ResponseWriter, req *http.Request) error {
		if err := goa.ContextError(ctx); err != nil {
			return err
		}
		rctx, err := NewDeleteBackupContext(ctx, req, service)
		if err != nil {
			return err
		}
		return ctrl.Delete(rctx)
	}
	h = handleSecurity("jwt", h, "api:manage")
	service.Mux.Handle("DELETE", "/backup/:backup_id", ctrl.MuxHandler("delete", h, nil))
	service.LogInfo("mount", "ctrl", "Backup", "action", "Delete", "route", "DELETE /backup/:backup_id", "security", "jwt")
	h = func(ctx context.Context, rw http.ResponseWriter, req *http.Request) error {
		if err := goa.ContextError(ctx); err != nil {
			return err
		}
		rctx, err := NewStatusBackupContext(ctx, req, service)
		if err != nil {
			return err
		}
		return ctrl.Status(rctx)
	}
	h = handleSecurity("jwt", h, "api:manage")
	service.Mux.Handle("GET", "/backup/:backup_id", ctrl.MuxHandler("status", h, nil))
	service.LogInfo("mount", "ctrl", "Backup", "action", "Status", "route", "GET /backup/:backup_id", "security", "jwt")
}
type ElementsController interface {
	goa.Muxer
	Create(*CreateElementsContext) error
	Delete(*DeleteElementsContext) error
	DeleteMulti(*DeleteMultiElementsContext) error
	Get(*GetElementsContext) error
	GetAround(*GetAroundElementsContext) error
	GetMulti(*GetMultiElementsContext) error
	Put(*PutElementsContext) error
	PutMulti(*PutMultiElementsContext) error
}
func MountElementsController(service *goa.Service, ctrl ElementsController) {
	initService(service)
	var h goa.Handler
	h = func(ctx context.Context, rw http.ResponseWriter, req *http.Request) error {
		if err := goa.ContextError(ctx); err != nil {
			return err
		}
		rctx, err := NewCreateElementsContext(ctx, req, service)
		if err != nil {
			return err
		}
		if rawPayload := goa.ContextRequest(ctx).Payload; rawPayload != nil {
			rctx.Payload = rawPayload.(*Element)
		} else {
			return goa.MissingPayloadError()
		}
		return ctrl.Create(rctx)
	}
	h = handleSecurity("jwt", h, "api:update")
	service.Mux.Handle("POST", "/lists/:list_id/elements", ctrl.MuxHandler("create", h, unmarshalCreateElementsPayload))
	service.LogInfo("mount", "ctrl", "Elements", "action", "Create", "route", "POST /lists/:list_id/elements", "security", "jwt")
	h = func(ctx context.Context, rw http.ResponseWriter, req *http.Request) error {
		if err := goa.ContextError(ctx); err != nil {
			return err
		}
		rctx, err := NewDeleteElementsContext(ctx, req, service)
		if err != nil {
			return err
		}
		return ctrl.Delete(rctx)
	}
	h = handleSecurity("jwt", h, "api:delete")
	service.Mux.Handle("DELETE", "/lists/:list_id/elements/:element_id", ctrl.MuxHandler("delete", h, nil))
	service.LogInfo("mount", "ctrl", "Elements", "action", "Delete", "route", "DELETE /lists/:list_id/elements/:element_id", "security", "jwt")
	h = func(ctx context.Context, rw http.ResponseWriter, req *http.Request) error {
		if err := goa.ContextError(ctx); err != nil {
			return err
		}
		rctx, err := NewDeleteMultiElementsContext(ctx, req, service)
		if err != nil {
			return err
		}
		return ctrl.DeleteMulti(rctx)
	}
	h = handleSecurity("jwt", h, "api:delete")
	service.Mux.Handle("DELETE", "/lists/:list_id/elements", ctrl.MuxHandler("delete-multi", h, nil))
	service.LogInfo("mount", "ctrl", "Elements", "action", "DeleteMulti", "route", "DELETE /lists/:list_id/elements", "security", "jwt")
	h = func(ctx context.Context, rw http.ResponseWriter, req *http.Request) error {
		if err := goa.ContextError(ctx); err != nil {
			return err
		}
		rctx, err := NewGetElementsContext(ctx, req, service)
		if err != nil {
			return err
		}
		return ctrl.Get(rctx)
	}
	h = handleSecurity("jwt", h, "api:read")
	service.Mux.Handle("GET", "/lists/:list_id/elements/:element_id", ctrl.MuxHandler("get", h, nil))
	service.LogInfo("mount", "ctrl", "Elements", "action", "Get", "route", "GET /lists/:list_id/elements/:element_id", "security", "jwt")
	h = func(ctx context.Context, rw http.ResponseWriter, req *http.Request) error {
		if err := goa.ContextError(ctx); err != nil {
			return err
		}
		rctx, err := NewGetAroundElementsContext(ctx, req, service)
		if err != nil {
			return err
		}
		if rawPayload := goa.ContextRequest(ctx).Payload; rawPayload != nil {
			rctx.Payload = rawPayload.(*MultiElement)
		} else {
			return goa.MissingPayloadError()
		}
		return ctrl.GetAround(rctx)
	}
	h = handleSecurity("jwt", h, "api:read")
	service.Mux.Handle("POST", "/lists/:list_id/elements/:element_id/around", ctrl.MuxHandler("get-around", h, unmarshalGetAroundElementsPayload))
	service.LogInfo("mount", "ctrl", "Elements", "action", "GetAround", "route", "POST /lists/:list_id/elements/:element_id/around", "security", "jwt")
	h = func(ctx context.Context, rw http.ResponseWriter, req *http.Request) error {
		if err := goa.ContextError(ctx); err != nil {
			return err
		}
		rctx, err := NewGetMultiElementsContext(ctx, req, service)
		if err != nil {
			return err
		}
		if rawPayload := goa.ContextRequest(ctx).Payload; rawPayload != nil {
			rctx.Payload = rawPayload.(*MultiElement)
		} else {
			return goa.MissingPayloadError()
		}
		return ctrl.GetMulti(rctx)
	}
	h = handleSecurity("jwt", h, "api:read")
	service.Mux.Handle("POST", "/lists/:list_id/elements/find", ctrl.MuxHandler("get-multi", h, unmarshalGetMultiElementsPayload))
	service.LogInfo("mount", "ctrl", "Elements", "action", "GetMulti", "route", "POST /lists/:list_id/elements/find", "security", "jwt")
	h = func(ctx context.Context, rw http.ResponseWriter, req *http.Request) error {
		if err := goa.ContextError(ctx); err != nil {
			return err
		}
		rctx, err := NewPutElementsContext(ctx, req, service)
		if err != nil {
			return err
		}
		if rawPayload := goa.ContextRequest(ctx).Payload; rawPayload != nil {
			rctx.Payload = rawPayload.(*Element)
		} else {
			return goa.MissingPayloadError()
		}
		return ctrl.Put(rctx)
	}
	h = handleSecurity("jwt", h, "api:update")
	service.Mux.Handle("PUT", "/lists/:list_id/elements/:element_id", ctrl.MuxHandler("put", h, unmarshalPutElementsPayload))
	service.LogInfo("mount", "ctrl", "Elements", "action", "Put", "route", "PUT /lists/:list_id/elements/:element_id", "security", "jwt")
	h = func(ctx context.Context, rw http.ResponseWriter, req *http.Request) error {
		if err := goa.ContextError(ctx); err != nil {
			return err
		}
		rctx, err := NewPutMultiElementsContext(ctx, req, service)
		if err != nil {
			return err
		}
		if rawPayload := goa.ContextRequest(ctx).Payload; rawPayload != nil {
			rctx.Payload = rawPayload.(PutMultiElementsPayload)
		} else {
			return goa.MissingPayloadError()
		}
		return ctrl.PutMulti(rctx)
	}
	h = handleSecurity("jwt", h, "api:update")
	service.Mux.Handle("PUT", "/lists/:list_id/elements", ctrl.MuxHandler("put-multi", h, unmarshalPutMultiElementsPayload))
	service.LogInfo("mount", "ctrl", "Elements", "action", "PutMulti", "route", "PUT /lists/:list_id/elements", "security", "jwt")
}
func unmarshalCreateElementsPayload(ctx context.Context, service *goa.Service, req *http.Request) error {
	payload := &element{}
	if err := service.DecodeRequest(req, payload); err != nil {
		return err
	}
	if err := payload.Validate(); err != nil {
		goa.ContextRequest(ctx).Payload = payload
		return err
	}
	goa.ContextRequest(ctx).Payload = payload.Publicize()
	return nil
}
func unmarshalGetAroundElementsPayload(ctx context.Context, service *goa.Service, req *http.Request) error {
	payload := &multiElement{}
	if err := service.DecodeRequest(req, payload); err != nil {
		return err
	}
	if err := payload.Validate(); err != nil {
		goa.ContextRequest(ctx).Payload = payload
		return err
	}
	goa.ContextRequest(ctx).Payload = payload.Publicize()
	return nil
}
func unmarshalGetMultiElementsPayload(ctx context.Context, service *goa.Service, req *http.Request) error {
	payload := &multiElement{}
	if err := service.DecodeRequest(req, payload); err != nil {
		return err
	}
	if err := payload.Validate(); err != nil {
		goa.ContextRequest(ctx).Payload = payload
		return err
	}
	goa.ContextRequest(ctx).Payload = payload.Publicize()
	return nil
}
func unmarshalPutElementsPayload(ctx context.Context, service *goa.Service, req *http.Request) error {
	payload := &element{}
	if err := service.DecodeRequest(req, payload); err != nil {
		return err
	}
	if err := payload.Validate(); err != nil {
		goa.ContextRequest(ctx).Payload = payload
		return err
	}
	goa.ContextRequest(ctx).Payload = payload.Publicize()
	return nil
}
func unmarshalPutMultiElementsPayload(ctx context.Context, service *goa.Service, req *http.Request) error {
	var payload PutMultiElementsPayload
	if err := service.DecodeRequest(req, &payload); err != nil {
		return err
	}
	if err := payload.Validate(); err != nil {
		goa.ContextRequest(ctx).Payload = payload
		return err
	}
	goa.ContextRequest(ctx).Payload = payload
	return nil
}
type HealthController interface {
	goa.Muxer
	Health(*HealthHealthContext) error
	Root(*RootHealthContext) error
}
func MountHealthController(service *goa.Service, ctrl HealthController) {
	initService(service)
	var h goa.Handler
	h = func(ctx context.Context, rw http.ResponseWriter, req *http.Request) error {
		if err := goa.ContextError(ctx); err != nil {
			return err
		}
		rctx, err := NewHealthHealthContext(ctx, req, service)
		if err != nil {
			return err
		}
		return ctrl.Health(rctx)
	}
	h = handleSecurity("jwt", h, "api:manage")
	service.Mux.Handle("GET", "/health", ctrl.MuxHandler("health", h, nil))
	service.LogInfo("mount", "ctrl", "Health", "action", "Health", "route", "GET /health", "security", "jwt")
	h = func(ctx context.Context, rw http.ResponseWriter, req *http.Request) error {
		if err := goa.ContextError(ctx); err != nil {
			return err
		}
		rctx, err := NewRootHealthContext(ctx, req, service)
		if err != nil {
			return err
		}
		return ctrl.Root(rctx)
	}
	h = handleSecurity("jwt", h, "api:manage")
	service.Mux.Handle("GET", "/", ctrl.MuxHandler("root", h, nil))
	service.LogInfo("mount", "ctrl", "Health", "action", "Root", "route", "GET /", "security", "jwt")
}
type JWTController interface {
	goa.Muxer
	JWT(*JWTJWTContext) error
}
func MountJWTController(service *goa.Service, ctrl JWTController) {
	initService(service)
	var h goa.Handler
	h = func(ctx context.Context, rw http.ResponseWriter, req *http.Request) error {
		if err := goa.ContextError(ctx); err != nil {
			return err
		}
		rctx, err := NewJWTJWTContext(ctx, req, service)
		if err != nil {
			return err
		}
		return ctrl.JWT(rctx)
	}
	h = handleSecurity("jwt", h, "api:manage")
	service.Mux.Handle("POST", "/jwt", ctrl.MuxHandler("jwt", h, nil))
	service.LogInfo("mount", "ctrl", "JWT", "action", "JWT", "route", "POST /jwt", "security", "jwt")
}
type ListsController interface {
	goa.Muxer
	Clone(*CloneListsContext) error
	Create(*CreateListsContext) error
	Delete(*DeleteListsContext) error
	Get(*GetListsContext) error
	GetPercentile(*GetPercentileListsContext) error
	GetRange(*GetRangeListsContext) error
	GetAll(*GetAllListsContext) error
	Reindex(*ReindexListsContext) error
	Repair(*RepairListsContext) error
	Verify(*VerifyListsContext) error
}
func MountListsController(service *goa.Service, ctrl ListsController) {
	initService(service)
	var h goa.Handler
	h = func(ctx context.Context, rw http.ResponseWriter, req *http.Request) error {
		if err := goa.ContextError(ctx); err != nil {
			return err
		}
		rctx, err := NewCloneListsContext(ctx, req, service)
		if err != nil {
			return err
		}
		if rawPayload := goa.ContextRequest(ctx).Payload; rawPayload != nil {
			rctx.Payload = rawPayload.(*RankList)
		} else {
			return goa.MissingPayloadError()
		}
		return ctrl.Clone(rctx)
	}
	h = handleSecurity("jwt", h, "api:manage")
	service.Mux.Handle("PUT", "/lists/:list_id/clone", ctrl.MuxHandler("clone", h, unmarshalCloneListsPayload))
	service.LogInfo("mount", "ctrl", "Lists", "action", "Clone", "route", "PUT /lists/:list_id/clone", "security", "jwt")
	h = func(ctx context.Context, rw http.ResponseWriter, req *http.Request) error {
		if err := goa.ContextError(ctx); err != nil {
			return err
		}
		rctx, err := NewCreateListsContext(ctx, req, service)
		if err != nil {
			return err
		}
		if rawPayload := goa.ContextRequest(ctx).Payload; rawPayload != nil {
			rctx.Payload = rawPayload.(*RankList)
		} else {
			return goa.MissingPayloadError()
		}
		return ctrl.Create(rctx)
	}
	h = handleSecurity("jwt", h, "api:manage")
	service.Mux.Handle("POST", "/lists", ctrl.MuxHandler("create", h, unmarshalCreateListsPayload))
	service.LogInfo("mount", "ctrl", "Lists", "action", "Create", "route", "POST /lists", "security", "jwt")
	h = func(ctx context.Context, rw http.ResponseWriter, req *http.Request) error {
		if err := goa.ContextError(ctx); err != nil {
			return err
		}
		rctx, err := NewDeleteListsContext(ctx, req, service)
		if err != nil {
			return err
		}
		return ctrl.Delete(rctx)
	}
	h = handleSecurity("jwt", h, "api:manage")
	service.Mux.Handle("DELETE", "/lists/:list_id", ctrl.MuxHandler("delete", h, nil))
	service.LogInfo("mount", "ctrl", "Lists", "action", "Delete", "route", "DELETE /lists/:list_id", "security", "jwt")
	h = func(ctx context.Context, rw http.ResponseWriter, req *http.Request) error {
		if err := goa.ContextError(ctx); err != nil {
			return err
		}
		rctx, err := NewGetListsContext(ctx, req, service)
		if err != nil {
			return err
		}
		return ctrl.Get(rctx)
	}
	h = handleSecurity("jwt", h, "api:read")
	service.Mux.Handle("GET", "/lists/:list_id", ctrl.MuxHandler("get", h, nil))
	service.LogInfo("mount", "ctrl", "Lists", "action", "Get", "route", "GET /lists/:list_id", "security", "jwt")
	h = func(ctx context.Context, rw http.ResponseWriter, req *http.Request) error {
		if err := goa.ContextError(ctx); err != nil {
			return err
		}
		rctx, err := NewGetPercentileListsContext(ctx, req, service)
		if err != nil {
			return err
		}
		return ctrl.GetPercentile(rctx)
	}
	h = handleSecurity("jwt", h, "api:read")
	service.Mux.Handle("GET", "/lists/:list_id/percentile", ctrl.MuxHandler("get-percentile", h, nil))
	service.LogInfo("mount", "ctrl", "Lists", "action", "GetPercentile", "route", "GET /lists/:list_id/percentile", "security", "jwt")
	h = func(ctx context.Context, rw http.ResponseWriter, req *http.Request) error {
		if err := goa.ContextError(ctx); err != nil {
			return err
		}
		rctx, err := NewGetRangeListsContext(ctx, req, service)
		if err != nil {
			return err
		}
		return ctrl.GetRange(rctx)
	}
	h = handleSecurity("jwt", h, "api:read")
	service.Mux.Handle("GET", "/lists/:list_id/range", ctrl.MuxHandler("get-range", h, nil))
	service.LogInfo("mount", "ctrl", "Lists", "action", "GetRange", "route", "GET /lists/:list_id/range", "security", "jwt")
	h = func(ctx context.Context, rw http.ResponseWriter, req *http.Request) error {
		if err := goa.ContextError(ctx); err != nil {
			return err
		}
		rctx, err := NewGetAllListsContext(ctx, req, service)
		if err != nil {
			return err
		}
		return ctrl.GetAll(rctx)
	}
	h = handleSecurity("jwt", h, "api:manage")
	service.Mux.Handle("GET", "/lists", ctrl.MuxHandler("get_all", h, nil))
	service.LogInfo("mount", "ctrl", "Lists", "action", "GetAll", "route", "GET /lists", "security", "jwt")
	h = func(ctx context.Context, rw http.ResponseWriter, req *http.Request) error {
		if err := goa.ContextError(ctx); err != nil {
			return err
		}
		rctx, err := NewReindexListsContext(ctx, req, service)
		if err != nil {
			return err
		}
		return ctrl.Reindex(rctx)
	}
	h = handleSecurity("jwt", h, "api:manage")
	service.Mux.Handle("PUT", "/lists/:list_id/reindex", ctrl.MuxHandler("reindex", h, nil))
	service.LogInfo("mount", "ctrl", "Lists", "action", "Reindex", "route", "PUT /lists/:list_id/reindex", "security", "jwt")
	h = func(ctx context.Context, rw http.ResponseWriter, req *http.Request) error {
		if err := goa.ContextError(ctx); err != nil {
			return err
		}
		rctx, err := NewRepairListsContext(ctx, req, service)
		if err != nil {
			return err
		}
		return ctrl.Repair(rctx)
	}
	h = handleSecurity("jwt", h, "api:manage")
	service.Mux.Handle("PUT", "/lists/:list_id/repair", ctrl.MuxHandler("repair", h, nil))
	service.LogInfo("mount", "ctrl", "Lists", "action", "Repair", "route", "PUT /lists/:list_id/repair", "security", "jwt")
	h = func(ctx context.Context, rw http.ResponseWriter, req *http.Request) error {
		if err := goa.ContextError(ctx); err != nil {
			return err
		}
		rctx, err := NewVerifyListsContext(ctx, req, service)
		if err != nil {
			return err
		}
		return ctrl.Verify(rctx)
	}
	h = handleSecurity("jwt", h, "api:manage")
	service.Mux.Handle("PUT", "/lists/:list_id/verify", ctrl.MuxHandler("verify", h, nil))
	service.LogInfo("mount", "ctrl", "Lists", "action", "Verify", "route", "PUT /lists/:list_id/verify", "security", "jwt")
}
func unmarshalCloneListsPayload(ctx context.Context, service *goa.Service, req *http.Request) error {
	payload := &rankList{}
	if err := service.DecodeRequest(req, payload); err != nil {
		return err
	}
	payload.Finalize()
	if err := payload.Validate(); err != nil {
		goa.ContextRequest(ctx).Payload = payload
		return err
	}
	goa.ContextRequest(ctx).Payload = payload.Publicize()
	return nil
}