-
Notifications
You must be signed in to change notification settings - Fork 973
/
Scroll.php
78 lines (67 loc) · 2.04 KB
/
Scroll.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
<?php
/**
* Elasticsearch PHP client
*
* @link https://github.com/elastic/elasticsearch-php/
* @copyright Copyright (c) Elasticsearch B.V (https://www.elastic.co)
* @license http://www.apache.org/licenses/LICENSE-2.0 Apache License, Version 2.0
* @license https://www.gnu.org/licenses/lgpl-2.1.html GNU Lesser General Public License, Version 2.1
*
* Licensed to Elasticsearch B.V under one or more agreements.
* Elasticsearch B.V licenses this file to you under the Apache 2.0 License or
* the GNU Lesser General Public License, Version 2.1, at your option.
* See the LICENSE file in the project root for more information.
*/
declare(strict_types = 1);
namespace Elasticsearch\Endpoints;
use Elasticsearch\Endpoints\AbstractEndpoint;
/**
* Class Scroll
* Elasticsearch API name scroll
*
* NOTE: this file is autogenerated using util/GenerateEndpoints.php
* and Elasticsearch 7.16.0-SNAPSHOT (dfc9a8e7563ed5f24b5210ed21ed92ae182cd0ee)
*/
class Scroll extends AbstractEndpoint
{
protected $scroll_id;
public function getURI(): string
{
$scroll_id = $this->scroll_id ?? null;
if (isset($scroll_id)) {
@trigger_error('A scroll id can be quite large and should be specified as part of the body', E_USER_DEPRECATED);
}
if (isset($scroll_id)) {
return "/_search/scroll/$scroll_id";
}
return "/_search/scroll";
}
public function getParamWhitelist(): array
{
return [
'scroll',
'scroll_id',
'rest_total_hits_as_int'
];
}
public function getMethod(): string
{
return isset($this->body) ? 'POST' : 'GET';
}
public function setBody($body): Scroll
{
if (isset($body) !== true) {
return $this;
}
$this->body = $body;
return $this;
}
public function setScrollId($scroll_id): Scroll
{
if (isset($scroll_id) !== true) {
return $this;
}
$this->scroll_id = $scroll_id;
return $this;
}
}