1<?php
2/**
3 * Elasticsearch PHP client
4 *
5 * @link      https://github.com/elastic/elasticsearch-php/
6 * @copyright Copyright (c) Elasticsearch B.V (https://www.elastic.co)
7 * @license   http://www.apache.org/licenses/LICENSE-2.0 Apache License, Version 2.0
8 * @license   https://www.gnu.org/licenses/lgpl-2.1.html GNU Lesser General Public License, Version 2.1
9 *
10 * Licensed to Elasticsearch B.V under one or more agreements.
11 * Elasticsearch B.V licenses this file to you under the Apache 2.0 License or
12 * the GNU Lesser General Public License, Version 2.1, at your option.
13 * See the LICENSE file in the project root for more information.
14 */
15declare(strict_types = 1);
16
17namespace Elasticsearch\Namespaces;
18
19use Elasticsearch\Namespaces\AbstractNamespace;
20
21/**
22 * Class DataFrameTransformDeprecatedNamespace
23 *
24 * NOTE: this file is autogenerated using util/GenerateEndpoints.php
25 * and Elasticsearch 7.16.0-SNAPSHOT (dfc9a8e7563ed5f24b5210ed21ed92ae182cd0ee)
26 */
27class DataFrameTransformDeprecatedNamespace extends AbstractNamespace
28{
29
30    /**
31     * Deletes an existing transform.
32     *
33     * $params['transform_id'] = (string) The id of the transform to delete
34     * $params['force']        = (boolean) When `true`, the transform is deleted regardless of its current state. The default value is `false`, meaning that the transform must be `stopped` before it can be deleted.
35     *
36     * @param array $params Associative array of parameters
37     * @return array
38     * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/delete-transform.html
39     *
40     * @note This API is BETA and may change in ways that are not backwards compatible
41     *
42     */
43    public function deleteTransform(array $params = [])
44    {
45        $transform_id = $this->extractArgument($params, 'transform_id');
46
47        $endpointBuilder = $this->endpoints;
48        $endpoint = $endpointBuilder('DataFrameTransformDeprecated\DeleteTransform');
49        $endpoint->setParams($params);
50        $endpoint->setTransformId($transform_id);
51
52        return $this->performRequest($endpoint);
53    }
54    /**
55     * Retrieves configuration information for transforms.
56     *
57     * $params['transform_id']      = (string) The id or comma delimited list of id expressions of the transforms to get, '_all' or '*' implies get all transforms
58     * $params['from']              = (int) skips a number of transform configs, defaults to 0
59     * $params['size']              = (int) specifies a max number of transforms to get, defaults to 100
60     * $params['allow_no_match']    = (boolean) Whether to ignore if a wildcard expression matches no transforms. (This includes `_all` string or when no transforms have been specified)
61     * $params['exclude_generated'] = (boolean) Omits generated fields. Allows transform configurations to be easily copied between clusters and within the same cluster (Default = false)
62     *
63     * @param array $params Associative array of parameters
64     * @return array
65     * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/get-transform.html
66     *
67     * @note This API is BETA and may change in ways that are not backwards compatible
68     *
69     */
70    public function getTransform(array $params = [])
71    {
72        $transform_id = $this->extractArgument($params, 'transform_id');
73
74        $endpointBuilder = $this->endpoints;
75        $endpoint = $endpointBuilder('DataFrameTransformDeprecated\GetTransform');
76        $endpoint->setParams($params);
77        $endpoint->setTransformId($transform_id);
78
79        return $this->performRequest($endpoint);
80    }
81    /**
82     * Retrieves usage information for transforms.
83     *
84     * $params['transform_id']   = (string) The id of the transform for which to get stats. '_all' or '*' implies all transforms
85     * $params['from']           = (number) skips a number of transform stats, defaults to 0
86     * $params['size']           = (number) specifies a max number of transform stats to get, defaults to 100
87     * $params['allow_no_match'] = (boolean) Whether to ignore if a wildcard expression matches no transforms. (This includes `_all` string or when no transforms have been specified)
88     *
89     * @param array $params Associative array of parameters
90     * @return array
91     * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/get-transform-stats.html
92     *
93     * @note This API is BETA and may change in ways that are not backwards compatible
94     *
95     */
96    public function getTransformStats(array $params = [])
97    {
98        $transform_id = $this->extractArgument($params, 'transform_id');
99
100        $endpointBuilder = $this->endpoints;
101        $endpoint = $endpointBuilder('DataFrameTransformDeprecated\GetTransformStats');
102        $endpoint->setParams($params);
103        $endpoint->setTransformId($transform_id);
104
105        return $this->performRequest($endpoint);
106    }
107    /**
108     * Previews a transform.
109     *
110     * $params['body'] = (array) The definition for the transform to preview (Required)
111     *
112     * @param array $params Associative array of parameters
113     * @return array
114     * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/preview-transform.html
115     *
116     * @note This API is BETA and may change in ways that are not backwards compatible
117     *
118     */
119    public function previewTransform(array $params = [])
120    {
121        $body = $this->extractArgument($params, 'body');
122
123        $endpointBuilder = $this->endpoints;
124        $endpoint = $endpointBuilder('DataFrameTransformDeprecated\PreviewTransform');
125        $endpoint->setParams($params);
126        $endpoint->setBody($body);
127
128        return $this->performRequest($endpoint);
129    }
130    /**
131     * Instantiates a transform.
132     *
133     * $params['transform_id']     = (string) The id of the new transform.
134     * $params['defer_validation'] = (boolean) If validations should be deferred until transform starts, defaults to false.
135     * $params['body']             = (array) The transform definition (Required)
136     *
137     * @param array $params Associative array of parameters
138     * @return array
139     * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/put-transform.html
140     *
141     * @note This API is BETA and may change in ways that are not backwards compatible
142     *
143     */
144    public function putTransform(array $params = [])
145    {
146        $transform_id = $this->extractArgument($params, 'transform_id');
147        $body = $this->extractArgument($params, 'body');
148
149        $endpointBuilder = $this->endpoints;
150        $endpoint = $endpointBuilder('DataFrameTransformDeprecated\PutTransform');
151        $endpoint->setParams($params);
152        $endpoint->setTransformId($transform_id);
153        $endpoint->setBody($body);
154
155        return $this->performRequest($endpoint);
156    }
157    /**
158     * Starts one or more transforms.
159     *
160     * $params['transform_id'] = (string) The id of the transform to start
161     * $params['timeout']      = (time) Controls the time to wait for the transform to start
162     *
163     * @param array $params Associative array of parameters
164     * @return array
165     * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/start-transform.html
166     *
167     * @note This API is BETA and may change in ways that are not backwards compatible
168     *
169     */
170    public function startTransform(array $params = [])
171    {
172        $transform_id = $this->extractArgument($params, 'transform_id');
173
174        $endpointBuilder = $this->endpoints;
175        $endpoint = $endpointBuilder('DataFrameTransformDeprecated\StartTransform');
176        $endpoint->setParams($params);
177        $endpoint->setTransformId($transform_id);
178
179        return $this->performRequest($endpoint);
180    }
181    /**
182     * Stops one or more transforms.
183     *
184     * $params['transform_id']        = (string) The id of the transform to stop
185     * $params['wait_for_completion'] = (boolean) Whether to wait for the transform to fully stop before returning or not. Default to false
186     * $params['timeout']             = (time) Controls the time to wait until the transform has stopped. Default to 30 seconds
187     * $params['allow_no_match']      = (boolean) Whether to ignore if a wildcard expression matches no transforms. (This includes `_all` string or when no transforms have been specified)
188     *
189     * @param array $params Associative array of parameters
190     * @return array
191     * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/stop-transform.html
192     *
193     * @note This API is BETA and may change in ways that are not backwards compatible
194     *
195     */
196    public function stopTransform(array $params = [])
197    {
198        $transform_id = $this->extractArgument($params, 'transform_id');
199
200        $endpointBuilder = $this->endpoints;
201        $endpoint = $endpointBuilder('DataFrameTransformDeprecated\StopTransform');
202        $endpoint->setParams($params);
203        $endpoint->setTransformId($transform_id);
204
205        return $this->performRequest($endpoint);
206    }
207    /**
208     * Updates certain properties of a transform.
209     *
210     * $params['transform_id']     = (string) The id of the transform.
211     * $params['defer_validation'] = (boolean) If validations should be deferred until transform starts, defaults to false.
212     * $params['body']             = (array) The update transform definition (Required)
213     *
214     * @param array $params Associative array of parameters
215     * @return array
216     * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/update-transform.html
217     *
218     * @note This API is BETA and may change in ways that are not backwards compatible
219     *
220     */
221    public function updateTransform(array $params = [])
222    {
223        $transform_id = $this->extractArgument($params, 'transform_id');
224        $body = $this->extractArgument($params, 'body');
225
226        $endpointBuilder = $this->endpoints;
227        $endpoint = $endpointBuilder('DataFrameTransformDeprecated\UpdateTransform');
228        $endpoint->setParams($params);
229        $endpoint->setTransformId($transform_id);
230        $endpoint->setBody($body);
231
232        return $this->performRequest($endpoint);
233    }
234}
235