<?php

declare(strict_types=1);

namespace App\Infrastructure\Api\RapidMail;

use App\Framework\HttpClient\HttpClient;

final readonly class RapidMailClient
{
    public RecipientService $recipients;

    public RecipientListService $recipientLists;

    public MailingService $mailings;

    public StatisticsService $statistics;

    public BlacklistService $blacklist;

    public function __construct(
        RapidMailConfig $config,
        HttpClient $httpClient
    ) {
        $apiClient = new RapidMailApiClient($config, $httpClient);

        $this->recipients = new RecipientService($apiClient);
        $this->recipientLists = new RecipientListService($apiClient);
        $this->mailings = new MailingService($apiClient);
        $this->statistics = new StatisticsService($apiClient);
        $this->blacklist = new BlacklistService($apiClient);
    }
}
