From 9a8170aca665d2ddb767c5c769e5c078bc51b5ae Mon Sep 17 00:00:00 2001 From: aey-infosys <82288255+aey-infosys@users.noreply.github.com> Date: Fri, 3 May 2024 22:22:23 -0500 Subject: [PATCH] Added Board Info API --- connectpyse/service/board_info.py | 23 +++++++++++++++++++++++ connectpyse/service/boards_info_api.py | 20 ++++++++++++++++++++ 2 files changed, 43 insertions(+) create mode 100644 connectpyse/service/board_info.py create mode 100644 connectpyse/service/boards_info_api.py diff --git a/connectpyse/service/board_info.py b/connectpyse/service/board_info.py new file mode 100644 index 0000000..64f2c17 --- /dev/null +++ b/connectpyse/service/board_info.py @@ -0,0 +1,23 @@ +from ..cw_model import CWModel + + +class BoardInfo(CWModel): + + def __init__(self, json_dict=None): + self.id = None # (Integer) + self.name = None # *(String(50)) + self.locationId = None # *(Integer) + self.businessUnitId = None # *(Integer) + self.inactive = None # (Boolean) + self.signOffTemplate = None # (ServiceSignoffReference) + self.sendToContact = None # (Boolean) + self.contactTemplateId = None # (Integer) + self.sendToResource = None # (Boolean) + self.resourceTemplateId = None # (Integer) + self.projectFlag = None # (Boolean) + self.showDependenciesFlag = None # (Boolean) + self.showEstimatesFlag = None # (Boolean) + self._info = None # (Metadata) + + # initialize object with json dict + super().__init__(json_dict) diff --git a/connectpyse/service/boards_info_api.py b/connectpyse/service/boards_info_api.py new file mode 100644 index 0000000..adde49f --- /dev/null +++ b/connectpyse/service/boards_info_api.py @@ -0,0 +1,20 @@ +from ..cw_controller import CWController +# Class for /service/info/boards +from . import board_info + + +class BoardsInfoAPI(CWController): + def __init__(self, **kwargs): + self.module_url = 'service' + self.module = 'info/boards' + self._class = board_info.BoardInfo + super().__init__(**kwargs) # instance gets passed to parent object + + def get_boards_info(self): + return super()._get() + + def get_boards_info_count(self): + return super()._get_count() + + def get_board_info_by_id(self, entry_id): + return super()._get_by_id(entry_id)