<?php

declare(strict_types=1);

namespace Apexl\Io\NotifierTwilio\Factories;

use Apexl\Io\NotifierTwilio\Dtos\TwilioConfigDto;
use DI\Container;
use Twilio\Rest\Client;

final readonly class TwilioClientFactory
{
    public function __construct(private Container $container, private TwilioConfigDto $config)
    {
    }

    public function make(): TwilioClientFactory
    {
        return $this->container->make(Client::class, [
            'username' => $this->config->sid,
            'password' => $this->config->token,
        ]);
    }
}
