1: | <?php |
2: | |
3: | declare(strict_types=1); |
4: | |
5: | |
6: | |
7: | |
8: | |
9: | |
10: | |
11: | |
12: | |
13: | |
14: | |
15: | |
16: | |
17: | |
18: | |
19: | |
20: | |
21: | |
22: | namespace OpenSearch\Endpoints\Indices; |
23: | |
24: | use OpenSearch\Endpoints\AbstractEndpoint; |
25: | |
26: | |
27: | |
28: | |
29: | class GetDataStream extends AbstractEndpoint |
30: | { |
31: | protected $name; |
32: | |
33: | public function getURI(): string |
34: | { |
35: | $name = $this->name ?? null; |
36: | if (isset($name)) { |
37: | return "/_data_stream/$name"; |
38: | } |
39: | return "/_data_stream"; |
40: | } |
41: | |
42: | public function getParamWhitelist(): array |
43: | { |
44: | return [ |
45: | 'pretty', |
46: | 'human', |
47: | 'error_trace', |
48: | 'source', |
49: | 'filter_path' |
50: | ]; |
51: | } |
52: | |
53: | public function getMethod(): string |
54: | { |
55: | return 'GET'; |
56: | } |
57: | |
58: | public function setName($name): static |
59: | { |
60: | if (isset($name) !== true) { |
61: | return $this; |
62: | } |
63: | if (is_array($name) === true) { |
64: | $name = implode(",", $name); |
65: | } |
66: | $this->name = $name; |
67: | |
68: | return $this; |
69: | } |
70: | } |
71: | |