<header class="page-header">
  <h3 class="page-title big">{{#if post}}POST{{else}}GET{{/if}} {{path}}/{{key}}</h3>

  <div class="page-actions">
    {{#if internal}}
      <span class="badge spacer-right">internal</span>
    {{/if}}
    {{#if since}}
      <span class="note spacer-right">Since {{since}}</span>
    {{/if}}

    <a class="js-permalink icon-link" href="{{link '/api_documentation/' path '/' key}}" target="_blank"></a>
  </div>
</header>

<div class="markdown">{{{description}}}</div>

{{#if params}}
  <h4 class="spacer-top little-spacer-bottom">Parameters</h4>
  <table class="width-100 data zebra">
    {{#each params}}
      <tr>
        <td style="width: 10em;">
          <code>{{key}}</code>
          <div class="note">{{#if required}}required{{else}}optional{{/if}}</div>
        </td>
        <td>
          <div class="markdown">{{{description}}}</div>

          {{#if possibleValues}}
            <p class="little-spacer-top">
              <strong>Possible values:</strong>
            </p>
            <ul class="list-styled">
              {{#each possibleValues}}
                <li class="little-spacer-top"><code>{{this}}</code></li>
              {{/each}}
            </ul>
          {{/if}}

          {{#if defaultValue}}
            <p class="little-spacer-top">
              <strong>Default value:</strong> <code>{{defaultValue}}</code>
            </p>
          {{/if}}

          {{#if exampleValue}}
            <p class="little-spacer-top">
              <strong>Example value:</strong> <code>{{exampleValue}}</code>
            </p>
          {{/if}}
        </td>
      </tr>
    {{/each}}
  </table>
{{/if}}

{{#if hasResponseExample}}
  <h4 class="spacer-top">
    Example Response
    {{#unless responseExample}}
      <a class="js-show-response-example little-spacer-left" href="#">Show</a>
    {{/unless}}
  </h4>

  {{#if responseExample}}
    <div class="little-spacer-top">
      <pre>
{{responseExample}}
      </pre>
    </div>
  {{/if}}
{{/if}}
