<?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\Entitlement\SwitchTier;
use RCP\LiquidWeb\LicensingApiClient\Requests\Entitlement\Upsert;
use RCP\LiquidWeb\LicensingApiClient\Responses\Entitlement\Cancel;
use RCP\LiquidWeb\LicensingApiClient\Responses\Entitlement\Delete;
use RCP\LiquidWeb\LicensingApiClient\Responses\Entitlement\Suspend;
use RCP\LiquidWeb\LicensingApiClient\Responses\Entitlement\SwitchTier as SwitchTierResponse;
use RCP\LiquidWeb\LicensingApiClient\Responses\Entitlement\Unsuspend;
use RCP\LiquidWeb\LicensingApiClient\Responses\Entitlement\Upsert as UpsertResponse;
use RCP\Psr\Http\Client\ClientExceptionInterface;

/**
 * Defines the entitlements resource surface.
 */
interface EntitlementsResourceInterface
{
	/**
	 * @throws ApiErrorExceptionInterface
	 * @throws MissingAuthenticationException
	 * @throws UnexpectedResponseException
	 * @throws ClientExceptionInterface
	 * @throws JsonException
	 */
	public function upsert(Upsert $request): UpsertResponse;

	/**
	 * @throws ApiErrorExceptionInterface
	 * @throws MissingAuthenticationException
	 * @throws UnexpectedResponseException
	 * @throws ClientExceptionInterface
	 * @throws JsonException
	 */
	public function switchTier(SwitchTier $request): SwitchTierResponse;

	/**
	 * @throws ApiErrorExceptionInterface
	 * @throws MissingAuthenticationException
	 * @throws UnexpectedResponseException
	 * @throws ClientExceptionInterface
	 * @throws JsonException
	 */
	public function suspend(string $licenseKey, string $productSlug, string $tier): Suspend;

	/**
	 * @throws ApiErrorExceptionInterface
	 * @throws MissingAuthenticationException
	 * @throws UnexpectedResponseException
	 * @throws ClientExceptionInterface
	 * @throws JsonException
	 */
	public function unsuspend(string $licenseKey, string $productSlug, string $tier): Unsuspend;

	/**
	 * @throws ApiErrorExceptionInterface
	 * @throws MissingAuthenticationException
	 * @throws UnexpectedResponseException
	 * @throws ClientExceptionInterface
	 * @throws JsonException
	 */
	public function cancel(string $licenseKey, string $productSlug, string $tier, ?string $reason = null): Cancel;

	/**
	 * @throws ApiErrorExceptionInterface
	 * @throws MissingAuthenticationException
	 * @throws UnexpectedResponseException
	 * @throws ClientExceptionInterface
	 * @throws JsonException
	 */
	public function delete(string $licenseKey, string $productSlug, string $tier): Delete;
}
