-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #322 from zowe/Response-Type-for-REST-APT
Update REST API response type
- Loading branch information
Showing
37 changed files
with
943 additions
and
146 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,12 @@ | ||
"""Zowe Python Client SDK. | ||
This program and the accompanying materials are made available under the terms of the | ||
Eclipse Public License v2.0 which accompanies this distribution, and is available at | ||
https://www.eclipse.org/legal/epl-v20.html | ||
SPDX-License-Identifier: EPL-2.0 | ||
Copyright Contributors to the Zowe Project. | ||
""" | ||
__version__ = "1.0.0-dev19" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 13 additions & 0 deletions
13
src/zos_console/zowe/zos_console_for_zowe_sdk/response/__init__.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
"""Zowe Python Client SDK. | ||
This program and the accompanying materials are made available under the terms of the | ||
Eclipse Public License v2.0 which accompanies this distribution, and is available at | ||
https://www.eclipse.org/legal/epl-v20.html | ||
SPDX-License-Identifier: EPL-2.0 | ||
Copyright Contributors to the Zowe Project. | ||
""" | ||
|
||
from .console import ConsoleResponse, IssueCommandResponse |
50 changes: 50 additions & 0 deletions
50
src/zos_console/zowe/zos_console_for_zowe_sdk/response/console.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
"""Zowe Python Client SDK. | ||
This program and the accompanying materials are made available under the terms of the | ||
Eclipse Public License v2.0 which accompanies this distribution, and is available at | ||
https://www.eclipse.org/legal/epl-v20.html | ||
SPDX-License-Identifier: EPL-2.0 | ||
Copyright Contributors to the Zowe Project. | ||
""" | ||
|
||
from dataclasses import dataclass | ||
from typing import Any, Optional | ||
|
||
|
||
@dataclass | ||
class IssueCommandResponse: | ||
cmd_response_key: Optional[str] = None | ||
cmd_response_url: Optional[str] = None | ||
cmd_response_uri: Optional[str] = None | ||
cmd_response: Optional[str] = None | ||
|
||
def __init__(self, response: dict) -> None: | ||
for k, value in response.items(): | ||
key = k.replace("-", "_") | ||
super().__setattr__(key, value) | ||
|
||
def __getitem__(self, key: str) -> str: | ||
return self.__dict__[key.replace("-", "_")] | ||
|
||
def __setitem__(self, key: str, value: str) -> None: | ||
self.__dict__[key.replace("-", "_")] = value | ||
|
||
|
||
@dataclass | ||
class ConsoleResponse: | ||
cmd_response: Optional[str] = None | ||
sol_key_detected: Optional[bool] = None | ||
|
||
def __init__(self, response: dict) -> None: | ||
for k, value in response.items(): | ||
key = k.replace("-", "_") | ||
super().__setattr__(key, value) | ||
|
||
def __getitem__(self, key: str) -> Any: | ||
return self.__dict__[key.replace("-", "_")] | ||
|
||
def __setitem__(self, key: str, value: Any) -> None: | ||
self.__dict__[key.replace("-", "_")] = value |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 14 additions & 0 deletions
14
src/zos_files/zowe/zos_files_for_zowe_sdk/response/__init__.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
"""Zowe Python Client SDK. | ||
This program and the accompanying materials are made available under the terms of the | ||
Eclipse Public License v2.0 which accompanies this distribution, and is available at | ||
https://www.eclipse.org/legal/epl-v20.html | ||
SPDX-License-Identifier: EPL-2.0 | ||
Copyright Contributors to the Zowe Project. | ||
""" | ||
from .datasets import DatasetListResponse, MemberListResponse | ||
from .file_system import FileSystemListResponse | ||
from .uss import USSListResponse |
Oops, something went wrong.