const sdk = require('node-{{ spec.title | caseDash }}');
{% if method.consumes[0] == 'multipart/form-data' %}
const fs = require('fs');
{% endif %}

const client = new sdk.Client()
    {%~ if method.auth|length > 0 %}
    .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
    {%~ for node in method.auth %}
    {%~ for key,header in node|keys %}
    .set{{header}}('{{node[header]['x-appwrite']['demo'] | raw }}'){% if loop.last %};{% endif%} // {{node[header].description}}
    {%~ endfor %}
    {%~ endfor %}
    {%~ endif %}

const {{ service.name | caseCamel }} = new sdk.{{service.name | caseUcfirst}}(client);

const result = await {{ service.name | caseCamel }}.{{ method.name | caseCamel }}({% if method.parameters.all | length == 0 %});{% endif %}

    {%~ for parameter in method.parameters.all %}
    {% if parameter.enumValues | length > 0%}sdk.{{ parameter.enumName }}.{{(parameter.enumKeys[0] ?? parameter.enumValues[0]) | caseEnumKey }}{% else %}{{ parameter | paramExample}}{% endif %}{% if not loop.last %},{% endif%} // {{ parameter.name }}{% if not parameter.required %} (optional){% endif %}

	  {%~ endfor -%}
{% if method.parameters.all | length > 0 %});
{% endif %}