diff --git a/docs/changelog.md b/docs/changelog.md index 6d63f1d..66ddebb 100644 --- a/docs/changelog.md +++ b/docs/changelog.md @@ -2,6 +2,12 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html) and [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) format. + +## [0.4.3] - 2024-07-19 +### Updated +- Updated models for new pephub API + + ## [0.4.2] - 2024-04-16 ### Updated - View creation, by adding description and no_fail flag diff --git a/pephubclient/__init__.py b/pephubclient/__init__.py index 9ae0611..eb0dba7 100644 --- a/pephubclient/__init__.py +++ b/pephubclient/__init__.py @@ -4,7 +4,7 @@ import coloredlogs __app_name__ = "pephubclient" -__version__ = "0.4.2" +__version__ = "0.4.3" __author__ = "Oleksandr Khoroshevskyi, Rafal Stepien" diff --git a/pephubclient/models.py b/pephubclient/models.py index 2df7681..55a12c6 100644 --- a/pephubclient/models.py +++ b/pephubclient/models.py @@ -52,4 +52,4 @@ class SearchReturnModel(BaseModel): count: int limit: int offset: int - items: List[ProjectAnnotationModel] + results: List[ProjectAnnotationModel] diff --git a/pephubclient/pephubclient.py b/pephubclient/pephubclient.py index 6aa54ed..b09760a 100644 --- a/pephubclient/pephubclient.py +++ b/pephubclient/pephubclient.py @@ -249,7 +249,7 @@ def find_project( if pephub_response.status_code == ResponseStatusCodes.OK: decoded_response = self.decode_response(pephub_response, output_json=True) project_list = [] - for project_found in decoded_response["items"]: + for project_found in decoded_response["results"]: project_list.append(ProjectAnnotationModel(**project_found)) return SearchReturnModel(**decoded_response) diff --git a/tests/test_pephubclient.py b/tests/test_pephubclient.py index 6a9aec9..5c89177 100644 --- a/tests/test_pephubclient.py +++ b/tests/test_pephubclient.py @@ -154,7 +154,7 @@ def test_search_prj(self, mocker): "count": 1, "limit": 100, "offset": 0, - "items": [ + "results": [ { "namespace": "namespace1", "name": "basic", @@ -185,7 +185,7 @@ def test_search_prj(self, mocker): return_value = PEPHubClient().find_project(namespace="namespace1") assert return_value.count == 1 - assert len(return_value.items) == 1 + assert len(return_value.results) == 1 class TestHelpers: