Generating new code
Creating a new client operation¶
If you want to create a new operation to a client, you may just generate it and complete the test stubs. Below is an example to generate an operation for DynamoDB.
- Clone the async-aws/aws repository.
- Run
composer install
- Run
./generate DynamoDb
and press "1" for generate a new operation. - Select the operation you want to generate. Don't generate operations that you don't need.
- Use the AWS Api Reference to fill the expected Input/Result.
If you started working on a new operation, please submit a "Draft PR" to show your progress. Don't hesitate asking for help.
Creating a new client¶
If you want to create a new AWS client, there are a few steps to take. Below is an example for DynamoDB.
- Clone the async-aws/aws repository.
- Run
composer install
- Copy
./src/Service/.template
to./src/Service/DynamoDb
- Replace all occurrences of
Foobar
toDynamoDb
andfoobar
todynamo-db
- Rename
FoobarClient
intoDynamoDbClient
- Add
dynamoDb
method to the client factorysrc/Core/src/AwsClientFactory.php
- Register the service in the
services
section of the./manifest.json
file.- Look at the official SDK for resources in
./src/data
. (DynamoDB example) - Add a link to
source
, and, if the files exists, links todocumentation
,example
,pagination
,waiter
etc. - Leave the
methods
key empty. ("methods": []
) - Provide the base URL to the AWS API reference (use AWS or Google)
- Look at the official SDK for resources in
- Configure the autoload section of
./composer.json
to include the new service ("AsyncAws\\DynamoDb\\": "src/Service/DynamoDb/src"
) - Do the same thing with the autoload-dev section of
./composer.json
. - Run
composer dump-autoload
- Add the operations you want following the process previously defined
- Update the packages overview section of the root
README.md
file - Create a
./docs/clients/dynamodb.md
file documenting the client - Update the
./docs/clients/index.md
and./couscous.yml
files to point to the new client documentation - Add the new client in
./src/Integration/Symfony/Bundle/src/DependencyInjection/AwsPackagesProvider.php
- Update the
./CHANGELOG.md
If you started working on a new client, please submit a "Draft PR" to show your progress. Don't hesitate asking for help.