sunaoka / aws-sdk-php-structures
Library for converting AWS SDK for PHP parameters and results into typed classes
dev-main
2025-01-27 06:44 UTC
Requires
- php: ^5.5 || ^7.0 || ^8.0
- aws/aws-sdk-php: ^3.278.3
Requires (Dev)
- composer/composer: ^1.0 || ^2.0
- mockery/mockery: ^0.9 || ^1.0
- phpunit/phpunit: ^4.8 || ^5.0 || ^6.0 || ^7.0 || ^8.0 || ^9.0 || ^10.0 || ^11.0
This package is auto-updated.
Last update: 2025-01-27 06:44:39 UTC
README
This is an EXPERIMENTAL library for converting AWS SDK for PHP parameters and results into typed classes.
Installation
Remove unused services and actions
This library contains a very large number of class files.
So, you can run the Sunaoka\Aws\Structures\Task\Composer::removeUnusedServices
task and specify the services you want to keep in composer.json
:
{ "scripts": { "pre-autoload-dump": [ "Sunaoka\\Aws\\Structures\\Task\\Composer::removeUnusedServices" ] }, "extra": { "sunaoka/aws-sdk-php-structures": { "S3": [ "GetObject" // Keep S3 GetObject action ], "DynamoDb": [] // Keep DynamoDb all actions } } }
Install
composer require sunaoka/aws-sdk-php-structures
Usage
use Aws\S3\S3Client; use Sunaoka\Aws\Structures\S3\GetObject\GetObjectRequest; use Sunaoka\Aws\Structures\S3\GetObject\GetObjectResponse; // The class of the request is '<Command>Request'. $request = new GetObjectRequest([ 'Bucket' => 'bucket', 'Key' => 'key', ]); $client = new S3Client(); $result = $client->getObject($request->toArray()); // The class of the result is '<Command>Response'. $response = new GetObjectResponse($result->toArray()); echo $response->Body->getContents();