@@ -153,19 +153,21 @@ export const serializeAws_restJson1PostContentCommand = async (
153
153
"content-type" : "application/octet-stream" ,
154
154
"x-amz-content-sha256" : "UNSIGNED-PAYLOAD" ,
155
155
...( isSerializableHeaderValue ( input . sessionAttributes ) && {
156
- "x-amz-lex-session-attributes" : Buffer . from ( __LazyJsonString . fromObject ( input . sessionAttributes ! ) ) . toString (
157
- "base64"
156
+ "x-amz-lex-session-attributes" : context . base64Encoder (
157
+ Buffer . from ( __LazyJsonString . fromObject ( input . sessionAttributes ! ) )
158
158
) ,
159
159
} ) ,
160
160
...( isSerializableHeaderValue ( input . requestAttributes ) && {
161
- "x-amz-lex-request-attributes" : Buffer . from ( __LazyJsonString . fromObject ( input . requestAttributes ! ) ) . toString (
162
- "base64"
161
+ "x-amz-lex-request-attributes" : context . base64Encoder (
162
+ Buffer . from ( __LazyJsonString . fromObject ( input . requestAttributes ! ) )
163
163
) ,
164
164
} ) ,
165
165
...( isSerializableHeaderValue ( input . contentType ) && { "content-type" : input . contentType ! } ) ,
166
166
...( isSerializableHeaderValue ( input . accept ) && { accept : input . accept ! } ) ,
167
167
...( isSerializableHeaderValue ( input . activeContexts ) && {
168
- "x-amz-lex-active-contexts" : Buffer . from ( __LazyJsonString . fromObject ( input . activeContexts ! ) ) . toString ( "base64" ) ,
168
+ "x-amz-lex-active-contexts" : context . base64Encoder (
169
+ Buffer . from ( __LazyJsonString . fromObject ( input . activeContexts ! ) )
170
+ ) ,
169
171
} ) ,
170
172
} ;
171
173
let resolvedPath =
@@ -575,20 +577,22 @@ export const deserializeAws_restJson1PostContentCommand = async (
575
577
}
576
578
if ( output . headers [ "x-amz-lex-nlu-intent-confidence" ] !== undefined ) {
577
579
contents . nluIntentConfidence = new __LazyJsonString (
578
- Buffer . from ( output . headers [ "x-amz-lex-nlu-intent-confidence" ] , "base64" ) . toString ( "ascii " )
580
+ Buffer . from ( context . base64Decoder ( output . headers [ "x-amz-lex-nlu-intent-confidence" ] ) ) . toString ( "utf8 " )
579
581
) ;
580
582
}
581
583
if ( output . headers [ "x-amz-lex-alternative-intents" ] !== undefined ) {
582
584
contents . alternativeIntents = new __LazyJsonString (
583
- Buffer . from ( output . headers [ "x-amz-lex-alternative-intents" ] , "base64" ) . toString ( "ascii " )
585
+ Buffer . from ( context . base64Decoder ( output . headers [ "x-amz-lex-alternative-intents" ] ) ) . toString ( "utf8 " )
584
586
) ;
585
587
}
586
588
if ( output . headers [ "x-amz-lex-slots" ] !== undefined ) {
587
- contents . slots = new __LazyJsonString ( Buffer . from ( output . headers [ "x-amz-lex-slots" ] , "base64" ) . toString ( "ascii" ) ) ;
589
+ contents . slots = new __LazyJsonString (
590
+ Buffer . from ( context . base64Decoder ( output . headers [ "x-amz-lex-slots" ] ) ) . toString ( "utf8" )
591
+ ) ;
588
592
}
589
593
if ( output . headers [ "x-amz-lex-session-attributes" ] !== undefined ) {
590
594
contents . sessionAttributes = new __LazyJsonString (
591
- Buffer . from ( output . headers [ "x-amz-lex-session-attributes" ] , "base64" ) . toString ( "ascii " )
595
+ Buffer . from ( context . base64Decoder ( output . headers [ "x-amz-lex-session-attributes" ] ) ) . toString ( "utf8 " )
592
596
) ;
593
597
}
594
598
if ( output . headers [ "x-amz-lex-sentiment" ] !== undefined ) {
@@ -623,7 +627,7 @@ export const deserializeAws_restJson1PostContentCommand = async (
623
627
}
624
628
if ( output . headers [ "x-amz-lex-active-contexts" ] !== undefined ) {
625
629
contents . activeContexts = new __LazyJsonString (
626
- Buffer . from ( output . headers [ "x-amz-lex-active-contexts" ] , "base64" ) . toString ( "ascii " )
630
+ Buffer . from ( context . base64Decoder ( output . headers [ "x-amz-lex-active-contexts" ] ) ) . toString ( "utf8 " )
627
631
) ;
628
632
}
629
633
const data : any = output . body ;
@@ -940,11 +944,13 @@ export const deserializeAws_restJson1PutSessionCommand = async (
940
944
contents . intentName = output . headers [ "x-amz-lex-intent-name" ] ;
941
945
}
942
946
if ( output . headers [ "x-amz-lex-slots" ] !== undefined ) {
943
- contents . slots = new __LazyJsonString ( Buffer . from ( output . headers [ "x-amz-lex-slots" ] , "base64" ) . toString ( "ascii" ) ) ;
947
+ contents . slots = new __LazyJsonString (
948
+ Buffer . from ( context . base64Decoder ( output . headers [ "x-amz-lex-slots" ] ) ) . toString ( "utf8" )
949
+ ) ;
944
950
}
945
951
if ( output . headers [ "x-amz-lex-session-attributes" ] !== undefined ) {
946
952
contents . sessionAttributes = new __LazyJsonString (
947
- Buffer . from ( output . headers [ "x-amz-lex-session-attributes" ] , "base64" ) . toString ( "ascii " )
953
+ Buffer . from ( context . base64Decoder ( output . headers [ "x-amz-lex-session-attributes" ] ) ) . toString ( "utf8 " )
948
954
) ;
949
955
}
950
956
if ( output . headers [ "x-amz-lex-message" ] !== undefined ) {
@@ -967,7 +973,7 @@ export const deserializeAws_restJson1PutSessionCommand = async (
967
973
}
968
974
if ( output . headers [ "x-amz-lex-active-contexts" ] !== undefined ) {
969
975
contents . activeContexts = new __LazyJsonString (
970
- Buffer . from ( output . headers [ "x-amz-lex-active-contexts" ] , "base64" ) . toString ( "ascii " )
976
+ Buffer . from ( context . base64Decoder ( output . headers [ "x-amz-lex-active-contexts" ] ) ) . toString ( "utf8 " )
971
977
) ;
972
978
}
973
979
const data : any = output . body ;
0 commit comments