1 | <?php |
||
2 | |||
3 | declare(strict_types=1); |
||
4 | |||
5 | namespace DigitalCz\DigiSign\Endpoint; |
||
6 | |||
7 | use DigitalCz\DigiSign\Endpoint\Traits\CreateEndpointTrait; |
||
8 | use DigitalCz\DigiSign\Endpoint\Traits\GetEndpointTrait; |
||
9 | use DigitalCz\DigiSign\Resource\Collection; |
||
10 | use DigitalCz\DigiSign\Resource\MyAccount; |
||
11 | |||
12 | /** |
||
13 | * @extends ResourceEndpoint<MyAccount> |
||
14 | * @method MyAccount create(array $body) |
||
15 | * @method MyAccount get(string $id) |
||
16 | */ |
||
17 | final class MyAccountsEndpoint extends ResourceEndpoint |
||
18 | { |
||
19 | use CreateEndpointTrait; |
||
20 | use GetEndpointTrait; |
||
21 | |||
22 | public function __construct(MyEndpoint $parent) |
||
23 | { |
||
24 | parent::__construct($parent, '/accounts', MyAccount::class); |
||
25 | } |
||
26 | |||
27 | /** |
||
28 | * @return Collection<MyAccount> |
||
29 | */ |
||
30 | public function list(): Collection |
||
31 | { |
||
32 | return $this->createCollectionResource($this->getRequest(), MyAccount::class); |
||
33 | } |
||
34 | |||
35 | public function accept(string $id): MyAccount |
||
36 | { |
||
37 | return $this->makeResource($this->postRequest('/{id}/accept', ['id' => $id])); |
||
0 ignored issues
–
show
Bug
Best Practice
introduced
by
![]() |
|||
38 | } |
||
39 | |||
40 | public function decline(string $id): void |
||
41 | { |
||
42 | $this->postRequest('/{id}/decline', ['id' => $id]); |
||
43 | } |
||
44 | } |
||
45 |