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

namespace RCP\LiquidWeb\LicensingApiClient\Responses\License;

use RCP\LiquidWeb\LicensingApiClient\Responses\Contracts\Response;

/**
 * Represents a license deactivation response.
 *
 * @implements Response<array{deactivated: bool}>
 */
final class Deactivate implements Response
{
	public bool $deactivated;

	private function __construct(bool $deactivated) {
		$this->deactivated = $deactivated;
	}

	/**
	 * @param array{deactivated: bool} $attributes
	 */
	public static function from(array $attributes): self {
		return new self($attributes['deactivated']);
	}

	/**
	 * @return array{deactivated: bool}
	 */
	public function toArray(): array {
		return [
			'deactivated' => $this->deactivated,
		];
	}
}
