Skip to content

Commit

Permalink
feat(client-rds-data): Add support for Stop DB feature.
Browse files Browse the repository at this point in the history
  • Loading branch information
awstools committed Feb 14, 2025
1 parent 70549de commit d356927
Show file tree
Hide file tree
Showing 8 changed files with 100 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -178,9 +178,9 @@ export interface BatchExecuteStatementCommandOutput extends BatchExecuteStatemen
* <p>The DB cluster doesn't have a DB instance.</p>
*
* @throws {@link DatabaseResumingException} (client fault)
* <p>A request was canceled because the Aurora Serverless v2 DB instance was in a paused state.
* The Data API request automatically causes the DB instance to begin resuming. Wait a few seconds and
* try again.</p>
* <p>A request was cancelled because the Aurora Serverless v2 DB instance was paused.
* The Data API request automatically resumes the DB instance. Wait a few seconds and
* try again.</p>
*
* @throws {@link DatabaseUnavailableException} (server fault)
* <p>The writer instance in the DB cluster isn't available.</p>
Expand All @@ -194,6 +194,9 @@ export interface BatchExecuteStatementCommandOutput extends BatchExecuteStatemen
* @throws {@link InternalServerErrorException} (server fault)
* <p>An internal error occurred.</p>
*
* @throws {@link InvalidResourceStateException} (client fault)
* <p>The resource is in an invalid state.</p>
*
* @throws {@link InvalidSecretException} (client fault)
* <p>The Secrets Manager secret used with the request isn't valid.</p>
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,9 @@ export interface BeginTransactionCommandOutput extends BeginTransactionResponse,
* <p>The DB cluster doesn't have a DB instance.</p>
*
* @throws {@link DatabaseResumingException} (client fault)
* <p>A request was canceled because the Aurora Serverless v2 DB instance was in a paused state.
* The Data API request automatically causes the DB instance to begin resuming. Wait a few seconds and
* try again.</p>
* <p>A request was cancelled because the Aurora Serverless v2 DB instance was paused.
* The Data API request automatically resumes the DB instance. Wait a few seconds and
* try again.</p>
*
* @throws {@link DatabaseUnavailableException} (server fault)
* <p>The writer instance in the DB cluster isn't available.</p>
Expand All @@ -92,6 +92,9 @@ export interface BeginTransactionCommandOutput extends BeginTransactionResponse,
* @throws {@link InternalServerErrorException} (server fault)
* <p>An internal error occurred.</p>
*
* @throws {@link InvalidResourceStateException} (client fault)
* <p>The resource is in an invalid state.</p>
*
* @throws {@link InvalidSecretException} (client fault)
* <p>The Secrets Manager secret used with the request isn't valid.</p>
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,9 @@ export interface CommitTransactionCommandOutput extends CommitTransactionRespons
* @throws {@link InternalServerErrorException} (server fault)
* <p>An internal error occurred.</p>
*
* @throws {@link InvalidResourceStateException} (client fault)
* <p>The resource is in an invalid state.</p>
*
* @throws {@link InvalidSecretException} (client fault)
* <p>The Secrets Manager secret used with the request isn't valid.</p>
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -205,9 +205,9 @@ export interface ExecuteStatementCommandOutput extends ExecuteStatementResponse,
* <p>The DB cluster doesn't have a DB instance.</p>
*
* @throws {@link DatabaseResumingException} (client fault)
* <p>A request was canceled because the Aurora Serverless v2 DB instance was in a paused state.
* The Data API request automatically causes the DB instance to begin resuming. Wait a few seconds and
* try again.</p>
* <p>A request was cancelled because the Aurora Serverless v2 DB instance was paused.
* The Data API request automatically resumes the DB instance. Wait a few seconds and
* try again.</p>
*
* @throws {@link DatabaseUnavailableException} (server fault)
* <p>The writer instance in the DB cluster isn't available.</p>
Expand All @@ -221,6 +221,9 @@ export interface ExecuteStatementCommandOutput extends ExecuteStatementResponse,
* @throws {@link InternalServerErrorException} (server fault)
* <p>An internal error occurred.</p>
*
* @throws {@link InvalidResourceStateException} (client fault)
* <p>The resource is in an invalid state.</p>
*
* @throws {@link InvalidSecretException} (client fault)
* <p>The Secrets Manager secret used with the request isn't valid.</p>
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,9 @@ export interface RollbackTransactionCommandOutput extends RollbackTransactionRes
* @throws {@link InternalServerErrorException} (server fault)
* <p>An internal error occurred.</p>
*
* @throws {@link InvalidResourceStateException} (client fault)
* <p>The resource is in an invalid state.</p>
*
* @throws {@link InvalidSecretException} (client fault)
* <p>The Secrets Manager secret used with the request isn't valid.</p>
*
Expand Down
26 changes: 23 additions & 3 deletions clients/client-rds-data/src/models/models_0.ts
Original file line number Diff line number Diff line change
Expand Up @@ -102,9 +102,9 @@ export class DatabaseNotFoundException extends __BaseException {
}

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

/**
* <p>The resource is in an invalid state.</p>
* @public
*/
export class InvalidResourceStateException extends __BaseException {
readonly name: "InvalidResourceStateException" = "InvalidResourceStateException";
readonly $fault: "client" = "client";
/**
* @internal
*/
constructor(opts: __ExceptionOptionType<InvalidResourceStateException, __BaseException>) {
super({
name: "InvalidResourceStateException",
$fault: "client",
...opts,
});
Object.setPrototypeOf(this, InvalidResourceStateException.prototype);
}
}

/**
* <p>The Secrets Manager secret used with the request isn't valid.</p>
* @public
Expand Down
24 changes: 24 additions & 0 deletions clients/client-rds-data/src/protocols/Aws_restJson1.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ import {
ForbiddenException,
HttpEndpointNotEnabledException,
InternalServerErrorException,
InvalidResourceStateException,
InvalidSecretException,
NotFoundException,
ResultFrame,
Expand Down Expand Up @@ -398,6 +399,9 @@ const de_CommandError = async (output: __HttpResponse, context: __SerdeContext):
case "InternalServerErrorException":
case "com.amazonaws.rdsdata#InternalServerErrorException":
throw await de_InternalServerErrorExceptionRes(parsedOutput, context);
case "InvalidResourceStateException":
case "com.amazonaws.rdsdata#InvalidResourceStateException":
throw await de_InvalidResourceStateExceptionRes(parsedOutput, context);
case "InvalidSecretException":
case "com.amazonaws.rdsdata#InvalidSecretException":
throw await de_InvalidSecretExceptionRes(parsedOutput, context);
Expand Down Expand Up @@ -600,6 +604,26 @@ const de_InternalServerErrorExceptionRes = async (
return __decorateServiceException(exception, parsedOutput.body);
};

/**
* deserializeAws_restJson1InvalidResourceStateExceptionRes
*/
const de_InvalidResourceStateExceptionRes = async (
parsedOutput: any,
context: __SerdeContext
): Promise<InvalidResourceStateException> => {
const contents: any = map({});
const data: any = parsedOutput.body;
const doc = take(data, {
message: __expectString,
});
Object.assign(contents, doc);
const exception = new InvalidResourceStateException({
$metadata: deserializeMetadata(parsedOutput),
...contents,
});
return __decorateServiceException(exception, parsedOutput.body);
};

/**
* deserializeAws_restJson1InvalidSecretExceptionRes
*/
Expand Down
30 changes: 29 additions & 1 deletion codegen/sdk-codegen/aws-models/rds-data.json
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,9 @@
{
"target": "com.amazonaws.rdsdata#InternalServerErrorException"
},
{
"target": "com.amazonaws.rdsdata#InvalidResourceStateException"
},
{
"target": "com.amazonaws.rdsdata#InvalidSecretException"
},
Expand Down Expand Up @@ -256,6 +259,9 @@
{
"target": "com.amazonaws.rdsdata#InternalServerErrorException"
},
{
"target": "com.amazonaws.rdsdata#InvalidResourceStateException"
},
{
"target": "com.amazonaws.rdsdata#InvalidSecretException"
},
Expand Down Expand Up @@ -496,6 +502,9 @@
{
"target": "com.amazonaws.rdsdata#InternalServerErrorException"
},
{
"target": "com.amazonaws.rdsdata#InvalidResourceStateException"
},
{
"target": "com.amazonaws.rdsdata#InvalidSecretException"
},
Expand Down Expand Up @@ -601,7 +610,7 @@
}
},
"traits": {
"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>",
"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>",
"smithy.api#error": "client",
"smithy.api#httpError": 400
}
Expand Down Expand Up @@ -779,6 +788,9 @@
{
"target": "com.amazonaws.rdsdata#InternalServerErrorException"
},
{
"target": "com.amazonaws.rdsdata#InvalidResourceStateException"
},
{
"target": "com.amazonaws.rdsdata#InvalidSecretException"
},
Expand Down Expand Up @@ -1036,6 +1048,19 @@
"smithy.api#httpError": 500
}
},
"com.amazonaws.rdsdata#InvalidResourceStateException": {
"type": "structure",
"members": {
"message": {
"target": "com.amazonaws.rdsdata#ErrorMessage"
}
},
"traits": {
"smithy.api#documentation": "<p>The resource is in an invalid state.</p>",
"smithy.api#error": "client",
"smithy.api#httpError": 400
}
},
"com.amazonaws.rdsdata#InvalidSecretException": {
"type": "structure",
"members": {
Expand Down Expand Up @@ -1904,6 +1929,9 @@
{
"target": "com.amazonaws.rdsdata#InternalServerErrorException"
},
{
"target": "com.amazonaws.rdsdata#InvalidResourceStateException"
},
{
"target": "com.amazonaws.rdsdata#InvalidSecretException"
},
Expand Down

0 comments on commit d356927

Please sign in to comment.