{{>licenseInfo}}
{{#operations}}/*
 * {{classname}}.h
 *
 * {{description}}
 */

#ifndef {{classname}}_H_
#define {{classname}}_H_

{{{defaultInclude}}}
#include <pistache/endpoint.h>
#include <pistache/http.h>
#include <pistache/router.h>
#include <pistache/http_headers.h>

{{#imports}}{{{import}}}
{{/imports}}

{{#apiNamespaceDeclarations}}
namespace {{this}} {
{{/apiNamespaceDeclarations}}

using namespace {{modelNamespace}};

class {{declspec}} {{classname}} {
public:
    {{classname}}(Pistache::Address addr);
    virtual ~{{classname}}() {};
    void init(size_t thr);
    void start();
    void shutdown();

    const std::string base = "{{basePathWithoutHost}}";

private:
    void setupRoutes();

    {{#operation}}
    void {{operationIdSnakeCase}}_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
    {{/operation}}
    void {{classnameSnakeLowerCase}}_default_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);

    std::shared_ptr<Pistache::Http::Endpoint> httpEndpoint;
    Pistache::Rest::Router router;

    {{#operation}}

    /// <summary>
    /// {{summary}}
    /// </summary>
    /// <remarks>
    /// {{notes}}
    /// </remarks>
    {{#vendorExtensions.x-codegen-pistache-isParsingSupported}}
    {{#allParams}}
    /// <param name="{{paramName}}">{{description}}{{^required}} (optional{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/required}}</param>
    {{/allParams}}
    virtual void {{operationIdSnakeCase}}({{#allParams}}const {{#isPrimitiveType}}{{{dataType}}}{{/isPrimitiveType}}{{^isPrimitiveType}}{{{baseType}}}{{/isPrimitiveType}} &{{paramName}}{{#hasMore}}, {{/hasMore}}{{/allParams}}{{#hasParams}}, {{/hasParams}}Pistache::Http::ResponseWriter &response) = 0;
    {{/vendorExtensions.x-codegen-pistache-isParsingSupported}}
    {{^vendorExtensions.x-codegen-pistache-isParsingSupported}}
    virtual void {{operationIdSnakeCase}}(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter &response) = 0;
    {{/vendorExtensions.x-codegen-pistache-isParsingSupported}}
    {{/operation}}

};

{{#apiNamespaceDeclarations}}
}
{{/apiNamespaceDeclarations}}

#endif /* {{classname}}_H_ */

{{/operations}}
