def de_json(cls, data, bot): if not data: return None data = super(SuccessfulPayment, cls).de_json(data, bot) data['order_info'] = OrderInfo.de_json(data.get('order_info'), bot) return cls(**data)
def de_json(cls, data, bot): if not data: return None data = super(SuccessfulPayment, cls).de_json(data, bot) data['order_info'] = OrderInfo.de_json(data.get('order_info'), bot) return cls(**data)
def de_json(cls, data: Optional[JSONDict], bot: 'Bot') -> Optional['SuccessfulPayment']: data = cls.parse_data(data) if not data: return None data['order_info'] = OrderInfo.de_json(data.get('order_info'), bot) return cls(**data)
def de_json(cls, data: Optional[JSONDict], bot: 'Bot') -> Optional['PreCheckoutQuery']: data = cls.parse_data(data) if not data: return None data['from_user'] = User.de_json(data.pop('from'), bot) data['order_info'] = OrderInfo.de_json(data.get('order_info'), bot) return cls(bot=bot, **data)
def de_json(cls, data, bot): if not data: return None data = super(PreCheckoutQuery, cls).de_json(data, bot) data['from_user'] = User.de_json(data.pop('from'), bot) data['order_info'] = OrderInfo.de_json(data.get('order_info'), bot) return cls(**data)
def de_json(cls, data, bot): if not data: return None data = super(PreCheckoutQuery, cls).de_json(data, bot) data['from_user'] = User.de_json(data.pop('from'), bot) data['order_info'] = OrderInfo.de_json(data.get('order_info'), bot) return cls(**data)
def de_json(cls, data, bot): if not data: return None data = super().de_json(data, bot) data['from_user'] = User.de_json(data.pop('from'), bot) data['order_info'] = OrderInfo.de_json(data.get('order_info'), bot) return cls(bot=bot, **data)
def de_json(cls, data: Optional[JSONDict], bot: 'Bot') -> Optional['SuccessfulPayment']: """See :meth:`telegram.TelegramObject.de_json`.""" data = cls._parse_data(data) if not data: return None data['order_info'] = OrderInfo.de_json(data.get('order_info'), bot) return cls(**data)
def de_json(cls, data: Optional[JSONDict], bot: 'Bot') -> Optional['PreCheckoutQuery']: """See :meth:`telegram.TelegramObject.de_json`.""" data = cls._parse_data(data) if not data: return None data['from_user'] = User.de_json(data.pop('from'), bot) data['order_info'] = OrderInfo.de_json(data.get('order_info'), bot) return cls(bot=bot, **data)
def test_de_json(self, bot): json_dict = { 'name': TestOrderInfo.name, 'phone_number': TestOrderInfo.phone_number, 'email': TestOrderInfo.email, 'shipping_address': TestOrderInfo.shipping_address.to_dict() } order_info = OrderInfo.de_json(json_dict, bot) assert order_info.name == self.name assert order_info.phone_number == self.phone_number assert order_info.email == self.email assert order_info.shipping_address == self.shipping_address
def test_de_json(self, bot): json_dict = { "name": TestOrderInfo.name, "phone_number": TestOrderInfo.phone_number, "email": TestOrderInfo.email, "shipping_address": TestOrderInfo.shipping_address.to_dict(), } order_info = OrderInfo.de_json(json_dict, bot) assert order_info.name == self.name assert order_info.phone_number == self.phone_number assert order_info.email == self.email assert order_info.shipping_address == self.shipping_address
def test_de_json(self, bot): json_dict = { 'name': TestOrderInfo.name, 'phone_number': TestOrderInfo.phone_number, 'email': TestOrderInfo.email, 'shipping_address': TestOrderInfo.shipping_address.to_dict() } order_info = OrderInfo.de_json(json_dict, bot) assert order_info.name == self.name assert order_info.phone_number == self.phone_number assert order_info.email == self.email assert order_info.shipping_address == self.shipping_address
def de_json(data, bot): """ Args: data (dict): bot (telegram.Bot): Returns: telegram.SuccessfulPayment: """ if not data: return None data = super(SuccessfulPayment, SuccessfulPayment).de_json(data, bot) data['order_info'] = OrderInfo.de_json(data.get('order_info'), bot) return SuccessfulPayment(**data)
def de_json(data, bot): """ Args: data (dict): bot (telegram.Bot): Returns: telegram.PreCheckoutQuery: """ if not data: return None data = super(PreCheckoutQuery, PreCheckoutQuery).de_json(data, bot) data['from_user'] = User.de_json(data.pop('from'), bot) data['order_info'] = OrderInfo.de_json(data.get('order_info'), bot) return PreCheckoutQuery(**data)
def de_json(data, bot): """ Args: data (dict): bot (telegram.Bot): Returns: telegram.PreCheckoutQuery: """ if not data: return None data = super(PreCheckoutQuery, PreCheckoutQuery).de_json(data, bot) data['from_user'] = User.de_json(data.pop('from'), bot) data['order_info'] = OrderInfo.de_json(data.get('order_info'), bot) return PreCheckoutQuery(**data)