give
/
vendor
/
vendor-prefixed
/
stellarwp
/
licensing-api-client
/
src
/
Responses
/
Credit
/
DeletePool.php
give
/
vendor
/
vendor-prefixed
/
stellarwp
/
licensing-api-client
/
src
/
Responses
/
Credit
Last commit date
ValueObjects
3 months ago
BalanceCollection.php
3 months ago
DeletePool.php
3 months ago
DeleteQuota.php
3 months ago
LedgerPage.php
3 months ago
PoolCollection.php
3 months ago
QuotaCollection.php
3 months ago
RecordUsage.php
3 months ago
Refund.php
3 months ago
DeletePool.php
43 lines
| 1 | <?php declare(strict_types=1); |
| 2 | |
| 3 | namespace Give\Vendors\LiquidWeb\LicensingApiClient\Responses\Credit; |
| 4 | |
| 5 | use Give\Vendors\LiquidWeb\LicensingApiClient\Responses\Contracts\Response; |
| 6 | |
| 7 | /** |
| 8 | * Represents a credit pool deletion response. |
| 9 | * |
| 10 | * @implements Response<array{deleted: bool, pool_id: int}> |
| 11 | */ |
| 12 | final class DeletePool implements Response |
| 13 | { |
| 14 | public bool $deleted; |
| 15 | |
| 16 | public int $poolId; |
| 17 | |
| 18 | private function __construct(bool $deleted, int $poolId) { |
| 19 | $this->deleted = $deleted; |
| 20 | $this->poolId = $poolId; |
| 21 | } |
| 22 | |
| 23 | /** |
| 24 | * @param array{deleted: bool, pool_id: int} $attributes |
| 25 | */ |
| 26 | public static function from(array $attributes): self { |
| 27 | return new self( |
| 28 | $attributes['deleted'], |
| 29 | $attributes['pool_id'] |
| 30 | ); |
| 31 | } |
| 32 | |
| 33 | /** |
| 34 | * @return array{deleted: bool, pool_id: int} |
| 35 | */ |
| 36 | public function toArray(): array { |
| 37 | return [ |
| 38 | 'deleted' => $this->deleted, |
| 39 | 'pool_id' => $this->poolId, |
| 40 | ]; |
| 41 | } |
| 42 | } |
| 43 |