-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
/
File.liquid
144 lines (121 loc) · 4.17 KB
/
File.liquid
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
/* tslint:disable */
//----------------------
// <auto-generated>
// Generated using the NSwag toolchain v{{ ToolchainVersion }} (http://NSwag.org)
// </auto-generated>
//----------------------
// ReSharper disable InconsistentNaming
{{ ExtensionCodeImport -}}
{% if ImportRequiredTypes -%}
{% if GenerateClientClasses -%}
{% if Framework.IsAngular -%}
{% if Framework.UseRxJs5 -%}
import 'rxjs/add/observable/fromPromise';
import 'rxjs/add/observable/of';
import 'rxjs/add/observable/throw';
import 'rxjs/add/operator/map';
import 'rxjs/add/operator/toPromise';
import 'rxjs/add/operator/mergeMap';
import 'rxjs/add/operator/catch';
import { Observable } from 'rxjs/Observable';
{% else -%}
import { mergeMap as {{ Framework.RxJs.ObservableMergeMapMethod }}, catchError as {{ Framework.RxJs.ObservableCatchMethod }} } from 'rxjs/operators';
import { Observable, from as {{ Framework.RxJs.ObservableFromMethod }}, throwError as {{ Framework.RxJs.ObservableThrowMethod }}, of as {{ Framework.RxJs.ObservableOfMethod }} } from 'rxjs';
{% endif -%}
import { Injectable, Inject, Optional, {{ Framework.Angular.InjectionTokenType }} } from '@angular/core';
{% if Framework.Angular.UseHttpClient -%}
import { HttpClient, HttpHeaders, HttpResponse, HttpResponseBase } from '@angular/common/http';
{% else -%}
import { Http, Headers, ResponseContentType, Response{% if UseTransformOptionsMethod %}, RequestOptionsArgs{% endif %} } from '@angular/http';
{% endif -%}
{% endif -%}
{% if Framework.IsAurelia -%}
import { inject } from 'aurelia-framework';
import { HttpClient, RequestInit } from 'aurelia-fetch-client';
{% endif -%}
{% if Framework.IsAngularJS -%}
import * as ng from 'angular';
{% endif -%}
{% if Framework.IsKnockout -%}
import * as ko from 'knockout';
{% endif -%}
{% if Framework.IsJQuery -%}
import * as jQuery from 'jquery';
{% endif -%}
{% endif -%}
{% if Framework.UseMomentJS -%}
import * as moment from 'moment';
{% endif -%}
{% endif -%}
{% if HasModuleName -%}
export module {{ ModuleName }} {
{% endif -%}
{% if HasNamespace -%}
namespace {{ Namespace }} {
{% endif -%}
{% if GenerateClientClasses and Framework.IsAngular -%}
export const {{ Framework.Angular.BaseUrlTokenName }} = new {{ Framework.Angular.InjectionTokenType }}{% if Framework.Angular.InjectionTokenType == "InjectionToken" %}<string>{% endif %}('{{ Framework.Angular.BaseUrlTokenName }}');
{% endif -%}
{{ ExtensionCodeTop }}
{{ Clients }}
{{ Types }}
{% if WrapResponses and GenerateResponseClasses -%}
{% for responseClassName in ResponseClassNames -%}
export class {{ responseClassName }}<TResult> {
status: number;
headers: { [key: string]: any; };
result: TResult;
constructor(status: number, headers: { [key: string]: any; }, result: TResult)
{
this.status = status;
this.headers = headers;
this.result = result;
}
}
{% endfor -%}
{% endif -%}
{% if RequiresFileParameterInterface -%}
export interface FileParameter {
data: any;
fileName: string;
}
{% endif -%}
{% if RequiresFileResponseInterface -%}
export interface FileResponse {
data: Blob;
status: number;
fileName?: string;
headers?: { [name: string]: any };
}
{% endif -%}
{% if RequiresSwaggerExceptionClass -%}
export class SwaggerException extends Error {
message: string;
status: number;
response: string;
headers: { [key: string]: any; };
result: any;
constructor(message: string, status: number, response: string, headers: { [key: string]: any; }, result: any) {
super();
this.message = message;
this.status = status;
this.response = response;
this.headers = headers;
this.result = result;
}
protected isSwaggerException = true;
static isSwaggerException(obj: any): obj is SwaggerException {
return obj.isSwaggerException === true;
}
}
{% endif -%}
{% if GenerateClientClasses -%}
{% template File.Utilities %}
{% endif -%}
{{ ExtensionCodeBottom }}
{% if HasNamespace -%}
}
{% endif -%}
{% if HasModuleName -%}
}
{% endif -%}