diff --git a/scaleapi/__init__.py b/scaleapi/__init__.py index f0a14d9..b687268 100644 --- a/scaleapi/__init__.py +++ b/scaleapi/__init__.py @@ -269,6 +269,10 @@ def tasks(self, **kwargs) -> Tasklist: limit (int): Determines the page size (1-100) + include_attachment_url (bool): + If true, returns a pre-signed s3 url for the + attachment used to create the task. + next_token (str): Can be use to fetch the next page of tasks """ @@ -288,6 +292,7 @@ def tasks(self, **kwargs) -> Tasklist: "updated_before", "updated_after", "unique_id", + "include_attachment_url", } for key in kwargs: @@ -323,6 +328,7 @@ def get_tasks( created_after: str = None, created_before: str = None, tags: Union[List[str], str] = None, + include_attachment_url: bool = True, ) -> Generator[Task, None, None]: """Retrieve all tasks as a `generator` method, with the given parameters. This methods handles pagination of @@ -382,6 +388,11 @@ def get_tasks( The tags of a task; multiple tags can be specified as a list. + include_attachment_url (bool): + If true, returns a pre-signed s3 url for the + attachment used to create the task. + + Yields: Generator[Task]: Yields Task objects, can be iterated. @@ -404,6 +415,7 @@ def get_tasks( created_after, created_before, tags, + include_attachment_url, ) while has_more: @@ -431,6 +443,7 @@ def get_tasks_count( created_after: str = None, created_before: str = None, tags: Union[List[str], str] = None, + include_attachment_url: bool = True, ) -> int: """Returns number of tasks with given filters. @@ -485,6 +498,10 @@ def get_tasks_count( The tags of a task; multiple tags can be specified as a list. + include_attachment_url (bool): + If true, returns a pre-signed s3 url for the + attachment used to create the task. + Returns: int: Returns number of tasks @@ -504,6 +521,7 @@ def get_tasks_count( created_after, created_before, tags, + include_attachment_url, ) tasks_args["limit"] = 1 @@ -526,6 +544,7 @@ def _process_tasks_endpoint_args( created_after: str = None, created_before: str = None, tags: Union[List[str], str] = None, + include_attachment_url: bool = True, ): """Generates args for /tasks endpoint.""" tasks_args = { @@ -539,6 +558,7 @@ def _process_tasks_endpoint_args( "updated_before": updated_before, "updated_after": updated_after, "unique_id": unique_id, + "include_attachment_url": include_attachment_url, } if status: diff --git a/scaleapi/_version.py b/scaleapi/_version.py index cf0e064..709a0ab 100644 --- a/scaleapi/_version.py +++ b/scaleapi/_version.py @@ -1,2 +1,2 @@ -__version__ = "2.14.3" +__version__ = "2.14.4" __package_name__ = "scaleapi"