{% import "type_name.html" as common %}

<h4 class="title is-4 type-heading" id="service-{{ service.full_name }}">
  <a href="#service-{{ service.full_name }}" title="{{ service.full_name }}">service {{ service.name }}</a>
  {% if service.repository_url %}
    <a class="type-source-link" href="{{ service.repository_url }}">{{ service.source_file_path }}</a>
  {% endif %}
</h4>

<div class="block content">
  <p>{{ service.description_html | safe }}</p>
</div>

{% for method in service.methods %}
<div class="box">
  <div class="block">
    <h5 class="title is-5" id="service-{{ service.full_name }}-{{ method.name }}">
      <a href="#service-{{ service.full_name }}-{{ method.name }}">
        rpc <code>{{ method.name }}</code>
      </a>
    </h5>
    Request: <code>{{ common.type_name(method.request) | trim }}</code><br>
    Response: <code>{{ common.type_name(method.response) }}</code><br>
  </div>

  {% if method.description_html %}
  <div class="block">
    <p>{{ method.description_html | safe }}</p>
  </div>
  {% endif %}
</div>
{% endfor %}
