// Package gen provides primitives to interact with the openapi HTTP API.
//
// Code generated by unknown module path version unknown version DO NOT EDIT.
package gen

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

	"github.com/deepmap/oapi-codegen/pkg/runtime"
	"github.com/getkin/kin-openapi/openapi3"
	"github.com/labstack/echo/v4"
)

// ServerInterface represents all server handlers.
type ServerInterface interface {
	// Service domain health
	// (GET /health)
	GetHealth(ctx echo.Context) error
	// List of investment accounts
	// (GET /investments/)
	GetInvestments(ctx echo.Context, params GetInvestmentsParams) error
	// Investment accounts
	// (GET /investments/details)
	GetInvestmentsDetails(ctx echo.Context, params GetInvestmentsDetailsParams) error
	// List holdings linked to investment account.
	// (GET /investments/{investment_account_id})
	GetInvestmentsInvestmentAccountId(ctx echo.Context, investmentAccountId string, params GetInvestmentsInvestmentAccountIdParams) error
	// Create a holding
	// (POST /investments/{investment_account_id})
	PostInvestmentsInvestmentAccountId(ctx echo.Context, investmentAccountId string, params PostInvestmentsInvestmentAccountIdParams) error

	// (GET /investments/{investment_account_id}/authorisation)
	GetInvestmentsInvestmentAccountIdAuthorisation(ctx echo.Context, investmentAccountId string, params GetInvestmentsInvestmentAccountIdAuthorisationParams) error
	// Details on the investment account
	// (GET /investments/{investment_account_id}/details)
	GetInvestmentsInvestmentAccountIdDetails(ctx echo.Context, investmentAccountId string, params GetInvestmentsInvestmentAccountIdDetailsParams) error
	// Fetch holding information
	// (GET /investments/{investment_account_id}/holdings/{holding_id})
	GetInvestmentsInvestmentAccountIdHoldingsHoldingId(ctx echo.Context, investmentAccountId string, holdingId string, params GetInvestmentsInvestmentAccountIdHoldingsHoldingIdParams) error
	// Request to create a new investment account
	// (POST /register)
	PostRegister(ctx echo.Context, params PostRegisterParams) error
	// Search service on indexed data
	// (GET /search)
	GetSearch(ctx echo.Context, params GetSearchParams) error
	// Search service on indexed data using complex criteria
	// (POST /search)
	PostSearch(ctx echo.Context, params PostSearchParams) error
	// Retrieve a customer status
	// (GET /status)
	GetStatus(ctx echo.Context, params GetStatusParams) error
}

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

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

	ctx.Set(BasicAuthScopes, []string{""})

	ctx.Set(ApiKeyScopes, []string{""})

	ctx.Set(BearerAuthScopes, []string{""})

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

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

	ctx.Set(BasicAuthScopes, []string{""})

	ctx.Set(ApiKeyScopes, []string{""})

	ctx.Set(BearerAuthScopes, []string{""})

	// Parameter object where we will unmarshal all parameters from the context
	var params GetInvestmentsParams

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

		err = runtime.BindStyledParameterWithLocation("simple", false, "X-CustomerID", runtime.ParamLocationHeader, valueList[0], &XCustomerID)
		if err != nil {
			return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter X-CustomerID: %s", err))
		}

		params.XCustomerID = &XCustomerID
	}

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

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

	ctx.Set(BasicAuthScopes, []string{""})

	ctx.Set(ApiKeyScopes, []string{""})

	ctx.Set(BearerAuthScopes, []string{""})

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

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

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

		err = runtime.BindStyledParameterWithLocation("simple", false, "X-CustomerId", runtime.ParamLocationHeader, valueList[0], &XCustomerId)
		if err != nil {
			return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter X-CustomerId: %s", err))
		}

		params.XCustomerId = &XCustomerId
	}

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

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

	err = runtime.BindStyledParameterWithLocation("simple", false, "investment_account_id", runtime.ParamLocationPath, ctx.Param("investment_account_id"), &investmentAccountId)
	if err != nil {
		return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter investment_account_id: %s", err))
	}

	ctx.Set(BasicAuthScopes, []string{""})

	ctx.Set(ApiKeyScopes, []string{""})

	ctx.Set(BearerAuthScopes, []string{""})

	// Parameter object where we will unmarshal all parameters from the context
	var params GetInvestmentsInvestmentAccountIdParams

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

		err = runtime.BindStyledParameterWithLocation("simple", false, "X-CustomerId", runtime.ParamLocationHeader, valueList[0], &XCustomerId)
		if err != nil {
			return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter X-CustomerId: %s", err))
		}

		params.XCustomerId = &XCustomerId
	}

	// Invoke the callback with all the unmarshalled arguments
	err = w.Handler.GetInvestmentsInvestmentAccountId(ctx, investmentAccountId, params)
	return err
}

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

	err = runtime.BindStyledParameterWithLocation("simple", false, "investment_account_id", runtime.ParamLocationPath, ctx.Param("investment_account_id"), &investmentAccountId)
	if err != nil {
		return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter investment_account_id: %s", err))
	}

	ctx.Set(BasicAuthScopes, []string{""})

	ctx.Set(ApiKeyScopes, []string{""})

	ctx.Set(BearerAuthScopes, []string{""})

	// Parameter object where we will unmarshal all parameters from the context
	var params PostInvestmentsInvestmentAccountIdParams

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

		err = runtime.BindStyledParameterWithLocation("simple", false, "X-CustomerId", runtime.ParamLocationHeader, valueList[0], &XCustomerId)
		if err != nil {
			return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter X-CustomerId: %s", err))
		}

		params.XCustomerId = &XCustomerId
	}

	// Invoke the callback with all the unmarshalled arguments
	err = w.Handler.PostInvestmentsInvestmentAccountId(ctx, investmentAccountId, params)
	return err
}

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

	err = runtime.BindStyledParameterWithLocation("simple", false, "investment_account_id", runtime.ParamLocationPath, ctx.Param("investment_account_id"), &investmentAccountId)
	if err != nil {
		return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter investment_account_id: %s", err))
	}

	ctx.Set(BasicAuthScopes, []string{""})

	ctx.Set(ApiKeyScopes, []string{""})

	ctx.Set(BearerAuthScopes, []string{""})

	// Parameter object where we will unmarshal all parameters from the context
	var params GetInvestmentsInvestmentAccountIdAuthorisationParams

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

		err = runtime.BindStyledParameterWithLocation("simple", false, "X-CustomerID", runtime.ParamLocationHeader, valueList[0], &XCustomerID)
		if err != nil {
			return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter X-CustomerID: %s", err))
		}

		params.XCustomerID = &XCustomerID
	}

	// Invoke the callback with all the unmarshalled arguments
	err = w.Handler.GetInvestmentsInvestmentAccountIdAuthorisation(ctx, investmentAccountId, params)
	return err
}

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

	err = runtime.BindStyledParameterWithLocation("simple", false, "investment_account_id", runtime.ParamLocationPath, ctx.Param("investment_account_id"), &investmentAccountId)
	if err != nil {
		return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter investment_account_id: %s", err))
	}

	ctx.Set(BasicAuthScopes, []string{""})

	ctx.Set(ApiKeyScopes, []string{""})

	ctx.Set(BearerAuthScopes, []string{""})

	// Parameter object where we will unmarshal all parameters from the context
	var params GetInvestmentsInvestmentAccountIdDetailsParams

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

		err = runtime.BindStyledParameterWithLocation("simple", false, "X-CustomerID", runtime.ParamLocationHeader, valueList[0], &XCustomerID)
		if err != nil {
			return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter X-CustomerID: %s", err))
		}

		params.XCustomerID = &XCustomerID
	}

	// Invoke the callback with all the unmarshalled arguments
	err = w.Handler.GetInvestmentsInvestmentAccountIdDetails(ctx, investmentAccountId, params)
	return err
}

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

	err = runtime.BindStyledParameterWithLocation("simple", false, "investment_account_id", runtime.ParamLocationPath, ctx.Param("investment_account_id"), &investmentAccountId)
	if err != nil {
		return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter investment_account_id: %s", err))
	}

	// ------------- Path parameter "holding_id" -------------
	var holdingId string

	err = runtime.BindStyledParameterWithLocation("simple", false, "holding_id", runtime.ParamLocationPath, ctx.Param("holding_id"), &holdingId)
	if err != nil {
		return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter holding_id: %s", err))
	}

	ctx.Set(BasicAuthScopes, []string{""})

	ctx.Set(ApiKeyScopes, []string{""})

	ctx.Set(BearerAuthScopes, []string{""})

	// Parameter object where we will unmarshal all parameters from the context
	var params GetInvestmentsInvestmentAccountIdHoldingsHoldingIdParams

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

		err = runtime.BindStyledParameterWithLocation("simple", false, "X-CustomerId", runtime.ParamLocationHeader, valueList[0], &XCustomerId)
		if err != nil {
			return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter X-CustomerId: %s", err))
		}

		params.XCustomerId = &XCustomerId
	}

	// Invoke the callback with all the unmarshalled arguments
	err = w.Handler.GetInvestmentsInvestmentAccountIdHoldingsHoldingId(ctx, investmentAccountId, holdingId, params)
	return err
}

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

	ctx.Set(BasicAuthScopes, []string{""})

	ctx.Set(ApiKeyScopes, []string{""})

	ctx.Set(BearerAuthScopes, []string{""})

	// Parameter object where we will unmarshal all parameters from the context
	var params PostRegisterParams

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

		err = runtime.BindStyledParameterWithLocation("simple", false, "X-CustomerID", runtime.ParamLocationHeader, valueList[0], &XCustomerID)
		if err != nil {
			return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter X-CustomerID: %s", err))
		}

		params.XCustomerID = &XCustomerID
	}

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

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

	ctx.Set(BasicAuthScopes, []string{""})

	ctx.Set(ApiKeyScopes, []string{""})

	ctx.Set(BearerAuthScopes, []string{""})

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

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

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

		err = runtime.BindStyledParameterWithLocation("simple", false, "x-v", runtime.ParamLocationHeader, valueList[0], &XV)
		if err != nil {
			return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter x-v: %s", err))
		}

		params.XV = &XV
	}
	// ------------- Optional header parameter "x-min-v" -------------
	if valueList, found := headers[http.CanonicalHeaderKey("x-min-v")]; found {
		var XMinV int
		n := len(valueList)
		if n != 1 {
			return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Expected one value for x-min-v, got %d", n))
		}

		err = runtime.BindStyledParameterWithLocation("simple", false, "x-min-v", runtime.ParamLocationHeader, valueList[0], &XMinV)
		if err != nil {
			return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter x-min-v: %s", err))
		}

		params.XMinV = &XMinV
	}
	// ------------- Optional header parameter "x-fapi-interaction-id" -------------
	if valueList, found := headers[http.CanonicalHeaderKey("x-fapi-interaction-id")]; found {
		var XFapiInteractionId string
		n := len(valueList)
		if n != 1 {
			return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Expected one value for x-fapi-interaction-id, got %d", n))
		}

		err = runtime.BindStyledParameterWithLocation("simple", false, "x-fapi-interaction-id", runtime.ParamLocationHeader, valueList[0], &XFapiInteractionId)
		if err != nil {
			return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter x-fapi-interaction-id: %s", err))
		}

		params.XFapiInteractionId = &XFapiInteractionId
	}

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

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

	ctx.Set(BasicAuthScopes, []string{""})

	ctx.Set(ApiKeyScopes, []string{""})

	ctx.Set(BearerAuthScopes, []string{""})

	// Parameter object where we will unmarshal all parameters from the context
	var params PostSearchParams

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

		err = runtime.BindStyledParameterWithLocation("simple", false, "x-v", runtime.ParamLocationHeader, valueList[0], &XV)
		if err != nil {
			return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter x-v: %s", err))
		}

		params.XV = &XV
	}
	// ------------- Optional header parameter "x-min-v" -------------
	if valueList, found := headers[http.CanonicalHeaderKey("x-min-v")]; found {
		var XMinV int
		n := len(valueList)
		if n != 1 {
			return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Expected one value for x-min-v, got %d", n))
		}

		err = runtime.BindStyledParameterWithLocation("simple", false, "x-min-v", runtime.ParamLocationHeader, valueList[0], &XMinV)
		if err != nil {
			return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter x-min-v: %s", err))
		}

		params.XMinV = &XMinV
	}
	// ------------- Optional header parameter "x-fapi-interaction-id" -------------
	if valueList, found := headers[http.CanonicalHeaderKey("x-fapi-interaction-id")]; found {
		var XFapiInteractionId string
		n := len(valueList)
		if n != 1 {
			return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Expected one value for x-fapi-interaction-id, got %d", n))
		}

		err = runtime.BindStyledParameterWithLocation("simple", false, "x-fapi-interaction-id", runtime.ParamLocationHeader, valueList[0], &XFapiInteractionId)
		if err != nil {
			return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter x-fapi-interaction-id: %s", err))
		}

		params.XFapiInteractionId = &XFapiInteractionId
	}

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

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

	ctx.Set(BasicAuthScopes, []string{""})

	ctx.Set(ApiKeyScopes, []string{""})

	ctx.Set(BearerAuthScopes, []string{""})

	// Parameter object where we will unmarshal all parameters from the context
	var params GetStatusParams

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

		err = runtime.BindStyledParameterWithLocation("simple", false, "X-CustomerID", runtime.ParamLocationHeader, valueList[0], &XCustomerID)
		if err != nil {
			return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter X-CustomerID: %s", err))
		}

		params.XCustomerID = &XCustomerID
	}

	// Invoke the callback with all the unmarshalled arguments
	err = w.Handler.GetStatus(ctx, params)
	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+"/health", wrapper.GetHealth)
	router.GET(baseURL+"/investments/", wrapper.GetInvestments)
	router.GET(baseURL+"/investments/details", wrapper.GetInvestmentsDetails)
	router.GET(baseURL+"/investments/:investment_account_id", wrapper.GetInvestmentsInvestmentAccountId)
	router.POST(baseURL+"/investments/:investment_account_id", wrapper.PostInvestmentsInvestmentAccountId)
	router.GET(baseURL+"/investments/:investment_account_id/authorisation", wrapper.GetInvestmentsInvestmentAccountIdAuthorisation)
	router.GET(baseURL+"/investments/:investment_account_id/details", wrapper.GetInvestmentsInvestmentAccountIdDetails)
	router.GET(baseURL+"/investments/:investment_account_id/holdings/:holding_id", wrapper.GetInvestmentsInvestmentAccountIdHoldingsHoldingId)
	router.POST(baseURL+"/register", wrapper.PostRegister)
	router.GET(baseURL+"/search", wrapper.GetSearch)
	router.POST(baseURL+"/search", wrapper.PostSearch)
	router.GET(baseURL+"/status", wrapper.GetStatus)

}

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

	"H4sIAAAAAAAC/+y9+3IbOZI3+iqI6o0Y24ekSOquExNzZFvdrbPdtlaSZ3a+psMBVqFIrIpANYCSxHE4",
	"Yh9in3Cf5AskLoWqQlGUb93T43+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AAAD//93AGp+u/QAA",
}

// 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: %s", err)
	}
	zr, err := gzip.NewReader(bytes.NewReader(zipped))
	if err != nil {
		return nil, fmt.Errorf("error decompressing spec: %s", err)
	}
	var buf bytes.Buffer
	_, err = buf.ReadFrom(zr)
	if err != nil {
		return nil, fmt.Errorf("error decompressing spec: %s", 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) {
	var 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) {
	var resolvePath = PathToRawSpec("")

	loader := openapi3.NewLoader()
	loader.IsExternalRefsAllowed = true
	loader.ReadFromURIFunc = func(loader *openapi3.Loader, url *url.URL) ([]byte, error) {
		var 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
}
