@@ -213,6 +213,10 @@ import {
213213 MalformedContentTypeWithoutBodyServerInput ,
214214 MalformedContentTypeWithoutBodyServerOutput ,
215215} from "../server/operations/MalformedContentTypeWithoutBody" ;
216+ import {
217+ MalformedContentTypeWithoutBodyEmptyInputServerInput ,
218+ MalformedContentTypeWithoutBodyEmptyInputServerOutput ,
219+ } from "../server/operations/MalformedContentTypeWithoutBodyEmptyInput" ;
216220import {
217221 MalformedContentTypeWithPayloadServerInput ,
218222 MalformedContentTypeWithPayloadServerOutput ,
@@ -324,6 +328,14 @@ import {
324328} from "../server/operations/QueryParamsAsStringListMap" ;
325329import { QueryPrecedenceServerInput , QueryPrecedenceServerOutput } from "../server/operations/QueryPrecedence" ;
326330import { 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" ;
327339import {
328340 SimpleScalarPropertiesServerInput ,
329341 SimpleScalarPropertiesServerOutput ,
@@ -2032,6 +2044,33 @@ export const deserializeMalformedContentTypeWithoutBodyRequest = async (
20322044 return contents ;
20332045} ;
20342046
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+
20352074export const deserializeMalformedContentTypeWithPayloadRequest = async (
20362075 output : __HttpRequest ,
20372076 context : __SerdeContext
@@ -3438,6 +3477,56 @@ export const deserializeRecursiveShapesRequest = async (
34383477 return contents ;
34393478} ;
34403479
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+
34413530export const deserializeSimpleScalarPropertiesRequest = async (
34423531 output : __HttpRequest ,
34433532 context : __SerdeContext
@@ -5701,6 +5790,40 @@ export const serializeMalformedContentTypeWithoutBodyResponse = async (
57015790 } ) ;
57025791} ;
57035792
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+
57045827export const serializeMalformedContentTypeWithPayloadResponse = async (
57055828 input : MalformedContentTypeWithPayloadServerOutput ,
57065829 ctx : ServerSerdeContext
@@ -7113,6 +7236,83 @@ export const serializeRecursiveShapesResponse = async (
71137236 } ) ;
71147237} ;
71157238
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+
71167316export const serializeSimpleScalarPropertiesResponse = async (
71177317 input : SimpleScalarPropertiesServerOutput ,
71187318 ctx : ServerSerdeContext
@@ -9169,6 +9369,7 @@ const _f = "foo";
91699369const _fIH = "floatInHeader" ;
91709370const _fl = "floatinheader" ;
91719371const _g = "greeting" ;
9372+ const _h = "header" ;
91729373const _hB = "headerByte" ;
91739374const _hBL = "headerBooleanList" ;
91749375const _hD = "headerDouble" ;
0 commit comments