@@ -213,6 +213,10 @@ import {
213
213
MalformedContentTypeWithoutBodyServerInput ,
214
214
MalformedContentTypeWithoutBodyServerOutput ,
215
215
} from "../server/operations/MalformedContentTypeWithoutBody" ;
216
+ import {
217
+ MalformedContentTypeWithoutBodyEmptyInputServerInput ,
218
+ MalformedContentTypeWithoutBodyEmptyInputServerOutput ,
219
+ } from "../server/operations/MalformedContentTypeWithoutBodyEmptyInput" ;
216
220
import {
217
221
MalformedContentTypeWithPayloadServerInput ,
218
222
MalformedContentTypeWithPayloadServerOutput ,
@@ -324,6 +328,14 @@ import {
324
328
} from "../server/operations/QueryParamsAsStringListMap" ;
325
329
import { QueryPrecedenceServerInput , QueryPrecedenceServerOutput } from "../server/operations/QueryPrecedence" ;
326
330
import { RecursiveShapesServerInput , RecursiveShapesServerOutput } from "../server/operations/RecursiveShapes" ;
331
+ import {
332
+ ResponseCodeHttpFallbackServerInput ,
333
+ ResponseCodeHttpFallbackServerOutput ,
334
+ } from "../server/operations/ResponseCodeHttpFallback" ;
335
+ import {
336
+ ResponseCodeRequiredServerInput ,
337
+ ResponseCodeRequiredServerOutput ,
338
+ } from "../server/operations/ResponseCodeRequired" ;
327
339
import {
328
340
SimpleScalarPropertiesServerInput ,
329
341
SimpleScalarPropertiesServerOutput ,
@@ -2032,6 +2044,33 @@ export const deserializeMalformedContentTypeWithoutBodyRequest = async (
2032
2044
return contents ;
2033
2045
} ;
2034
2046
2047
+ export const deserializeMalformedContentTypeWithoutBodyEmptyInputRequest = async (
2048
+ output : __HttpRequest ,
2049
+ context : __SerdeContext
2050
+ ) : Promise < MalformedContentTypeWithoutBodyEmptyInputServerInput > => {
2051
+ const contentTypeHeaderKey : string | undefined = Object . keys ( output . headers ) . find (
2052
+ ( key ) => key . toLowerCase ( ) === "content-type"
2053
+ ) ;
2054
+ if ( contentTypeHeaderKey != null ) {
2055
+ const contentType = output . headers [ contentTypeHeaderKey ] ;
2056
+ if ( contentType !== undefined && contentType !== "application/json" ) {
2057
+ throw new __UnsupportedMediaTypeException ( ) ;
2058
+ }
2059
+ }
2060
+ const acceptHeaderKey : string | undefined = Object . keys ( output . headers ) . find ( ( key ) => key . toLowerCase ( ) === "accept" ) ;
2061
+ if ( acceptHeaderKey != null ) {
2062
+ const accept = output . headers [ acceptHeaderKey ] ;
2063
+ if ( ! __acceptMatches ( accept , "application/json" ) ) {
2064
+ throw new __NotAcceptableException ( ) ;
2065
+ }
2066
+ }
2067
+ const contents : any = map ( {
2068
+ [ _h ] : [ , output . headers [ _h ] ] ,
2069
+ } ) ;
2070
+ await collectBody ( output . body , context ) ;
2071
+ return contents ;
2072
+ } ;
2073
+
2035
2074
export const deserializeMalformedContentTypeWithPayloadRequest = async (
2036
2075
output : __HttpRequest ,
2037
2076
context : __SerdeContext
@@ -3438,6 +3477,56 @@ export const deserializeRecursiveShapesRequest = async (
3438
3477
return contents ;
3439
3478
} ;
3440
3479
3480
+ export const deserializeResponseCodeHttpFallbackRequest = async (
3481
+ output : __HttpRequest ,
3482
+ context : __SerdeContext
3483
+ ) : Promise < ResponseCodeHttpFallbackServerInput > => {
3484
+ const contentTypeHeaderKey : string | undefined = Object . keys ( output . headers ) . find (
3485
+ ( key ) => key . toLowerCase ( ) === "content-type"
3486
+ ) ;
3487
+ if ( contentTypeHeaderKey != null ) {
3488
+ const contentType = output . headers [ contentTypeHeaderKey ] ;
3489
+ if ( contentType !== undefined && contentType !== "application/json" ) {
3490
+ throw new __UnsupportedMediaTypeException ( ) ;
3491
+ }
3492
+ }
3493
+ const acceptHeaderKey : string | undefined = Object . keys ( output . headers ) . find ( ( key ) => key . toLowerCase ( ) === "accept" ) ;
3494
+ if ( acceptHeaderKey != null ) {
3495
+ const accept = output . headers [ acceptHeaderKey ] ;
3496
+ if ( ! __acceptMatches ( accept , "application/json" ) ) {
3497
+ throw new __NotAcceptableException ( ) ;
3498
+ }
3499
+ }
3500
+ const contents : any = map ( { } ) ;
3501
+ await collectBody ( output . body , context ) ;
3502
+ return contents ;
3503
+ } ;
3504
+
3505
+ export const deserializeResponseCodeRequiredRequest = async (
3506
+ output : __HttpRequest ,
3507
+ context : __SerdeContext
3508
+ ) : Promise < ResponseCodeRequiredServerInput > => {
3509
+ const contentTypeHeaderKey : string | undefined = Object . keys ( output . headers ) . find (
3510
+ ( key ) => key . toLowerCase ( ) === "content-type"
3511
+ ) ;
3512
+ if ( contentTypeHeaderKey != null ) {
3513
+ const contentType = output . headers [ contentTypeHeaderKey ] ;
3514
+ if ( contentType !== undefined ) {
3515
+ throw new __UnsupportedMediaTypeException ( ) ;
3516
+ }
3517
+ }
3518
+ const acceptHeaderKey : string | undefined = Object . keys ( output . headers ) . find ( ( key ) => key . toLowerCase ( ) === "accept" ) ;
3519
+ if ( acceptHeaderKey != null ) {
3520
+ const accept = output . headers [ acceptHeaderKey ] ;
3521
+ if ( ! __acceptMatches ( accept , "application/json" ) ) {
3522
+ throw new __NotAcceptableException ( ) ;
3523
+ }
3524
+ }
3525
+ const contents : any = map ( { } ) ;
3526
+ await collectBody ( output . body , context ) ;
3527
+ return contents ;
3528
+ } ;
3529
+
3441
3530
export const deserializeSimpleScalarPropertiesRequest = async (
3442
3531
output : __HttpRequest ,
3443
3532
context : __SerdeContext
@@ -5701,6 +5790,40 @@ export const serializeMalformedContentTypeWithoutBodyResponse = async (
5701
5790
} ) ;
5702
5791
} ;
5703
5792
5793
+ export const serializeMalformedContentTypeWithoutBodyEmptyInputResponse = async (
5794
+ input : MalformedContentTypeWithoutBodyEmptyInputServerOutput ,
5795
+ ctx : ServerSerdeContext
5796
+ ) : Promise < __HttpResponse > => {
5797
+ const context : __SerdeContext = {
5798
+ ...ctx ,
5799
+ endpoint : ( ) =>
5800
+ Promise . resolve ( {
5801
+ protocol : "" ,
5802
+ hostname : "" ,
5803
+ path : "" ,
5804
+ } ) ,
5805
+ } ;
5806
+ const statusCode = 200 ;
5807
+ let headers : any = map ( { } , isSerializableHeaderValue , { } ) ;
5808
+ let body : any ;
5809
+ if (
5810
+ body &&
5811
+ Object . keys ( headers )
5812
+ . map ( ( str ) => str . toLowerCase ( ) )
5813
+ . indexOf ( "content-length" ) === - 1
5814
+ ) {
5815
+ const length = calculateBodyLength ( body ) ;
5816
+ if ( length !== undefined ) {
5817
+ headers = { ...headers , "content-length" : String ( length ) } ;
5818
+ }
5819
+ }
5820
+ return new __HttpResponse ( {
5821
+ headers,
5822
+ body,
5823
+ statusCode,
5824
+ } ) ;
5825
+ } ;
5826
+
5704
5827
export const serializeMalformedContentTypeWithPayloadResponse = async (
5705
5828
input : MalformedContentTypeWithPayloadServerOutput ,
5706
5829
ctx : ServerSerdeContext
@@ -7113,6 +7236,83 @@ export const serializeRecursiveShapesResponse = async (
7113
7236
} ) ;
7114
7237
} ;
7115
7238
7239
+ export const serializeResponseCodeHttpFallbackResponse = async (
7240
+ input : ResponseCodeHttpFallbackServerOutput ,
7241
+ ctx : ServerSerdeContext
7242
+ ) : Promise < __HttpResponse > => {
7243
+ const context : __SerdeContext = {
7244
+ ...ctx ,
7245
+ endpoint : ( ) =>
7246
+ Promise . resolve ( {
7247
+ protocol : "" ,
7248
+ hostname : "" ,
7249
+ path : "" ,
7250
+ } ) ,
7251
+ } ;
7252
+ const statusCode = 201 ;
7253
+ let headers : any = map ( { } , isSerializableHeaderValue , {
7254
+ "content-type" : "application/json" ,
7255
+ } ) ;
7256
+ let body : any ;
7257
+ body = "{}" ;
7258
+ if (
7259
+ body &&
7260
+ Object . keys ( headers )
7261
+ . map ( ( str ) => str . toLowerCase ( ) )
7262
+ . indexOf ( "content-length" ) === - 1
7263
+ ) {
7264
+ const length = calculateBodyLength ( body ) ;
7265
+ if ( length !== undefined ) {
7266
+ headers = { ...headers , "content-length" : String ( length ) } ;
7267
+ }
7268
+ }
7269
+ return new __HttpResponse ( {
7270
+ headers,
7271
+ body,
7272
+ statusCode,
7273
+ } ) ;
7274
+ } ;
7275
+
7276
+ export const serializeResponseCodeRequiredResponse = async (
7277
+ input : ResponseCodeRequiredServerOutput ,
7278
+ ctx : ServerSerdeContext
7279
+ ) : Promise < __HttpResponse > => {
7280
+ const context : __SerdeContext = {
7281
+ ...ctx ,
7282
+ endpoint : ( ) =>
7283
+ Promise . resolve ( {
7284
+ protocol : "" ,
7285
+ hostname : "" ,
7286
+ path : "" ,
7287
+ } ) ,
7288
+ } ;
7289
+ let statusCode = 200 ;
7290
+ if ( input . responseCode !== undefined ) {
7291
+ statusCode = input . responseCode ;
7292
+ }
7293
+ let headers : any = map ( { } , isSerializableHeaderValue , {
7294
+ "content-type" : "application/json" ,
7295
+ } ) ;
7296
+ let body : any ;
7297
+ body = "{}" ;
7298
+ if (
7299
+ body &&
7300
+ Object . keys ( headers )
7301
+ . map ( ( str ) => str . toLowerCase ( ) )
7302
+ . indexOf ( "content-length" ) === - 1
7303
+ ) {
7304
+ const length = calculateBodyLength ( body ) ;
7305
+ if ( length !== undefined ) {
7306
+ headers = { ...headers , "content-length" : String ( length ) } ;
7307
+ }
7308
+ }
7309
+ return new __HttpResponse ( {
7310
+ headers,
7311
+ body,
7312
+ statusCode,
7313
+ } ) ;
7314
+ } ;
7315
+
7116
7316
export const serializeSimpleScalarPropertiesResponse = async (
7117
7317
input : SimpleScalarPropertiesServerOutput ,
7118
7318
ctx : ServerSerdeContext
@@ -9169,6 +9369,7 @@ const _f = "foo";
9169
9369
const _fIH = "floatInHeader" ;
9170
9370
const _fl = "floatinheader" ;
9171
9371
const _g = "greeting" ;
9372
+ const _h = "header" ;
9172
9373
const _hB = "headerByte" ;
9173
9374
const _hBL = "headerBooleanList" ;
9174
9375
const _hD = "headerDouble" ;
0 commit comments