From 48949327db597ab49f411b089760d25f2b59f3e3 Mon Sep 17 00:00:00 2001 From: Timothy MacDonald Date: Fri, 12 Jan 2024 13:36:55 -0600 Subject: [PATCH] docs: fix CRUD search method docstring (#145) It indicates a generator as a return type when it is actually a dict Signed-off-by: Timothy MacDonald --- laceworksdk/api/crud_endpoint.py | 28 +++++++++++++++++----------- 1 file changed, 17 insertions(+), 11 deletions(-) diff --git a/laceworksdk/api/crud_endpoint.py b/laceworksdk/api/crud_endpoint.py index f6f407e..6e86e0f 100644 --- a/laceworksdk/api/crud_endpoint.py +++ b/laceworksdk/api/crud_endpoint.py @@ -62,20 +62,26 @@ def search(self, json=None): depending on the operation you are using. Args: - json (list of dicts): A list of dictionaries containing the desired search parameters: \n - - field (str): The name of the data field to which the condition applies\n - - expression (str): The comparison operator for the filter condition. Valid values are:\n - "eq", "ne", "in", "not_in", "like", "ilike", "not_like", "not_ilike", "not_rlike", "rlike", "gt", "ge", \ - "lt", "le", "between" - - value (str, optional): The value that the condition checks for in the specified field. Use this attribute \ - when using an operator that requires a single value. - - values (list of str, optional): The values that the condition checks for in the specified field. Use this \ - attribute when using an operator that requires multiple values. + json (dict): The desired search parameters: \n + - timeFilter (dict, optional): A dict containing the time frame for the search:\n + - startTime (str): The start time for the search + - endTime (str): The end time for the search + + - filters (list of dict, optional): Filters based on field contents:\n + - field (str): The name of the data field to which the condition applies\n + - expression (str): The comparison operator for the filter condition. Valid values are:\n + "eq", "ne", "in", "not_in", "like", "ilike", "not_like", "not_ilike", "not_rlike", "rlike", "gt", "ge", \ + "lt", "le", "between"\n + - value (str, optional): The value that the condition checks for in the specified field. Use this attribute \ + when using an operator that requires a single value. + - values (list of str, optional): The values that the condition checks for in the specified field. Use this \ + attribute when using an operator that requires multiple values. + - returns (list of str, optional): The fields to return - Yields: - dict: returns a generator which yields a page of objects at a time as returned by the Lacework API. + Returns: + dict: returns a dict containing the search results """ response = self._session.post(self._build_url(action="search"), json=json)