1:   2:   3:   4:   5:   6:   7:   8:   9:  10:  11:  12:  13:  14:  15:  16:  17:  18:  19:  20:  21:  22:  23:  24:  25:  26:  27:  28:  29:  30:  31:  32:  33:  34:  35:  36:  37:  38:  39:  40:  41:  42:  43:  44:  45:  46:  47:  48:  49:  50:  51:  52:  53:  54:  55:  56:  57:  58:  59:  60:  61:  62:  63:  64:  65:  66:  67:  68:  69:  70:  71:  72:  73:  74:  75:  76:  77:  78:  79:  80:  81:  82:  83:  84:  85:  86:  87:  88:  89:  90:  91:  92:  93:  94:  95:  96:  97:  98:  99: 100: 101: 102: 103: 104: 105: 106: 107: 108: 109: 110: 111: 112: 113: 114: 115: 116: 117: 118: 119: 120: 121: 122: 123: 124: 125: 126: 127: 128: 129: 130: 131: 132: 133: 134: 135: 136: 137: 138: 139: 140: 141: 142: 143: 144: 145: 146: 147: 148: 149: 150: 151: 152: 153: 154: 155: 156: 157: 158: 159: 160: 161: 162: 163: 164: 165: 166: 167: 168: 169: 170: 171: 172: 173: 174: 175: 176: 177: 178: 179: 180: 181: 182: 183: 184: 185: 186: 187: 188: 189: 190: 191: 192: 193: 194: 195: 196: 197: 198: 199: 200: 201: 
<?php


namespace Manticoresearch;


use Manticoresearch\Endpoints\Nodes\AgentStatus;
use Manticoresearch\Endpoints\Nodes\CreateFunction;
use Manticoresearch\Endpoints\Nodes\CreatePlugin;
use Manticoresearch\Endpoints\Nodes\Debug;
use Manticoresearch\Endpoints\Nodes\DropFunction;
use Manticoresearch\Endpoints\Nodes\DropPlugin;
use Manticoresearch\Endpoints\Nodes\FlushAttributes;
use Manticoresearch\Endpoints\Nodes\FlushHostnames;
use Manticoresearch\Endpoints\Nodes\FlushLogs;
use Manticoresearch\Endpoints\Nodes\Plugins;
use Manticoresearch\Endpoints\Nodes\ReloadIndexes;
use Manticoresearch\Endpoints\Nodes\ReloadPlugins;
use Manticoresearch\Endpoints\Nodes\Set;
use Manticoresearch\Endpoints\Nodes\Status;
use Manticoresearch\Endpoints\Nodes\Tables;
use Manticoresearch\Endpoints\Nodes\Threads;
use Manticoresearch\Endpoints\Nodes\Variables;
use Manticoresearch\Endpoints\Sql;

class Nodes
{
    /**
     * @var Client
     */
    protected $_client;
    protected $_params;

    /**
     * Nodes namespace
     * @param Client $client
     */
    public function __construct($client)
    {
        $this->_client = $client;
        $this->_params =['responseClass'=>'Manticoresearch\\Response\\SqlToArray'];
    }

    public function agentstatus($params=[])
    {
        $body = $params['body']??[];
        $endpoint = new AgentStatus();
        $endpoint->setBody($body);
        $response = $this->_client->request($endpoint,$this->_params);
        return  $response->getResponse();
    }

    public function createfunction($params)
    {
        $body = $params['body'];
        $endpoint = new CreateFunction();
        $endpoint->setBody($body);
        $response = $this->_client->request($endpoint,$this->_params);
        return  $response->getResponse();
    }

    public function createplugin($params)
    {
        $body = $params['body'];
        $endpoint = new CreatePlugin();
        $endpoint->setBody($body);
        $response = $this->_client->request($endpoint,$this->_params);
        return  $response->getResponse();
    }

    public function debug($params)
    {
        $body = $params['body'];
        $endpoint = new Debug();
        $endpoint->setBody($body);
        $response = $this->_client->request($endpoint,$this->_params);
        return  $response->getResponse();
    }

    public function dropfunction($params)
    {
        $body = $params['body'];
        $endpoint = new DropFunction();
        $endpoint->setBody($body);
        $response = $this->_client->request($endpoint,$this->_params);
        return  $response->getResponse();
    }

    public function dropplugin($params)
    {
        $body = $params['body'];
        $endpoint = new DropPlugin();
        $endpoint->setBody($body);
        $response = $this->_client->request($endpoint,$this->_params);
        return  $response->getResponse();
    }

    public function flushattributes($params=[])
    {
        $body = $params['body']??[];
        $endpoint = new FlushAttributes();
        $endpoint->setBody($body);
        $response = $this->_client->request($endpoint,$this->_params);
        return  $response->getResponse();
    }

    public function flushhostnames($params=[])
    {
        $body = $params['body']??[];
        $endpoint = new FlushHostnames();
        $endpoint->setBody($body);
        $response = $this->_client->request($endpoint,$this->_params);
        return  $response->getResponse();
    }

    public function flushlogs($params=[])
    {
        $body = $params['body']??[];
        $endpoint = new FlushLogs();
        $endpoint->setBody($body);
        $response = $this->_client->request($endpoint,$this->_params);
        return  $response->getResponse();
    }

    public function plugins($params=[])
    {
        $body = $params['body']??[];
        $endpoint = new Plugins();
        $endpoint->setBody($body);
        $response = $this->_client->request($endpoint,$this->_params);
        return  $response->getResponse();
    }

    public function reloadindexes($params=[])
    {
        $body = $params['body']??[];
        $endpoint = new ReloadIndexes();
        $endpoint->setBody($body);
        $response = $this->_client->request($endpoint,$this->_params);
        return  $response->getResponse();
    }

    public function reloadplugins($params=[])
    {
        $body = $params['body']??[];
        $endpoint = new ReloadPlugins();
        $endpoint->setBody($body);
        $response = $this->_client->request($endpoint,$this->_params);
        return  $response->getResponse();
    }

    public function set($params)
    {
        $body = $params['body'];
        $endpoint = new Set();
        $endpoint->setBody($body);
        $response = $this->_client->request($endpoint,$this->_params);
        return  $response->getResponse();
    }

    /**
     * @param array $params
     * @return mixed
     */
    public function status($params=[])
    {
        $body = $params['body']??[];
        $endpoint = new Status();
        $endpoint->setBody($body);
        $response = $this->_client->request($endpoint,$this->_params);
        return  $response->getResponse();

    }

    public function tables($params=[])
    {
        $body = $params['body']??[];
        $endpoint = new Tables();
        $endpoint->setBody($body);
        $response = $this->_client->request($endpoint,$this->_params);
        return  $response->getResponse();
    }

    public function threads($params=[])
    {
        $body = $params['body']??[];
        $endpoint = new Threads();
        $endpoint->setBody($body);
        $response = $this->_client->request($endpoint,$this->_params);
        return  $response->getResponse();
    }

    public function variables($params=[])
    {
        $body = $params['body']??[];
        $endpoint = new Variables();
        $endpoint->setBody($body);
        $response = $this->_client->request($endpoint,$this->_params);
        return  $response->getResponse();
    }
}