{% extends 'module.py.jinja2' -%}
{% macro render_param(param) %}
{{ param.name }}: {{ param.annotation.type.__repr__() }}{% if not param.required %} = lapis_client_base.absent.ABSENT{% endif %},
{% endmacro %}
{% block body -%}
{% set model = model.body -%}
class ApiClient(lapis_client_base.ApiBase):
{%- for func in model.methods %}
    async def {{ func.name }}(
        self,{% for param in func.params if param.required %}
        {{ render_param(param) }}
{%- endfor %}{% for param in func.params if not param.required %}
        {{ render_param(param) }}
{%- endfor %}) -> dict:
{%- if func.params_model_name %}
        import {{ func.params_model_name.module }}
{%- endif %}
        return await super()._request(
            '{{ func.method.upper() }}',
            f'{{ func.path }}'{% if func.params_model_name %},
            {{ func.params_model_name.full_name() }}(**locals()){% endif %}
        )
{% else %}
    pass
{%- endfor %}
{%- endblock %}
