Skip to content

Commit

Permalink
Added a proxy for closeCursor.
Browse files Browse the repository at this point in the history
Signed-off-by: dblock <dblock@amazon.com>
  • Loading branch information
dblock committed Aug 12, 2024
1 parent 52d3b22 commit 4407a23
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 1 deletion.
8 changes: 8 additions & 0 deletions src/OpenSearch/Namespaces/SqlNamespace.php
Original file line number Diff line number Diff line change
Expand Up @@ -170,4 +170,12 @@ public function settings(array $params = [])

return $this->performRequest($endpoint);
}
/**
* Proxy function to closeCursor() to prevent BC break.
* This API will be removed in a future version. Use 'close' API instead.
*/
public function closeCursor(array $params = [])
{
return $this->close($params);
}
}
2 changes: 1 addition & 1 deletion util/ClientEndpoint.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
13 changes: 13 additions & 0 deletions util/EndpointProxies/sql/closeCursorProxy.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?php

return <<<'EOD'
/**
* Proxy function to closeCursor() to prevent BC break.
* This API will be removed in a future version. Use 'close' API instead.
*/
public function closeCursor(array $params = [])
{
return $this->close($params);
}
EOD;

0 comments on commit 4407a23

Please sign in to comment.