<?php


namespace ModulesGarden\ProxmoxAddon\App\Services\Vps;


use ModulesGarden\ProxmoxAddon\App\Services\ApiService;
use ModulesGarden\ProxmoxAddon\Core\UI\Traits\WhmcsParams;

class FirewallOptionService
{
    use WhmcsParams;
    use ApiService;
    use ProductService;

    public function update(){
        $attributes = [
            "enable" => $this->configuration()->isFirewalOptionEnable() ? 1 : 0,
            "dhcp" => $this->configuration()->isFirewalOptionDhcp()? 1 : 0,
            "ndp" => $this->configuration()->isFirewalOptionNdp()? 1 : 0,
            "radv" => $this->configuration()->isFirewalOptionRadv() ? 1 : 0,
            "macfilter" => $this->configuration()->isFirewalOptionMacfilter() ? 1 : 0,
            "ipfilter" => $this->configuration()->isFirewalOptionIpfilter() ? 1 : 0,
        ];
        $this->vm()->firewallOptions()->setAttributes($attributes)->update();
    }

}