give
/
vendor
/
vendor-prefixed
/
stellarwp
/
licensing-api-client
/
src
/
Resources
/
Contracts
/
CreditsResourceInterface.php
give
/
vendor
/
vendor-prefixed
/
stellarwp
/
licensing-api-client
/
src
/
Resources
/
Contracts
Last commit date
CreditsLedgerResourceInterface.php
3 months ago
CreditsPoolsResourceInterface.php
3 months ago
CreditsQuotasResourceInterface.php
3 months ago
CreditsResourceInterface.php
3 months ago
EntitlementsResourceInterface.php
3 months ago
LicensesResourceInterface.php
3 months ago
ProductsResourceInterface.php
3 months ago
TokensResourceInterface.php
3 months ago
CreditsResourceInterface.php
75 lines
| 1 | <?php declare(strict_types=1); |
| 2 | |
| 3 | namespace Give\Vendors\LiquidWeb\LicensingApiClient\Resources\Contracts; |
| 4 | |
| 5 | use JsonException; |
| 6 | use Give\Vendors\LiquidWeb\LicensingApiClient\Exceptions\Contracts\ApiErrorExceptionInterface; |
| 7 | use Give\Vendors\LiquidWeb\LicensingApiClient\Exceptions\MissingAuthenticationException; |
| 8 | use Give\Vendors\LiquidWeb\LicensingApiClient\Exceptions\UnexpectedResponseException; |
| 9 | use Give\Vendors\LiquidWeb\LicensingApiClient\Requests\Credit\RecordUsage as RecordUsageRequest; |
| 10 | use Give\Vendors\LiquidWeb\LicensingApiClient\Requests\Credit\Refund as RefundRequest; |
| 11 | use Give\Vendors\LiquidWeb\LicensingApiClient\Responses\Credit\BalanceCollection; |
| 12 | use Give\Vendors\LiquidWeb\LicensingApiClient\Responses\Credit\RecordUsage; |
| 13 | use Give\Vendors\LiquidWeb\LicensingApiClient\Responses\Credit\Refund; |
| 14 | use Give\Vendors\Psr\Http\Client\ClientExceptionInterface; |
| 15 | |
| 16 | /** |
| 17 | * Defines the root credits resource surface. |
| 18 | */ |
| 19 | interface CreditsResourceInterface |
| 20 | { |
| 21 | /** |
| 22 | * @throws ApiErrorExceptionInterface |
| 23 | * @throws MissingAuthenticationException |
| 24 | * @throws UnexpectedResponseException |
| 25 | * @throws ClientExceptionInterface |
| 26 | * @throws JsonException |
| 27 | */ |
| 28 | public function balance(string $licenseKey, string $domain, ?string $creditType = null, ?string $sort = null): BalanceCollection; |
| 29 | |
| 30 | /** |
| 31 | * @throws ApiErrorExceptionInterface |
| 32 | * @throws MissingAuthenticationException |
| 33 | * @throws UnexpectedResponseException |
| 34 | * @throws ClientExceptionInterface |
| 35 | * @throws JsonException |
| 36 | */ |
| 37 | public function recordUsage(RecordUsageRequest $request): RecordUsage; |
| 38 | |
| 39 | /** |
| 40 | * @throws ApiErrorExceptionInterface |
| 41 | * @throws MissingAuthenticationException |
| 42 | * @throws UnexpectedResponseException |
| 43 | * @throws ClientExceptionInterface |
| 44 | * @throws JsonException |
| 45 | */ |
| 46 | public function refund(RefundRequest $request): Refund; |
| 47 | |
| 48 | /** |
| 49 | * @throws ApiErrorExceptionInterface |
| 50 | * @throws MissingAuthenticationException |
| 51 | * @throws UnexpectedResponseException |
| 52 | * @throws ClientExceptionInterface |
| 53 | * @throws JsonException |
| 54 | */ |
| 55 | public function pools(): CreditsPoolsResourceInterface; |
| 56 | |
| 57 | /** |
| 58 | * @throws ApiErrorExceptionInterface |
| 59 | * @throws MissingAuthenticationException |
| 60 | * @throws UnexpectedResponseException |
| 61 | * @throws ClientExceptionInterface |
| 62 | * @throws JsonException |
| 63 | */ |
| 64 | public function quotas(): CreditsQuotasResourceInterface; |
| 65 | |
| 66 | /** |
| 67 | * @throws ApiErrorExceptionInterface |
| 68 | * @throws MissingAuthenticationException |
| 69 | * @throws UnexpectedResponseException |
| 70 | * @throws ClientExceptionInterface |
| 71 | * @throws JsonException |
| 72 | */ |
| 73 | public function ledger(): CreditsLedgerResourceInterface; |
| 74 | } |
| 75 |