class LinkPojo(): def __init__(self, url, email, updated_at, ip_country): self.url = url self.email = email self.updated_at = updated_at self.ip_country = ip_country @staticmethod def from_firestore_dict(source): updated_at = source['updated_at'] email = source['email'] url = source['url'] ip_country = "FR" if source.get('ip_country'): ip_country = source['ip_country'] result = LinkPojo(email=email, url=url, updated_at=updated_at, ip_country=ip_country) return result