<?php

namespace PloverCRM\Modules\Automations\Endpoints;

use PloverCRM\Core\Api\AbstractEndpoint;
use PloverCRM\Modules\Automations\Services\AutomationAppBootstrapService;
use WP_REST_Request;

class AutomationsBootstrapEndpoint extends AbstractEndpoint
{
    public function getRoute(): string
    {
        return '/automations/bootstrap';
    }

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

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