def de_json(cls, data: Optional[JSONDict], bot: 'Bot') -> Optional['EncryptedPassportElement']: data = cls.parse_data(data) if not data: return None data['files'] = PassportFile.de_list(data.get('files'), bot) or None data['front_side'] = PassportFile.de_json(data.get('front_side'), bot) data['reverse_side'] = PassportFile.de_json(data.get('reverse_side'), bot) data['selfie'] = PassportFile.de_json(data.get('selfie'), bot) data['translation'] = PassportFile.de_list(data.get('translation'), bot) or None return cls(bot=bot, **data)
def de_json(cls, data, bot): if not data: return None data = super(EncryptedPassportElement, cls).de_json(data, bot) data['files'] = PassportFile.de_list(data.get('files'), bot) or None data['front_side'] = PassportFile.de_json(data.get('front_side'), bot) data['reverse_side'] = PassportFile.de_json(data.get('reverse_side'), bot) data['selfie'] = PassportFile.de_json(data.get('selfie'), bot) data['translation'] = PassportFile.de_list(data.get('translation'), bot) or None return cls(bot=bot, **data)