/* tslint:disable */

/**
 * This file was automatically generated by "Swaxios".
 * It should not be modified by hand.
 */

import axios, {AxiosInstance, AxiosRequestConfig} from 'axios';
{{#each imports}}
import {
  {{#each this.files}}
    {{{this.name}}}
    {{#if this.alternativeName}}
      as {{{this.alternativeName}}}
    {{/if}},
  {{/each}}
} from './{{{this.dir}}}/';
{{/each}}

{{#if description}}
/**
 * {{{description}}}
 */
{{/if}}
export class APIClient {
  private readonly httpClient: AxiosInstance;

  constructor(baseURL: string);
  constructor(config: AxiosRequestConfig);
  constructor(configOrBaseURL: AxiosRequestConfig | string) {
    if (typeof configOrBaseURL === 'string') {
      configOrBaseURL = {baseURL: configOrBaseURL};
    }

    this.httpClient = axios.create(configOrBaseURL);
  }

  get rest() {
    return {{{API}}};
  }

  get defaults() {
    return this.httpClient.defaults;
  }

  get interceptors() {
    return this.httpClient.interceptors;
  }
}
