{% macro getProperty(definitions, responseModel, depth) %}
        {%~ for definition in definitions %}
        {%~ if definition.name == responseModel %}
        {%~ for property in definition.properties  %}
        {{ ("% " ~ depth * 4 ~ "s") |format("") }}{{ property.name | replace({'$': '_'}) }}{%~ if property.sub_schema %} {{ '{' }}
            {{- '\n' -}}
                {{- _self.getProperty(definitions, property.sub_schema, depth + 1) -}}
            {{ ("% " ~ depth * 4 ~ "s") |format("") }}{{ '        }' }}
        {%~ else %}
            {{- '\n' -}}
        {%~ endif %}
        {%~ endfor %}
        {%~ if definition.additionalProperties %}
        {{ ("% " ~ depth * 4 ~ "s") |format("") }}data
        {%~ endif %}
        {%~ endif %}
        {%~ endfor %}
{% endmacro %}
{% for key,header in method.headers %}
{% if header == 'multipart/form-data' %}
{% set boundary = 'cec8e8123c05ba25' %}
{{ method.method | caseUpper }} {{spec.basePath}}{{ method.path }} HTTP/1.1
Host: {{ spec.host }}
{% for key, header in method.headers %}
{{ key | caseUcwords }}: {{ header }}{% if header == 'multipart/form-data' %}; boundary="{{boundary}}"{% endif ~%}
{% endfor %}
{% for key,header in spec.global.defaultHeaders %}
{{ key }}: {{ header }}
{% endfor %}
{% for node in method.security %}
{% for key,header in node | keys %}
{{ node[header]['name'] }}: {{ node[header]['x-appwrite']['demo'] | raw }}
{% endfor %}
{% endfor %}
Content-Length: *Length of your entity body in bytes*

--{{boundary}}
Content-Disposition: form-data; name="operations"

{ "query": "mutation { {{ service.name | caseCamel }}{{ method.name | caseCamel | caseUcfirst }}({% for parameter in method.parameters.all  %}{{ parameter.name | caseCamel }}: ${{ parameter.name | caseCamel }}{% if not loop.last %}, {% endif %}{% endfor %}) { id }" }, "variables": { {% for parameter in method.parameters.all  %}"{{ parameter.name | caseCamel }}": {{ parameter | paramExample }}{% if not loop.last %}, {% endif %}{% endfor %} } }

--{{boundary}}
Content-Disposition: form-data; name="map"

{% set counter = 0 %}
{ {% for parameter in method.parameters.all  %}{% if parameter.type == 'file' %}"{{ counter }}": ["variables.{{ parameter.name | caseCamel }}"]{% if not loop.last %}, {% endif %}{% set counter = counter + 1 %}{% endif %}{% endfor %} }

{% set counter = 0 %}
{% for parameter in method.parameters.all  %}
{% if parameter.type == 'file' %}
--{{ boundary }}
Content-Disposition: form-data; name="{{ counter }}"; filename="{{ parameter.name }}.ext"

File contents

{% set counter = counter + 1 %}
{% endif %}
{% endfor %}
--{{boundary}}--
{% else %}
{%~ if method.method == 'get' %}
query {
{%~ else %}
mutation {
{%~ endif %}
    {{ service.name | caseCamel }}{{ method.name | caseCamel | caseUcfirst }}{% if method.parameters.all  | length == 0 %} {{ '{' }}{% else %}(
        {%~ for parameter in method.parameters.all  %}
        {{ parameter.name | caseCamel }}: {{ parameter | paramExample }}{% if not loop.last %},{% endif %}

        {%~ endfor %}
    ) {{ '{' }}{%~ endif %}

        {%~ if method.responseModel == 'none' or method.responseModel == '' %}
        status
        {%~ else %}
        {{- _self.getProperty(spec.definitions, method.responseModel, 0) -}}
        {%~ endif %}
    }
}
{% endif %}
{% endfor %}