<?php

namespace App\Controller\UDS;

use App\Entity\OrganizationalUnit;
use App\Entity\RemoteCalendar;
use App\Model\OrganizationalUnitTypes;
use App\Service\UDS\UDSClient;
use Doctrine\ORM\EntityManagerInterface;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\DependencyInjection\Attribute\Autowire;
use Symfony\Component\HttpFoundation\JsonResponse;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Contracts\HttpClient\Exception\TransportExceptionInterface;

class RemoteCalendarSyncUdsAction extends AbstractController
{

    public function __construct(
        private readonly UDSClient $udsClient
    )
    {
    }

    /**
     * @throws TransportExceptionInterface
     */
    public function __invoke(RemoteCalendar $remoteCalendar): JsonResponse
    {
        $data = $this->udsClient->__invoke();

        return new JsonResponse($data, Response::HTTP_OK);

    }
}