<?php

namespace PloverCRM\Modules\Integrations\Endpoints;

use PloverCRM\Core\Api\AbstractEndpoint;
use PloverCRM\Modules\Integrations\Services\DataSourcesAppBootstrapService;
use WP_REST_Request;

class DataSourcesBootstrapEndpoint extends AbstractEndpoint
{
  public function getRoute(): string
  {
    return '/data-sources/bootstrap';
  }

  public function getMethod()
  {
    return 'GET';
  }

  public function handle(WP_REST_Request $request)
  {
    return $this->success(DataSourcesAppBootstrapService::build($this->container));
  }
}
