@@ -53,16 +53,20 @@ export class ApiEndpoints {
53
53
const contentType : string = httpRes ?. headers ?. [ "content-type" ] ?? "" ;
54
54
55
55
if ( httpRes ?. status == null ) throw new Error ( `status code not found in response: ${ httpRes } ` ) ;
56
- const res : operations . DeleteApiEndpointResponse = { statusCode : httpRes . status , contentType : contentType , rawResponse : httpRes } ;
56
+ const res : operations . DeleteApiEndpointResponse =
57
+ new operations . DeleteApiEndpointResponse ( {
58
+ statusCode : httpRes . status ,
59
+ contentType : contentType ,
60
+ rawResponse : httpRes
61
+ } ) ;
57
62
switch ( true ) {
58
63
case httpRes ?. status == 200 :
59
64
break ;
60
65
default :
61
66
if ( utils . matchContentType ( contentType , `application/json` ) ) {
62
- res . error = plainToInstance (
67
+ res . error = utils . deserializeJSONResponse (
68
+ httpRes ?. data ,
63
69
shared . ErrorT ,
64
- httpRes ?. data as shared . ErrorT ,
65
- { excludeExtraneousValues : true }
66
70
) ;
67
71
}
68
72
break ;
@@ -106,23 +110,26 @@ export class ApiEndpoints {
106
110
const contentType : string = httpRes ?. headers ?. [ "content-type" ] ?? "" ;
107
111
108
112
if ( httpRes ?. status == null ) throw new Error ( `status code not found in response: ${ httpRes } ` ) ;
109
- const res : operations . FindApiEndpointResponse = { statusCode : httpRes . status , contentType : contentType , rawResponse : httpRes } ;
113
+ const res : operations . FindApiEndpointResponse =
114
+ new operations . FindApiEndpointResponse ( {
115
+ statusCode : httpRes . status ,
116
+ contentType : contentType ,
117
+ rawResponse : httpRes
118
+ } ) ;
110
119
switch ( true ) {
111
120
case httpRes ?. status == 200 :
112
121
if ( utils . matchContentType ( contentType , `application/json` ) ) {
113
- res . apiEndpoint = plainToInstance (
122
+ res . apiEndpoint = utils . deserializeJSONResponse (
123
+ httpRes ?. data ,
114
124
shared . ApiEndpoint ,
115
- httpRes ?. data as shared . ApiEndpoint ,
116
- { excludeExtraneousValues : true }
117
125
) ;
118
126
}
119
127
break ;
120
128
default :
121
129
if ( utils . matchContentType ( contentType , `application/json` ) ) {
122
- res . error = plainToInstance (
130
+ res . error = utils . deserializeJSONResponse (
131
+ httpRes ?. data ,
123
132
shared . ErrorT ,
124
- httpRes ?. data as shared . ErrorT ,
125
- { excludeExtraneousValues : true }
126
133
) ;
127
134
}
128
135
break ;
@@ -166,23 +173,26 @@ export class ApiEndpoints {
166
173
const contentType : string = httpRes ?. headers ?. [ "content-type" ] ?? "" ;
167
174
168
175
if ( httpRes ?. status == null ) throw new Error ( `status code not found in response: ${ httpRes } ` ) ;
169
- const res : operations . GenerateOpenApiSpecForApiEndpointResponse = { statusCode : httpRes . status , contentType : contentType , rawResponse : httpRes } ;
176
+ const res : operations . GenerateOpenApiSpecForApiEndpointResponse =
177
+ new operations . GenerateOpenApiSpecForApiEndpointResponse ( {
178
+ statusCode : httpRes . status ,
179
+ contentType : contentType ,
180
+ rawResponse : httpRes
181
+ } ) ;
170
182
switch ( true ) {
171
183
case httpRes ?. status == 200 :
172
184
if ( utils . matchContentType ( contentType , `application/json` ) ) {
173
- res . generateOpenApiSpecDiff = plainToInstance (
185
+ res . generateOpenApiSpecDiff = utils . deserializeJSONResponse (
186
+ httpRes ?. data ,
174
187
shared . GenerateOpenApiSpecDiff ,
175
- httpRes ?. data as shared . GenerateOpenApiSpecDiff ,
176
- { excludeExtraneousValues : true }
177
188
) ;
178
189
}
179
190
break ;
180
191
default :
181
192
if ( utils . matchContentType ( contentType , `application/json` ) ) {
182
- res . error = plainToInstance (
193
+ res . error = utils . deserializeJSONResponse (
194
+ httpRes ?. data ,
183
195
shared . ErrorT ,
184
- httpRes ?. data as shared . ErrorT ,
185
- { excludeExtraneousValues : true }
186
196
) ;
187
197
}
188
198
break ;
@@ -225,7 +235,12 @@ export class ApiEndpoints {
225
235
const contentType : string = httpRes ?. headers ?. [ "content-type" ] ?? "" ;
226
236
227
237
if ( httpRes ?. status == null ) throw new Error ( `status code not found in response: ${ httpRes } ` ) ;
228
- const res : operations . GeneratePostmanCollectionForApiEndpointResponse = { statusCode : httpRes . status , contentType : contentType , rawResponse : httpRes } ;
238
+ const res : operations . GeneratePostmanCollectionForApiEndpointResponse =
239
+ new operations . GeneratePostmanCollectionForApiEndpointResponse ( {
240
+ statusCode : httpRes . status ,
241
+ contentType : contentType ,
242
+ rawResponse : httpRes
243
+ } ) ;
229
244
switch ( true ) {
230
245
case httpRes ?. status == 200 :
231
246
if ( utils . matchContentType ( contentType , `application/octet-stream` ) ) {
@@ -237,10 +252,9 @@ export class ApiEndpoints {
237
252
break ;
238
253
default :
239
254
if ( utils . matchContentType ( contentType , `application/json` ) ) {
240
- res . error = plainToInstance (
255
+ res . error = utils . deserializeJSONResponse (
256
+ httpRes ?. data ,
241
257
shared . ErrorT ,
242
- httpRes ?. data as shared . ErrorT ,
243
- { excludeExtraneousValues : true }
244
258
) ;
245
259
}
246
260
break ;
@@ -281,19 +295,29 @@ export class ApiEndpoints {
281
295
const contentType : string = httpRes ?. headers ?. [ "content-type" ] ?? "" ;
282
296
283
297
if ( httpRes ?. status == null ) throw new Error ( `status code not found in response: ${ httpRes } ` ) ;
284
- const res : operations . GetAllApiEndpointsResponse = { statusCode : httpRes . status , contentType : contentType , rawResponse : httpRes } ;
298
+ const res : operations . GetAllApiEndpointsResponse =
299
+ new operations . GetAllApiEndpointsResponse ( {
300
+ statusCode : httpRes . status ,
301
+ contentType : contentType ,
302
+ rawResponse : httpRes
303
+ } ) ;
285
304
switch ( true ) {
286
305
case httpRes ?. status == 200 :
287
306
if ( utils . matchContentType ( contentType , `application/json` ) ) {
288
- res . apiEndpoints = httpRes ?. data ;
307
+ res . apiEndpoints = [ ] ;
308
+ const resFieldDepth : number = utils . getResFieldDepth ( res ) ;
309
+ res . apiEndpoints = utils . deserializeJSONResponse (
310
+ httpRes ?. data ,
311
+ shared . ApiEndpoint ,
312
+ resFieldDepth
313
+ ) ;
289
314
}
290
315
break ;
291
316
default :
292
317
if ( utils . matchContentType ( contentType , `application/json` ) ) {
293
- res . error = plainToInstance (
318
+ res . error = utils . deserializeJSONResponse (
319
+ httpRes ?. data ,
294
320
shared . ErrorT ,
295
- httpRes ?. data as shared . ErrorT ,
296
- { excludeExtraneousValues : true }
297
321
) ;
298
322
}
299
323
break ;
@@ -334,19 +358,29 @@ export class ApiEndpoints {
334
358
const contentType : string = httpRes ?. headers ?. [ "content-type" ] ?? "" ;
335
359
336
360
if ( httpRes ?. status == null ) throw new Error ( `status code not found in response: ${ httpRes } ` ) ;
337
- const res : operations . GetAllForVersionApiEndpointsResponse = { statusCode : httpRes . status , contentType : contentType , rawResponse : httpRes } ;
361
+ const res : operations . GetAllForVersionApiEndpointsResponse =
362
+ new operations . GetAllForVersionApiEndpointsResponse ( {
363
+ statusCode : httpRes . status ,
364
+ contentType : contentType ,
365
+ rawResponse : httpRes
366
+ } ) ;
338
367
switch ( true ) {
339
368
case httpRes ?. status == 200 :
340
369
if ( utils . matchContentType ( contentType , `application/json` ) ) {
341
- res . apiEndpoints = httpRes ?. data ;
370
+ res . apiEndpoints = [ ] ;
371
+ const resFieldDepth : number = utils . getResFieldDepth ( res ) ;
372
+ res . apiEndpoints = utils . deserializeJSONResponse (
373
+ httpRes ?. data ,
374
+ shared . ApiEndpoint ,
375
+ resFieldDepth
376
+ ) ;
342
377
}
343
378
break ;
344
379
default :
345
380
if ( utils . matchContentType ( contentType , `application/json` ) ) {
346
- res . error = plainToInstance (
381
+ res . error = utils . deserializeJSONResponse (
382
+ httpRes ?. data ,
347
383
shared . ErrorT ,
348
- httpRes ?. data as shared . ErrorT ,
349
- { excludeExtraneousValues : true }
350
384
) ;
351
385
}
352
386
break ;
@@ -387,23 +421,26 @@ export class ApiEndpoints {
387
421
const contentType : string = httpRes ?. headers ?. [ "content-type" ] ?? "" ;
388
422
389
423
if ( httpRes ?. status == null ) throw new Error ( `status code not found in response: ${ httpRes } ` ) ;
390
- const res : operations . GetApiEndpointResponse = { statusCode : httpRes . status , contentType : contentType , rawResponse : httpRes } ;
424
+ const res : operations . GetApiEndpointResponse =
425
+ new operations . GetApiEndpointResponse ( {
426
+ statusCode : httpRes . status ,
427
+ contentType : contentType ,
428
+ rawResponse : httpRes
429
+ } ) ;
391
430
switch ( true ) {
392
431
case httpRes ?. status == 200 :
393
432
if ( utils . matchContentType ( contentType , `application/json` ) ) {
394
- res . apiEndpoint = plainToInstance (
433
+ res . apiEndpoint = utils . deserializeJSONResponse (
434
+ httpRes ?. data ,
395
435
shared . ApiEndpoint ,
396
- httpRes ?. data as shared . ApiEndpoint ,
397
- { excludeExtraneousValues : true }
398
436
) ;
399
437
}
400
438
break ;
401
439
default :
402
440
if ( utils . matchContentType ( contentType , `application/json` ) ) {
403
- res . error = plainToInstance (
441
+ res . error = utils . deserializeJSONResponse (
442
+ httpRes ?. data ,
404
443
shared . ErrorT ,
405
- httpRes ?. data as shared . ErrorT ,
406
- { excludeExtraneousValues : true }
407
444
) ;
408
445
}
409
446
break ;
@@ -458,23 +495,26 @@ export class ApiEndpoints {
458
495
const contentType : string = httpRes ?. headers ?. [ "content-type" ] ?? "" ;
459
496
460
497
if ( httpRes ?. status == null ) throw new Error ( `status code not found in response: ${ httpRes } ` ) ;
461
- const res : operations . UpsertApiEndpointResponse = { statusCode : httpRes . status , contentType : contentType , rawResponse : httpRes } ;
498
+ const res : operations . UpsertApiEndpointResponse =
499
+ new operations . UpsertApiEndpointResponse ( {
500
+ statusCode : httpRes . status ,
501
+ contentType : contentType ,
502
+ rawResponse : httpRes
503
+ } ) ;
462
504
switch ( true ) {
463
505
case httpRes ?. status == 200 :
464
506
if ( utils . matchContentType ( contentType , `application/json` ) ) {
465
- res . apiEndpoint = plainToInstance (
507
+ res . apiEndpoint = utils . deserializeJSONResponse (
508
+ httpRes ?. data ,
466
509
shared . ApiEndpoint ,
467
- httpRes ?. data as shared . ApiEndpoint ,
468
- { excludeExtraneousValues : true }
469
510
) ;
470
511
}
471
512
break ;
472
513
default :
473
514
if ( utils . matchContentType ( contentType , `application/json` ) ) {
474
- res . error = plainToInstance (
515
+ res . error = utils . deserializeJSONResponse (
516
+ httpRes ?. data ,
475
517
shared . ErrorT ,
476
- httpRes ?. data as shared . ErrorT ,
477
- { excludeExtraneousValues : true }
478
518
) ;
479
519
}
480
520
break ;
0 commit comments