Move templates to files

This commit is contained in:
Honza Král
2019-12-22 16:32:49 +01:00
committed by Honza Král
parent 219a8bb12f
commit 77f084dc0d
21 changed files with 129 additions and 133 deletions
+29
View File
@@ -0,0 +1,29 @@
@query_params({{ api.query_params|map("tojson")|join(", ")}})
def {{ api.name }}(self, {{ api.func_params|join(", ") }}):
"""
{% if api.description %}
{{ api.description|replace("\n", " ")|wordwrap(wrapstring="\n ") }}
{% endif %}
{% if api.doc_url %}
`<{{ api.doc_url }}>`_
{% endif %}
{% if api.params %}
{% for p, info in api.params %}
{% filter wordwrap(72, wrapstring="\n ") %}
:arg {{ p }}: {{ info.description }} {% if info.options %}Valid choices: {{ info.options|join(", ") }}{% endif %} {% if info.default %}Default: {{ info.default }}{% endif %}
{% endfilter %}
{% endfor %}
{% endif %}
"""
{% include "substitutions" %}
{% include "required" %}
{% if api.body.body.serialize == "bulk" %}
body = self._bulk_body(body)
{% endif %}
{% block request %}
return self.transport.perform_request("{{ api.method }}", {% include "url" %}, params=params{% if api.body.body %}, body=body{% endif %})
{% endblock %}