// THIS FILE IS GENERATED BY swagger-ts-gen. DO NOT CHANGE MANUALLY.
/* tslint:disable */
/* eslint-disable */

import { HTTPMethod, APIRequest } from "swagger-ts-gen";
{{#if response.isRef}}
import { {{response.type}} } from "../{{definitionDir}}/{{response.type}}";
{{/if}}
{{#each response.properties}}
{{#if isRef}}
import { {{type}} } from "../{{definitionDir}}/{{type}}"
{{/if}}
{{/each}}
{{#if bodyParameter.isRef}}
import { {{bodyParameter.type}} } from "../{{definitionDir}}/{{bodyParameter.type}}";
{{/if}}
{{#each bodyParameter.properties}}
{{#if isRef}}
import { {{type}} } from "../{{definitionDir}}/{{type}}";
{{/if}}
{{/each}}

export class {{name}}Request implements APIRequest<{{#ifEmpty response.properties}}{{response.type}}{{else}}{{name}}Request.Response{{/ifEmpty}}> {
  {{#if response}}
  _response?: {{#ifEmpty response.properties}}{{response.type}}{{else}}{{name}}Request.Response{{/ifEmpty}};
  {{else}}
  _response: void;
  {{/if}}
  path: string = "{{{path}}}";
  method: HTTPMethod = "{{method}}";
  {{#if contentType}}
  contentType = "{{contentType}}";
  {{/if}}

  constructor(
    {{~#each pathParameter.properties~}}{{normalizeCase @key}}: {{type}}{{#unless @last}},{{/unless}}{{/each~}}

    {{~#if bodyParameter}}
    {{~#ifEmpty pathParameter.properties}}{{else}}, {{/ifEmpty~}}
    public parameter: {{bodyParameter.type}}
    {{~/if~}}

    {{~#ifEmpty queryParameter.properties ~}}
    {{~else~}}
    {{~#ifEmpty pathParameter.properties}}{{else}}, {{/ifEmpty~}}
    public parameter: {{name}}Request.Parameter
    {{~/ifEmpty~}}

    {{~#ifEmpty formDataParameter.properties ~}}
    {{~else~}}
    {{~#ifEmpty pathParameter.properties}}{{else}}, {{/ifEmpty~}}
    public parameter: {{name}}Request.Parameter
    {{~/ifEmpty~}}
  ) {
    {{#each pathParameter.properties}}
    this.path = this.path.replace('{ {{~@key~}} }', {{normalizeCase @key}});
    {{/each}}
  }
}

namespace {{name}}Request {
{{#ifEmpty queryParameter.properties}}
{{else}}
  export interface Parameter {
    {{#each queryParameter.properties}}
    {{> property}}
    {{/each}}
  }
{{/ifEmpty}}
{{#ifEmpty formDataParameter.properties}}
{{else}}
  export interface Parameter {
    {{#each formDataParameter.properties}}
    {{> property}}
    {{/each}}
  }
{{/ifEmpty}}
{{#ifEmpty response.properties}}
{{else}}
  export interface Response {
    {{#each response.properties}}
    {{> property}}
    {{/each}}
  }
{{/ifEmpty}}
}