1<?php
2
3declare(strict_types = 1);
4
5namespace Elasticsearch\Endpoints\Indices;
6
7use Elasticsearch\Endpoints\AbstractEndpoint;
8use Elasticsearch\Common\Exceptions;
9
10/**
11 * Class FlushSynced
12 *
13 * @category Elasticsearch
14 * @package  Elasticsearch\Endpoints\Indices
15 * @author   Enrico Zimuel <enrico.zimuel@elastic.co>
16 * @license  http://www.apache.org/licenses/LICENSE-2.0 Apache2
17 * @link     http://elastic.co
18 */
19class FlushSynced extends AbstractEndpoint
20{
21    public function getURI(): string
22    {
23        $index = $this->index ?? null;
24        if (isset($index)) {
25            return "/$index/_flush/synced";
26        }
27        return "/_flush/synced";
28    }
29
30    public function getParamWhitelist(): array
31    {
32        return [
33            'ignore_unavailable',
34            'allow_no_indices',
35            'expand_wildcards'
36        ];
37    }
38
39    public function getMethod(): string
40    {
41        return 'POST';
42    }
43}
44