<?php

namespace App\Integrations\Semrush\Requests;

use App\Integrations\Common\Configurable;

final class DeleteCampaignRequest extends Configurable implements RequestInterface
{
    protected $options = [
        'url' => 'https://api.semrush.com/management/v1/projects',
        'method' => 'DELETE',
    ];

    public function __construct()
    {
        parent::__construct();
    }

    /**
     * @return string
     */
    public function getMethod(): string
    {
        return $this->getOption('method');
    }

    public function getUri()
    {
        return $this->getOption('url')
            .'/'
            .$this->getOption('projectId')
            .'?key='
            .$this->getOption('key');
    }

    public function setProjectId(string $projectId)
    {
        $this->setOption('projectId', $projectId);
    }

    public function getBody()
    {
        return ['id' => $this->getOption('projectId')];
    }
}
