Skip to content

Commit d356927

Browse files
author
awstools
committed
feat(client-rds-data): Add support for Stop DB feature.
1 parent 70549de commit d356927

File tree

8 files changed

+100
-13
lines changed

8 files changed

+100
-13
lines changed

Diff for: clients/client-rds-data/src/commands/BatchExecuteStatementCommand.ts

+6-3
Original file line numberDiff line numberDiff line change
@@ -178,9 +178,9 @@ export interface BatchExecuteStatementCommandOutput extends BatchExecuteStatemen
178178
* <p>The DB cluster doesn't have a DB instance.</p>
179179
*
180180
* @throws {@link DatabaseResumingException} (client fault)
181-
* <p>A request was canceled because the Aurora Serverless v2 DB instance was in a paused state.
182-
* The Data API request automatically causes the DB instance to begin resuming. Wait a few seconds and
183-
* try again.</p>
181+
* <p>A request was cancelled because the Aurora Serverless v2 DB instance was paused.
182+
* The Data API request automatically resumes the DB instance. Wait a few seconds and
183+
* try again.</p>
184184
*
185185
* @throws {@link DatabaseUnavailableException} (server fault)
186186
* <p>The writer instance in the DB cluster isn't available.</p>
@@ -194,6 +194,9 @@ export interface BatchExecuteStatementCommandOutput extends BatchExecuteStatemen
194194
* @throws {@link InternalServerErrorException} (server fault)
195195
* <p>An internal error occurred.</p>
196196
*
197+
* @throws {@link InvalidResourceStateException} (client fault)
198+
* <p>The resource is in an invalid state.</p>
199+
*
197200
* @throws {@link InvalidSecretException} (client fault)
198201
* <p>The Secrets Manager secret used with the request isn't valid.</p>
199202
*

Diff for: clients/client-rds-data/src/commands/BeginTransactionCommand.ts

+6-3
Original file line numberDiff line numberDiff line change
@@ -76,9 +76,9 @@ export interface BeginTransactionCommandOutput extends BeginTransactionResponse,
7676
* <p>The DB cluster doesn't have a DB instance.</p>
7777
*
7878
* @throws {@link DatabaseResumingException} (client fault)
79-
* <p>A request was canceled because the Aurora Serverless v2 DB instance was in a paused state.
80-
* The Data API request automatically causes the DB instance to begin resuming. Wait a few seconds and
81-
* try again.</p>
79+
* <p>A request was cancelled because the Aurora Serverless v2 DB instance was paused.
80+
* The Data API request automatically resumes the DB instance. Wait a few seconds and
81+
* try again.</p>
8282
*
8383
* @throws {@link DatabaseUnavailableException} (server fault)
8484
* <p>The writer instance in the DB cluster isn't available.</p>
@@ -92,6 +92,9 @@ export interface BeginTransactionCommandOutput extends BeginTransactionResponse,
9292
* @throws {@link InternalServerErrorException} (server fault)
9393
* <p>An internal error occurred.</p>
9494
*
95+
* @throws {@link InvalidResourceStateException} (client fault)
96+
* <p>The resource is in an invalid state.</p>
97+
*
9598
* @throws {@link InvalidSecretException} (client fault)
9699
* <p>The Secrets Manager secret used with the request isn't valid.</p>
97100
*

Diff for: clients/client-rds-data/src/commands/CommitTransactionCommand.ts

+3
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,9 @@ export interface CommitTransactionCommandOutput extends CommitTransactionRespons
7979
* @throws {@link InternalServerErrorException} (server fault)
8080
* <p>An internal error occurred.</p>
8181
*
82+
* @throws {@link InvalidResourceStateException} (client fault)
83+
* <p>The resource is in an invalid state.</p>
84+
*
8285
* @throws {@link InvalidSecretException} (client fault)
8386
* <p>The Secrets Manager secret used with the request isn't valid.</p>
8487
*

Diff for: clients/client-rds-data/src/commands/ExecuteStatementCommand.ts

+6-3
Original file line numberDiff line numberDiff line change
@@ -205,9 +205,9 @@ export interface ExecuteStatementCommandOutput extends ExecuteStatementResponse,
205205
* <p>The DB cluster doesn't have a DB instance.</p>
206206
*
207207
* @throws {@link DatabaseResumingException} (client fault)
208-
* <p>A request was canceled because the Aurora Serverless v2 DB instance was in a paused state.
209-
* The Data API request automatically causes the DB instance to begin resuming. Wait a few seconds and
210-
* try again.</p>
208+
* <p>A request was cancelled because the Aurora Serverless v2 DB instance was paused.
209+
* The Data API request automatically resumes the DB instance. Wait a few seconds and
210+
* try again.</p>
211211
*
212212
* @throws {@link DatabaseUnavailableException} (server fault)
213213
* <p>The writer instance in the DB cluster isn't available.</p>
@@ -221,6 +221,9 @@ export interface ExecuteStatementCommandOutput extends ExecuteStatementResponse,
221221
* @throws {@link InternalServerErrorException} (server fault)
222222
* <p>An internal error occurred.</p>
223223
*
224+
* @throws {@link InvalidResourceStateException} (client fault)
225+
* <p>The resource is in an invalid state.</p>
226+
*
224227
* @throws {@link InvalidSecretException} (client fault)
225228
* <p>The Secrets Manager secret used with the request isn't valid.</p>
226229
*

Diff for: clients/client-rds-data/src/commands/RollbackTransactionCommand.ts

+3
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,9 @@ export interface RollbackTransactionCommandOutput extends RollbackTransactionRes
7878
* @throws {@link InternalServerErrorException} (server fault)
7979
* <p>An internal error occurred.</p>
8080
*
81+
* @throws {@link InvalidResourceStateException} (client fault)
82+
* <p>The resource is in an invalid state.</p>
83+
*
8184
* @throws {@link InvalidSecretException} (client fault)
8285
* <p>The Secrets Manager secret used with the request isn't valid.</p>
8386
*

Diff for: clients/client-rds-data/src/models/models_0.ts

+23-3
Original file line numberDiff line numberDiff line change
@@ -102,9 +102,9 @@ export class DatabaseNotFoundException extends __BaseException {
102102
}
103103

104104
/**
105-
* <p>A request was canceled because the Aurora Serverless v2 DB instance was in a paused state.
106-
* The Data API request automatically causes the DB instance to begin resuming. Wait a few seconds and
107-
* try again.</p>
105+
* <p>A request was cancelled because the Aurora Serverless v2 DB instance was paused.
106+
* The Data API request automatically resumes the DB instance. Wait a few seconds and
107+
* try again.</p>
108108
* @public
109109
*/
110110
export class DatabaseResumingException extends __BaseException {
@@ -203,6 +203,26 @@ export class InternalServerErrorException extends __BaseException {
203203
}
204204
}
205205

206+
/**
207+
* <p>The resource is in an invalid state.</p>
208+
* @public
209+
*/
210+
export class InvalidResourceStateException extends __BaseException {
211+
readonly name: "InvalidResourceStateException" = "InvalidResourceStateException";
212+
readonly $fault: "client" = "client";
213+
/**
214+
* @internal
215+
*/
216+
constructor(opts: __ExceptionOptionType<InvalidResourceStateException, __BaseException>) {
217+
super({
218+
name: "InvalidResourceStateException",
219+
$fault: "client",
220+
...opts,
221+
});
222+
Object.setPrototypeOf(this, InvalidResourceStateException.prototype);
223+
}
224+
}
225+
206226
/**
207227
* <p>The Secrets Manager secret used with the request isn't valid.</p>
208228
* @public

Diff for: clients/client-rds-data/src/protocols/Aws_restJson1.ts

+24
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ import {
5555
ForbiddenException,
5656
HttpEndpointNotEnabledException,
5757
InternalServerErrorException,
58+
InvalidResourceStateException,
5859
InvalidSecretException,
5960
NotFoundException,
6061
ResultFrame,
@@ -398,6 +399,9 @@ const de_CommandError = async (output: __HttpResponse, context: __SerdeContext):
398399
case "InternalServerErrorException":
399400
case "com.amazonaws.rdsdata#InternalServerErrorException":
400401
throw await de_InternalServerErrorExceptionRes(parsedOutput, context);
402+
case "InvalidResourceStateException":
403+
case "com.amazonaws.rdsdata#InvalidResourceStateException":
404+
throw await de_InvalidResourceStateExceptionRes(parsedOutput, context);
401405
case "InvalidSecretException":
402406
case "com.amazonaws.rdsdata#InvalidSecretException":
403407
throw await de_InvalidSecretExceptionRes(parsedOutput, context);
@@ -600,6 +604,26 @@ const de_InternalServerErrorExceptionRes = async (
600604
return __decorateServiceException(exception, parsedOutput.body);
601605
};
602606

607+
/**
608+
* deserializeAws_restJson1InvalidResourceStateExceptionRes
609+
*/
610+
const de_InvalidResourceStateExceptionRes = async (
611+
parsedOutput: any,
612+
context: __SerdeContext
613+
): Promise<InvalidResourceStateException> => {
614+
const contents: any = map({});
615+
const data: any = parsedOutput.body;
616+
const doc = take(data, {
617+
message: __expectString,
618+
});
619+
Object.assign(contents, doc);
620+
const exception = new InvalidResourceStateException({
621+
$metadata: deserializeMetadata(parsedOutput),
622+
...contents,
623+
});
624+
return __decorateServiceException(exception, parsedOutput.body);
625+
};
626+
603627
/**
604628
* deserializeAws_restJson1InvalidSecretExceptionRes
605629
*/

Diff for: codegen/sdk-codegen/aws-models/rds-data.json

+29-1
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,9 @@
128128
{
129129
"target": "com.amazonaws.rdsdata#InternalServerErrorException"
130130
},
131+
{
132+
"target": "com.amazonaws.rdsdata#InvalidResourceStateException"
133+
},
131134
{
132135
"target": "com.amazonaws.rdsdata#InvalidSecretException"
133136
},
@@ -256,6 +259,9 @@
256259
{
257260
"target": "com.amazonaws.rdsdata#InternalServerErrorException"
258261
},
262+
{
263+
"target": "com.amazonaws.rdsdata#InvalidResourceStateException"
264+
},
259265
{
260266
"target": "com.amazonaws.rdsdata#InvalidSecretException"
261267
},
@@ -496,6 +502,9 @@
496502
{
497503
"target": "com.amazonaws.rdsdata#InternalServerErrorException"
498504
},
505+
{
506+
"target": "com.amazonaws.rdsdata#InvalidResourceStateException"
507+
},
499508
{
500509
"target": "com.amazonaws.rdsdata#InvalidSecretException"
501510
},
@@ -601,7 +610,7 @@
601610
}
602611
},
603612
"traits": {
604-
"smithy.api#documentation": "<p>A request was canceled because the Aurora Serverless v2 DB instance was in a paused state.\n The Data API request automatically causes the DB instance to begin resuming. Wait a few seconds and\n try again.</p>",
613+
"smithy.api#documentation": "<p>A request was cancelled because the Aurora Serverless v2 DB instance was paused.\n The Data API request automatically resumes the DB instance. Wait a few seconds and\n try again.</p>",
605614
"smithy.api#error": "client",
606615
"smithy.api#httpError": 400
607616
}
@@ -779,6 +788,9 @@
779788
{
780789
"target": "com.amazonaws.rdsdata#InternalServerErrorException"
781790
},
791+
{
792+
"target": "com.amazonaws.rdsdata#InvalidResourceStateException"
793+
},
782794
{
783795
"target": "com.amazonaws.rdsdata#InvalidSecretException"
784796
},
@@ -1036,6 +1048,19 @@
10361048
"smithy.api#httpError": 500
10371049
}
10381050
},
1051+
"com.amazonaws.rdsdata#InvalidResourceStateException": {
1052+
"type": "structure",
1053+
"members": {
1054+
"message": {
1055+
"target": "com.amazonaws.rdsdata#ErrorMessage"
1056+
}
1057+
},
1058+
"traits": {
1059+
"smithy.api#documentation": "<p>The resource is in an invalid state.</p>",
1060+
"smithy.api#error": "client",
1061+
"smithy.api#httpError": 400
1062+
}
1063+
},
10391064
"com.amazonaws.rdsdata#InvalidSecretException": {
10401065
"type": "structure",
10411066
"members": {
@@ -1904,6 +1929,9 @@
19041929
{
19051930
"target": "com.amazonaws.rdsdata#InternalServerErrorException"
19061931
},
1932+
{
1933+
"target": "com.amazonaws.rdsdata#InvalidResourceStateException"
1934+
},
19071935
{
19081936
"target": "com.amazonaws.rdsdata#InvalidSecretException"
19091937
},

0 commit comments

Comments
 (0)