Files
2024-01-23 23:33:55 +01:00

18 lines
585 B
Python

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