# {{ name }}
{{ description }}

## Requests
{% for req in requests %}
- [{{ req.name }}](#{{ req.name|lower|replace(' ', '-') }})
{% endfor %}
{% for req in requests %}

## {{ req.name }}
{{ req.description }}

	{% if req.example_raw %}
{{ req.example_raw }}
	{% else %}
		{% if body %}
```javascript
import {{ body }} from '@ouroboros/{{ body }}';
{% if req.data_example %}const request = {{ req.data_example }};
{% endif %}
{{ body }}.{{ req.action }}(
  '{{ req.uri }}'{% if req.data %}, request{% endif %} 
).then(data => {}, error => {});
		{% else %}
```javascript
import body from '@ouroboros/body';
{% if req.data_example %}const request = {{ req.data_example }};{% endif %} 
body.{{ req.action }}(
  '{{ uri }}', '{{ req.uri }}'{% if req.data %}, request{% endif %} 
).then(data => {}, error => {});
		{% endif %}
```
	{% endif %}
	{% if req.data %}

		{% if req.data is string %}
### Request
{{ req.data }}
		{% else %}
### Request variables
| name | type | optional | description |
| ---- | ---- | -------- | ----------- |
			{% for var in req.data %}
| {{ var.name }} | {{ var.type|replace('|', '\|') }} | {{ var.optional }} | {{ var.descr}} |
			{% endfor %}
		{% endif %}
	{% endif %}
	{% if req.response_example %}

### Response example
```json
{{ req.response_example }}
```
	{% endif %}
	{% if req.response %}

		{% if req.response is string %}
### Response
{{ req.response }}
		{% else %}
### Response variables
| name | type | description |
| ---- | ---- | ----------- |
			{% for var in req.response %}
| {{ var.name }} | {{ var.type|replace('|', '\|') }} | {{ var.descr}} |
			{% endfor %}
		{% endif %}
	{% endif %}
	{% if req.error %}

		{% if req.error is string %}
### Error
{{ req.error }}
		{% else %}
### Error codes
| code | constant | description |
| ---- | -------- | ----------- |
			{% for var in req.error %}
| {{ var.code }} | {{ var.const }} | {{ var.descr}} |
			{% endfor %}
		{% endif %}
	{% endif %}
{% endfor %}