Skip to content

Commit

Permalink
feat(client): adapt OpenAPI listJob
Browse files Browse the repository at this point in the history
  • Loading branch information
graczhual committed Dec 21, 2021
1 parent 323eadb commit 29511b7
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions tensorbay/client/version.py
Original file line number Diff line number Diff line change
Expand Up @@ -643,14 +643,14 @@ def _delete_job(self, job_id: str) -> None:
"""

def _generate_jobs(
def _list_jobs(
self,
job_type: str,
status: Optional[str] = None,
offset: int = 0,
limit: int = 128,
) -> Generator[Dict[str, Any], None, int]:
"""Get a generator of :class:`Job`.
) -> Dict[str, Any]:
"""Get a dict about the list of :class:`Job`.
Arguments:
job_type: Type of the Job.
Expand All @@ -659,10 +659,14 @@ def _generate_jobs(
offset: The offset of the page.
limit: The limit of the page.
Return:
The generator of job info.
Returns:
The dict of job info list.
"""
params = {"jobType": job_type, "status": status, "offset": offset, "limit": limit}

response = self._client.open_api_do("GET", "jobs", self._dataset_id, params=params)
return response.json() # type: ignore[no-any-return]


class SquashAndMerge(JobMixin):
Expand Down

0 comments on commit 29511b7

Please sign in to comment.