Skip to content

Commit c1a931e

Browse files
committed
fix: to use bytes
1 parent 2d0d765 commit c1a931e

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

templates/python/package/services/service.py.twig

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ class {{ service.name | caseUcfirst }}(Service):
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 %}) -> {% if method.type == 'webAuth' or method.type == 'location' %}str{% else %}Dict[str, Any]{% endif %}:
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{% elseif method.type == 'location' %}bytes{% else %}Dict[str, Any]{% endif %}:
3232
"""
3333
{% autoescape false %}{{ method.description | replace({"\n": "\n "}) }}{% endautoescape %}
3434

@@ -48,8 +48,8 @@ class {{ service.name | caseUcfirst }}(Service):
4848
-------
4949
{% if method.type == 'webAuth' %}str
5050
Authentication response as a string
51-
{% elseif method.type == 'location' %}str
52-
Response as a string
51+
{% elseif method.type == 'location' %}bytes
52+
Response as bytes
5353
{% else %}Dict[str, Any]
5454
API response as a dictionary
5555
{% endif %}

0 commit comments

Comments
 (0)