from ..service import Service
from ..exception import AppwriteException

class {{ service.name | caseUcfirst }}(Service):

    def __init__(self, client):
        super({{ service.name | caseUcfirst }}, self).__init__(client)
{% for method in service.methods %}

    def {{ method.name | caseSnake }}(self{% if method.parameters.all|length > 0 %}, {% endif %}{% for parameter in method.parameters.all %}{{ parameter.name | escapeKeyword | caseSnake }}{% if not parameter.required %} = None{% endif %}{% if not loop.last %}, {% endif %}{% endfor %}{% if 'multipart/form-data' in method.consumes %}, on_progress = None{% endif %}):
{% if method.title %}
        """{{ method.title }}"""

{% endif %}        
        api_path = '{{ method.path }}'
{{ include('python/base/params.twig') }}
{% if 'multipart/form-data' in method.consumes %}
{{ include('python/base/requests/file.twig') }}
{% else %}
{{ include('python/base/requests/api.twig') }}
{% endif %}
{% endfor %}
