1: <?php
2:
3: declare(strict_types=1);
4:
5: /**
6: * Copyright OpenSearch Contributors
7: * SPDX-License-Identifier: Apache-2.0
8: *
9: * OpenSearch PHP client
10: *
11: * @link https://github.com/opensearch-project/opensearch-php/
12: * @copyright Copyright (c) Elasticsearch B.V (https://www.elastic.co)
13: * @license http://www.apache.org/licenses/LICENSE-2.0 Apache License, Version 2.0
14: * @license https://www.gnu.org/licenses/lgpl-2.1.html GNU Lesser General Public License, Version 2.1
15: *
16: * Licensed to Elasticsearch B.V under one or more agreements.
17: * Elasticsearch B.V licenses this file to you under the Apache 2.0 License or
18: * the GNU Lesser General Public License, Version 2.1, at your option.
19: * See the LICENSE file in the project root for more information.
20: */
21:
22: namespace OpenSearch\Endpoints;
23:
24: use OpenSearch\Exception\RuntimeException;
25:
26: /**
27: * NOTE: This file is autogenerated using util/GenerateEndpoints.php
28: */
29: class DeleteByQuery extends AbstractEndpoint
30: {
31: public function getURI(): string
32: {
33: if (!isset($this->index) || $this->index === '') {
34: throw new RuntimeException('index is required for delete_by_query');
35: }
36: $index = $this->index;
37:
38: return "/$index/_delete_by_query";
39: }
40:
41: public function getParamWhitelist(): array
42: {
43: return [
44: '_source',
45: '_source_excludes',
46: '_source_includes',
47: 'allow_no_indices',
48: 'analyze_wildcard',
49: 'analyzer',
50: 'conflicts',
51: 'default_operator',
52: 'df',
53: 'expand_wildcards',
54: 'from',
55: 'ignore_unavailable',
56: 'lenient',
57: 'max_docs',
58: 'preference',
59: 'q',
60: 'refresh',
61: 'request_cache',
62: 'requests_per_second',
63: 'routing',
64: 'scroll',
65: 'scroll_size',
66: 'search_timeout',
67: 'search_type',
68: 'size',
69: 'slices',
70: 'sort',
71: 'stats',
72: 'terminate_after',
73: 'timeout',
74: 'version',
75: 'wait_for_active_shards',
76: 'wait_for_completion',
77: 'pretty',
78: 'human',
79: 'error_trace',
80: 'source',
81: 'filter_path'
82: ];
83: }
84:
85: public function getMethod(): string
86: {
87: return 'POST';
88: }
89:
90: public function setBody($body): static
91: {
92: if (is_null($body)) {
93: return $this;
94: }
95: $this->body = $body;
96:
97: return $this;
98: }
99: }
100: