1<?php
2
3declare(strict_types = 1);
4
5namespace Elasticsearch\Endpoints\Ingest\Pipeline;
6
7use Elasticsearch\Common\Exceptions;
8use Elasticsearch\Endpoints\AbstractEndpoint;
9
10/**
11 * Class Get
12 *
13 * @category Elasticsearch
14 * @package  Elasticsearch\Endpoints\Ingest
15 * @author   Zachary Tong <zach@elastic.co>
16 * @license  http://www.apache.org/licenses/LICENSE-2.0 Apache2
17 * @link     http://elastic.co
18 */
19class Get extends AbstractEndpoint
20{
21    public function getURI(): string
22    {
23        $id = $this->id ?? null;
24        if (isset($id)) {
25            return "/_ingest/pipeline/$id";
26        }
27        return "/_ingest/pipeline";
28    }
29
30    public function getParamWhitelist(): array
31    {
32        return [
33            'master_timeout'
34        ];
35    }
36
37    public function getMethod(): string
38    {
39        return 'GET';
40    }
41}
42