@@ -12,15 +12,11 @@ import {
1212} from "../models/rdsdataservice" ;
1313import { HttpRequest , HttpResponse } from "@aws-sdk/protocol-http" ;
1414import { SerializerUtils , DeserializerUtils } from "@aws-sdk/types" ;
15- import * as __aws_sdk_stream_collector_node from "@aws-sdk/stream-collector-node" ;
16- import * as __aws_sdk_util_utf8_node from "@aws-sdk/util-utf8-node" ;
1715import { ResponseMetadata } from "@aws-sdk/types" ;
1816
19- type Utils = { [ key : string ] : any } ;
20-
2117export function executeStatementAwsRestJson1_1Serialize (
2218 input : ExecuteStatementRequest ,
23- utils ?: Utils
19+ utils : SerializerUtils
2420) : HttpRequest {
2521 let body : any = { } ;
2622 if ( input . resourceArn !== undefined ) {
@@ -44,7 +40,7 @@ export function executeStatementAwsRestJson1_1Serialize(
4440 }
4541
4642 if ( input . parameters !== undefined ) {
47- body . parameters = sqlParameterListAwsRestJson1_1Serialize ( input . parameters ) ;
43+ body . parameters = sqlParameterListAwsRestJson1_1Serialize ( input . parameters , utils ) ;
4844 }
4945
5046 if ( input . transactionId !== undefined ) {
@@ -72,51 +68,54 @@ export function executeStatementAwsRestJson1_1Serialize(
7268
7369export async function executeStatementAwsRestJson1_1Deserialize (
7470 output : HttpResponse ,
75- utils ?: Utils
71+ utils : DeserializerUtils
7672) : Promise < ExecuteStatementResponse > {
7773 if ( output . statusCode !== 200 ) {
78- return executeStatementAwsRestJson1_1DeserializeError ( output ) ;
74+ return executeStatementAwsRestJson1_1DeserializeError ( output , utils ) ;
7975 }
8076 let data : any = await parseBody ( output . body , utils ) ;
8177 return Promise . resolve ( {
8278 $metadata : deserializeMetadata ( output ) ,
8379 __type : "com.amazon.rdsdataservice#ExecuteStatementResponse" ,
84- records : recordsAwsRestJson1_1Deserialize ( data . records ) ,
80+ records : recordsAwsRestJson1_1Deserialize ( data . records , utils ) ,
8581 columnMetadata : columnMetadataListAwsRestJson1_1Deserialize (
86- data . columnMetadata
82+ data . columnMetadata ,
83+ utils
8784 ) ,
8885 numberOfRecordsUpdated : data . numberOfRecordsUpdated ,
8986 generatedFields : generatedFieldsAwsRestJson1_1Deserialize (
90- data . generatedFields
87+ data . generatedFields ,
88+ utils
9189 )
9290 } ) ;
9391}
9492
9593async function executeStatementAwsRestJson1_1DeserializeError (
96- output : HttpResponse
94+ output : HttpResponse ,
95+ utils : DeserializerUtils
9796) : Promise < ExecuteStatementResponse > {
98- let data = await parseBody ( output . body ) ;
97+ let data = await parseBody ( output . body , utils ) ;
9998 let response : any ;
10099 switch ( output . headers [ "x-amzn-ErrorType" ] ) {
101100 case "BadRequestException" :
102101 case "com.amazon.rdsdataservice#BadRequestException" :
103- response = badRequestExceptionDeserialize ( data ) ;
102+ response = badRequestExceptionDeserialize ( data , utils ) ;
104103 break ;
105104 case "StatementTimeoutException" :
106105 case "com.amazon.rdsdataservice#StatementTimeoutException" :
107- response = statementTimeoutExceptionDeserialize ( data ) ;
106+ response = statementTimeoutExceptionDeserialize ( data , utils ) ;
108107 break ;
109108 case "ForbiddenException" :
110109 case "com.amazon.rdsdataservice#ForbiddenException" :
111- response = forbiddenExceptionDeserialize ( data ) ;
110+ response = forbiddenExceptionDeserialize ( data , utils ) ;
112111 break ;
113112 case "InternalServerErrorException" :
114113 case "com.amazon.rdsdataservice#InternalServerErrorException" :
115- response = internalServerErrorExceptionDeserialize ( data ) ;
114+ response = internalServerErrorExceptionDeserialize ( data , utils ) ;
116115 break ;
117116 case "ServiceUnavailableError" :
118117 case "com.amazon.rdsdataservice#ServiceUnavailableError" :
119- response = serviceUnavailableErrorDeserialize ( data ) ;
118+ response = serviceUnavailableErrorDeserialize ( data , utils ) ;
120119 break ;
121120 default :
122121 response = {
@@ -130,19 +129,20 @@ async function executeStatementAwsRestJson1_1DeserializeError(
130129}
131130
132131const sqlParameterListAwsRestJson1_1Serialize = (
133- input : Array < SqlParameter >
132+ input : Array < SqlParameter > ,
133+ utils : SerializerUtils
134134) : Array < SqlParameter > =>
135135 input &&
136- input . map ( sqlParameter => sqlParameterAwsRestJson1_1Serialize ( sqlParameter ) ) ;
136+ input . map ( sqlParameter => sqlParameterAwsRestJson1_1Serialize ( sqlParameter , utils ) ) ;
137137
138- const sqlParameterAwsRestJson1_1Serialize = ( input : SqlParameter ) : any =>
138+ const sqlParameterAwsRestJson1_1Serialize = ( input : SqlParameter , utils : SerializerUtils ) : any =>
139139 input . name &&
140140 input . value && {
141141 name : input . name ,
142- value : fieldAwsRestJson1_1Serialize ( input . value )
142+ value : fieldAwsRestJson1_1Serialize ( input . value , utils )
143143 } ;
144144
145- const fieldAwsRestJson1_1Serialize = ( input : Field ) : any =>
145+ const fieldAwsRestJson1_1Serialize = ( input : Field , utils : SerializerUtils ) : any =>
146146 Field . visit ( input , {
147147 blobValue : value => {
148148 value ;
@@ -174,7 +174,8 @@ const fieldAwsRestJson1_1Serialize = (input: Field): any =>
174174 } ) ;
175175
176176export function columnMetadataAwsRestJson1_1Deserialize (
177- input : any
177+ input : any ,
178+ utils : DeserializerUtils
178179) : ColumnMetadata {
179180 let columnMetadata : any = {
180181 $namespace : "com.amazon.rdsdataservice" ,
@@ -240,14 +241,15 @@ export function columnMetadataAwsRestJson1_1Deserialize(
240241}
241242
242243const columnMetadataListAwsRestJson1_1Deserialize = (
243- input : any
244+ input : any ,
245+ utils : DeserializerUtils
244246) : Array < ColumnMetadata > =>
245247 input &&
246248 input . map ( ( columnMetadata : any ) =>
247- columnMetadataAwsRestJson1_1Deserialize ( columnMetadata )
249+ columnMetadataAwsRestJson1_1Deserialize ( columnMetadata , utils )
248250 ) ;
249251
250- const fieldAwsRestJson1_1Deserialize = ( input : any ) : any =>
252+ const fieldAwsRestJson1_1Deserialize = ( input : any , utils : DeserializerUtils ) : any =>
251253 Field . visit ( input , {
252254 blobValue : value => {
253255 value ;
@@ -278,27 +280,28 @@ const fieldAwsRestJson1_1Deserialize = (input: any): any =>
278280 }
279281 } ) ;
280282
281- const generatedFieldsAwsRestJson1_1Deserialize = ( input : any ) : Array < Field > =>
282- input && input . map ( ( field : any ) => fieldAwsRestJson1_1Deserialize ( field ) ) ;
283+ const generatedFieldsAwsRestJson1_1Deserialize = ( input : any , utils : DeserializerUtils ) : Array < Field > =>
284+ input && input . map ( ( field : any ) => fieldAwsRestJson1_1Deserialize ( field , utils ) ) ;
283285
284- const recordsAwsRestJson1_1Deserialize = ( input : any ) : Array < Array < Field > > =>
286+ const recordsAwsRestJson1_1Deserialize = ( input : any , utils : DeserializerUtils ) : Array < Array < Field > > =>
285287 input &&
286288 input . map ( ( recordsList : any ) =>
287- recordsListAwsRestJson1_1Deserialize ( recordsList )
289+ recordsListAwsRestJson1_1Deserialize ( recordsList , utils )
288290 ) ;
289291
290- const recordsListAwsRestJson1_1Deserialize = ( input : any ) : Array < Field > =>
291- input && input . map ( ( field : any ) => fieldAwsRestJson1_1Deserialize ( field ) ) ;
292+ const recordsListAwsRestJson1_1Deserialize = ( input : any , utils : DeserializerUtils ) : Array < Field > =>
293+ input && input . map ( ( field : any ) => fieldAwsRestJson1_1Deserialize ( field , utils ) ) ;
292294
293- const badRequestExceptionDeserialize = ( input : any ) : BadRequestException => ( {
295+ const badRequestExceptionDeserialize = ( input : any , utils : DeserializerUtils ) : BadRequestException => ( {
294296 __type : "com.amazon.rdsdataservice#BadRequestException" ,
295297 $name : "BadRequestException" ,
296298 $fault : "client" ,
297299 message : input . message
298300} ) ;
299301
300302const statementTimeoutExceptionDeserialize = (
301- input : any
303+ input : any ,
304+ utils : DeserializerUtils
302305) : StatementTimeoutException => ( {
303306 __type : "com.amazon.rdsdataservice#StatementTimeoutException" ,
304307 $name : "StatementTimeoutException" ,
@@ -307,23 +310,25 @@ const statementTimeoutExceptionDeserialize = (
307310 dbConnectionId : input . dbConnectionId
308311} ) ;
309312
310- const forbiddenExceptionDeserialize = ( input : any ) : ForbiddenException => ( {
313+ const forbiddenExceptionDeserialize = ( input : any , utils : DeserializerUtils ) : ForbiddenException => ( {
311314 __type : "com.amazon.rdsdataservice#ForbiddenException" ,
312315 $name : "ForbiddenException" ,
313316 $fault : "client" ,
314317 message : input . message
315318} ) ;
316319
317320const internalServerErrorExceptionDeserialize = (
318- input : any
321+ input : any ,
322+ utils : DeserializerUtils
319323) : InternalServerErrorException => ( {
320324 __type : "com.amazon.rdsdataservice#InternalServerErrorException" ,
321325 $name : "InternalServerErrorException" ,
322326 $fault : "server"
323327} ) ;
324328
325329const serviceUnavailableErrorDeserialize = (
326- input : any
330+ input : any ,
331+ utils : DeserializerUtils
327332) : ServiceUnavailableError => ( {
328333 __type : "com.amazon.rdsdataservice#ServiceUnavailableError" ,
329334 $name : "ServiceUnavailableError" ,
@@ -336,17 +341,8 @@ const deserializeMetadata = (output: HttpResponse): ResponseMetadata => ({
336341 requestId : output . headers [ "x-amzn-requestid" ]
337342} ) ;
338343
339- const parseBody = ( streamBody : any , utils ?: Utils ) : any => {
340- const streamCollector =
341- utils && utils [ "streamCollector" ]
342- ? ( < DeserializerUtils > utils ) [ "streamCollector" ]
343- : __aws_sdk_stream_collector_node . streamCollector ;
344- const toUtf8 =
345- utils && utils [ "streamCollector" ]
346- ? ( < DeserializerUtils > utils ) [ "utf8Encoder" ]
347- : __aws_sdk_util_utf8_node . toUtf8 ;
348-
349- return streamCollector ( streamBody ) . then ( body => {
350- return JSON . parse ( toUtf8 ( body ) ) ;
344+ const parseBody = ( streamBody : any , utils : DeserializerUtils ) : any => {
345+ return utils . streamCollector ( streamBody ) . then ( body => {
346+ return JSON . parse ( utils . utf8Encoder ( body ) ) ;
351347 } ) ;
352348} ;
0 commit comments