This template is modified from the original one, to handle multiple status-code handling of response. Don't ask me how they work, I don't quite understand them in depth...
28 lines
634 B
Text
28 lines
634 B
Text
import {
|
|
Configuration,
|
|
ConfigurationParameters,
|
|
} from "../index{{importFileExtension}}";
|
|
|
|
import {
|
|
{{#apiInfo}}
|
|
{{#apis}}
|
|
{{classFilename}},
|
|
{{/apis}}
|
|
{{/apiInfo}}
|
|
} from "./index{{importFileExtension}}";
|
|
|
|
export class Api {
|
|
{{#apiInfo}}
|
|
{{#apis}}
|
|
public static {{#lambda.camelcase}}{{classFilename}}{{/lambda.camelcase}}: {{classFilename}};
|
|
{{/apis}}
|
|
{{/apiInfo}}
|
|
|
|
public static init(apiBaseConfig: ConfigurationParameters) {
|
|
{{#apiInfo}}
|
|
{{#apis}}
|
|
Api.{{#lambda.camelcase}}{{classFilename}}{{/lambda.camelcase}} = new {{classFilename}}(new Configuration(apiBaseConfig));
|
|
{{/apis}}
|
|
{{/apiInfo}}
|
|
}
|
|
}
|