Proyectos de Subversion Moodle

Rev

| Ultima modificación | Ver Log |

Rev Autor Línea Nro. Línea
1 efrain 1
<?php
2
namespace Aws\Api\Parser;
3
 
4
use Aws\Api\Service;
5
use Aws\Api\StructureShape;
6
use Aws\CommandInterface;
7
use Aws\ResultInterface;
8
use Psr\Http\Message\ResponseInterface;
9
use Psr\Http\Message\StreamInterface;
10
 
11
/**
12
 * @internal
13
 */
14
abstract class AbstractParser
15
{
16
    /** @var \Aws\Api\Service Representation of the service API*/
17
    protected $api;
18
 
19
    /** @var callable */
20
    protected $parser;
21
 
22
    /**
23
     * @param Service $api Service description.
24
     */
25
    public function __construct(Service $api)
26
    {
27
        $this->api = $api;
28
    }
29
 
30
    /**
31
     * @param CommandInterface  $command  Command that was executed.
32
     * @param ResponseInterface $response Response that was received.
33
     *
34
     * @return ResultInterface
35
     */
36
    abstract public function __invoke(
37
        CommandInterface $command,
38
        ResponseInterface $response
39
    );
40
 
41
    abstract public function parseMemberFromStream(
42
        StreamInterface $stream,
43
        StructureShape $member,
44
        $response
45
    );
46
}