{{#models}}{{#model}}/*
 * {{classname}}.h
 *
 * {{description}}
 */

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

#include <string.h>
#include "../external/cJSON.h"
#include "../include/list.h"
#include "../include/keyValuePair.h"
#include "../include/binary.h"
{{#imports}}
#include "{{{.}}}.h"
{{/imports}}

#ifdef __cplusplus
extern "C" {
#endif

{{#isEnum}}
    {{#allowableValues}}
        typedef enum { OpenAPI_{{classVarName}}_NULL = 0{{#enumVars}}, OpenAPI_{{classVarName}}_{{{value}}}{{/enumVars}} } OpenAPI_{{classVarName}}_e;
    {{/allowableValues}}

    char* OpenAPI_{{classname}}_ToString(OpenAPI_{{classVarName}}_e {{classname}});

    OpenAPI_{{classVarName}}_e OpenAPI_{{classname}}_FromString(char* {{classname}});
{{/isEnum}}
{{^isEnum}}
    typedef struct OpenAPI_{{classname}}_s OpenAPI_{{classname}}_t;
{{#vars}}
    {{^isContainer}}
        {{#isPrimitiveType}}
            {{#isEnum}}
                {{#allowableValues}}
                typedef enum { OpenAPI_{{classVarName}}_{{enumName}}_NULL = 0{{#enumVars}}, OpenAPI_{{classVarName}}_{{enumName}}_{{{value}}}{{/enumVars}} } OpenAPI_{{classVarName}}_{{name}}_e;
                {{/allowableValues}}

                char* OpenAPI_{{classVarName}}_{{name}}_ToString(OpenAPI_{{classVarName}}_{{name}}_e {{name}});

                OpenAPI_{{classVarName}}_{{name}}_e OpenAPI_{{classVarName}}_{{name}}_FromString(char* {{name}});
            {{/isEnum}}
        {{/isPrimitiveType}}
    {{/isContainer}}
{{/vars}}
    typedef struct OpenAPI_{{classname}}_s {
{{#vars}}
    {{^isContainer}}
        {{^isPrimitiveType}}
            {{#isEnum}}
                OpenAPI_{{datatype}}_e {{name}};
            {{/isEnum}}
            {{^isEnum}}
                {{#isModel}}
                    struct OpenAPI_{{datatype}}_s *{{name}};
                {{/isModel}}
                {{#isUuid}}
                    {{datatype}} *{{name}};
                {{/isUuid}}
                {{#isEmail}}
                    {{datatype}} *{{name}};
                {{/isEmail}}
                {{#isFreeFormObject}}
                    OpenAPI_{{datatype}}_t *{{name}};
                {{/isFreeFormObject}}
            {{/isEnum}}
        {{/isPrimitiveType}}
        {{#isPrimitiveType}}
            {{#isEnum}}
                OpenAPI_{{classVarName}}_{{name}}_e {{name}};
            {{/isEnum}}
            {{^isEnum}}
                {{#isNumeric}}
                    {{datatype}} {{name}};
                {{/isNumeric}}
                {{#isBoolean}}
                    {{datatype}} {{name}};
                {{/isBoolean}}
                {{#isString}}
                    {{datatype}} *{{name}};
                {{/isString}}
            {{/isEnum}}
            {{#isByteArray}}
                {{datatype}} {{name}};
            {{/isByteArray}}
            {{#isBinary}}
                OpenAPI_{{datatype}} {{name}};
            {{/isBinary}}
            {{#isDate}}
                {{datatype}} *{{name}};
            {{/isDate}}
            {{#isDateTime}}
                {{datatype}} *{{name}};
            {{/isDateTime}}
        {{/isPrimitiveType}}
    {{/isContainer}}
    {{#isContainer}}
        {{#isListContainer}}
            OpenAPI_{{datatype}}_t *{{name}};
        {{/isListContainer}}
        {{#isMapContainer}}
            OpenAPI_{{datatype}} {{name}};
        {{/isMapContainer}}
    {{/isContainer}}
{{/vars}}
} OpenAPI_{{classname}}_t;

OpenAPI_{{classname}}_t *OpenAPI_{{classname}}_create(
{{#vars}}
    {{^isContainer}}
        {{^isPrimitiveType}}
            {{#isEnum}}
                OpenAPI_{{datatype}}_e {{name}}{{#hasMore}},{{/hasMore}}
            {{/isEnum}}
            {{^isEnum}}
                {{#isModel}}
                    OpenAPI_{{datatype}}_t *{{name}}{{#hasMore}},{{/hasMore}}
                {{/isModel}}
                {{#isUuid}}
                    {{datatype}} *{{name}}{{#hasMore}},{{/hasMore}}
                {{/isUuid}}
                {{#isEmail}}
                    {{datatype}} *{{name}}{{#hasMore}},{{/hasMore}}
                {{/isEmail}}
                {{#isFreeFormObject}}
                    OpenAPI_{{datatype}}_t *{{name}}{{#hasMore}},{{/hasMore}}
                {{/isFreeFormObject}}
            {{/isEnum}}
        {{/isPrimitiveType}}
        {{#isPrimitiveType}}
            {{#isEnum}}
                OpenAPI_{{classVarName}}_{{name}}_e {{name}}{{#hasMore}},{{/hasMore}}
            {{/isEnum}}
            {{^isEnum}}
                {{#isNumeric}}
                    {{datatype}} {{name}}{{#hasMore}},{{/hasMore}}
                {{/isNumeric}}
                {{#isBoolean}}
                    {{datatype}} {{name}}{{#hasMore}},{{/hasMore}}
                {{/isBoolean}}
                {{#isString}}
                    {{datatype}} *{{name}}{{#hasMore}},{{/hasMore}}
                {{/isString}}
            {{/isEnum}}
            {{#isByteArray}}
                {{datatype}} {{name}}{{#hasMore}},{{/hasMore}}
            {{/isByteArray}}
            {{#isBinary}}
                OpenAPI_{{datatype}} {{name}}{{#hasMore}},{{/hasMore}}
            {{/isBinary}}
            {{#isDate}}
                {{datatype}} *{{name}}{{#hasMore}},{{/hasMore}}
            {{/isDate}}
            {{#isDateTime}}
                {{datatype}} *{{name}}{{#hasMore}},{{/hasMore}}
            {{/isDateTime}}
        {{/isPrimitiveType}}
    {{/isContainer}}
    {{#isContainer}}
        {{#isListContainer}}
            OpenAPI_{{datatype}}_t *{{name}}{{#hasMore}},{{/hasMore}}
        {{/isListContainer}}
        {{#isMapContainer}}
            OpenAPI_{{datatype}} {{name}}{{#hasMore}},{{/hasMore}}
        {{/isMapContainer}}
    {{/isContainer}}
{{/vars}});
void OpenAPI_{{classname}}_free(OpenAPI_{{classname}}_t *{{classname}});
OpenAPI_{{classname}}_t *OpenAPI_{{classname}}_parseFromJSON(cJSON *{{classname}}JSON);
cJSON *OpenAPI_{{classname}}_convertToJSON(OpenAPI_{{classname}}_t *{{classname}});
OpenAPI_{{classname}}_t *OpenAPI_{{classname}}_copy(OpenAPI_{{classname}}_t *dst, OpenAPI_{{classname}}_t *src);
{{/isEnum}}

#ifdef __cplusplus
}
#endif

#endif /* _OpenAPI_{{classname}}_H_ */
{{/model}}{{/models}}
