2019-12-22 15:15:00 +01:00
2023-11-06 13:08:19 -05:00
@query_params({{ api.query_params|map("tojson")|join(", ")}})
async def {{ api.name }}(self, {% include "func_params" %}) -> Any:
2019-12-22 15:15:00 +01:00
"""
{% if api.description %}
{{ api.description|replace("\n", " ")|wordwrap(wrapstring="\n ") }}
{% endif %}
2023-06-27 11:56:55 -07:00
2019-12-22 15:15:00 +01:00
{% if api.doc_url %}
2020-10-20 12:07:41 -05:00
2019-12-22 15:15:00 +01:00
`<{{ api.doc_url }}>`_
{% endif %}
2020-10-28 13:49:05 -05:00
{% if api.stability != "stable" %}
.. warning::
This API is **{{ api.stability }}** so may include breaking changes
or be removed in a future version
{% endif %}
2020-04-03 12:52:11 -05:00
{% if api.params|list|length %}
2019-12-22 15:15:00 +01:00
{% for p, info in api.params %}
2023-10-26 07:58:33 -07:00
{% if info.description %}
2019-12-22 15:15:00 +01:00
{% filter wordwrap(72, wrapstring="\n ") %}
2024-04-17 16:22:14 -07:00
:arg {{ p }}{% if info.deprecated and info.deprecation_message is defined %} (Deprecated: {{ info['deprecation_message'][:-1] }}.){% endif %}: {{ info.description }} {% if info.options and "Valid values" not in info.description %}Valid choices are {{ info.options|join(", ") }}.{% endif %}
2023-10-26 07:58:33 -07:00
{% if info.default is defined %}{% if info.default is not none %}{% if info.default is sameas(false) %}Default is false.{% else %}Default is {{ info.default }}.{% endif %}{% endif %}{% endif %}
2019-12-22 15:15:00 +01:00
{% endfilter %}
2023-10-26 07:58:33 -07:00
{% endif %}
2019-12-22 15:15:00 +01:00
{% endfor %}
{% endif %}
"""
2023-10-09 13:47:26 -07:00
{% if api.deprecation_message %}
from warnings import warn
warn("Deprecated: {{ api.deprecation_message }}")
{% endif %}
2019-12-22 15:15:00 +01:00
{% include "substitutions" %}
{% include "required" %}
2024-05-01 13:59:17 -07:00
{% if api.body.serialize %}
2020-02-21 12:12:27 -06:00
body = _bulk_body(self.transport.serializer, body)
2019-12-22 15:15:00 +01:00
{% endif %}
{% block request %}
2020-05-15 09:36:47 -05:00
return await self.transport.perform_request("{{ api.method }}", {% include "url" %}, params=params, headers=headers{% if api.body %}, body=body{% endif %})
2019-12-22 15:15:00 +01:00
{% endblock %}