| 1 |
<?php |
| 2 |
namespace Aws\Api\Parser; |
| 3 |
|
| 4 |
use Aws\Api\Cbor\CborDecoder; |
| 5 |
use Aws\Api\Service; |
| 6 |
use Aws\Api\StructureShape; |
| 7 |
use Psr\Http\Message\StreamInterface; |
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
final class RpcV2CborParser extends AbstractRpcV2Parser |
| 17 |
{ |
| 18 |
|
| 19 |
protected static string $smithyProtocol = 'rpc-v2-cbor'; |
| 20 |
|
| 21 |
|
| 22 |
private CborDecoder $decoder; |
| 23 |
|
| 24 |
use RpcV2ParserTrait; |
| 25 |
|
| 26 |
|
| 27 |
|
| 28 |
|
| 29 |
public function __construct(Service $api) |
| 30 |
{ |
| 31 |
$this->decoder = new CborDecoder(); |
| 32 |
parent::__construct($api); |
| 33 |
} |
| 34 |
|
| 35 |
|
| 36 |
|
| 37 |
|
| 38 |
|
| 39 |
|
| 40 |
|
| 41 |
|
| 42 |
public function parseMemberFromStream( |
| 43 |
StreamInterface $stream, |
| 44 |
StructureShape $member, |
| 45 |
$response |
| 46 |
): mixed |
| 47 |
{ |
| 48 |
return $this->resolveOutputShape($member, $this->parseCbor($stream, $response)); |
| 49 |
} |
| 50 |
} |