<?php

namespace ModulesGarden\ProxmoxAddon\App\Services\Cloud;

use ModulesGarden\ProxmoxAddon\App\Models\KeyPair;
use ModulesGarden\ProxmoxAddon\App\Services\ApiService;
use ModulesGarden\ProxmoxAddon\App\Services\Vps\HostingService;
use ModulesGarden\ProxmoxAddon\Core\UI\Traits\WhmcsParams;
use ModulesGarden\ProxmoxAddon\Core\Traits\Smarty;

class ContainerService
{
    use ApiService;
    use WhmcsParams;
    use Smarty;
    use ProductService;
    use HostingService;

    /**
     * @return KeyPair
     */
    public function makeKeyPairs()
    {
        //delete
        KeyPair::ofHostingId($this->getWhmcsParamByKey('serviceid'))->delete();
        $keyPairs = KeyPair::make();
        $keyPairs->setHostingId($this->getWhmcsParamByKey('serviceid'))
            ->save();
        return $keyPairs;
    }

}