@@ -5,14 +5,15 @@ import {
5
5
Handler ,
6
6
HandlerExecutionContext ,
7
7
FinalizeHandlerArguments ,
8
- MiddlewareStack
8
+ MiddlewareStack ,
9
+ SerdeContext
9
10
} from "@aws-sdk/types" ;
10
11
import { RDSDataResolvedConfiguration } from "../RDSDataConfiguration" ;
11
- import { HttpRequest } from "@aws-sdk/protocol-http" ;
12
+ import { HttpRequest , HttpResponse } from "@aws-sdk/protocol-http" ;
12
13
import {
13
- executeStatementSerializer ,
14
- executeStatementDeserializer
15
- } from "../protocol/ExecuteStatement " ;
14
+ executeStatementAwsRestJson1_1Serialize ,
15
+ executeStatementAwsRestJson1_1Deserialize
16
+ } from "../protocol/AwsRestJson1_1 " ;
16
17
import { ExecuteStatementRequest , ExecuteStatementResponse } from "../models" ;
17
18
18
19
type InputTypesUnion = any ;
@@ -35,13 +36,7 @@ export class ExecuteStatementCommand extends Command<
35
36
protocol : { handler }
36
37
} = configuration ;
37
38
38
- this . use (
39
- serdePlugin (
40
- configuration ,
41
- executeStatementSerializer ,
42
- executeStatementDeserializer
43
- )
44
- ) ;
39
+ this . use ( serdePlugin ( configuration , this . serialize , this . deserialize ) ) ;
45
40
46
41
const stack = clientStack . concat ( this . middlewareStack ) ;
47
42
@@ -55,4 +50,30 @@ export class ExecuteStatementCommand extends Command<
55
50
handlerExecutionContext
56
51
) ;
57
52
}
53
+
54
+ private serialize (
55
+ input : ExecuteStatementRequest ,
56
+ protocol : string ,
57
+ context : SerdeContext
58
+ ) : HttpRequest {
59
+ switch ( protocol ) {
60
+ case "aws.rest-json-1.1" :
61
+ return executeStatementAwsRestJson1_1Serialize ( input , context ) ;
62
+ default :
63
+ throw new Error ( "Unknown protocol, use aws.rest-json-1.1" ) ;
64
+ }
65
+ }
66
+
67
+ private async deserialize (
68
+ output : HttpResponse ,
69
+ protocol : string ,
70
+ context : SerdeContext
71
+ ) : Promise < ExecuteStatementResponse > {
72
+ switch ( protocol ) {
73
+ case "aws.rest-json-1.1" :
74
+ return executeStatementAwsRestJson1_1Deserialize ( output , context ) ;
75
+ default :
76
+ throw new Error ( "Unknown protocol, use aws.rest-json-1.1" ) ;
77
+ }
78
+ }
58
79
}
0 commit comments