<?php

namespace Datalumo\PhpSdk;

use Datalumo\PhpSdk\Resources\CollectionResource;
use Datalumo\PhpSdk\Resources\EntryResource;
use Datalumo\PhpSdk\Resources\IntegrationResource;

class Datalumo
{
    private HttpClient $client;

    public function __construct(
        private readonly string $token,
        private readonly string $baseUrl = 'https://datalumo.app',
    ) {
        $this->client = new HttpClient($this->baseUrl, $this->token);
    }

    public function collections(): CollectionResource
    {
        return new CollectionResource($this->client);
    }

    public function entries(string $collectionId): EntryResource
    {
        return new EntryResource($this->client, $collectionId);
    }

    public function integrations(): IntegrationResource
    {
        return new IntegrationResource($this->client);
    }
}
