This is an EXPERIMENTAL library for converting AWS SDK for PHP parameters and results into typed classes.
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
:
composer require sunaoka/aws-sdk-php-structures
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();