// Package api provides primitives to interact with the openapi HTTP API.
//
// Code generated by github.com/oapi-codegen/oapi-codegen/v2 version v2.4.1 DO NOT EDIT.
package api

import (
	"bytes"
	"compress/gzip"
	"encoding/base64"
	"fmt"
	"net/http"
	"net/url"
	"path"
	"strings"

	. "github.com/aceeric/ociregistry/api/models"
	"github.com/getkin/kin-openapi/openapi3"
	"github.com/labstack/echo/v4"
	"github.com/oapi-codegen/runtime"
)

// ServerInterface represents all server handlers.
type ServerInterface interface {

	// (GET /)
	Root(ctx echo.Context) error

	// (GET /cmd/blob/list)
	CmdBloblist(ctx echo.Context, params CmdBloblistParams) error

	// (GET /cmd/image/list)
	CmdImagelist(ctx echo.Context, params CmdImagelistParams) error

	// (GET /cmd/manifest/list)
	CmdManifestlist(ctx echo.Context, params CmdManifestlistParams) error

	// (DELETE /cmd/prune)
	CmdPrune(ctx echo.Context, params CmdPruneParams) error

	// (GET /cmd/stop)
	CmdStop(ctx echo.Context) error

	// (GET /v2/)
	V2Default(ctx echo.Context) error

	// (HEAD /v2/)
	V2HeadDefault(ctx echo.Context) error

	// (GET /v2/auth)
	V2Auth(ctx echo.Context, params V2AuthParams) error

	// (DELETE /v2/{image}/blobs/{digest})
	V2DeleteImageBlobsDigest(ctx echo.Context, image string, digest string) error

	// (GET /v2/{image}/blobs/{digest})
	V2GetImageBlobsDigest(ctx echo.Context, image string, digest string) error

	// (HEAD /v2/{image}/blobs/{digest})
	V2HeadImageBlobsDigest(ctx echo.Context, image string, digest string) error

	// (DELETE /v2/{image}/manifests/{reference})
	V2DeleteImageManifestsReference(ctx echo.Context, image string, reference string) error

	// (GET /v2/{image}/manifests/{reference})
	V2GetImageManifestsReference(ctx echo.Context, image string, reference string, params V2GetImageManifestsReferenceParams) error

	// (HEAD /v2/{image}/manifests/{reference})
	V2HeadImageManifestsReference(ctx echo.Context, image string, reference string, params V2HeadImageManifestsReferenceParams) error

	// (PUT /v2/{image}/manifests/{reference})
	V2PutImageManifestsReference(ctx echo.Context, image string, reference string) error

	// (POST /v2/{name}/blobs/uploads)
	V2PostNameBlobsUploads(ctx echo.Context, name string, params V2PostNameBlobsUploadsParams) error

	// (GET /v2/{name}/blobs/uploads/{reference})
	V2GetNameBlobsUploadsReference(ctx echo.Context, name string, reference string) error

	// (PATCH /v2/{name}/blobs/uploads/{reference})
	V2PatchNameBlobsUploadsReference(ctx echo.Context, name string, reference string) error

	// (PUT /v2/{name}/blobs/uploads/{reference})
	V2PutNameBlobsUploadsReference(ctx echo.Context, name string, reference string, params V2PutNameBlobsUploadsReferenceParams) error

	// (GET /v2/{name}/referrers/{digest})
	V2GetNameReferrersDigest(ctx echo.Context, name string, digest string, params V2GetNameReferrersDigestParams) error

	// (GET /v2/{name}/tags/list)
	V2GetNameTagsList(ctx echo.Context, name string, params V2GetNameTagsListParams) error

	// (DELETE /v2/{ns}/{org}/{image}/blobs/{digest})
	V2DeleteNsOrgImageBlobsDigest(ctx echo.Context, ns string, org string, image string, digest string) error

	// (GET /v2/{ns}/{org}/{image}/blobs/{digest})
	V2GetNsOrgImageBlobsDigest(ctx echo.Context, ns string, org string, image string, digest string) error

	// (HEAD /v2/{ns}/{org}/{image}/blobs/{digest})
	V2HeadNsOrgImageBlobsDigest(ctx echo.Context, ns string, org string, image string, digest string) error

	// (DELETE /v2/{ns}/{org}/{image}/manifests/{reference})
	V2DeleteNsOrgImageManifestsReference(ctx echo.Context, ns string, org string, image string, reference string) error

	// (GET /v2/{ns}/{org}/{image}/manifests/{reference})
	V2GetNsOrgImageManifestsReference(ctx echo.Context, ns string, org string, image string, reference string) error

	// (HEAD /v2/{ns}/{org}/{image}/manifests/{reference})
	V2HeadNsOrgImageManifestsReference(ctx echo.Context, ns string, org string, image string, reference string) error

	// (PUT /v2/{ns}/{org}/{image}/manifests/{reference})
	V2PutNsOrgImageManifestsReference(ctx echo.Context, ns string, org string, image string, reference string) error

	// (DELETE /v2/{org}/{image}/blobs/{digest})
	V2DeleteOrgImageBlobsDigest(ctx echo.Context, org string, image string, digest string) error

	// (GET /v2/{org}/{image}/blobs/{digest})
	V2GetOrgImageBlobsDigest(ctx echo.Context, org string, image string, digest string) error

	// (HEAD /v2/{org}/{image}/blobs/{digest})
	V2HeadOrgImageBlobsDigest(ctx echo.Context, org string, image string, digest string) error

	// (DELETE /v2/{org}/{image}/manifests/{reference})
	V2DeleteOrgImageManifestsReference(ctx echo.Context, org string, image string, reference string) error

	// (GET /v2/{org}/{image}/manifests/{reference})
	V2GetOrgImageManifestsReference(ctx echo.Context, org string, image string, reference string, params V2GetOrgImageManifestsReferenceParams) error

	// (HEAD /v2/{org}/{image}/manifests/{reference})
	V2HeadOrgImageManifestsReference(ctx echo.Context, org string, image string, reference string, params V2HeadOrgImageManifestsReferenceParams) error

	// (PUT /v2/{org}/{image}/manifests/{reference})
	V2PutOrgImageManifestsReference(ctx echo.Context, org string, image string, reference string) error
}

// ServerInterfaceWrapper converts echo contexts to parameters.
type ServerInterfaceWrapper struct {
	Handler ServerInterface
}

// Root converts echo context to params.
func (w *ServerInterfaceWrapper) Root(ctx echo.Context) error {
	var err error

	// Invoke the callback with all the unmarshaled arguments
	err = w.Handler.Root(ctx)
	return err
}

// CmdBloblist converts echo context to params.
func (w *ServerInterfaceWrapper) CmdBloblist(ctx echo.Context) error {
	var err error

	// Parameter object where we will unmarshal all parameters from the context
	var params CmdBloblistParams
	// ------------- Optional query parameter "substr" -------------

	err = runtime.BindQueryParameter("form", true, false, "substr", ctx.QueryParams(), &params.Substr)
	if err != nil {
		return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter substr: %s", err))
	}

	// ------------- Optional query parameter "count" -------------

	err = runtime.BindQueryParameter("form", true, false, "count", ctx.QueryParams(), &params.Count)
	if err != nil {
		return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter count: %s", err))
	}

	// Invoke the callback with all the unmarshaled arguments
	err = w.Handler.CmdBloblist(ctx, params)
	return err
}

// CmdImagelist converts echo context to params.
func (w *ServerInterfaceWrapper) CmdImagelist(ctx echo.Context) error {
	var err error

	// Parameter object where we will unmarshal all parameters from the context
	var params CmdImagelistParams
	// ------------- Optional query parameter "pattern" -------------

	err = runtime.BindQueryParameter("form", true, false, "pattern", ctx.QueryParams(), &params.Pattern)
	if err != nil {
		return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter pattern: %s", err))
	}

	// ------------- Optional query parameter "digest" -------------

	err = runtime.BindQueryParameter("form", true, false, "digest", ctx.QueryParams(), &params.Digest)
	if err != nil {
		return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter digest: %s", err))
	}

	// ------------- Optional query parameter "count" -------------

	err = runtime.BindQueryParameter("form", true, false, "count", ctx.QueryParams(), &params.Count)
	if err != nil {
		return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter count: %s", err))
	}

	// Invoke the callback with all the unmarshaled arguments
	err = w.Handler.CmdImagelist(ctx, params)
	return err
}

// CmdManifestlist converts echo context to params.
func (w *ServerInterfaceWrapper) CmdManifestlist(ctx echo.Context) error {
	var err error

	// Parameter object where we will unmarshal all parameters from the context
	var params CmdManifestlistParams
	// ------------- Optional query parameter "pattern" -------------

	err = runtime.BindQueryParameter("form", true, false, "pattern", ctx.QueryParams(), &params.Pattern)
	if err != nil {
		return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter pattern: %s", err))
	}

	// ------------- Optional query parameter "count" -------------

	err = runtime.BindQueryParameter("form", true, false, "count", ctx.QueryParams(), &params.Count)
	if err != nil {
		return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter count: %s", err))
	}

	// Invoke the callback with all the unmarshaled arguments
	err = w.Handler.CmdManifestlist(ctx, params)
	return err
}

// CmdPrune converts echo context to params.
func (w *ServerInterfaceWrapper) CmdPrune(ctx echo.Context) error {
	var err error

	// Parameter object where we will unmarshal all parameters from the context
	var params CmdPruneParams
	// ------------- Required query parameter "type" -------------

	err = runtime.BindQueryParameter("form", true, true, "type", ctx.QueryParams(), &params.Type)
	if err != nil {
		return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter type: %s", err))
	}

	// ------------- Optional query parameter "dur" -------------

	err = runtime.BindQueryParameter("form", true, false, "dur", ctx.QueryParams(), &params.Dur)
	if err != nil {
		return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter dur: %s", err))
	}

	// ------------- Optional query parameter "expr" -------------

	err = runtime.BindQueryParameter("form", true, false, "expr", ctx.QueryParams(), &params.Expr)
	if err != nil {
		return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter expr: %s", err))
	}

	// ------------- Optional query parameter "dryRun" -------------

	err = runtime.BindQueryParameter("form", true, false, "dryRun", ctx.QueryParams(), &params.DryRun)
	if err != nil {
		return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter dryRun: %s", err))
	}

	// ------------- Optional query parameter "count" -------------

	err = runtime.BindQueryParameter("form", true, false, "count", ctx.QueryParams(), &params.Count)
	if err != nil {
		return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter count: %s", err))
	}

	// Invoke the callback with all the unmarshaled arguments
	err = w.Handler.CmdPrune(ctx, params)
	return err
}

// CmdStop converts echo context to params.
func (w *ServerInterfaceWrapper) CmdStop(ctx echo.Context) error {
	var err error

	// Invoke the callback with all the unmarshaled arguments
	err = w.Handler.CmdStop(ctx)
	return err
}

// V2Default converts echo context to params.
func (w *ServerInterfaceWrapper) V2Default(ctx echo.Context) error {
	var err error

	// Invoke the callback with all the unmarshaled arguments
	err = w.Handler.V2Default(ctx)
	return err
}

// V2HeadDefault converts echo context to params.
func (w *ServerInterfaceWrapper) V2HeadDefault(ctx echo.Context) error {
	var err error

	// Invoke the callback with all the unmarshaled arguments
	err = w.Handler.V2HeadDefault(ctx)
	return err
}

// V2Auth converts echo context to params.
func (w *ServerInterfaceWrapper) V2Auth(ctx echo.Context) error {
	var err error

	// Parameter object where we will unmarshal all parameters from the context
	var params V2AuthParams
	// ------------- Optional query parameter "scope" -------------

	err = runtime.BindQueryParameter("form", true, false, "scope", ctx.QueryParams(), &params.Scope)
	if err != nil {
		return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter scope: %s", err))
	}

	// ------------- Optional query parameter "service" -------------

	err = runtime.BindQueryParameter("form", true, false, "service", ctx.QueryParams(), &params.Service)
	if err != nil {
		return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter service: %s", err))
	}

	headers := ctx.Request().Header
	// ------------- Required header parameter "authorization" -------------
	if valueList, found := headers[http.CanonicalHeaderKey("authorization")]; found {
		var Authorization string
		n := len(valueList)
		if n != 1 {
			return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Expected one value for authorization, got %d", n))
		}

		err = runtime.BindStyledParameterWithOptions("simple", "authorization", valueList[0], &Authorization, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationHeader, Explode: false, Required: true})
		if err != nil {
			return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter authorization: %s", err))
		}

		params.Authorization = Authorization
	} else {
		return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Header parameter authorization is required, but not found"))
	}

	// Invoke the callback with all the unmarshaled arguments
	err = w.Handler.V2Auth(ctx, params)
	return err
}

// V2DeleteImageBlobsDigest converts echo context to params.
func (w *ServerInterfaceWrapper) V2DeleteImageBlobsDigest(ctx echo.Context) error {
	var err error
	// ------------- Path parameter "image" -------------
	var image string

	err = runtime.BindStyledParameterWithOptions("simple", "image", ctx.Param("image"), &image, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true})
	if err != nil {
		return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter image: %s", err))
	}

	// ------------- Path parameter "digest" -------------
	var digest string

	err = runtime.BindStyledParameterWithOptions("simple", "digest", ctx.Param("digest"), &digest, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true})
	if err != nil {
		return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter digest: %s", err))
	}

	// Invoke the callback with all the unmarshaled arguments
	err = w.Handler.V2DeleteImageBlobsDigest(ctx, image, digest)
	return err
}

// V2GetImageBlobsDigest converts echo context to params.
func (w *ServerInterfaceWrapper) V2GetImageBlobsDigest(ctx echo.Context) error {
	var err error
	// ------------- Path parameter "image" -------------
	var image string

	err = runtime.BindStyledParameterWithOptions("simple", "image", ctx.Param("image"), &image, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true})
	if err != nil {
		return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter image: %s", err))
	}

	// ------------- Path parameter "digest" -------------
	var digest string

	err = runtime.BindStyledParameterWithOptions("simple", "digest", ctx.Param("digest"), &digest, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true})
	if err != nil {
		return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter digest: %s", err))
	}

	// Invoke the callback with all the unmarshaled arguments
	err = w.Handler.V2GetImageBlobsDigest(ctx, image, digest)
	return err
}

// V2HeadImageBlobsDigest converts echo context to params.
func (w *ServerInterfaceWrapper) V2HeadImageBlobsDigest(ctx echo.Context) error {
	var err error
	// ------------- Path parameter "image" -------------
	var image string

	err = runtime.BindStyledParameterWithOptions("simple", "image", ctx.Param("image"), &image, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true})
	if err != nil {
		return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter image: %s", err))
	}

	// ------------- Path parameter "digest" -------------
	var digest string

	err = runtime.BindStyledParameterWithOptions("simple", "digest", ctx.Param("digest"), &digest, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true})
	if err != nil {
		return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter digest: %s", err))
	}

	// Invoke the callback with all the unmarshaled arguments
	err = w.Handler.V2HeadImageBlobsDigest(ctx, image, digest)
	return err
}

// V2DeleteImageManifestsReference converts echo context to params.
func (w *ServerInterfaceWrapper) V2DeleteImageManifestsReference(ctx echo.Context) error {
	var err error
	// ------------- Path parameter "image" -------------
	var image string

	err = runtime.BindStyledParameterWithOptions("simple", "image", ctx.Param("image"), &image, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true})
	if err != nil {
		return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter image: %s", err))
	}

	// ------------- Path parameter "reference" -------------
	var reference string

	err = runtime.BindStyledParameterWithOptions("simple", "reference", ctx.Param("reference"), &reference, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true})
	if err != nil {
		return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter reference: %s", err))
	}

	// Invoke the callback with all the unmarshaled arguments
	err = w.Handler.V2DeleteImageManifestsReference(ctx, image, reference)
	return err
}

// V2GetImageManifestsReference converts echo context to params.
func (w *ServerInterfaceWrapper) V2GetImageManifestsReference(ctx echo.Context) error {
	var err error
	// ------------- Path parameter "image" -------------
	var image string

	err = runtime.BindStyledParameterWithOptions("simple", "image", ctx.Param("image"), &image, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true})
	if err != nil {
		return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter image: %s", err))
	}

	// ------------- Path parameter "reference" -------------
	var reference string

	err = runtime.BindStyledParameterWithOptions("simple", "reference", ctx.Param("reference"), &reference, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true})
	if err != nil {
		return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter reference: %s", err))
	}

	// Parameter object where we will unmarshal all parameters from the context
	var params V2GetImageManifestsReferenceParams
	// ------------- Optional query parameter "ns" -------------

	err = runtime.BindQueryParameter("form", true, false, "ns", ctx.QueryParams(), &params.Ns)
	if err != nil {
		return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter ns: %s", err))
	}

	// Invoke the callback with all the unmarshaled arguments
	err = w.Handler.V2GetImageManifestsReference(ctx, image, reference, params)
	return err
}

// V2HeadImageManifestsReference converts echo context to params.
func (w *ServerInterfaceWrapper) V2HeadImageManifestsReference(ctx echo.Context) error {
	var err error
	// ------------- Path parameter "image" -------------
	var image string

	err = runtime.BindStyledParameterWithOptions("simple", "image", ctx.Param("image"), &image, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true})
	if err != nil {
		return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter image: %s", err))
	}

	// ------------- Path parameter "reference" -------------
	var reference string

	err = runtime.BindStyledParameterWithOptions("simple", "reference", ctx.Param("reference"), &reference, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true})
	if err != nil {
		return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter reference: %s", err))
	}

	// Parameter object where we will unmarshal all parameters from the context
	var params V2HeadImageManifestsReferenceParams
	// ------------- Optional query parameter "ns" -------------

	err = runtime.BindQueryParameter("form", true, false, "ns", ctx.QueryParams(), &params.Ns)
	if err != nil {
		return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter ns: %s", err))
	}

	// Invoke the callback with all the unmarshaled arguments
	err = w.Handler.V2HeadImageManifestsReference(ctx, image, reference, params)
	return err
}

// V2PutImageManifestsReference converts echo context to params.
func (w *ServerInterfaceWrapper) V2PutImageManifestsReference(ctx echo.Context) error {
	var err error
	// ------------- Path parameter "image" -------------
	var image string

	err = runtime.BindStyledParameterWithOptions("simple", "image", ctx.Param("image"), &image, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true})
	if err != nil {
		return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter image: %s", err))
	}

	// ------------- Path parameter "reference" -------------
	var reference string

	err = runtime.BindStyledParameterWithOptions("simple", "reference", ctx.Param("reference"), &reference, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true})
	if err != nil {
		return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter reference: %s", err))
	}

	// Invoke the callback with all the unmarshaled arguments
	err = w.Handler.V2PutImageManifestsReference(ctx, image, reference)
	return err
}

// V2PostNameBlobsUploads converts echo context to params.
func (w *ServerInterfaceWrapper) V2PostNameBlobsUploads(ctx echo.Context) error {
	var err error
	// ------------- Path parameter "name" -------------
	var name string

	err = runtime.BindStyledParameterWithOptions("simple", "name", ctx.Param("name"), &name, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true})
	if err != nil {
		return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter name: %s", err))
	}

	// Parameter object where we will unmarshal all parameters from the context
	var params V2PostNameBlobsUploadsParams
	// ------------- Optional query parameter "digest" -------------

	err = runtime.BindQueryParameter("form", true, false, "digest", ctx.QueryParams(), &params.Digest)
	if err != nil {
		return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter digest: %s", err))
	}

	// ------------- Optional query parameter "mount" -------------

	err = runtime.BindQueryParameter("form", true, false, "mount", ctx.QueryParams(), &params.Mount)
	if err != nil {
		return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter mount: %s", err))
	}

	// ------------- Optional query parameter "from" -------------

	err = runtime.BindQueryParameter("form", true, false, "from", ctx.QueryParams(), &params.From)
	if err != nil {
		return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter from: %s", err))
	}

	// Invoke the callback with all the unmarshaled arguments
	err = w.Handler.V2PostNameBlobsUploads(ctx, name, params)
	return err
}

// V2GetNameBlobsUploadsReference converts echo context to params.
func (w *ServerInterfaceWrapper) V2GetNameBlobsUploadsReference(ctx echo.Context) error {
	var err error
	// ------------- Path parameter "name" -------------
	var name string

	err = runtime.BindStyledParameterWithOptions("simple", "name", ctx.Param("name"), &name, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true})
	if err != nil {
		return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter name: %s", err))
	}

	// ------------- Path parameter "reference" -------------
	var reference string

	err = runtime.BindStyledParameterWithOptions("simple", "reference", ctx.Param("reference"), &reference, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true})
	if err != nil {
		return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter reference: %s", err))
	}

	// Invoke the callback with all the unmarshaled arguments
	err = w.Handler.V2GetNameBlobsUploadsReference(ctx, name, reference)
	return err
}

// V2PatchNameBlobsUploadsReference converts echo context to params.
func (w *ServerInterfaceWrapper) V2PatchNameBlobsUploadsReference(ctx echo.Context) error {
	var err error
	// ------------- Path parameter "name" -------------
	var name string

	err = runtime.BindStyledParameterWithOptions("simple", "name", ctx.Param("name"), &name, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true})
	if err != nil {
		return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter name: %s", err))
	}

	// ------------- Path parameter "reference" -------------
	var reference string

	err = runtime.BindStyledParameterWithOptions("simple", "reference", ctx.Param("reference"), &reference, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true})
	if err != nil {
		return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter reference: %s", err))
	}

	// Invoke the callback with all the unmarshaled arguments
	err = w.Handler.V2PatchNameBlobsUploadsReference(ctx, name, reference)
	return err
}

// V2PutNameBlobsUploadsReference converts echo context to params.
func (w *ServerInterfaceWrapper) V2PutNameBlobsUploadsReference(ctx echo.Context) error {
	var err error
	// ------------- Path parameter "name" -------------
	var name string

	err = runtime.BindStyledParameterWithOptions("simple", "name", ctx.Param("name"), &name, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true})
	if err != nil {
		return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter name: %s", err))
	}

	// ------------- Path parameter "reference" -------------
	var reference string

	err = runtime.BindStyledParameterWithOptions("simple", "reference", ctx.Param("reference"), &reference, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true})
	if err != nil {
		return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter reference: %s", err))
	}

	// Parameter object where we will unmarshal all parameters from the context
	var params V2PutNameBlobsUploadsReferenceParams
	// ------------- Optional query parameter "digest" -------------

	err = runtime.BindQueryParameter("form", true, false, "digest", ctx.QueryParams(), &params.Digest)
	if err != nil {
		return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter digest: %s", err))
	}

	// Invoke the callback with all the unmarshaled arguments
	err = w.Handler.V2PutNameBlobsUploadsReference(ctx, name, reference, params)
	return err
}

// V2GetNameReferrersDigest converts echo context to params.
func (w *ServerInterfaceWrapper) V2GetNameReferrersDigest(ctx echo.Context) error {
	var err error
	// ------------- Path parameter "name" -------------
	var name string

	err = runtime.BindStyledParameterWithOptions("simple", "name", ctx.Param("name"), &name, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true})
	if err != nil {
		return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter name: %s", err))
	}

	// ------------- Path parameter "digest" -------------
	var digest string

	err = runtime.BindStyledParameterWithOptions("simple", "digest", ctx.Param("digest"), &digest, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true})
	if err != nil {
		return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter digest: %s", err))
	}

	// Parameter object where we will unmarshal all parameters from the context
	var params V2GetNameReferrersDigestParams
	// ------------- Optional query parameter "artifactType" -------------

	err = runtime.BindQueryParameter("form", true, false, "artifactType", ctx.QueryParams(), &params.ArtifactType)
	if err != nil {
		return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter artifactType: %s", err))
	}

	// Invoke the callback with all the unmarshaled arguments
	err = w.Handler.V2GetNameReferrersDigest(ctx, name, digest, params)
	return err
}

// V2GetNameTagsList converts echo context to params.
func (w *ServerInterfaceWrapper) V2GetNameTagsList(ctx echo.Context) error {
	var err error
	// ------------- Path parameter "name" -------------
	var name string

	err = runtime.BindStyledParameterWithOptions("simple", "name", ctx.Param("name"), &name, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true})
	if err != nil {
		return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter name: %s", err))
	}

	// Parameter object where we will unmarshal all parameters from the context
	var params V2GetNameTagsListParams
	// ------------- Optional query parameter "n" -------------

	err = runtime.BindQueryParameter("form", true, false, "n", ctx.QueryParams(), &params.N)
	if err != nil {
		return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter n: %s", err))
	}

	// ------------- Optional query parameter "last" -------------

	err = runtime.BindQueryParameter("form", true, false, "last", ctx.QueryParams(), &params.Last)
	if err != nil {
		return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter last: %s", err))
	}

	// Invoke the callback with all the unmarshaled arguments
	err = w.Handler.V2GetNameTagsList(ctx, name, params)
	return err
}

// V2DeleteNsOrgImageBlobsDigest converts echo context to params.
func (w *ServerInterfaceWrapper) V2DeleteNsOrgImageBlobsDigest(ctx echo.Context) error {
	var err error
	// ------------- Path parameter "ns" -------------
	var ns string

	err = runtime.BindStyledParameterWithOptions("simple", "ns", ctx.Param("ns"), &ns, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true})
	if err != nil {
		return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter ns: %s", err))
	}

	// ------------- Path parameter "org" -------------
	var org string

	err = runtime.BindStyledParameterWithOptions("simple", "org", ctx.Param("org"), &org, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true})
	if err != nil {
		return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter org: %s", err))
	}

	// ------------- Path parameter "image" -------------
	var image string

	err = runtime.BindStyledParameterWithOptions("simple", "image", ctx.Param("image"), &image, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true})
	if err != nil {
		return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter image: %s", err))
	}

	// ------------- Path parameter "digest" -------------
	var digest string

	err = runtime.BindStyledParameterWithOptions("simple", "digest", ctx.Param("digest"), &digest, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true})
	if err != nil {
		return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter digest: %s", err))
	}

	// Invoke the callback with all the unmarshaled arguments
	err = w.Handler.V2DeleteNsOrgImageBlobsDigest(ctx, ns, org, image, digest)
	return err
}

// V2GetNsOrgImageBlobsDigest converts echo context to params.
func (w *ServerInterfaceWrapper) V2GetNsOrgImageBlobsDigest(ctx echo.Context) error {
	var err error
	// ------------- Path parameter "ns" -------------
	var ns string

	err = runtime.BindStyledParameterWithOptions("simple", "ns", ctx.Param("ns"), &ns, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true})
	if err != nil {
		return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter ns: %s", err))
	}

	// ------------- Path parameter "org" -------------
	var org string

	err = runtime.BindStyledParameterWithOptions("simple", "org", ctx.Param("org"), &org, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true})
	if err != nil {
		return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter org: %s", err))
	}

	// ------------- Path parameter "image" -------------
	var image string

	err = runtime.BindStyledParameterWithOptions("simple", "image", ctx.Param("image"), &image, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true})
	if err != nil {
		return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter image: %s", err))
	}

	// ------------- Path parameter "digest" -------------
	var digest string

	err = runtime.BindStyledParameterWithOptions("simple", "digest", ctx.Param("digest"), &digest, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true})
	if err != nil {
		return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter digest: %s", err))
	}

	// Invoke the callback with all the unmarshaled arguments
	err = w.Handler.V2GetNsOrgImageBlobsDigest(ctx, ns, org, image, digest)
	return err
}

// V2HeadNsOrgImageBlobsDigest converts echo context to params.
func (w *ServerInterfaceWrapper) V2HeadNsOrgImageBlobsDigest(ctx echo.Context) error {
	var err error
	// ------------- Path parameter "ns" -------------
	var ns string

	err = runtime.BindStyledParameterWithOptions("simple", "ns", ctx.Param("ns"), &ns, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true})
	if err != nil {
		return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter ns: %s", err))
	}

	// ------------- Path parameter "org" -------------
	var org string

	err = runtime.BindStyledParameterWithOptions("simple", "org", ctx.Param("org"), &org, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true})
	if err != nil {
		return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter org: %s", err))
	}

	// ------------- Path parameter "image" -------------
	var image string

	err = runtime.BindStyledParameterWithOptions("simple", "image", ctx.Param("image"), &image, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true})
	if err != nil {
		return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter image: %s", err))
	}

	// ------------- Path parameter "digest" -------------
	var digest string

	err = runtime.BindStyledParameterWithOptions("simple", "digest", ctx.Param("digest"), &digest, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true})
	if err != nil {
		return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter digest: %s", err))
	}

	// Invoke the callback with all the unmarshaled arguments
	err = w.Handler.V2HeadNsOrgImageBlobsDigest(ctx, ns, org, image, digest)
	return err
}

// V2DeleteNsOrgImageManifestsReference converts echo context to params.
func (w *ServerInterfaceWrapper) V2DeleteNsOrgImageManifestsReference(ctx echo.Context) error {
	var err error
	// ------------- Path parameter "ns" -------------
	var ns string

	err = runtime.BindStyledParameterWithOptions("simple", "ns", ctx.Param("ns"), &ns, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true})
	if err != nil {
		return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter ns: %s", err))
	}

	// ------------- Path parameter "org" -------------
	var org string

	err = runtime.BindStyledParameterWithOptions("simple", "org", ctx.Param("org"), &org, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true})
	if err != nil {
		return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter org: %s", err))
	}

	// ------------- Path parameter "image" -------------
	var image string

	err = runtime.BindStyledParameterWithOptions("simple", "image", ctx.Param("image"), &image, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true})
	if err != nil {
		return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter image: %s", err))
	}

	// ------------- Path parameter "reference" -------------
	var reference string

	err = runtime.BindStyledParameterWithOptions("simple", "reference", ctx.Param("reference"), &reference, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true})
	if err != nil {
		return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter reference: %s", err))
	}

	// Invoke the callback with all the unmarshaled arguments
	err = w.Handler.V2DeleteNsOrgImageManifestsReference(ctx, ns, org, image, reference)
	return err
}

// V2GetNsOrgImageManifestsReference converts echo context to params.
func (w *ServerInterfaceWrapper) V2GetNsOrgImageManifestsReference(ctx echo.Context) error {
	var err error
	// ------------- Path parameter "ns" -------------
	var ns string

	err = runtime.BindStyledParameterWithOptions("simple", "ns", ctx.Param("ns"), &ns, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true})
	if err != nil {
		return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter ns: %s", err))
	}

	// ------------- Path parameter "org" -------------
	var org string

	err = runtime.BindStyledParameterWithOptions("simple", "org", ctx.Param("org"), &org, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true})
	if err != nil {
		return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter org: %s", err))
	}

	// ------------- Path parameter "image" -------------
	var image string

	err = runtime.BindStyledParameterWithOptions("simple", "image", ctx.Param("image"), &image, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true})
	if err != nil {
		return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter image: %s", err))
	}

	// ------------- Path parameter "reference" -------------
	var reference string

	err = runtime.BindStyledParameterWithOptions("simple", "reference", ctx.Param("reference"), &reference, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true})
	if err != nil {
		return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter reference: %s", err))
	}

	// Invoke the callback with all the unmarshaled arguments
	err = w.Handler.V2GetNsOrgImageManifestsReference(ctx, ns, org, image, reference)
	return err
}

// V2HeadNsOrgImageManifestsReference converts echo context to params.
func (w *ServerInterfaceWrapper) V2HeadNsOrgImageManifestsReference(ctx echo.Context) error {
	var err error
	// ------------- Path parameter "ns" -------------
	var ns string

	err = runtime.BindStyledParameterWithOptions("simple", "ns", ctx.Param("ns"), &ns, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true})
	if err != nil {
		return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter ns: %s", err))
	}

	// ------------- Path parameter "org" -------------
	var org string

	err = runtime.BindStyledParameterWithOptions("simple", "org", ctx.Param("org"), &org, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true})
	if err != nil {
		return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter org: %s", err))
	}

	// ------------- Path parameter "image" -------------
	var image string

	err = runtime.BindStyledParameterWithOptions("simple", "image", ctx.Param("image"), &image, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true})
	if err != nil {
		return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter image: %s", err))
	}

	// ------------- Path parameter "reference" -------------
	var reference string

	err = runtime.BindStyledParameterWithOptions("simple", "reference", ctx.Param("reference"), &reference, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true})
	if err != nil {
		return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter reference: %s", err))
	}

	// Invoke the callback with all the unmarshaled arguments
	err = w.Handler.V2HeadNsOrgImageManifestsReference(ctx, ns, org, image, reference)
	return err
}

// V2PutNsOrgImageManifestsReference converts echo context to params.
func (w *ServerInterfaceWrapper) V2PutNsOrgImageManifestsReference(ctx echo.Context) error {
	var err error
	// ------------- Path parameter "ns" -------------
	var ns string

	err = runtime.BindStyledParameterWithOptions("simple", "ns", ctx.Param("ns"), &ns, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true})
	if err != nil {
		return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter ns: %s", err))
	}

	// ------------- Path parameter "org" -------------
	var org string

	err = runtime.BindStyledParameterWithOptions("simple", "org", ctx.Param("org"), &org, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true})
	if err != nil {
		return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter org: %s", err))
	}

	// ------------- Path parameter "image" -------------
	var image string

	err = runtime.BindStyledParameterWithOptions("simple", "image", ctx.Param("image"), &image, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true})
	if err != nil {
		return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter image: %s", err))
	}

	// ------------- Path parameter "reference" -------------
	var reference string

	err = runtime.BindStyledParameterWithOptions("simple", "reference", ctx.Param("reference"), &reference, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true})
	if err != nil {
		return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter reference: %s", err))
	}

	// Invoke the callback with all the unmarshaled arguments
	err = w.Handler.V2PutNsOrgImageManifestsReference(ctx, ns, org, image, reference)
	return err
}

// V2DeleteOrgImageBlobsDigest converts echo context to params.
func (w *ServerInterfaceWrapper) V2DeleteOrgImageBlobsDigest(ctx echo.Context) error {
	var err error
	// ------------- Path parameter "org" -------------
	var org string

	err = runtime.BindStyledParameterWithOptions("simple", "org", ctx.Param("org"), &org, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true})
	if err != nil {
		return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter org: %s", err))
	}

	// ------------- Path parameter "image" -------------
	var image string

	err = runtime.BindStyledParameterWithOptions("simple", "image", ctx.Param("image"), &image, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true})
	if err != nil {
		return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter image: %s", err))
	}

	// ------------- Path parameter "digest" -------------
	var digest string

	err = runtime.BindStyledParameterWithOptions("simple", "digest", ctx.Param("digest"), &digest, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true})
	if err != nil {
		return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter digest: %s", err))
	}

	// Invoke the callback with all the unmarshaled arguments
	err = w.Handler.V2DeleteOrgImageBlobsDigest(ctx, org, image, digest)
	return err
}

// V2GetOrgImageBlobsDigest converts echo context to params.
func (w *ServerInterfaceWrapper) V2GetOrgImageBlobsDigest(ctx echo.Context) error {
	var err error
	// ------------- Path parameter "org" -------------
	var org string

	err = runtime.BindStyledParameterWithOptions("simple", "org", ctx.Param("org"), &org, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true})
	if err != nil {
		return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter org: %s", err))
	}

	// ------------- Path parameter "image" -------------
	var image string

	err = runtime.BindStyledParameterWithOptions("simple", "image", ctx.Param("image"), &image, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true})
	if err != nil {
		return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter image: %s", err))
	}

	// ------------- Path parameter "digest" -------------
	var digest string

	err = runtime.BindStyledParameterWithOptions("simple", "digest", ctx.Param("digest"), &digest, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true})
	if err != nil {
		return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter digest: %s", err))
	}

	// Invoke the callback with all the unmarshaled arguments
	err = w.Handler.V2GetOrgImageBlobsDigest(ctx, org, image, digest)
	return err
}

// V2HeadOrgImageBlobsDigest converts echo context to params.
func (w *ServerInterfaceWrapper) V2HeadOrgImageBlobsDigest(ctx echo.Context) error {
	var err error
	// ------------- Path parameter "org" -------------
	var org string

	err = runtime.BindStyledParameterWithOptions("simple", "org", ctx.Param("org"), &org, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true})
	if err != nil {
		return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter org: %s", err))
	}

	// ------------- Path parameter "image" -------------
	var image string

	err = runtime.BindStyledParameterWithOptions("simple", "image", ctx.Param("image"), &image, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true})
	if err != nil {
		return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter image: %s", err))
	}

	// ------------- Path parameter "digest" -------------
	var digest string

	err = runtime.BindStyledParameterWithOptions("simple", "digest", ctx.Param("digest"), &digest, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true})
	if err != nil {
		return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter digest: %s", err))
	}

	// Invoke the callback with all the unmarshaled arguments
	err = w.Handler.V2HeadOrgImageBlobsDigest(ctx, org, image, digest)
	return err
}

// V2DeleteOrgImageManifestsReference converts echo context to params.
func (w *ServerInterfaceWrapper) V2DeleteOrgImageManifestsReference(ctx echo.Context) error {
	var err error
	// ------------- Path parameter "org" -------------
	var org string

	err = runtime.BindStyledParameterWithOptions("simple", "org", ctx.Param("org"), &org, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true})
	if err != nil {
		return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter org: %s", err))
	}

	// ------------- Path parameter "image" -------------
	var image string

	err = runtime.BindStyledParameterWithOptions("simple", "image", ctx.Param("image"), &image, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true})
	if err != nil {
		return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter image: %s", err))
	}

	// ------------- Path parameter "reference" -------------
	var reference string

	err = runtime.BindStyledParameterWithOptions("simple", "reference", ctx.Param("reference"), &reference, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true})
	if err != nil {
		return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter reference: %s", err))
	}

	// Invoke the callback with all the unmarshaled arguments
	err = w.Handler.V2DeleteOrgImageManifestsReference(ctx, org, image, reference)
	return err
}

// V2GetOrgImageManifestsReference converts echo context to params.
func (w *ServerInterfaceWrapper) V2GetOrgImageManifestsReference(ctx echo.Context) error {
	var err error
	// ------------- Path parameter "org" -------------
	var org string

	err = runtime.BindStyledParameterWithOptions("simple", "org", ctx.Param("org"), &org, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true})
	if err != nil {
		return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter org: %s", err))
	}

	// ------------- Path parameter "image" -------------
	var image string

	err = runtime.BindStyledParameterWithOptions("simple", "image", ctx.Param("image"), &image, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true})
	if err != nil {
		return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter image: %s", err))
	}

	// ------------- Path parameter "reference" -------------
	var reference string

	err = runtime.BindStyledParameterWithOptions("simple", "reference", ctx.Param("reference"), &reference, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true})
	if err != nil {
		return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter reference: %s", err))
	}

	// Parameter object where we will unmarshal all parameters from the context
	var params V2GetOrgImageManifestsReferenceParams
	// ------------- Optional query parameter "ns" -------------

	err = runtime.BindQueryParameter("form", true, false, "ns", ctx.QueryParams(), &params.Ns)
	if err != nil {
		return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter ns: %s", err))
	}

	// Invoke the callback with all the unmarshaled arguments
	err = w.Handler.V2GetOrgImageManifestsReference(ctx, org, image, reference, params)
	return err
}

// V2HeadOrgImageManifestsReference converts echo context to params.
func (w *ServerInterfaceWrapper) V2HeadOrgImageManifestsReference(ctx echo.Context) error {
	var err error
	// ------------- Path parameter "org" -------------
	var org string

	err = runtime.BindStyledParameterWithOptions("simple", "org", ctx.Param("org"), &org, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true})
	if err != nil {
		return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter org: %s", err))
	}

	// ------------- Path parameter "image" -------------
	var image string

	err = runtime.BindStyledParameterWithOptions("simple", "image", ctx.Param("image"), &image, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true})
	if err != nil {
		return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter image: %s", err))
	}

	// ------------- Path parameter "reference" -------------
	var reference string

	err = runtime.BindStyledParameterWithOptions("simple", "reference", ctx.Param("reference"), &reference, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true})
	if err != nil {
		return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter reference: %s", err))
	}

	// Parameter object where we will unmarshal all parameters from the context
	var params V2HeadOrgImageManifestsReferenceParams
	// ------------- Optional query parameter "ns" -------------

	err = runtime.BindQueryParameter("form", true, false, "ns", ctx.QueryParams(), &params.Ns)
	if err != nil {
		return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter ns: %s", err))
	}

	// Invoke the callback with all the unmarshaled arguments
	err = w.Handler.V2HeadOrgImageManifestsReference(ctx, org, image, reference, params)
	return err
}

// V2PutOrgImageManifestsReference converts echo context to params.
func (w *ServerInterfaceWrapper) V2PutOrgImageManifestsReference(ctx echo.Context) error {
	var err error
	// ------------- Path parameter "org" -------------
	var org string

	err = runtime.BindStyledParameterWithOptions("simple", "org", ctx.Param("org"), &org, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true})
	if err != nil {
		return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter org: %s", err))
	}

	// ------------- Path parameter "image" -------------
	var image string

	err = runtime.BindStyledParameterWithOptions("simple", "image", ctx.Param("image"), &image, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true})
	if err != nil {
		return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter image: %s", err))
	}

	// ------------- Path parameter "reference" -------------
	var reference string

	err = runtime.BindStyledParameterWithOptions("simple", "reference", ctx.Param("reference"), &reference, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true})
	if err != nil {
		return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter reference: %s", err))
	}

	// Invoke the callback with all the unmarshaled arguments
	err = w.Handler.V2PutOrgImageManifestsReference(ctx, org, image, reference)
	return err
}

// This is a simple interface which specifies echo.Route addition functions which
// are present on both echo.Echo and echo.Group, since we want to allow using
// either of them for path registration
type EchoRouter interface {
	CONNECT(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
	DELETE(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
	GET(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
	HEAD(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
	OPTIONS(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
	PATCH(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
	POST(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
	PUT(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
	TRACE(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
}

// RegisterHandlers adds each server route to the EchoRouter.
func RegisterHandlers(router EchoRouter, si ServerInterface) {
	RegisterHandlersWithBaseURL(router, si, "")
}

// Registers handlers, and prepends BaseURL to the paths, so that the paths
// can be served under a prefix.
func RegisterHandlersWithBaseURL(router EchoRouter, si ServerInterface, baseURL string) {

	wrapper := ServerInterfaceWrapper{
		Handler: si,
	}

	router.GET(baseURL+"/", wrapper.Root)
	router.GET(baseURL+"/cmd/blob/list", wrapper.CmdBloblist)
	router.GET(baseURL+"/cmd/image/list", wrapper.CmdImagelist)
	router.GET(baseURL+"/cmd/manifest/list", wrapper.CmdManifestlist)
	router.DELETE(baseURL+"/cmd/prune", wrapper.CmdPrune)
	router.GET(baseURL+"/cmd/stop", wrapper.CmdStop)
	router.GET(baseURL+"/v2/", wrapper.V2Default)
	router.HEAD(baseURL+"/v2/", wrapper.V2HeadDefault)
	router.GET(baseURL+"/v2/auth", wrapper.V2Auth)
	router.DELETE(baseURL+"/v2/:image/blobs/:digest", wrapper.V2DeleteImageBlobsDigest)
	router.GET(baseURL+"/v2/:image/blobs/:digest", wrapper.V2GetImageBlobsDigest)
	router.HEAD(baseURL+"/v2/:image/blobs/:digest", wrapper.V2HeadImageBlobsDigest)
	router.DELETE(baseURL+"/v2/:image/manifests/:reference", wrapper.V2DeleteImageManifestsReference)
	router.GET(baseURL+"/v2/:image/manifests/:reference", wrapper.V2GetImageManifestsReference)
	router.HEAD(baseURL+"/v2/:image/manifests/:reference", wrapper.V2HeadImageManifestsReference)
	router.PUT(baseURL+"/v2/:image/manifests/:reference", wrapper.V2PutImageManifestsReference)
	router.POST(baseURL+"/v2/:name/blobs/uploads", wrapper.V2PostNameBlobsUploads)
	router.GET(baseURL+"/v2/:name/blobs/uploads/:reference", wrapper.V2GetNameBlobsUploadsReference)
	router.PATCH(baseURL+"/v2/:name/blobs/uploads/:reference", wrapper.V2PatchNameBlobsUploadsReference)
	router.PUT(baseURL+"/v2/:name/blobs/uploads/:reference", wrapper.V2PutNameBlobsUploadsReference)
	router.GET(baseURL+"/v2/:name/referrers/:digest", wrapper.V2GetNameReferrersDigest)
	router.GET(baseURL+"/v2/:name/tags/list", wrapper.V2GetNameTagsList)
	router.DELETE(baseURL+"/v2/:ns/:org/:image/blobs/:digest", wrapper.V2DeleteNsOrgImageBlobsDigest)
	router.GET(baseURL+"/v2/:ns/:org/:image/blobs/:digest", wrapper.V2GetNsOrgImageBlobsDigest)
	router.HEAD(baseURL+"/v2/:ns/:org/:image/blobs/:digest", wrapper.V2HeadNsOrgImageBlobsDigest)
	router.DELETE(baseURL+"/v2/:ns/:org/:image/manifests/:reference", wrapper.V2DeleteNsOrgImageManifestsReference)
	router.GET(baseURL+"/v2/:ns/:org/:image/manifests/:reference", wrapper.V2GetNsOrgImageManifestsReference)
	router.HEAD(baseURL+"/v2/:ns/:org/:image/manifests/:reference", wrapper.V2HeadNsOrgImageManifestsReference)
	router.PUT(baseURL+"/v2/:ns/:org/:image/manifests/:reference", wrapper.V2PutNsOrgImageManifestsReference)
	router.DELETE(baseURL+"/v2/:org/:image/blobs/:digest", wrapper.V2DeleteOrgImageBlobsDigest)
	router.GET(baseURL+"/v2/:org/:image/blobs/:digest", wrapper.V2GetOrgImageBlobsDigest)
	router.HEAD(baseURL+"/v2/:org/:image/blobs/:digest", wrapper.V2HeadOrgImageBlobsDigest)
	router.DELETE(baseURL+"/v2/:org/:image/manifests/:reference", wrapper.V2DeleteOrgImageManifestsReference)
	router.GET(baseURL+"/v2/:org/:image/manifests/:reference", wrapper.V2GetOrgImageManifestsReference)
	router.HEAD(baseURL+"/v2/:org/:image/manifests/:reference", wrapper.V2HeadOrgImageManifestsReference)
	router.PUT(baseURL+"/v2/:org/:image/manifests/:reference", wrapper.V2PutOrgImageManifestsReference)

}

// Base64 encoded, gzipped, json marshaled Swagger object
var swaggerSpec = []string{

	"H4sIAAAAAAAC/+xbT1PbOBT/Kh6ddmfcOAR2DzltFzptZigwgd3LTg+K/GJrxpZU6YltmvF370hJoIBt",
	"YiehCfgCAUnP7/1+76+SzAl8Q9CCZmeSGTKckxgM01whl4IMyUeOn+wkMNJqBgGTMZCQWJ2RIUkRlRlG",
	"UcIxtZMek3lEGYDmLJKMa0i4QT0jRUi4mEonmkmBlKF7CTnlTghV6vssmf2ltEQpejm4/Q9VuLJZ9k6K",
	"bBYo9wpTLW2SBoyylIskuHtQSDLOQBhw8gXNgQzJ59FNcL74b/BbLmM+5RD//sQETf/vLcywBrRTEwRW",
	"WRRpmJooBRqbKKdcROej0w8X1x+c5gg6N5fTa9C3nDkFLqRwiCHHzP15eToKxks5wbvgUoF4fzUKjnt9",
	"EpJb0GZh8lGv3+s7eVKBoIqTITnu9XvHJCSKYup5ityPBDyaUoGmDq5RTIZkLCWSkGgwSgoDfveg339K",
	"LimKoghJxPI4mmRyEmXcYKXY0zz+O5MTv8fpoWkOCNqQ4X9zwp28rxY8D0vwjZ0Y1CQkhqWQUycRZ8qv",
	"oOYiIUURlp9k0gosO8gFQgKaFMWX9QwMyUn1wkk9JDynCTyLycjtWh8URdHFWxtUYp6AwcPFM6eCT8Hg",
	"s5B+Xm58EVT3AxulrYDFlgwQSmG58nvWwsOb4LT+armGmAxRW2jjcrZV/MI31epcrGdje8AsGpSqzrGv",
	"3XqTzHw7qE7z/w7OYEpttm6urzXsqFyHkLg6V/bsT0Dj3T9/iQG1mNbg8N4tl8eFUx/0vZ84SVLz7/74",
	"NiLEMOlDrfnBZY9Qd7SBy9YDOPe1rPBV3kTzRSUp6vKN8y634subq/vmbFV+ynB2bcm9bf5prdB9KOeu",
	"4q0v6Clkg0bB7Bb+qAqGCv/7CHj4MDXNefWp4e3h8SjSVs2OieYapqBBMFg/4FYdkBmvzr4ogPqnp+4k",
	"9PovFpMHiWRFyRCG/PKY7vBshKeypd55ZfE1xflRy1zp1Fg1JVZlksZeoJKmHDVp8ILmi7ryz3L/Onj5",
	"X9sYh1pP4HnVfPLcwamWOdkKG1tLx7X8PS531en5MZPNQqA1pbuJgJPmmYEiS0u93C28KnAad+BHfzbP",
	"pweMWPts0yAVbxbj3jAN+uHwWB/c49WZBiPAlnhoMQFUkEA18illeDNTW5vVN6MCaWLqr1DvGLihiTnn",
	"u4b+cVfVpsxltLGnt0bRFNFc6qTY4FbkwlzqpNWM63vOTd1b6mQLUt7eLU1H237fGnX87Mst1tMk2fpC",
	"657UltPuK+T2dVywdczujtldJdaOqV/PVM0Q2/G0d5eUG44KbTuarsdvV5Q6vHdUQzpgN+6qt9NQb1gi",
	"uk54d0nnDVOyn+9Zd8Ts5ZvfHS3baFCL0H+KcAXUw+80/PyNBap4dDsgxZfiRwAAAP//ox6opvAxAAA=",
}

// GetSwagger returns the content of the embedded swagger specification file
// or error if failed to decode
func decodeSpec() ([]byte, error) {
	zipped, err := base64.StdEncoding.DecodeString(strings.Join(swaggerSpec, ""))
	if err != nil {
		return nil, fmt.Errorf("error base64 decoding spec: %w", err)
	}
	zr, err := gzip.NewReader(bytes.NewReader(zipped))
	if err != nil {
		return nil, fmt.Errorf("error decompressing spec: %w", err)
	}
	var buf bytes.Buffer
	_, err = buf.ReadFrom(zr)
	if err != nil {
		return nil, fmt.Errorf("error decompressing spec: %w", err)
	}

	return buf.Bytes(), nil
}

var rawSpec = decodeSpecCached()

// a naive cached of a decoded swagger spec
func decodeSpecCached() func() ([]byte, error) {
	data, err := decodeSpec()
	return func() ([]byte, error) {
		return data, err
	}
}

// Constructs a synthetic filesystem for resolving external references when loading openapi specifications.
func PathToRawSpec(pathToFile string) map[string]func() ([]byte, error) {
	res := make(map[string]func() ([]byte, error))
	if len(pathToFile) > 0 {
		res[pathToFile] = rawSpec
	}

	return res
}

// GetSwagger returns the Swagger specification corresponding to the generated code
// in this file. The external references of Swagger specification are resolved.
// The logic of resolving external references is tightly connected to "import-mapping" feature.
// Externally referenced files must be embedded in the corresponding golang packages.
// Urls can be supported but this task was out of the scope.
func GetSwagger() (swagger *openapi3.T, err error) {
	resolvePath := PathToRawSpec("")

	loader := openapi3.NewLoader()
	loader.IsExternalRefsAllowed = true
	loader.ReadFromURIFunc = func(loader *openapi3.Loader, url *url.URL) ([]byte, error) {
		pathToFile := url.String()
		pathToFile = path.Clean(pathToFile)
		getSpec, ok := resolvePath[pathToFile]
		if !ok {
			err1 := fmt.Errorf("path not found: %s", pathToFile)
			return nil, err1
		}
		return getSpec()
	}
	var specData []byte
	specData, err = rawSpec()
	if err != nil {
		return
	}
	swagger, err = loader.LoadFromData(specData)
	if err != nil {
		return
	}
	return
}
