diff --git a/changelog.md b/changelog.md index 80d37b4..fff9c8f 100644 --- a/changelog.md +++ b/changelog.md @@ -5,6 +5,8 @@ All notable changes to this project will be documented in this file. ### Added - Support for new version 3.7. +- New method `activate_customer_page` in customer-api v3.6 and v3.7 (rtm). +- New method `deactivate_customer_page` in customer-api v3.6 and v3.7 (rtm). - New method `request_welcome_message` in customer-api v3.6 and v3.7. - New method `delete_event` in customer-api v3.6. - New methods in configuration-api v3.6 for greetings: `create_greeting`, `delete_greeting`, `get_greeting`, `update_greeting`, `list_greetings`. diff --git a/livechat/customer/rtm/api/v36.py b/livechat/customer/rtm/api/v36.py index 79d5974..e975851 100644 --- a/livechat/customer/rtm/api/v36.py +++ b/livechat/customer/rtm/api/v36.py @@ -487,6 +487,40 @@ def update_customer_page(self, 'payload': payload }) + def activate_customer_page(self, + payload: dict = None) -> RtmResponse: + ''' Marks the current Customer's page tab as active (focused). + + Args: + payload (dict): Custom payload to be used as request's data. + It overrides all other parameters provided for the method. + + Returns: + RtmResponse: RTM response structure (`request_id`, `action`, + `type`, `success` and `payload` properties) + ''' + return self.ws.send({ + 'action': 'activate_customer_page', + 'payload': {} if payload is None else payload + }) + + def deactivate_customer_page(self, + payload: dict = None) -> RtmResponse: + ''' Marks the current Customer's page tab as inactive (unfocused). + + Args: + payload (dict): Custom payload to be used as request's data. + It overrides all other parameters provided for the method. + + Returns: + RtmResponse: RTM response structure (`request_id`, `action`, + `type`, `success` and `payload` properties) + ''' + return self.ws.send({ + 'action': 'deactivate_customer_page', + 'payload': {} if payload is None else payload + }) + def set_customer_session_fields(self, session_fields: list = None, payload: dict = None) -> RtmResponse: diff --git a/livechat/customer/rtm/api/v37.py b/livechat/customer/rtm/api/v37.py index 1f5a8d6..e767c8b 100644 --- a/livechat/customer/rtm/api/v37.py +++ b/livechat/customer/rtm/api/v37.py @@ -487,6 +487,40 @@ def update_customer_page(self, 'payload': payload }) + def activate_customer_page(self, + payload: dict = None) -> RtmResponse: + ''' Marks the current Customer's page tab as active (focused). + + Args: + payload (dict): Custom payload to be used as request's data. + It overrides all other parameters provided for the method. + + Returns: + RtmResponse: RTM response structure (`request_id`, `action`, + `type`, `success` and `payload` properties) + ''' + return self.ws.send({ + 'action': 'activate_customer_page', + 'payload': {} if payload is None else payload + }) + + def deactivate_customer_page(self, + payload: dict = None) -> RtmResponse: + ''' Marks the current Customer's page tab as inactive (unfocused). + + Args: + payload (dict): Custom payload to be used as request's data. + It overrides all other parameters provided for the method. + + Returns: + RtmResponse: RTM response structure (`request_id`, `action`, + `type`, `success` and `payload` properties) + ''' + return self.ws.send({ + 'action': 'deactivate_customer_page', + 'payload': {} if payload is None else payload + }) + def set_customer_session_fields(self, session_fields: list = None, payload: dict = None) -> RtmResponse: