<?php
namespace WHMCS\Module\Addon\ProxyCheap\Commands;

use WHMCS\Module\Addon\ProxyCheap\AbstractCommand;
use WHMCS\Module\Addon\ProxyCheap\API;

class WhitelistIP extends AbstractCommand
{
    public function get()
    {
        $api = new API();
        $request = $api->setKey($this->params['apikey'])
            ->setSecret($this->params['apisecret'])
            ->setHeaders()
            ->executeGET('proxies/'.$this->input['proxy_id'].'/whitelist-ip');
        return $request;
    }

    public function post()
    {
        $api = new API();
        $request = $api->setKey($this->params['apikey'])
            ->setSecret($this->params['apisecret'])
            ->setHeaders()
            ->executePOST('proxies/'.$this->input['proxy_account_id'].'/whitelist-ip', ['ips' => $this->input['ips']]);
        return $request;
    }
}
