@@ -31,120 +31,90 @@ import { OpenAPI } from '../core/OpenAPI';
31
31
import { request as __request } from '../core/request';
32
32
{{ /if }}
33
33
34
- {{ #equals @root.httpClient ' angular' }}
35
- @Injectable()
36
- {{ /equals }}
37
- export class {{{ name }}}{{{ @root.postfix }}} {
38
- {{ #if @root.exportClient }}
39
-
40
- constructor(public readonly httpRequest: BaseHttpRequest) {}
41
- {{ else }}
42
- {{ #equals @root.httpClient ' angular' }}
43
-
44
- constructor(public readonly http: HttpClient) {}
45
- {{ /equals }}
46
- {{ /if }}
47
-
48
- {{ #each operations }}
49
- /**
50
- {{ #if deprecated }}
51
- * @deprecated
52
- {{ /if }}
53
- {{ #if summary }}
54
- * {{{ escapeComment summary }}}
55
- {{ /if }}
56
- {{ #if description }}
57
- * {{{ escapeComment description }}}
58
- {{ /if }}
59
- {{ #unless @root.useOptions }}
60
- {{ #if parameters }}
61
- {{ #each parameters }}
62
- * @param {{{ name }}} {{ #if description }} {{{ escapeComment description }}} {{ /if }}
63
- {{ /each }}
64
- {{ /if }}
65
- {{ /unless }}
66
- {{ #each results }}
67
- * @returns {{{ type }}} {{ #if description }} {{{ escapeComment description }}} {{ /if }}
68
- {{ /each }}
69
- * @throws ApiError
70
- */
71
- {{ #if @root.exportClient }}
72
- {{ #equals @root.httpClient ' angular' }}
73
- public {{{ name }}} ({{> parameters }} ): Observable<{{ >result}}> {
74
- return this.httpRequest.request({
75
- {{ else }}
76
- public {{{ name }}} ({{> parameters }} ): CancelablePromise<{{ >result}}> {
77
- return this.httpRequest.request({
78
- {{ /equals }}
79
- {{ else }}
80
- {{ #equals @root.httpClient ' angular' }}
81
- public {{{ name }}} ({{> parameters }} ): Observable<{{ >result}}> {
82
- return __request(OpenAPI, this.http, {
83
- {{ else }}
84
- public static {{{ name }}} ({{> parameters }} ): CancelablePromise<{{ >result}}> {
85
- return __request(OpenAPI, {
86
- {{ /equals }}
87
- {{ /if }}
88
- method: '{{{ method }}} ',
89
- url: '{{{ path }}} ',
90
- {{ #if parametersPath }}
91
- path: {
92
- {{ #each parametersPath }}
93
- '{{{ prop }}} ': {{{ name }}} ,
94
- {{ /each }}
95
- },
96
- {{ /if }}
97
- {{ #if parametersCookie }}
98
- cookies: {
99
- {{ #each parametersCookie }}
100
- '{{{ prop }}} ': {{{ name }}} ,
101
- {{ /each }}
102
- },
103
- {{ /if }}
104
- {{ #if parametersHeader }}
105
- headers: {
106
- {{ #each parametersHeader }}
107
- '{{{ prop }}} ': {{{ name }}} ,
108
- {{ /each }}
109
- },
110
- {{ /if }}
111
- {{ #if parametersQuery }}
112
- query: {
113
- {{ #each parametersQuery }}
114
- '{{{ prop }}} ': {{{ name }}} ,
115
- {{ /each }}
116
- },
117
- {{ /if }}
118
- {{ #if parametersForm }}
119
- formData: {
120
- {{ #each parametersForm }}
121
- '{{{ prop }}} ': {{{ name }}} ,
122
- {{ /each }}
123
- },
124
- {{ /if }}
125
- {{ #if parametersBody }}
126
- {{ #equals parametersBody.in ' formData' }}
127
- formData: {{{ parametersBody.name }}} ,
128
- {{ /equals }}
129
- {{ #equals parametersBody.in ' body' }}
130
- body: {{{ parametersBody.name }}} ,
131
- {{ /equals }}
132
- {{ #if parametersBody.mediaType }}
133
- mediaType: '{{{ parametersBody.mediaType }}} ',
134
- {{ /if }}
135
- {{ /if }}
136
- {{ #if responseHeader }}
137
- responseHeader: '{{{ responseHeader }}} ',
138
- {{ /if }}
139
- {{ #if errors }}
140
- errors: {
141
- {{ #each errors }}
142
- {{{ code }}} : `{{{ escapeDescription description }}} `,
143
- {{ /each }}
144
- },
145
- {{ /if }}
146
- });
147
- }
34
+ {{ #each operations }}
35
+ /**
36
+ {{ #if deprecated }}
37
+ * @deprecated
38
+ {{ /if }}
39
+ {{ #if summary }}
40
+ * {{{ escapeComment summary }}}
41
+ {{ /if }}
42
+ {{ #if description }}
43
+ * {{{ escapeComment description }}}
44
+ {{ /if }}
45
+ {{ #unless @root.useOptions }}
46
+ {{ #if parameters }}
47
+ {{ #each parameters }}
48
+ * @param {{{ name }}} {{ #if description }} {{{ escapeComment description }}} {{ /if }}
49
+ {{ /each }}
50
+ {{ /if }}
51
+ {{ /unless }}
52
+ {{ #each results }}
53
+ * @returns {{{ type }}} {{ #if description }} {{{ escapeComment description }}} {{ /if }}
54
+ {{ /each }}
55
+ * @throws ApiError
56
+ */
57
+ export const {{{ name }}} = ({{> parameters }} ): CancelablePromise<{{ >result}}> => {
58
+ return __request(OpenAPI, {
59
+ method: '{{{ method }}} ',
60
+ url: '{{{ path }}} ',
61
+ {{ #if parametersPath }}
62
+ path: {
63
+ {{ #each parametersPath }}
64
+ '{{{ prop }}} ': {{{ name }}} ,
65
+ {{ /each }}
66
+ },
67
+ {{ /if }}
68
+ {{ #if parametersCookie }}
69
+ cookies: {
70
+ {{ #each parametersCookie }}
71
+ '{{{ prop }}} ': {{{ name }}} ,
72
+ {{ /each }}
73
+ },
74
+ {{ /if }}
75
+ {{ #if parametersHeader }}
76
+ headers: {
77
+ {{ #each parametersHeader }}
78
+ '{{{ prop }}} ': {{{ name }}} ,
79
+ {{ /each }}
80
+ },
81
+ {{ /if }}
82
+ {{ #if parametersQuery }}
83
+ query: {
84
+ {{ #each parametersQuery }}
85
+ '{{{ prop }}} ': {{{ name }}} ,
86
+ {{ /each }}
87
+ },
88
+ {{ /if }}
89
+ {{ #if parametersForm }}
90
+ formData: {
91
+ {{ #each parametersForm }}
92
+ '{{{ prop }}} ': {{{ name }}} ,
93
+ {{ /each }}
94
+ },
95
+ {{ /if }}
96
+ {{ #if parametersBody }}
97
+ {{ #equals parametersBody.in ' formData' }}
98
+ formData: {{{ parametersBody.name }}} ,
99
+ {{ /equals }}
100
+ {{ #equals parametersBody.in ' body' }}
101
+ body: {{{ parametersBody.name }}} ,
102
+ {{ /equals }}
103
+ {{ #if parametersBody.mediaType }}
104
+ mediaType: '{{{ parametersBody.mediaType }}} ',
105
+ {{ /if }}
106
+ {{ /if }}
107
+ {{ #if responseHeader }}
108
+ responseHeader: '{{{ responseHeader }}} ',
109
+ {{ /if }}
110
+ {{ #if errors }}
111
+ errors: {
112
+ {{ #each errors }}
113
+ {{{ code }}} : `{{{ escapeDescription description }}} `,
114
+ {{ /each }}
115
+ },
116
+ {{ /if }}
117
+ });
118
+ };
148
119
149
- {{ /each }}
150
- }
120
+ {{ /each }}
0 commit comments