Skip to content

Commit

Permalink
Update generated code (#1633)
Browse files Browse the repository at this point in the history
* update generated code

* Update src/Service/RdsDataService/CHANGELOG.md

---------

Co-authored-by: Jérémy Derussé <[email protected]>
  • Loading branch information
async-aws-bot and jderusse authored Dec 22, 2023
1 parent 12dd874 commit 99bad97
Show file tree
Hide file tree
Showing 15 changed files with 220 additions and 30 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

## NOT RELEASED

### Added

- AWS api-change: Added new kind of Exceptions in transactions and execute statement operations

## 2.0.1

### Changed
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
},
"extra": {
"branch-alias": {
"dev-master": "2.0-dev"
"dev-master": "2.1-dev"
}
}
}
2 changes: 1 addition & 1 deletion src/Exception/AccessDeniedException.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
use AsyncAws\Core\Exception\Http\ClientException;

/**
* You do not have sufficient access to perform this action.
* You don't have sufficient access to perform this action.
*/
final class AccessDeniedException extends ClientException
{
Expand Down
3 changes: 2 additions & 1 deletion src/Exception/BadRequestException.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
use AsyncAws\Core\Exception\Http\ClientException;

/**
* There is an error in the call or in a SQL statement.
* There is an error in the call or in a SQL statement. (This error only appears in calls from Aurora Serverless v1
* databases.).
*/
final class BadRequestException extends ClientException
{
Expand Down
12 changes: 12 additions & 0 deletions src/Exception/DatabaseErrorException.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?php

namespace AsyncAws\RdsDataService\Exception;

use AsyncAws\Core\Exception\Http\ClientException;

/**
* There was an error in processing the SQL statement.
*/
final class DatabaseErrorException extends ClientException
{
}
12 changes: 12 additions & 0 deletions src/Exception/DatabaseNotFoundException.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?php

namespace AsyncAws\RdsDataService\Exception;

use AsyncAws\Core\Exception\Http\ClientException;

/**
* The DB cluster doesn't have a DB instance.
*/
final class DatabaseNotFoundException extends ClientException
{
}
12 changes: 12 additions & 0 deletions src/Exception/DatabaseUnavailableException.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?php

namespace AsyncAws\RdsDataService\Exception;

use AsyncAws\Core\Exception\Http\ServerException;

/**
* The writer instance in the DB cluster isn't available.
*/
final class DatabaseUnavailableException extends ServerException
{
}
12 changes: 12 additions & 0 deletions src/Exception/HttpEndpointNotEnabledException.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?php

namespace AsyncAws\RdsDataService\Exception;

use AsyncAws\Core\Exception\Http\ClientException;

/**
* The HTTP endpoint for using RDS Data API isn't enabled for the DB cluster.
*/
final class HttpEndpointNotEnabledException extends ClientException
{
}
12 changes: 12 additions & 0 deletions src/Exception/InvalidSecretException.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?php

namespace AsyncAws\RdsDataService\Exception;

use AsyncAws\Core\Exception\Http\ClientException;

/**
* The Secrets Manager secret used with the request isn't valid.
*/
final class InvalidSecretException extends ClientException
{
}
16 changes: 16 additions & 0 deletions src/Exception/SecretsErrorException.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?php

namespace AsyncAws\RdsDataService\Exception;

use AsyncAws\Core\Exception\Http\ClientException;

/**
* There was a problem with the Secrets Manager secret used with the request, caused by one of the following conditions:.
*
* - RDS Data API timed out retrieving the secret.
* - The secret provided wasn't found.
* - The secret couldn't be decrypted.
*/
final class SecretsErrorException extends ClientException
{
}
2 changes: 1 addition & 1 deletion src/Exception/ServiceUnavailableErrorException.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
use AsyncAws\Core\Exception\Http\ServerException;

/**
* The service specified by the `resourceArn` parameter is not available.
* The service specified by the `resourceArn` parameter isn't available.
*/
final class ServiceUnavailableErrorException extends ServerException
{
Expand Down
12 changes: 12 additions & 0 deletions src/Exception/TransactionNotFoundException.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?php

namespace AsyncAws\RdsDataService\Exception;

use AsyncAws\Core\Exception\Http\ClientException;

/**
* The transaction ID wasn't found.
*/
final class TransactionNotFoundException extends ClientException
{
}
16 changes: 16 additions & 0 deletions src/Exception/UnsupportedResultException.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?php

namespace AsyncAws\RdsDataService\Exception;

use AsyncAws\Core\Exception\Http\ClientException;

/**
* There was a problem with the result because of one of the following conditions:.
*
* - It contained an unsupported data type.
* - It contained a multidimensional array.
* - The size was too large.
*/
final class UnsupportedResultException extends ClientException
{
}
120 changes: 100 additions & 20 deletions src/RdsDataServiceClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,19 @@
use AsyncAws\RdsDataService\Enum\RecordsFormatType;
use AsyncAws\RdsDataService\Exception\AccessDeniedException;
use AsyncAws\RdsDataService\Exception\BadRequestException;
use AsyncAws\RdsDataService\Exception\DatabaseErrorException;
use AsyncAws\RdsDataService\Exception\DatabaseNotFoundException;
use AsyncAws\RdsDataService\Exception\DatabaseUnavailableException;
use AsyncAws\RdsDataService\Exception\ForbiddenException;
use AsyncAws\RdsDataService\Exception\HttpEndpointNotEnabledException;
use AsyncAws\RdsDataService\Exception\InternalServerErrorException;
use AsyncAws\RdsDataService\Exception\InvalidSecretException;
use AsyncAws\RdsDataService\Exception\NotFoundException;
use AsyncAws\RdsDataService\Exception\SecretsErrorException;
use AsyncAws\RdsDataService\Exception\ServiceUnavailableErrorException;
use AsyncAws\RdsDataService\Exception\StatementTimeoutException;
use AsyncAws\RdsDataService\Exception\TransactionNotFoundException;
use AsyncAws\RdsDataService\Exception\UnsupportedResultException;
use AsyncAws\RdsDataService\Input\BatchExecuteStatementRequest;
use AsyncAws\RdsDataService\Input\BeginTransactionRequest;
use AsyncAws\RdsDataService\Input\CommitTransactionRequest;
Expand Down Expand Up @@ -61,23 +69,37 @@ class RdsDataServiceClient extends AbstractApi
* '@region'?: string|null,
* }|BatchExecuteStatementRequest $input
*
* @throws SecretsErrorException
* @throws HttpEndpointNotEnabledException
* @throws DatabaseErrorException
* @throws DatabaseUnavailableException
* @throws TransactionNotFoundException
* @throws InvalidSecretException
* @throws ServiceUnavailableErrorException
* @throws ForbiddenException
* @throws DatabaseNotFoundException
* @throws AccessDeniedException
* @throws BadRequestException
* @throws StatementTimeoutException
* @throws InternalServerErrorException
* @throws ForbiddenException
* @throws ServiceUnavailableErrorException
*/
public function batchExecuteStatement($input): BatchExecuteStatementResponse
{
$input = BatchExecuteStatementRequest::create($input);
$response = $this->getResponse($input->request(), new RequestContext(['operation' => 'BatchExecuteStatement', 'region' => $input->getRegion(), 'exceptionMapping' => [
'SecretsErrorException' => SecretsErrorException::class,
'HttpEndpointNotEnabledException' => HttpEndpointNotEnabledException::class,
'DatabaseErrorException' => DatabaseErrorException::class,
'DatabaseUnavailableException' => DatabaseUnavailableException::class,
'TransactionNotFoundException' => TransactionNotFoundException::class,
'InvalidSecretException' => InvalidSecretException::class,
'ServiceUnavailableError' => ServiceUnavailableErrorException::class,
'ForbiddenException' => ForbiddenException::class,
'DatabaseNotFoundException' => DatabaseNotFoundException::class,
'AccessDeniedException' => AccessDeniedException::class,
'BadRequestException' => BadRequestException::class,
'StatementTimeoutException' => StatementTimeoutException::class,
'InternalServerErrorException' => InternalServerErrorException::class,
'ForbiddenException' => ForbiddenException::class,
'ServiceUnavailableError' => ServiceUnavailableErrorException::class,
]]));

return new BatchExecuteStatementResponse($response);
Expand Down Expand Up @@ -106,23 +128,37 @@ public function batchExecuteStatement($input): BatchExecuteStatementResponse
* '@region'?: string|null,
* }|BeginTransactionRequest $input
*
* @throws SecretsErrorException
* @throws HttpEndpointNotEnabledException
* @throws DatabaseErrorException
* @throws DatabaseUnavailableException
* @throws TransactionNotFoundException
* @throws InvalidSecretException
* @throws ServiceUnavailableErrorException
* @throws ForbiddenException
* @throws DatabaseNotFoundException
* @throws AccessDeniedException
* @throws BadRequestException
* @throws StatementTimeoutException
* @throws InternalServerErrorException
* @throws ForbiddenException
* @throws ServiceUnavailableErrorException
*/
public function beginTransaction($input): BeginTransactionResponse
{
$input = BeginTransactionRequest::create($input);
$response = $this->getResponse($input->request(), new RequestContext(['operation' => 'BeginTransaction', 'region' => $input->getRegion(), 'exceptionMapping' => [
'SecretsErrorException' => SecretsErrorException::class,
'HttpEndpointNotEnabledException' => HttpEndpointNotEnabledException::class,
'DatabaseErrorException' => DatabaseErrorException::class,
'DatabaseUnavailableException' => DatabaseUnavailableException::class,
'TransactionNotFoundException' => TransactionNotFoundException::class,
'InvalidSecretException' => InvalidSecretException::class,
'ServiceUnavailableError' => ServiceUnavailableErrorException::class,
'ForbiddenException' => ForbiddenException::class,
'DatabaseNotFoundException' => DatabaseNotFoundException::class,
'AccessDeniedException' => AccessDeniedException::class,
'BadRequestException' => BadRequestException::class,
'StatementTimeoutException' => StatementTimeoutException::class,
'InternalServerErrorException' => InternalServerErrorException::class,
'ForbiddenException' => ForbiddenException::class,
'ServiceUnavailableError' => ServiceUnavailableErrorException::class,
]]));

return new BeginTransactionResponse($response);
Expand All @@ -141,24 +177,38 @@ public function beginTransaction($input): BeginTransactionResponse
* '@region'?: string|null,
* }|CommitTransactionRequest $input
*
* @throws SecretsErrorException
* @throws HttpEndpointNotEnabledException
* @throws DatabaseErrorException
* @throws DatabaseUnavailableException
* @throws TransactionNotFoundException
* @throws InvalidSecretException
* @throws ServiceUnavailableErrorException
* @throws ForbiddenException
* @throws DatabaseNotFoundException
* @throws AccessDeniedException
* @throws BadRequestException
* @throws StatementTimeoutException
* @throws InternalServerErrorException
* @throws ForbiddenException
* @throws ServiceUnavailableErrorException
* @throws NotFoundException
*/
public function commitTransaction($input): CommitTransactionResponse
{
$input = CommitTransactionRequest::create($input);
$response = $this->getResponse($input->request(), new RequestContext(['operation' => 'CommitTransaction', 'region' => $input->getRegion(), 'exceptionMapping' => [
'SecretsErrorException' => SecretsErrorException::class,
'HttpEndpointNotEnabledException' => HttpEndpointNotEnabledException::class,
'DatabaseErrorException' => DatabaseErrorException::class,
'DatabaseUnavailableException' => DatabaseUnavailableException::class,
'TransactionNotFoundException' => TransactionNotFoundException::class,
'InvalidSecretException' => InvalidSecretException::class,
'ServiceUnavailableError' => ServiceUnavailableErrorException::class,
'ForbiddenException' => ForbiddenException::class,
'DatabaseNotFoundException' => DatabaseNotFoundException::class,
'AccessDeniedException' => AccessDeniedException::class,
'BadRequestException' => BadRequestException::class,
'StatementTimeoutException' => StatementTimeoutException::class,
'InternalServerErrorException' => InternalServerErrorException::class,
'ForbiddenException' => ForbiddenException::class,
'ServiceUnavailableError' => ServiceUnavailableErrorException::class,
'NotFoundException' => NotFoundException::class,
]]));

Expand Down Expand Up @@ -191,23 +241,39 @@ public function commitTransaction($input): CommitTransactionResponse
* '@region'?: string|null,
* }|ExecuteStatementRequest $input
*
* @throws SecretsErrorException
* @throws HttpEndpointNotEnabledException
* @throws DatabaseErrorException
* @throws DatabaseUnavailableException
* @throws TransactionNotFoundException
* @throws InvalidSecretException
* @throws ServiceUnavailableErrorException
* @throws ForbiddenException
* @throws DatabaseNotFoundException
* @throws AccessDeniedException
* @throws BadRequestException
* @throws StatementTimeoutException
* @throws InternalServerErrorException
* @throws ForbiddenException
* @throws ServiceUnavailableErrorException
* @throws UnsupportedResultException
*/
public function executeStatement($input): ExecuteStatementResponse
{
$input = ExecuteStatementRequest::create($input);
$response = $this->getResponse($input->request(), new RequestContext(['operation' => 'ExecuteStatement', 'region' => $input->getRegion(), 'exceptionMapping' => [
'SecretsErrorException' => SecretsErrorException::class,
'HttpEndpointNotEnabledException' => HttpEndpointNotEnabledException::class,
'DatabaseErrorException' => DatabaseErrorException::class,
'DatabaseUnavailableException' => DatabaseUnavailableException::class,
'TransactionNotFoundException' => TransactionNotFoundException::class,
'InvalidSecretException' => InvalidSecretException::class,
'ServiceUnavailableError' => ServiceUnavailableErrorException::class,
'ForbiddenException' => ForbiddenException::class,
'DatabaseNotFoundException' => DatabaseNotFoundException::class,
'AccessDeniedException' => AccessDeniedException::class,
'BadRequestException' => BadRequestException::class,
'StatementTimeoutException' => StatementTimeoutException::class,
'InternalServerErrorException' => InternalServerErrorException::class,
'ForbiddenException' => ForbiddenException::class,
'ServiceUnavailableError' => ServiceUnavailableErrorException::class,
'UnsupportedResultException' => UnsupportedResultException::class,
]]));

return new ExecuteStatementResponse($response);
Expand All @@ -226,24 +292,38 @@ public function executeStatement($input): ExecuteStatementResponse
* '@region'?: string|null,
* }|RollbackTransactionRequest $input
*
* @throws SecretsErrorException
* @throws HttpEndpointNotEnabledException
* @throws DatabaseErrorException
* @throws DatabaseUnavailableException
* @throws TransactionNotFoundException
* @throws InvalidSecretException
* @throws ServiceUnavailableErrorException
* @throws ForbiddenException
* @throws DatabaseNotFoundException
* @throws AccessDeniedException
* @throws BadRequestException
* @throws StatementTimeoutException
* @throws InternalServerErrorException
* @throws ForbiddenException
* @throws ServiceUnavailableErrorException
* @throws NotFoundException
*/
public function rollbackTransaction($input): RollbackTransactionResponse
{
$input = RollbackTransactionRequest::create($input);
$response = $this->getResponse($input->request(), new RequestContext(['operation' => 'RollbackTransaction', 'region' => $input->getRegion(), 'exceptionMapping' => [
'SecretsErrorException' => SecretsErrorException::class,
'HttpEndpointNotEnabledException' => HttpEndpointNotEnabledException::class,
'DatabaseErrorException' => DatabaseErrorException::class,
'DatabaseUnavailableException' => DatabaseUnavailableException::class,
'TransactionNotFoundException' => TransactionNotFoundException::class,
'InvalidSecretException' => InvalidSecretException::class,
'ServiceUnavailableError' => ServiceUnavailableErrorException::class,
'ForbiddenException' => ForbiddenException::class,
'DatabaseNotFoundException' => DatabaseNotFoundException::class,
'AccessDeniedException' => AccessDeniedException::class,
'BadRequestException' => BadRequestException::class,
'StatementTimeoutException' => StatementTimeoutException::class,
'InternalServerErrorException' => InternalServerErrorException::class,
'ForbiddenException' => ForbiddenException::class,
'ServiceUnavailableError' => ServiceUnavailableErrorException::class,
'NotFoundException' => NotFoundException::class,
]]));

Expand Down
Loading

0 comments on commit 99bad97

Please sign in to comment.