From bf7edd6b12b5bc8999e2803e5057f7a4af4fe19a Mon Sep 17 00:00:00 2001 From: Preston Date: Tue, 28 May 2024 20:28:27 -0500 Subject: [PATCH] Created board_status_info controller class. Created board_status_info_api for connecting to the endpoint. --- connectpyse/service/board_status_info.py | 16 ++++++++++++++++ connectpyse/service/board_status_info_api.py | 17 +++++++++++++++++ 2 files changed, 33 insertions(+) create mode 100644 connectpyse/service/board_status_info.py create mode 100644 connectpyse/service/board_status_info_api.py diff --git a/connectpyse/service/board_status_info.py b/connectpyse/service/board_status_info.py new file mode 100644 index 0000000..c71b32e --- /dev/null +++ b/connectpyse/service/board_status_info.py @@ -0,0 +1,16 @@ +from ..cw_model import CWModel + + +class BoardStatusInfo(CWModel): + + def __init__(self, json_dict=None): + self.id = None # (Integer) + self.name = None # *(String(50)) + self.sortOrder = None # (Integer) + self.defaultFlag = None # (Boolean) + self.inactiveFlag = None # (Boolean) + self.closedFlag = None # (Boolean) + self._info = None # (Metadata) + + # initialize object with json dict + super().__init__(json_dict) diff --git a/connectpyse/service/board_status_info_api.py b/connectpyse/service/board_status_info_api.py new file mode 100644 index 0000000..d4780da --- /dev/null +++ b/connectpyse/service/board_status_info_api.py @@ -0,0 +1,17 @@ +from ..cw_controller import CWController +# Class for /service/boards{}/statuses/info +from . import board_status_info + + +class BoardsStatusInfoAPI(CWController): + def __init__(self, board_id, **kwargs): + self.module_url = 'service' + self.module = 'boards/{}/statuses/info'.format(board_id) + self._class = board_status_info.BoardStatusInfo + super().__init__(**kwargs) # instance gets passed to parent object + + def get_board_statuses(self): + return super()._get() + + def get_count_board_statuses(self): + return super()._get_count()