30 lines
605 B
PHP
30 lines
605 B
PHP
![]() |
<?php
|
||
|
|
||
|
namespace OpenCloud\Common\Resource;
|
||
|
|
||
|
use Psr\Http\Message\ResponseInterface;
|
||
|
|
||
|
/**
|
||
|
* Represents an API resource.
|
||
|
*
|
||
|
* @package OpenCloud\Common\Resource
|
||
|
*/
|
||
|
interface ResourceInterface
|
||
|
{
|
||
|
/**
|
||
|
* All models which represent an API resource should be able to be populated
|
||
|
* from a {@see ResponseInterface} object.
|
||
|
*
|
||
|
* @param ResponseInterface $response
|
||
|
*
|
||
|
* @return self
|
||
|
*/
|
||
|
public function populateFromResponse(ResponseInterface $response);
|
||
|
|
||
|
/**
|
||
|
* @param array $data
|
||
|
* @return mixed
|
||
|
*/
|
||
|
public function populateFromArray(array $data);
|
||
|
}
|