Skip to content

Commit bdd1a6c

Browse files
Auto-generated API code
1 parent 6b9a137 commit bdd1a6c

File tree

4 files changed

+240
-0
lines changed

4 files changed

+240
-0
lines changed

src/Endpoints/Esql.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,7 @@ public function asyncQueryStop(?array $params = null)
193193
* Delete a non-materialized VIEW for ESQL.
194194
*
195195
* @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-esql-view-delete
196+
* @group serverless
196197
* @internal This API is EXPERIMENTAL and may be changed or removed completely in a future release
197198
*
198199
* @param array{
@@ -274,6 +275,7 @@ public function getQuery(?array $params = null)
274275
* Get a non-materialized VIEW for ESQL.
275276
*
276277
* @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-esql-view-get
278+
* @group serverless
277279
* @internal This API is EXPERIMENTAL and may be changed or removed completely in a future release
278280
*
279281
* @param array{
@@ -354,6 +356,7 @@ public function listQueries(?array $params = null)
354356
* Creates a non-materialized VIEW for ESQL.
355357
*
356358
* @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-esql-view-put
359+
* @group serverless
357360
* @internal This API is EXPERIMENTAL and may be changed or removed completely in a future release
358361
*
359362
* @param array{

src/Endpoints/Inference.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1160,6 +1160,7 @@ public function putMistral(?array $params = null)
11601160
* Create an Nvidia inference endpoint
11611161
*
11621162
* @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-inference-put-nvidia
1163+
* @group serverless
11631164
*
11641165
* @param array{
11651166
* task_type: string, // (REQUIRED) The task type

src/Endpoints/ProjectRouting.php

Lines changed: 226 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,226 @@
1+
<?php
2+
3+
/**
4+
* Elasticsearch PHP Client
5+
*
6+
* @link https://github.com/elastic/elasticsearch-php
7+
* @copyright Copyright (c) Elasticsearch B.V (https://www.elastic.co)
8+
* @license https://opensource.org/licenses/MIT MIT License
9+
*
10+
* Licensed to Elasticsearch B.V under one or more agreements.
11+
* Elasticsearch B.V licenses this file to you under the MIT License.
12+
* See the LICENSE file in the project root for more information.
13+
*/
14+
15+
declare(strict_types=1);
16+
17+
namespace Elastic\Elasticsearch\Endpoints;
18+
19+
use Elastic\Elasticsearch\Exception\ClientResponseException;
20+
use Elastic\Elasticsearch\Exception\MissingParameterException;
21+
use Elastic\Elasticsearch\Exception\ServerResponseException;
22+
use Elastic\Elasticsearch\Response\Elasticsearch;
23+
use Elastic\Transport\Exception\NoNodeAvailableException;
24+
use Http\Promise\Promise;
25+
26+
/**
27+
* @generated This file is generated, please do not edit
28+
*/
29+
class ProjectRouting extends AbstractEndpoint
30+
{
31+
/**
32+
* Create or update named project routing expression
33+
*
34+
* @group serverless
35+
* @internal This API is EXPERIMENTAL and may be changed or removed completely in a future release
36+
*
37+
* @param array{
38+
* name: string, // (REQUIRED) The name of the project routing expression
39+
* pretty?: bool, // Pretty format the returned JSON response. (DEFAULT: false)
40+
* human?: bool, // Return human readable values for statistics. (DEFAULT: true)
41+
* error_trace?: bool, // Include the stack trace of returned errors. (DEFAULT: false)
42+
* source?: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
43+
* filter_path?: string|array<string>, // A comma-separated list of filters used to reduce the response.
44+
* body: string|array<mixed>, // (REQUIRED) Project routing expression to save. If body is a string must be a valid JSON.
45+
* } $params
46+
*
47+
* @throws MissingParameterException if a required parameter is missing
48+
* @throws NoNodeAvailableException if all the hosts are offline
49+
* @throws ClientResponseException if the status code of response is 4xx
50+
* @throws ServerResponseException if the status code of response is 5xx
51+
*
52+
* @return Elasticsearch|Promise
53+
*/
54+
public function create(?array $params = null)
55+
{
56+
$params = $params ?? [];
57+
$this->checkRequiredParameters(['name','body'], $params);
58+
$url = '/_project_routing/' . $this->encode($params['name']);
59+
$method = 'PUT';
60+
61+
$url = $this->addQueryString($url, $params, ['pretty','human','error_trace','source','filter_path']);
62+
$headers = [
63+
'Accept' => 'application/json',
64+
'Content-Type' => 'application/json',
65+
];
66+
$request = $this->createRequest($method, $url, $headers, $params['body'] ?? null);
67+
$request = $this->addOtelAttributes($params, ['name'], $request, 'project_routing.create');
68+
return $this->client->sendRequest($request);
69+
}
70+
71+
72+
/**
73+
* Create or update named project routing expressions
74+
*
75+
* @group serverless
76+
* @internal This API is EXPERIMENTAL and may be changed or removed completely in a future release
77+
*
78+
* @param array{
79+
* pretty?: bool, // Pretty format the returned JSON response. (DEFAULT: false)
80+
* human?: bool, // Return human readable values for statistics. (DEFAULT: true)
81+
* error_trace?: bool, // Include the stack trace of returned errors. (DEFAULT: false)
82+
* source?: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
83+
* filter_path?: string|array<string>, // A comma-separated list of filters used to reduce the response.
84+
* body: string|array<mixed>, // (REQUIRED) Project routing expressions to save. If body is a string must be a valid JSON.
85+
* } $params
86+
*
87+
* @throws NoNodeAvailableException if all the hosts are offline
88+
* @throws ClientResponseException if the status code of response is 4xx
89+
* @throws ServerResponseException if the status code of response is 5xx
90+
*
91+
* @return Elasticsearch|Promise
92+
*/
93+
public function createMany(?array $params = null)
94+
{
95+
$params = $params ?? [];
96+
$this->checkRequiredParameters(['body'], $params);
97+
$url = '/_project_routing/';
98+
$method = 'PUT';
99+
100+
$url = $this->addQueryString($url, $params, ['pretty','human','error_trace','source','filter_path']);
101+
$headers = [
102+
'Accept' => 'application/json',
103+
'Content-Type' => 'application/json',
104+
];
105+
$request = $this->createRequest($method, $url, $headers, $params['body'] ?? null);
106+
$request = $this->addOtelAttributes($params, [], $request, 'project_routing.create_many');
107+
return $this->client->sendRequest($request);
108+
}
109+
110+
111+
/**
112+
* Delete named project routing expression
113+
*
114+
* @group serverless
115+
* @internal This API is EXPERIMENTAL and may be changed or removed completely in a future release
116+
*
117+
* @param array{
118+
* name: string, // (REQUIRED) The name of the project routing expression
119+
* pretty?: bool, // Pretty format the returned JSON response. (DEFAULT: false)
120+
* human?: bool, // Return human readable values for statistics. (DEFAULT: true)
121+
* error_trace?: bool, // Include the stack trace of returned errors. (DEFAULT: false)
122+
* source?: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
123+
* filter_path?: string|array<string>, // A comma-separated list of filters used to reduce the response.
124+
* } $params
125+
*
126+
* @throws MissingParameterException if a required parameter is missing
127+
* @throws NoNodeAvailableException if all the hosts are offline
128+
* @throws ClientResponseException if the status code of response is 4xx
129+
* @throws ServerResponseException if the status code of response is 5xx
130+
*
131+
* @return Elasticsearch|Promise
132+
*/
133+
public function delete(?array $params = null)
134+
{
135+
$params = $params ?? [];
136+
$this->checkRequiredParameters(['name'], $params);
137+
$url = '/_project_routing/' . $this->encode($params['name']);
138+
$method = 'DELETE';
139+
140+
$url = $this->addQueryString($url, $params, ['pretty','human','error_trace','source','filter_path']);
141+
$headers = [
142+
'Accept' => 'application/json',
143+
'Content-Type' => 'application/json',
144+
];
145+
$request = $this->createRequest($method, $url, $headers, $params['body'] ?? null);
146+
$request = $this->addOtelAttributes($params, ['name'], $request, 'project_routing.delete');
147+
return $this->client->sendRequest($request);
148+
}
149+
150+
151+
/**
152+
* Get named project routing expression
153+
*
154+
* @group serverless
155+
* @internal This API is EXPERIMENTAL and may be changed or removed completely in a future release
156+
*
157+
* @param array{
158+
* name: string, // (REQUIRED) The name of the project routing expression
159+
* pretty?: bool, // Pretty format the returned JSON response. (DEFAULT: false)
160+
* human?: bool, // Return human readable values for statistics. (DEFAULT: true)
161+
* error_trace?: bool, // Include the stack trace of returned errors. (DEFAULT: false)
162+
* source?: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
163+
* filter_path?: string|array<string>, // A comma-separated list of filters used to reduce the response.
164+
* } $params
165+
*
166+
* @throws MissingParameterException if a required parameter is missing
167+
* @throws NoNodeAvailableException if all the hosts are offline
168+
* @throws ClientResponseException if the status code of response is 4xx
169+
* @throws ServerResponseException if the status code of response is 5xx
170+
*
171+
* @return Elasticsearch|Promise
172+
*/
173+
public function get(?array $params = null)
174+
{
175+
$params = $params ?? [];
176+
$this->checkRequiredParameters(['name'], $params);
177+
$url = '/_project_routing/' . $this->encode($params['name']);
178+
$method = 'GET';
179+
180+
$url = $this->addQueryString($url, $params, ['pretty','human','error_trace','source','filter_path']);
181+
$headers = [
182+
'Accept' => 'application/json',
183+
'Content-Type' => 'application/json',
184+
];
185+
$request = $this->createRequest($method, $url, $headers, $params['body'] ?? null);
186+
$request = $this->addOtelAttributes($params, ['name'], $request, 'project_routing.get');
187+
return $this->client->sendRequest($request);
188+
}
189+
190+
191+
/**
192+
* Get named project routing expressions
193+
*
194+
* @group serverless
195+
* @internal This API is EXPERIMENTAL and may be changed or removed completely in a future release
196+
*
197+
* @param array{
198+
* pretty?: bool, // Pretty format the returned JSON response. (DEFAULT: false)
199+
* human?: bool, // Return human readable values for statistics. (DEFAULT: true)
200+
* error_trace?: bool, // Include the stack trace of returned errors. (DEFAULT: false)
201+
* source?: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
202+
* filter_path?: string|array<string>, // A comma-separated list of filters used to reduce the response.
203+
* } $params
204+
*
205+
* @throws NoNodeAvailableException if all the hosts are offline
206+
* @throws ClientResponseException if the status code of response is 4xx
207+
* @throws ServerResponseException if the status code of response is 5xx
208+
*
209+
* @return Elasticsearch|Promise
210+
*/
211+
public function getMany(?array $params = null)
212+
{
213+
$params = $params ?? [];
214+
$url = '/_project_routing/';
215+
$method = 'GET';
216+
217+
$url = $this->addQueryString($url, $params, ['pretty','human','error_trace','source','filter_path']);
218+
$headers = [
219+
'Accept' => 'application/json',
220+
'Content-Type' => 'application/json',
221+
];
222+
$request = $this->createRequest($method, $url, $headers, $params['body'] ?? null);
223+
$request = $this->addOtelAttributes($params, [], $request, 'project_routing.get_many');
224+
return $this->client->sendRequest($request);
225+
}
226+
}

src/Traits/NamespaceTrait.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@
4141
use Elastic\Elasticsearch\Endpoints\Nodes;
4242
use Elastic\Elasticsearch\Endpoints\Profiling;
4343
use Elastic\Elasticsearch\Endpoints\Project;
44+
use Elastic\Elasticsearch\Endpoints\ProjectRouting;
4445
use Elastic\Elasticsearch\Endpoints\QueryRules;
4546
use Elastic\Elasticsearch\Endpoints\Rollup;
4647
use Elastic\Elasticsearch\Endpoints\SearchApplication;
@@ -294,6 +295,15 @@ public function project(): Project
294295
}
295296

296297

298+
public function projectRouting(): ProjectRouting
299+
{
300+
if (!isset($this->namespace['ProjectRouting'])) {
301+
$this->namespace['ProjectRouting'] = new ProjectRouting($this);
302+
}
303+
return $this->namespace['ProjectRouting'];
304+
}
305+
306+
297307
public function queryRules(): QueryRules
298308
{
299309
if (!isset($this->namespace['QueryRules'])) {

0 commit comments

Comments
 (0)