@@ -11,12 +11,15 @@ import {
11
11
ServiceUnavailableError
12
12
} from "../models/rdsdataservice" ;
13
13
import { HttpRequest , HttpResponse } from "@aws-sdk/protocol-http" ;
14
- import { SerializerUtils , DeserializerUtils } from "@aws-sdk/types" ;
15
- import { ResponseMetadata , Endpoint } from "@aws-sdk/types" ;
14
+ import {
15
+ SerializerContext ,
16
+ DeserializerContext ,
17
+ ResponseMetadata
18
+ } from "@aws-sdk/types" ;
16
19
17
20
export function executeStatementAwsRestJson1_1Serialize (
18
21
input : ExecuteStatementRequest ,
19
- utils : SerializerUtils & { endpoint : Endpoint }
22
+ context : SerializerContext
20
23
) : HttpRequest {
21
24
let body : any = { } ;
22
25
if ( input . resourceArn !== undefined ) {
@@ -42,7 +45,7 @@ export function executeStatementAwsRestJson1_1Serialize(
42
45
if ( input . parameters !== undefined ) {
43
46
body . parameters = sqlParameterListAwsRestJson1_1Serialize (
44
47
input . parameters ,
45
- utils
48
+ context
46
49
) ;
47
50
}
48
51
@@ -59,7 +62,7 @@ export function executeStatementAwsRestJson1_1Serialize(
59
62
}
60
63
61
64
return new HttpRequest ( {
62
- ...utils . endpoint ,
65
+ ...context . endpoint ,
63
66
body : JSON . stringify ( body ) ,
64
67
path : "/Execute" ,
65
68
method : "POST" ,
@@ -72,54 +75,54 @@ export function executeStatementAwsRestJson1_1Serialize(
72
75
73
76
export async function executeStatementAwsRestJson1_1Deserialize (
74
77
output : HttpResponse ,
75
- utils : DeserializerUtils
78
+ context : DeserializerContext
76
79
) : Promise < ExecuteStatementResponse > {
77
80
if ( output . statusCode !== 200 ) {
78
- return executeStatementAwsRestJson1_1DeserializeError ( output , utils ) ;
81
+ return executeStatementAwsRestJson1_1DeserializeError ( output , context ) ;
79
82
}
80
- let data : any = await parseBody ( output . body , utils ) ;
83
+ let data : any = await parseBody ( output . body , context ) ;
81
84
return Promise . resolve ( {
82
85
$metadata : deserializeMetadata ( output ) ,
83
86
__type : "com.amazon.rdsdataservice#ExecuteStatementResponse" ,
84
- records : recordsAwsRestJson1_1Deserialize ( data . records , utils ) ,
87
+ records : recordsAwsRestJson1_1Deserialize ( data . records , context ) ,
85
88
columnMetadata : columnMetadataListAwsRestJson1_1Deserialize (
86
89
data . columnMetadata ,
87
- utils
90
+ context
88
91
) ,
89
92
numberOfRecordsUpdated : data . numberOfRecordsUpdated ,
90
93
generatedFields : generatedFieldsAwsRestJson1_1Deserialize (
91
94
data . generatedFields ,
92
- utils
95
+ context
93
96
)
94
97
} ) ;
95
98
}
96
99
97
100
async function executeStatementAwsRestJson1_1DeserializeError (
98
101
output : HttpResponse ,
99
- utils : DeserializerUtils
102
+ context : DeserializerContext
100
103
) : Promise < ExecuteStatementResponse > {
101
- let data = await parseBody ( output . body , utils ) ;
104
+ let data = await parseBody ( output . body , context ) ;
102
105
let response : any ;
103
106
switch ( output . headers [ "x-amzn-ErrorType" ] ) {
104
107
case "BadRequestException" :
105
108
case "com.amazon.rdsdataservice#BadRequestException" :
106
- response = badRequestExceptionDeserialize ( data , utils ) ;
109
+ response = badRequestExceptionDeserialize ( data , context ) ;
107
110
break ;
108
111
case "StatementTimeoutException" :
109
112
case "com.amazon.rdsdataservice#StatementTimeoutException" :
110
- response = statementTimeoutExceptionDeserialize ( data , utils ) ;
113
+ response = statementTimeoutExceptionDeserialize ( data , context ) ;
111
114
break ;
112
115
case "ForbiddenException" :
113
116
case "com.amazon.rdsdataservice#ForbiddenException" :
114
- response = forbiddenExceptionDeserialize ( data , utils ) ;
117
+ response = forbiddenExceptionDeserialize ( data , context ) ;
115
118
break ;
116
119
case "InternalServerErrorException" :
117
120
case "com.amazon.rdsdataservice#InternalServerErrorException" :
118
- response = internalServerErrorExceptionDeserialize ( data , utils ) ;
121
+ response = internalServerErrorExceptionDeserialize ( data , context ) ;
119
122
break ;
120
123
case "ServiceUnavailableError" :
121
124
case "com.amazon.rdsdataservice#ServiceUnavailableError" :
122
- response = serviceUnavailableErrorDeserialize ( data , utils ) ;
125
+ response = serviceUnavailableErrorDeserialize ( data , context ) ;
123
126
break ;
124
127
default :
125
128
response = {
@@ -134,26 +137,26 @@ async function executeStatementAwsRestJson1_1DeserializeError(
134
137
135
138
const sqlParameterListAwsRestJson1_1Serialize = (
136
139
input : Array < SqlParameter > ,
137
- utils : SerializerUtils
140
+ context : SerializerContext
138
141
) : Array < SqlParameter > =>
139
142
input &&
140
143
input . map ( sqlParameter =>
141
- sqlParameterAwsRestJson1_1Serialize ( sqlParameter , utils )
144
+ sqlParameterAwsRestJson1_1Serialize ( sqlParameter , context )
142
145
) ;
143
146
144
147
const sqlParameterAwsRestJson1_1Serialize = (
145
148
input : SqlParameter ,
146
- utils : SerializerUtils
149
+ context : SerializerContext
147
150
) : any =>
148
151
input . name &&
149
152
input . value && {
150
153
name : input . name ,
151
- value : fieldAwsRestJson1_1Serialize ( input . value , utils )
154
+ value : fieldAwsRestJson1_1Serialize ( input . value , context )
152
155
} ;
153
156
154
157
const fieldAwsRestJson1_1Serialize = (
155
158
input : Field ,
156
- utils : SerializerUtils
159
+ context : SerializerContext
157
160
) : any =>
158
161
Field . visit ( input , {
159
162
blobValue : value => {
@@ -187,7 +190,7 @@ const fieldAwsRestJson1_1Serialize = (
187
190
188
191
export function columnMetadataAwsRestJson1_1Deserialize (
189
192
input : any ,
190
- utils : DeserializerUtils
193
+ context : DeserializerContext
191
194
) : ColumnMetadata {
192
195
let columnMetadata : any = {
193
196
$namespace : "com.amazon.rdsdataservice" ,
@@ -254,16 +257,16 @@ export function columnMetadataAwsRestJson1_1Deserialize(
254
257
255
258
const columnMetadataListAwsRestJson1_1Deserialize = (
256
259
input : any ,
257
- utils : DeserializerUtils
260
+ context : DeserializerContext
258
261
) : Array < ColumnMetadata > =>
259
262
input &&
260
263
input . map ( ( columnMetadata : any ) =>
261
- columnMetadataAwsRestJson1_1Deserialize ( columnMetadata , utils )
264
+ columnMetadataAwsRestJson1_1Deserialize ( columnMetadata , context )
262
265
) ;
263
266
264
267
const fieldAwsRestJson1_1Deserialize = (
265
268
input : any ,
266
- utils : DeserializerUtils
269
+ context : DeserializerContext
267
270
) : any =>
268
271
Field . visit ( input , {
269
272
blobValue : value => {
@@ -297,30 +300,30 @@ const fieldAwsRestJson1_1Deserialize = (
297
300
298
301
const generatedFieldsAwsRestJson1_1Deserialize = (
299
302
input : any ,
300
- utils : DeserializerUtils
303
+ context : DeserializerContext
301
304
) : Array < Field > =>
302
305
input &&
303
- input . map ( ( field : any ) => fieldAwsRestJson1_1Deserialize ( field , utils ) ) ;
306
+ input . map ( ( field : any ) => fieldAwsRestJson1_1Deserialize ( field , context ) ) ;
304
307
305
308
const recordsAwsRestJson1_1Deserialize = (
306
309
input : any ,
307
- utils : DeserializerUtils
310
+ context : DeserializerContext
308
311
) : Array < Array < Field > > =>
309
312
input &&
310
313
input . map ( ( recordsList : any ) =>
311
- recordsListAwsRestJson1_1Deserialize ( recordsList , utils )
314
+ recordsListAwsRestJson1_1Deserialize ( recordsList , context )
312
315
) ;
313
316
314
317
const recordsListAwsRestJson1_1Deserialize = (
315
318
input : any ,
316
- utils : DeserializerUtils
319
+ context : DeserializerContext
317
320
) : Array < Field > =>
318
321
input &&
319
- input . map ( ( field : any ) => fieldAwsRestJson1_1Deserialize ( field , utils ) ) ;
322
+ input . map ( ( field : any ) => fieldAwsRestJson1_1Deserialize ( field , context ) ) ;
320
323
321
324
const badRequestExceptionDeserialize = (
322
325
input : any ,
323
- utils : DeserializerUtils
326
+ context : DeserializerContext
324
327
) : BadRequestException => ( {
325
328
__type : "com.amazon.rdsdataservice#BadRequestException" ,
326
329
$name : "BadRequestException" ,
@@ -330,7 +333,7 @@ const badRequestExceptionDeserialize = (
330
333
331
334
const statementTimeoutExceptionDeserialize = (
332
335
input : any ,
333
- utils : DeserializerUtils
336
+ context : DeserializerContext
334
337
) : StatementTimeoutException => ( {
335
338
__type : "com.amazon.rdsdataservice#StatementTimeoutException" ,
336
339
$name : "StatementTimeoutException" ,
@@ -341,7 +344,7 @@ const statementTimeoutExceptionDeserialize = (
341
344
342
345
const forbiddenExceptionDeserialize = (
343
346
input : any ,
344
- utils : DeserializerUtils
347
+ context : DeserializerContext
345
348
) : ForbiddenException => ( {
346
349
__type : "com.amazon.rdsdataservice#ForbiddenException" ,
347
350
$name : "ForbiddenException" ,
@@ -351,7 +354,7 @@ const forbiddenExceptionDeserialize = (
351
354
352
355
const internalServerErrorExceptionDeserialize = (
353
356
input : any ,
354
- utils : DeserializerUtils
357
+ context : DeserializerContext
355
358
) : InternalServerErrorException => ( {
356
359
__type : "com.amazon.rdsdataservice#InternalServerErrorException" ,
357
360
$name : "InternalServerErrorException" ,
@@ -360,7 +363,7 @@ const internalServerErrorExceptionDeserialize = (
360
363
361
364
const serviceUnavailableErrorDeserialize = (
362
365
input : any ,
363
- utils : DeserializerUtils
366
+ context : DeserializerContext
364
367
) : ServiceUnavailableError => ( {
365
368
__type : "com.amazon.rdsdataservice#ServiceUnavailableError" ,
366
369
$name : "ServiceUnavailableError" ,
@@ -373,8 +376,8 @@ const deserializeMetadata = (output: HttpResponse): ResponseMetadata => ({
373
376
requestId : output . headers [ "x-amzn-requestid" ]
374
377
} ) ;
375
378
376
- const parseBody = ( streamBody : any , utils : DeserializerUtils ) : any => {
377
- return utils . streamCollector ( streamBody ) . then ( body => {
378
- return JSON . parse ( utils . utf8Encoder ( body ) ) ;
379
+ const parseBody = ( streamBody : any , context : DeserializerContext ) : any => {
380
+ return context . streamCollector ( streamBody ) . then ( body => {
381
+ return JSON . parse ( context . utf8Encoder ( body ) ) ;
379
382
} ) ;
380
383
} ;
0 commit comments