Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions src/Endpoints/Esql.php
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,7 @@ public function asyncQueryStop(?array $params = null)
* Delete a non-materialized VIEW for ESQL.
*
* @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-esql-view-delete
* @group serverless
* @internal This API is EXPERIMENTAL and may be changed or removed completely in a future release
*
* @param array{
Expand Down Expand Up @@ -274,6 +275,7 @@ public function getQuery(?array $params = null)
* Get a non-materialized VIEW for ESQL.
*
* @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-esql-view-get
* @group serverless
* @internal This API is EXPERIMENTAL and may be changed or removed completely in a future release
*
* @param array{
Expand Down Expand Up @@ -354,6 +356,7 @@ public function listQueries(?array $params = null)
* Creates a non-materialized VIEW for ESQL.
*
* @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-esql-view-put
* @group serverless
* @internal This API is EXPERIMENTAL and may be changed or removed completely in a future release
*
* @param array{
Expand Down
1 change: 1 addition & 0 deletions src/Endpoints/Inference.php
Original file line number Diff line number Diff line change
Expand Up @@ -1160,6 +1160,7 @@ public function putMistral(?array $params = null)
* Create an Nvidia inference endpoint
*
* @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-inference-put-nvidia
* @group serverless
*
* @param array{
* task_type: string, // (REQUIRED) The task type
Expand Down
226 changes: 226 additions & 0 deletions src/Endpoints/ProjectRouting.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,226 @@
<?php

/**
* Elasticsearch PHP Client
*
* @link https://github.com/elastic/elasticsearch-php
* @copyright Copyright (c) Elasticsearch B.V (https://www.elastic.co)
* @license https://opensource.org/licenses/MIT MIT License
*
* Licensed to Elasticsearch B.V under one or more agreements.
* Elasticsearch B.V licenses this file to you under the MIT License.
* See the LICENSE file in the project root for more information.
*/

declare(strict_types=1);

namespace Elastic\Elasticsearch\Endpoints;

use Elastic\Elasticsearch\Exception\ClientResponseException;
use Elastic\Elasticsearch\Exception\MissingParameterException;
use Elastic\Elasticsearch\Exception\ServerResponseException;
use Elastic\Elasticsearch\Response\Elasticsearch;
use Elastic\Transport\Exception\NoNodeAvailableException;
use Http\Promise\Promise;

/**
* @generated This file is generated, please do not edit
*/
class ProjectRouting extends AbstractEndpoint
{
/**
* Create or update named project routing expression
*
* @group serverless
* @internal This API is EXPERIMENTAL and may be changed or removed completely in a future release
*
* @param array{
* name: string, // (REQUIRED) The name of the project routing expression
* pretty?: bool, // Pretty format the returned JSON response. (DEFAULT: false)
* human?: bool, // Return human readable values for statistics. (DEFAULT: true)
* error_trace?: bool, // Include the stack trace of returned errors. (DEFAULT: false)
* source?: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
* filter_path?: string|array<string>, // A comma-separated list of filters used to reduce the response.
* body: string|array<mixed>, // (REQUIRED) Project routing expression to save. If body is a string must be a valid JSON.
* } $params
*
* @throws MissingParameterException if a required parameter is missing
* @throws NoNodeAvailableException if all the hosts are offline
* @throws ClientResponseException if the status code of response is 4xx
* @throws ServerResponseException if the status code of response is 5xx
*
* @return Elasticsearch|Promise
*/
public function create(?array $params = null)
{
$params = $params ?? [];
$this->checkRequiredParameters(['name','body'], $params);
$url = '/_project_routing/' . $this->encode($params['name']);
$method = 'PUT';

$url = $this->addQueryString($url, $params, ['pretty','human','error_trace','source','filter_path']);
$headers = [
'Accept' => 'application/json',
'Content-Type' => 'application/json',
];
$request = $this->createRequest($method, $url, $headers, $params['body'] ?? null);
$request = $this->addOtelAttributes($params, ['name'], $request, 'project_routing.create');
return $this->client->sendRequest($request);
}


/**
* Create or update named project routing expressions
*
* @group serverless
* @internal This API is EXPERIMENTAL and may be changed or removed completely in a future release
*
* @param array{
* pretty?: bool, // Pretty format the returned JSON response. (DEFAULT: false)
* human?: bool, // Return human readable values for statistics. (DEFAULT: true)
* error_trace?: bool, // Include the stack trace of returned errors. (DEFAULT: false)
* source?: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
* filter_path?: string|array<string>, // A comma-separated list of filters used to reduce the response.
* body: string|array<mixed>, // (REQUIRED) Project routing expressions to save. If body is a string must be a valid JSON.
* } $params
*
* @throws NoNodeAvailableException if all the hosts are offline
* @throws ClientResponseException if the status code of response is 4xx
* @throws ServerResponseException if the status code of response is 5xx
*
* @return Elasticsearch|Promise
*/
public function createMany(?array $params = null)
{
$params = $params ?? [];
$this->checkRequiredParameters(['body'], $params);
$url = '/_project_routing/';
$method = 'PUT';

$url = $this->addQueryString($url, $params, ['pretty','human','error_trace','source','filter_path']);
$headers = [
'Accept' => 'application/json',
'Content-Type' => 'application/json',
];
$request = $this->createRequest($method, $url, $headers, $params['body'] ?? null);
$request = $this->addOtelAttributes($params, [], $request, 'project_routing.create_many');
return $this->client->sendRequest($request);
}


/**
* Delete named project routing expression
*
* @group serverless
* @internal This API is EXPERIMENTAL and may be changed or removed completely in a future release
*
* @param array{
* name: string, // (REQUIRED) The name of the project routing expression
* pretty?: bool, // Pretty format the returned JSON response. (DEFAULT: false)
* human?: bool, // Return human readable values for statistics. (DEFAULT: true)
* error_trace?: bool, // Include the stack trace of returned errors. (DEFAULT: false)
* source?: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
* filter_path?: string|array<string>, // A comma-separated list of filters used to reduce the response.
* } $params
*
* @throws MissingParameterException if a required parameter is missing
* @throws NoNodeAvailableException if all the hosts are offline
* @throws ClientResponseException if the status code of response is 4xx
* @throws ServerResponseException if the status code of response is 5xx
*
* @return Elasticsearch|Promise
*/
public function delete(?array $params = null)
{
$params = $params ?? [];
$this->checkRequiredParameters(['name'], $params);
$url = '/_project_routing/' . $this->encode($params['name']);
$method = 'DELETE';

$url = $this->addQueryString($url, $params, ['pretty','human','error_trace','source','filter_path']);
$headers = [
'Accept' => 'application/json',
'Content-Type' => 'application/json',
];
$request = $this->createRequest($method, $url, $headers, $params['body'] ?? null);
$request = $this->addOtelAttributes($params, ['name'], $request, 'project_routing.delete');
return $this->client->sendRequest($request);
}


/**
* Get named project routing expression
*
* @group serverless
* @internal This API is EXPERIMENTAL and may be changed or removed completely in a future release
*
* @param array{
* name: string, // (REQUIRED) The name of the project routing expression
* pretty?: bool, // Pretty format the returned JSON response. (DEFAULT: false)
* human?: bool, // Return human readable values for statistics. (DEFAULT: true)
* error_trace?: bool, // Include the stack trace of returned errors. (DEFAULT: false)
* source?: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
* filter_path?: string|array<string>, // A comma-separated list of filters used to reduce the response.
* } $params
*
* @throws MissingParameterException if a required parameter is missing
* @throws NoNodeAvailableException if all the hosts are offline
* @throws ClientResponseException if the status code of response is 4xx
* @throws ServerResponseException if the status code of response is 5xx
*
* @return Elasticsearch|Promise
*/
public function get(?array $params = null)
{
$params = $params ?? [];
$this->checkRequiredParameters(['name'], $params);
$url = '/_project_routing/' . $this->encode($params['name']);
$method = 'GET';

$url = $this->addQueryString($url, $params, ['pretty','human','error_trace','source','filter_path']);
$headers = [
'Accept' => 'application/json',
'Content-Type' => 'application/json',
];
$request = $this->createRequest($method, $url, $headers, $params['body'] ?? null);
$request = $this->addOtelAttributes($params, ['name'], $request, 'project_routing.get');
return $this->client->sendRequest($request);
}


/**
* Get named project routing expressions
*
* @group serverless
* @internal This API is EXPERIMENTAL and may be changed or removed completely in a future release
*
* @param array{
* pretty?: bool, // Pretty format the returned JSON response. (DEFAULT: false)
* human?: bool, // Return human readable values for statistics. (DEFAULT: true)
* error_trace?: bool, // Include the stack trace of returned errors. (DEFAULT: false)
* source?: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
* filter_path?: string|array<string>, // A comma-separated list of filters used to reduce the response.
* } $params
*
* @throws NoNodeAvailableException if all the hosts are offline
* @throws ClientResponseException if the status code of response is 4xx
* @throws ServerResponseException if the status code of response is 5xx
*
* @return Elasticsearch|Promise
*/
public function getMany(?array $params = null)
{
$params = $params ?? [];
$url = '/_project_routing/';
$method = 'GET';

$url = $this->addQueryString($url, $params, ['pretty','human','error_trace','source','filter_path']);
$headers = [
'Accept' => 'application/json',
'Content-Type' => 'application/json',
];
$request = $this->createRequest($method, $url, $headers, $params['body'] ?? null);
$request = $this->addOtelAttributes($params, [], $request, 'project_routing.get_many');
return $this->client->sendRequest($request);
}
}
10 changes: 10 additions & 0 deletions src/Traits/NamespaceTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
use Elastic\Elasticsearch\Endpoints\Nodes;
use Elastic\Elasticsearch\Endpoints\Profiling;
use Elastic\Elasticsearch\Endpoints\Project;
use Elastic\Elasticsearch\Endpoints\ProjectRouting;
use Elastic\Elasticsearch\Endpoints\QueryRules;
use Elastic\Elasticsearch\Endpoints\Rollup;
use Elastic\Elasticsearch\Endpoints\SearchApplication;
Expand Down Expand Up @@ -294,6 +295,15 @@ public function project(): Project
}


public function projectRouting(): ProjectRouting
{
if (!isset($this->namespace['ProjectRouting'])) {
$this->namespace['ProjectRouting'] = new ProjectRouting($this);
}
return $this->namespace['ProjectRouting'];
}


public function queryRules(): QueryRules
{
if (!isset($this->namespace['QueryRules'])) {
Expand Down