digitalcz /
digisign
| 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\DeleteEndpointTrait; |
||
| 9 | use DigitalCz\DigiSign\Endpoint\Traits\GetEndpointTrait; |
||
| 10 | use DigitalCz\DigiSign\Endpoint\Traits\ListEndpointTrait; |
||
| 11 | use DigitalCz\DigiSign\Resource\Certificate; |
||
| 12 | use DigitalCz\DigiSign\Resource\ListResource; |
||
| 13 | |||
| 14 | /** |
||
| 15 | * @extends ResourceEndpoint<Certificate> |
||
| 16 | * @method ListResource<Certificate> list(array $query = []) |
||
| 17 | * @method Certificate get(string $id) |
||
| 18 | * @method Certificate create(array $body) |
||
| 19 | */ |
||
| 20 | class AccountCertificatesEndpoint extends ResourceEndpoint |
||
| 21 | { |
||
| 22 | /** @use ListEndpointTrait<Certificate> */ |
||
| 23 | use ListEndpointTrait; |
||
| 24 | use GetEndpointTrait; |
||
| 25 | use CreateEndpointTrait; |
||
| 26 | use DeleteEndpointTrait; |
||
| 27 | |||
| 28 | public function __construct(AccountEndpoint $parent) |
||
| 29 | { |
||
| 30 | parent::__construct($parent, '/certificates', Certificate::class); |
||
| 31 | } |
||
| 32 | |||
| 33 | /** |
||
| 34 | * @param Certificate|string $id |
||
| 35 | */ |
||
| 36 | public function reload($id): Certificate |
||
| 37 | { |
||
| 38 | return $this->makeResource($this->postRequest('/{id}/reload', ['id' => $id])); |
||
|
0 ignored issues
–
show
Bug
Best Practice
introduced
by
Loading history...
|
|||
| 39 | } |
||
| 40 | |||
| 41 | /** |
||
| 42 | * @param Certificate|string $id |
||
| 43 | */ |
||
| 44 | public function disable($id): Certificate |
||
| 45 | { |
||
| 46 | return $this->makeResource($this->postRequest('/{id}/disable', ['id' => $id])); |
||
|
0 ignored issues
–
show
|
|||
| 47 | } |
||
| 48 | |||
| 49 | /** |
||
| 50 | * @param Certificate|string $id |
||
| 51 | */ |
||
| 52 | public function enable($id): Certificate |
||
| 53 | { |
||
| 54 | return $this->makeResource($this->postRequest('/{id}/enable', ['id' => $id])); |
||
|
0 ignored issues
–
show
|
|||
| 55 | } |
||
| 56 | } |
||
| 57 |