1<?php
2
3declare(strict_types = 1);
4
5namespace Elasticsearch\Endpoints\Template;
6
7use Elasticsearch\Endpoints\AbstractEndpoint;
8use Elasticsearch\Common\Exceptions;
9
10/**
11 * Class Get
12 *
13 * @category Elasticsearch
14 * @package  Elasticsearch\Endpoints\Template
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    /**
22     * @throws \Elasticsearch\Common\Exceptions\RuntimeException
23     */
24    public function getURI(): string
25    {
26        if (isset($this->id) !== true) {
27            throw new Exceptions\RuntimeException(
28                'id is required for Get'
29            );
30        }
31        return "/_search/template/{$this->id}";
32    }
33
34    public function getParamWhitelist(): array
35    {
36        return [];
37    }
38
39    public function getMethod(): string
40    {
41        return 'GET';
42    }
43}
44