11from ..service import Service
2- from typing import List
2+ from typing import List, Dict, Any
33from ..exception import AppwriteException
44{% set added = [] %}
55{% for method in service .methods %}
@@ -24,12 +24,38 @@ from ..enums.{{ name | caseSnake }} import {{ name | caseUcfirst }};
2424
2525class {{ service .name | caseUcfirst }}(Service):
2626
27- def __init__(self, client):
27+ def __init__(self, client) -> None :
2828 super({{ service .name | caseUcfirst }}, self).__init__(client)
2929{% for method in service .methods %}
3030
31- def {{ method .name | caseSnake }}(self{% if method .parameters .all | length > 0 %}, {% endif %}{% for parameter in method .parameters .all %}{{ parameter .name | escapeKeyword | caseSnake }}: {{ parameter | getPropertyType(method ) | raw }}{% if not parameter .required %} = None{% endif %}{% if not loop .last %}, {% endif %}{% endfor %}{% if ' multipart/form-data' in method .consumes %}, on_progress = None{% endif %}):
32- """{{method .title }}"""
31+ def {{ method .name | caseSnake }}(self{% if method .parameters .all | length > 0 %}, {% endif %}{% for parameter in method .parameters .all %}{{ parameter .name | escapeKeyword | caseSnake }}: {{ parameter | getPropertyType(method ) | raw }}{% 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 .type == ' webAuth' %}str{% else %}Dict[str, Any]{% endif %}:
32+ """
33+ {% autoescape false %}{{ method .description | replace({" \n" : " \n " }) }}{% endautoescape %}
34+ {% if method .parameters .all | length > 0 or ' multipart/form-data' in method .consumes %}
35+
36+ Parameters
37+ ----------
38+ {% for parameter in method .parameters .all %}{{ parameter .name | escapeKeyword | caseSnake }} : {{ parameter | getPropertyType(method ) | raw }}
39+ {% autoescape false %}{{ parameter .description | replace({" \n" : " \n " }) }}{% endautoescape %}
40+
41+ {% endfor %}{% if ' multipart/form-data' in method .consumes %}
42+ on_progress : callable, optional
43+ Optional callback for upload progress
44+ {% endif %}{% endif %}
45+
46+ Returns
47+ -------
48+ {% if method .type == ' webAuth' %}str
49+ Authentication response as a string
50+ {% else %}Dict[str, Any]
51+ API response as a dictionary
52+ {% endif %}
53+
54+ Raises
55+ ------
56+ AppwriteException
57+ If API request fails
58+ """
3359
3460 api_path = '{{ method .path }}'
3561{{ include (' python/base/params.twig' ) }}
0 commit comments