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