opensearch-project / opensearch-py

Python Client for OpenSearch
https://opensearch.org/docs/latest/clients/python/
Apache License 2.0
350 stars 175 forks source link

delete_point_in_time implementation difference between Generated vs Existed client #501

Closed saimedhi closed 1 year ago

saimedhi commented 1 year ago

Async/init delete_point_in_time

existing:

@query_params()
async def delete_point_in_time(self, body=None, all=False, params=None, headers=None):
    """
    Delete a point in time
    :arg body: a point-in-time id to delete
    :arg all: set it to `True` to delete all alive point in time.
    """
    path = (
        _make_path("_search", "point_in_time", "_all")
        if all
        else _make_path("_search", "point_in_time")
    )
    return await self.transport.perform_request(
        "DELETE", path, params=params, headers=headers, body=body
    )

generated:

@query_params()
async def delete_all_pits(self, params=None, headers=None):
    """
    Deletes all active point in time searches.
    """
    return await self.transport.perform_request(
        "DELETE", "/_search/point_in_time/_all", params=params, headers=headers
    )

@query_params()
async def delete_pit(self, body=None, params=None, headers=None):
    """
    Deletes one or more point in time searches based on the IDs passed.

    :arg body:
    """
    return await self.transport.perform_request(
        "DELETE",
        "/_search/point_in_time",
        params=params,
        headers=headers,
        body=body,
    )