public function setAutoRefresh($index = '', $autoRefresh = false, array $options = [])
    {
        if (empty($index)) {
            if (empty($this->defaultIndex)) {
                throw new InvalidArgumentException('Unable to set auto refresh on index: no index specified');
            }

            $index = $this->defaultIndex;
        }

        $response = $this->query(
            $this->buildQueryArgs('index', 'setAutoRefresh', $index),
            [
                'body' => [
                    'autoRefresh' => $autoRefresh
                ]
            ],
            $options
        );

        return $response['result'];
    }