From 5747874334bbee27c2a2e69b697f0b71082dff20 Mon Sep 17 00:00:00 2001 From: Seth Michael Larson Date: Thu, 5 Aug 2021 08:23:53 -0500 Subject: [PATCH] Update APIs for 7.14.0 --- .../client/_workplace_search.py | 30 ++++++++----------- 1 file changed, 13 insertions(+), 17 deletions(-) diff --git a/elastic_enterprise_search/client/_workplace_search.py b/elastic_enterprise_search/client/_workplace_search.py index 5db9fdb..cce391d 100644 --- a/elastic_enterprise_search/client/_workplace_search.py +++ b/elastic_enterprise_search/client/_workplace_search.py @@ -532,10 +532,10 @@ def get_document( ignore_status=ignore_status, ) - def delete_documents_by_query( + def delete_documents( self, content_source_id, - body, + document_ids, params=None, headers=None, http_auth=DEFAULT, @@ -543,13 +543,13 @@ def delete_documents_by_query( ignore_status=(), ): """ - Deletes documents by query in a custom content source + Deletes a list of documents from a custom content source - ``_ + ``_ :arg content_source_id: Unique ID for a Custom API source, provided upon creation of a Custom API Source - :arg body: HTTP request body + :arg document_ids: HTTP request body :arg params: Additional query params to send with the request :arg headers: Additional headers to send with the request :arg http_auth: Access token or HTTP basic auth username @@ -559,6 +559,7 @@ def delete_documents_by_query( :raises elastic_enterprise_search.BadRequestError: :raises elastic_enterprise_search.UnauthorizedError: :raises elastic_enterprise_search.NotFoundError: + :raises elastic_enterprise_search.PayloadTooLargeError: """ if content_source_id in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument") @@ -566,7 +567,7 @@ def delete_documents_by_query( params = QueryParams(params) return self.perform_request( - "DELETE", + "POST", to_path( "api", "ws", @@ -574,8 +575,9 @@ def delete_documents_by_query( "sources", content_source_id, "documents", + "bulk_destroy", ), - body=body, + body=document_ids, params=params, headers=headers, http_auth=http_auth, @@ -583,10 +585,9 @@ def delete_documents_by_query( ignore_status=ignore_status, ) - def delete_documents( + def delete_all_documents( self, content_source_id, - document_ids, params=None, headers=None, http_auth=DEFAULT, @@ -594,23 +595,20 @@ def delete_documents( ignore_status=(), ): """ - Deletes a list of documents from a custom content source + Deletes all documents in a custom content source - ``_ + ``_ :arg content_source_id: Unique ID for a Custom API source, provided upon creation of a Custom API Source - :arg document_ids: HTTP request body :arg params: Additional query params to send with the request :arg headers: Additional headers to send with the request :arg http_auth: Access token or HTTP basic auth username and password to send with the request :arg request_timeout: Timeout in seconds :arg ignore_status: HTTP status codes to not raise an error - :raises elastic_enterprise_search.BadRequestError: :raises elastic_enterprise_search.UnauthorizedError: :raises elastic_enterprise_search.NotFoundError: - :raises elastic_enterprise_search.PayloadTooLargeError: """ if content_source_id in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument") @@ -618,7 +616,7 @@ def delete_documents( params = QueryParams(params) return self.perform_request( - "POST", + "DELETE", to_path( "api", "ws", @@ -626,9 +624,7 @@ def delete_documents( "sources", content_source_id, "documents", - "bulk_destroy", ), - body=document_ids, params=params, headers=headers, http_auth=http_auth,