From fba7d20257cdde18aa6775244fc5cf87ff09494d Mon Sep 17 00:00:00 2001 From: dblock Date: Mon, 12 Aug 2024 08:59:12 -0400 Subject: [PATCH] Add a proxy for closeCursor for backwards-compatibility. Signed-off-by: dblock --- util/ClientEndpoint.php | 2 +- util/EndpointProxies/sql/closeCursorProxy.php | 27 +++++++++++++++++++ 2 files changed, 28 insertions(+), 1 deletion(-) create mode 100644 util/EndpointProxies/sql/closeCursorProxy.php diff --git a/util/ClientEndpoint.php b/util/ClientEndpoint.php index 1acec505..2e3a9f54 100644 --- a/util/ClientEndpoint.php +++ b/util/ClientEndpoint.php @@ -50,7 +50,7 @@ public function renderClass(): string $useNamespace = ''; // The following namespaces do not have OpenSearch API specifications - $patchnamespaces = ['async_search', 'searchable_snapshots', 'ssl', 'sql', 'data_frame_transform_deprecated', 'monitoring']; + $patchnamespaces = ['async_search', 'searchable_snapshots', 'ssl', 'data_frame_transform_deprecated', 'monitoring']; $this->namespace = array_unique(array_merge($this->namespace, $patchnamespaces)); sort($this->namespace); diff --git a/util/EndpointProxies/sql/closeCursorProxy.php b/util/EndpointProxies/sql/closeCursorProxy.php new file mode 100644 index 00000000..fa770c5c --- /dev/null +++ b/util/EndpointProxies/sql/closeCursorProxy.php @@ -0,0 +1,27 @@ +endpoints; + + /** @var AbstractEndpoint $endpoint */ + $endpoint = $endpointBuilder('Sql\Close'); + $endpoint->setBody(array_filter([ + 'cursor' => $this->extractArgument($params, 'cursor'), + ])); + $endpoint->setParams($params); + + return $this->performRequest($endpoint); + } +EOD;