<?php
/**
 * @license GPL-2.0-or-later
 *
 * Modified using Strauss.
 * @see https://github.com/BrianHenryIE/strauss
 */ declare(strict_types=1);

namespace RCP\LiquidWeb\LicensingApiClient\Resources\Contracts;

use JsonException;
use RCP\LiquidWeb\LicensingApiClient\Exceptions\Contracts\ApiErrorExceptionInterface;
use RCP\LiquidWeb\LicensingApiClient\Exceptions\MissingAuthenticationException;
use RCP\LiquidWeb\LicensingApiClient\Exceptions\UnexpectedResponseException;
use RCP\LiquidWeb\LicensingApiClient\Requests\Credit\CreatePool;
use RCP\LiquidWeb\LicensingApiClient\Requests\Credit\DeletePool as DeletePoolRequest;
use RCP\LiquidWeb\LicensingApiClient\Requests\Credit\UpdatePool;
use RCP\LiquidWeb\LicensingApiClient\Responses\Credit\DeletePool;
use RCP\LiquidWeb\LicensingApiClient\Responses\Credit\PoolCollection;
use RCP\LiquidWeb\LicensingApiClient\Responses\Credit\ValueObjects\CreditPool;
use RCP\Psr\Http\Client\ClientExceptionInterface;

/**
 * Defines the credits pools resource surface.
 */
interface CreditsPoolsResourceInterface
{
	/**
	 * @throws ApiErrorExceptionInterface
	 * @throws MissingAuthenticationException
	 * @throws UnexpectedResponseException
	 * @throws ClientExceptionInterface
	 * @throws JsonException
	 */
	public function list(string $licenseKey, bool $active = false): PoolCollection;

	/**
	 * @throws ApiErrorExceptionInterface
	 * @throws MissingAuthenticationException
	 * @throws UnexpectedResponseException
	 * @throws ClientExceptionInterface
	 * @throws JsonException
	 */
	public function create(CreatePool $request): CreditPool;

	/**
	 * @throws ApiErrorExceptionInterface
	 * @throws MissingAuthenticationException
	 * @throws UnexpectedResponseException
	 * @throws ClientExceptionInterface
	 * @throws JsonException
	 */
	public function update(UpdatePool $request): CreditPool;

	/**
	 * @throws ApiErrorExceptionInterface
	 * @throws MissingAuthenticationException
	 * @throws UnexpectedResponseException
	 * @throws ClientExceptionInterface
	 * @throws JsonException
	 */
	public function delete(DeletePoolRequest $request): DeletePool;
}
