2024-03-22 12:55:25 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace App\Http\Integrations\Lastfm\Requests;
|
|
|
|
|
2024-03-22 14:34:13 +00:00
|
|
|
use App\Http\Integrations\Lastfm\Contracts\RequiresSignature;
|
2024-03-22 12:55:25 +00:00
|
|
|
use Saloon\Enums\Method;
|
2024-03-22 14:34:13 +00:00
|
|
|
use Saloon\Http\Request;
|
2024-03-22 12:55:25 +00:00
|
|
|
|
2024-03-22 14:34:13 +00:00
|
|
|
final class GetSessionKeyRequest extends Request implements RequiresSignature
|
2024-03-22 12:55:25 +00:00
|
|
|
{
|
|
|
|
protected Method $method = Method::GET;
|
|
|
|
|
2024-04-18 14:36:28 +00:00
|
|
|
public function __construct(private readonly string $token)
|
2024-03-22 12:55:25 +00:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
public function resolveEndpoint(): string
|
|
|
|
{
|
|
|
|
return '/';
|
|
|
|
}
|
|
|
|
|
|
|
|
/** @return array<mixed> */
|
|
|
|
protected function defaultQuery(): array
|
|
|
|
{
|
|
|
|
return [
|
|
|
|
'method' => 'auth.getSession',
|
|
|
|
'token' => $this->token,
|
|
|
|
'format' => 'json',
|
|
|
|
];
|
|
|
|
}
|
|
|
|
}
|