diff --git a/CHANGELOG.md b/CHANGELOG.md index ee29df7a..fc9b4801 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,6 +14,8 @@ All notable changes to the Zowe Client Python SDK will be documented in this fil - Added checks and auto addition for license headers on workflow. [#293] (https://github.com/zowe/zowe-client-python-sdk/issues/293) +- *Breaking*: Update custom class for REST API responses [#89] (https://github.com/zowe/zowe-client-python-sdk/issues/89) + ### Bug Fixes ## `1.0.0-dev18` diff --git a/src/zos_files/zowe/zos_files_for_zowe_sdk/response/datasets.py b/src/zos_files/zowe/zos_files_for_zowe_sdk/response/datasets.py index 0c5f7ada..76fe92d3 100644 --- a/src/zos_files/zowe/zos_files_for_zowe_sdk/response/datasets.py +++ b/src/zos_files/zowe/zos_files_for_zowe_sdk/response/datasets.py @@ -9,13 +9,14 @@ Copyright Contributors to the Zowe Project. """ + from dataclasses import dataclass from typing import Any, Dict, List, Optional @dataclass class DatasetListResponse: - items: Optional[list[dict]] = None + items: Optional[List[dict]] = None returnedRows: Optional[int] = None totalRows: Optional[int] = None JSONversion: Optional[int] = None @@ -78,7 +79,7 @@ def __setitem__(self, key: str, value: Any) -> None: @dataclass class MemberListResponse: - items: Optional[list[dict]] = None + items: Optional[List[dict]] = None totalRows: Optional[int] = None JSONversion: Optional[int] = None diff --git a/src/zos_files/zowe/zos_files_for_zowe_sdk/response/file_system.py b/src/zos_files/zowe/zos_files_for_zowe_sdk/response/file_system.py index c48c6cde..30e41750 100644 --- a/src/zos_files/zowe/zos_files_for_zowe_sdk/response/file_system.py +++ b/src/zos_files/zowe/zos_files_for_zowe_sdk/response/file_system.py @@ -9,6 +9,7 @@ Copyright Contributors to the Zowe Project. """ + from dataclasses import dataclass from typing import Any, Dict, List, Optional @@ -40,7 +41,7 @@ def __setitem__(self, key: str, value: Any) -> None: @dataclass class FileSystemListResponse: - items: Optional[list[FileSystemResponse]] = None + items: Optional[List[FileSystemResponse]] = None returnedRows: Optional[int] = None totalRows: Optional[int] = None JSONversion: Optional[int] = None diff --git a/src/zos_files/zowe/zos_files_for_zowe_sdk/response/uss.py b/src/zos_files/zowe/zos_files_for_zowe_sdk/response/uss.py index d9414e7b..644abebe 100644 --- a/src/zos_files/zowe/zos_files_for_zowe_sdk/response/uss.py +++ b/src/zos_files/zowe/zos_files_for_zowe_sdk/response/uss.py @@ -9,6 +9,7 @@ Copyright Contributors to the Zowe Project. """ + from dataclasses import dataclass from typing import Any, Optional @@ -33,7 +34,7 @@ def __setitem__(self, key: str, value: Any) -> None: @dataclass class USSListResponse: - items: Optional[list[dict]] = None + items: Optional[List[dict]] = None returnedRows: Optional[int] = None totalRows: Optional[int] = None JSONversion: Optional[int] = None diff --git a/src/zos_jobs/zowe/zos_jobs_for_zowe_sdk/jobs.py b/src/zos_jobs/zowe/zos_jobs_for_zowe_sdk/jobs.py index ad1948f0..5de2d488 100644 --- a/src/zos_jobs/zowe/zos_jobs_for_zowe_sdk/jobs.py +++ b/src/zos_jobs/zowe/zos_jobs_for_zowe_sdk/jobs.py @@ -11,7 +11,7 @@ """ import os -from typing import Optional +from typing import List, Optional from zowe.core_for_zowe_sdk import SdkApi @@ -265,7 +265,7 @@ def list_jobs( prefix: str = "*", max_jobs: int = 1000, user_correlator: Optional[str] = None, - ) -> list[JobResponse]: + ) -> List[JobResponse]: """ Retrieve list of jobs on JES based on the provided arguments. @@ -369,7 +369,7 @@ def submit_plaintext(self, jcl: str) -> JobResponse: response_json = self.request_handler.perform_request("PUT", custom_args, expected_code=[201]) return JobResponse(response_json) - def get_spool_files(self, correlator: str) -> list[SpoolResponse]: + def get_spool_files(self, correlator: str) -> List[SpoolResponse]: """ Retrieve the spool files for a job identified by the correlator. diff --git a/src/zos_tso/zowe/zos_tso_for_zowe_sdk/response/tso.py b/src/zos_tso/zowe/zos_tso_for_zowe_sdk/response/tso.py index 82a007fa..1e779700 100644 --- a/src/zos_tso/zowe/zos_tso_for_zowe_sdk/response/tso.py +++ b/src/zos_tso/zowe/zos_tso_for_zowe_sdk/response/tso.py @@ -9,6 +9,7 @@ Copyright Contributors to the Zowe Project. """ + from dataclasses import dataclass from typing import Any, Dict, List, Optional @@ -19,7 +20,7 @@ class StartResponse: queueID: Optional[str] = None sessionID: Optional[str] = None ver: Optional[str] = None - tsoData: Optional[list[dict]] = None + tsoData: Optional[List[dict]] = None reused: Optional[bool] = None timeout: Optional[bool] = None @@ -37,7 +38,7 @@ class EndResponse: reused: Optional[bool] = None timeout: Optional[bool] = None msgData: Optional[str] = None - msgId: Optional[list] = None + msgId: Optional[List] = None def __getitem__(self, key: str) -> Any: return self.__dict__[key] @@ -50,7 +51,7 @@ def __setitem__(self, key: str, value: Any) -> None: class SendResponse: servletKey: Optional[str] = None ver: Optional[str] = None - tsoData: Optional[list[dict]] = None + tsoData: Optional[List[dict]] = None reused: Optional[bool] = None timeout: Optional[bool] = None