diff --git a/src/Resource/EmptyRepository.php b/src/Resource/EmptyRepository.php index c527be08bc..ae0fe64c24 100644 --- a/src/Resource/EmptyRepository.php +++ b/src/Resource/EmptyRepository.php @@ -197,4 +197,12 @@ public function htmlUrl() : string { return null; } + + /** + * @return User + */ + public function owner() : User + { + return null; + } } diff --git a/src/Resource/Repository.php b/src/Resource/Repository.php index 9be86836ab..273340432b 100644 --- a/src/Resource/Repository.php +++ b/src/Resource/Repository.php @@ -3,10 +3,14 @@ namespace ApiClients\Client\Github\Resource; use ApiClients\Foundation\Hydrator\Annotations\EmptyResource; +use ApiClients\Foundation\Hydrator\Annotations\Nested; use ApiClients\Foundation\Resource\AbstractResource; use DateTimeInterface; /** + * @Nested( + * owner="User" + * ) * @EmptyResource("EmptyRepository") */ abstract class Repository extends AbstractResource implements RepositoryInterface @@ -121,15 +125,20 @@ abstract class Repository extends AbstractResource implements RepositoryInterfac */ protected $updated_at; + /** + * @var array + */ + protected $permissions; + /** * @var string */ protected $html_url; /** - * @var array + * @var User */ - //protected $permissions; + protected $owner; /** * @return int @@ -315,11 +324,6 @@ public function permissions() : array return $this->permissions; } - public function labels() - { - return $this->labels; - } - /** * @return string */ @@ -327,4 +331,12 @@ public function htmlUrl() : string { return $this->html_url; } + + /** + * @return User + */ + public function owner() : User + { + return $this->owner; + } } diff --git a/src/Resource/RepositoryInterface.php b/src/Resource/RepositoryInterface.php index 88afd2f8fe..8d07d55401 100644 --- a/src/Resource/RepositoryInterface.php +++ b/src/Resource/RepositoryInterface.php @@ -128,4 +128,9 @@ public function permissions() : array; * @return string */ public function htmlUrl() : string; + + /** + * @return User + */ + public function owner() : User; } diff --git a/yaml/repository.yml b/yaml/repository.yml index ea42773e49..29680b1b27 100644 --- a/yaml/repository.yml +++ b/yaml/repository.yml @@ -24,3 +24,7 @@ properties: updated_at: DateTimeInterface permissions: array html_url: string + owner: + type: User + annotations: + nested: User