1<?php
2
3declare(strict_types = 1);
4
5namespace Elasticsearch\Endpoints;
6
7/**
8 * Class Reindex
9 *
10 * @category Elasticsearch
11 * @package  Elasticsearch\Endpoints\Indices
12 * @author   Augustin Husson <husson.augustin@gmail.com>
13 * @license  http://www.apache.org/licenses/LICENSE-2.0 Apache2
14 * @link     http://elastic.co
15 */
16class Reindex extends AbstractEndpoint
17{
18
19    public function getParamWhitelist(): array
20    {
21        return [
22            'refresh',
23            'timeout',
24            'wait_for_active_shards',
25            'wait_for_completion',
26            'requests_per_second',
27            'scroll',
28            'slices'
29        ];
30    }
31
32    public function getURI(): string
33    {
34        return '/_reindex';
35    }
36
37    public function getMethod(): string
38    {
39        return 'POST';
40    }
41
42    public function setBody($body): Reindex
43    {
44        if (isset($body) !== true) {
45            return $this;
46        }
47
48        $this->body = $body;
49
50        return $this;
51    }
52}
53