mirror of
https://github.com/SociallyDev/Spaces-API.git
synced 2025-08-20 13:23:47 -07:00
v2: Updates
* Simplifies & beautifies everything * Introduces a new Class system. * Errors are defaulted to AWS's handler. * New function names & more efficient handling. * Should fix a majority of the errors. Please read the README for more!
This commit is contained in:
parent
ad0726e41e
commit
e6d7753dc8
1095 changed files with 45088 additions and 2911 deletions
|
@ -1,10 +1,12 @@
|
|||
<?php
|
||||
namespace Aws\Api\Parser;
|
||||
|
||||
use Aws\Api\StructureShape;
|
||||
use Aws\Api\Service;
|
||||
use Aws\Result;
|
||||
use Aws\CommandInterface;
|
||||
use Psr\Http\Message\ResponseInterface;
|
||||
use Psr\Http\Message\StreamInterface;
|
||||
|
||||
/**
|
||||
* @internal Implements JSON-RPC parsing (e.g., DynamoDB)
|
||||
|
@ -13,8 +15,6 @@ class JsonRpcParser extends AbstractParser
|
|||
{
|
||||
use PayloadParserTrait;
|
||||
|
||||
private $parser;
|
||||
|
||||
/**
|
||||
* @param Service $api Service description
|
||||
* @param JsonParser $parser JSON body builder
|
||||
|
@ -32,11 +32,20 @@ class JsonRpcParser extends AbstractParser
|
|||
$operation = $this->api->getOperation($command->getName());
|
||||
$result = null === $operation['output']
|
||||
? null
|
||||
: $this->parser->parse(
|
||||
: $this->parseMemberFromStream(
|
||||
$response->getBody(),
|
||||
$operation->getOutput(),
|
||||
$this->parseJson($response->getBody())
|
||||
$response
|
||||
);
|
||||
|
||||
return new Result($result ?: []);
|
||||
}
|
||||
|
||||
public function parseMemberFromStream(
|
||||
StreamInterface $stream,
|
||||
StructureShape $member,
|
||||
$response
|
||||
) {
|
||||
return $this->parser->parse($member, $this->parseJson($stream, $response));
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue