<?php

namespace interfaces;

use Exception;

interface gatewayapi_i
{
    /**
     * Check if the module is enabled
     * @return bool True if the module is enabled, false otherwise
     */
    public function isEnabled(): bool;

    /**
     * Require the module to be enabled
     * @throws Exception If the module is not enabled
     */
    public function requireEnabled(): void;

    /**
     * Send a message
     * @param array{string} $to The recipient(s) of the message
     * @param string $message The message to be sent
     * @return bool True if the message was sent, false otherwise
     * @throws Exception If the module is not enabled
     * @throws Exception If the message could not be sent
     */
    public function send(array $to, string $message): bool;

    /**
     * Send request to the API
     * @param string $url The URL to send the request to
     * @param string $method The HTTP method to use (GET, POST, PUT, DELETE)
     * @param array $data The data to send with the request
     */
    public function sendRequest(string $url, string $method, array $data = []): array;

    /**
     * Get the default request headers
     * @return array The default request headers
     */
    public function getDefaultRequestHeaders(): array;
}