<?php

namespace App\Http\Integrations\Imake\Requests\HubtelSMS;

use Saloon\Enums\Method;
use Saloon\Http\Request;

class SendSMS extends Request
{
    /**
     * The HTTP method of the request
     */
    protected Method $method = Method::GET;

    public function __construct(
        protected readonly string $to,
        protected readonly string $content
    ) {}

    /**
     * The endpoint for the request
     */
    public function resolveEndpoint(): string
    {
        return '/messages/send?clientsecret=' . env('HUBTEL_CLIENT_SECRET')
            . '&clientid=' . env('HUBTEL_CLIENT_ID')
            . '&from=' . env('HUBTEL_FROM')
            . '&to=' . $this->to
            . '&content=' . urlencode($this->content);
    }
}