def __members(self): data_no_nones = utils.remove_none_values(self.data) meta_no_nones = utils.remove_none_values(self.metadata) return ( self.text, jsonpickle.encode(data_no_nones), jsonpickle.encode(meta_no_nones), )
def _message( recipient_id, request_id=UserMessage.DEFAULT_REQUEST_ID, user_id=UserMessage.DEFAULT_USER_ID, text=None, image=None, buttons=None, attachment=None, custom=None, elements=None, quick_replies=None, parse_data=None, ): """Create a message object that will be stored.""" obj = { "sender_id": recipient_id, "request_id": request_id, "user_id": user_id, "text": text, "image": image, "buttons": buttons, "attachment": attachment, "custom": custom, "elements": elements, "quick_replies": quick_replies, "nlu_data": parse_data, } # filter out any values that are `None` return utils.remove_none_values(obj)
def _message( recipient_id: Text, text: Text = None, image: Text = None, buttons: List[Dict[Text, Any]] = None, quick_replies: List[Dict[Text, Any]] = None, attachment: Text = None, custom: Dict[Text, Any] = None, metadata: Dict[Text, Any] = {}, ) -> Dict: """Create a message object that will be stored.""" obj = { "recipient_id": recipient_id, "text": text, "image": image, "quick_replies": quick_replies, "buttons": buttons, "attachment": attachment, "metadata": metadata, } if custom: obj.update(custom) # filter out any values that are `None` return utils.remove_none_values(obj)
def _message(recipient_id, text=None, image=None, buttons=None, attachment=None): """Create a message object that will be stored.""" obj = { "recipient_id": recipient_id, "text": text, "image": image, "buttons": buttons, "attachment": attachment, } # filter out any values that are `None` return utils.remove_none_values(obj)
def _message( recipient_id: Text, text: Text = None, image: Text = None, buttons: List[Dict[Text, Any]] = None, attachment: Text = None, custom: Dict[Text, Any] = None, ) -> Dict: """Create a message object that will be stored.""" obj = { "recipient_id": recipient_id, "text": text, "image": image, "buttons": buttons, "attachment": attachment, "custom": custom, } # filter out any values that are `None` return utils.remove_none_values(obj)
def __members(self): wo_none_values = utils.remove_none_values(self.data) return (self.text, jsonpickle.encode(wo_none_values))