| 1: | <?php |
| 2: | |
| 3: | declare(strict_types=1); |
| 4: | |
| 5: | /** |
| 6: | * SPDX-License-Identifier: Apache-2.0 |
| 7: | * |
| 8: | * The OpenSearch Contributors require contributions made to |
| 9: | * this file be licensed under the Apache-2.0 license or a |
| 10: | * compatible open source license. |
| 11: | * |
| 12: | * Modifications Copyright OpenSearch Contributors. See |
| 13: | * GitHub history for details. |
| 14: | */ |
| 15: | |
| 16: | namespace OpenSearch\Namespaces; |
| 17: | |
| 18: | use OpenSearch\Endpoints\SearchPipeline\Delete; |
| 19: | use OpenSearch\Endpoints\SearchPipeline\Get; |
| 20: | use OpenSearch\Endpoints\SearchPipeline\Put; |
| 21: | |
| 22: | /** |
| 23: | * Class SearchPipelineNamespace |
| 24: | * |
| 25: | * NOTE: This file is autogenerated using util/GenerateEndpoints.php |
| 26: | */ |
| 27: | class SearchPipelineNamespace extends AbstractNamespace |
| 28: | { |
| 29: | /** |
| 30: | * Deletes the specified search pipeline. |
| 31: | * |
| 32: | * $params['id'] = (string) Pipeline ID. |
| 33: | * $params['cluster_manager_timeout'] = (string) Operation timeout for connection to cluster-manager node. |
| 34: | * $params['timeout'] = (string) Operation timeout. |
| 35: | * $params['pretty'] = (boolean) Whether to pretty-format the returned JSON response. (Default = false) |
| 36: | * $params['human'] = (boolean) Whether to return human-readable values for statistics. (Default = false) |
| 37: | * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. (Default = false) |
| 38: | * $params['source'] = (string) The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
| 39: | * $params['filter_path'] = (any) A comma-separated list of filters used to filter the response. Use wildcards to match any field or part of a field's name. To exclude fields, use `-`. |
| 40: | * |
| 41: | * @param array $params Associative array of parameters |
| 42: | * @return array |
| 43: | */ |
| 44: | public function delete(array $params = []) |
| 45: | { |
| 46: | $id = $this->extractArgument($params, 'id'); |
| 47: | |
| 48: | $endpoint = $this->endpointFactory->getEndpoint(Delete::class); |
| 49: | $endpoint->setParams($params); |
| 50: | $endpoint->setId($id); |
| 51: | |
| 52: | return $this->performRequest($endpoint); |
| 53: | } |
| 54: | |
| 55: | /** |
| 56: | * Retrieves information about a specified search pipeline. |
| 57: | * |
| 58: | * $params['id'] = (string) Comma-separated list of search pipeline ids. Wildcards supported. |
| 59: | * $params['cluster_manager_timeout'] = (string) operation timeout for connection to cluster-manager node. |
| 60: | * $params['pretty'] = (boolean) Whether to pretty-format the returned JSON response. (Default = false) |
| 61: | * $params['human'] = (boolean) Whether to return human-readable values for statistics. (Default = false) |
| 62: | * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. (Default = false) |
| 63: | * $params['source'] = (string) The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
| 64: | * $params['filter_path'] = (any) A comma-separated list of filters used to filter the response. Use wildcards to match any field or part of a field's name. To exclude fields, use `-`. |
| 65: | * |
| 66: | * @param array $params Associative array of parameters |
| 67: | * @return array |
| 68: | */ |
| 69: | public function get(array $params = []) |
| 70: | { |
| 71: | $id = $this->extractArgument($params, 'id'); |
| 72: | |
| 73: | $endpoint = $this->endpointFactory->getEndpoint(Get::class); |
| 74: | $endpoint->setParams($params); |
| 75: | $endpoint->setId($id); |
| 76: | |
| 77: | return $this->performRequest($endpoint); |
| 78: | } |
| 79: | |
| 80: | /** |
| 81: | * Creates or replaces the specified search pipeline. |
| 82: | * |
| 83: | * $params['id'] = (string) Pipeline ID. |
| 84: | * $params['cluster_manager_timeout'] = (string) operation timeout for connection to cluster-manager node. |
| 85: | * $params['timeout'] = (string) Operation timeout. |
| 86: | * $params['pretty'] = (boolean) Whether to pretty-format the returned JSON response. (Default = false) |
| 87: | * $params['human'] = (boolean) Whether to return human-readable values for statistics. (Default = false) |
| 88: | * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. (Default = false) |
| 89: | * $params['source'] = (string) The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
| 90: | * $params['filter_path'] = (any) A comma-separated list of filters used to filter the response. Use wildcards to match any field or part of a field's name. To exclude fields, use `-`. |
| 91: | * |
| 92: | * @param array $params Associative array of parameters |
| 93: | * @return array |
| 94: | */ |
| 95: | public function put(array $params = []) |
| 96: | { |
| 97: | $id = $this->extractArgument($params, 'id'); |
| 98: | $body = $this->extractArgument($params, 'body'); |
| 99: | |
| 100: | $endpoint = $this->endpointFactory->getEndpoint(Put::class); |
| 101: | $endpoint->setParams($params); |
| 102: | $endpoint->setId($id); |
| 103: | $endpoint->setBody($body); |
| 104: | |
| 105: | return $this->performRequest($endpoint); |
| 106: | } |
| 107: | |
| 108: | } |
| 109: |