diff --git a/pyzipline/models.py b/pyzipline/models.py index 0a8d5d0..ee7fed3 100644 --- a/pyzipline/models.py +++ b/pyzipline/models.py @@ -1,6 +1,7 @@ """This is a list of all the models used in PyZipline. They are used to represent the data returned from the Zipline API.""" from typing import List, Dict, Optional from datetime import datetime +from pyzipline.utils import convert_str_to_datetime class File: @@ -83,7 +84,7 @@ class Invite: id (int): Integer ID of the invite code (str): String of the invite's code created_at (datetime): Datetime object of when the invite was created - expired_at (datetime): Datetime object of when the invite will expire + expires_at (datetime): Datetime object of when the invite will expire used (bool): Boolean of whether the invite has been used created_by_id (int): Integer ID of the user who created the invite """ @@ -91,16 +92,16 @@ class Invite: self, id: int, # pylint: disable=redefined-builtin code: str, - createdAt: datetime, - expiredAt: datetime, + createdAt: str, + expiresAt: str, used: bool, createdById: int, **kwargs ): self.id = id self.code = code - self.created_at = createdAt - self.expired_at = expiredAt + self.created_at = convert_str_to_datetime(createdAt) + self.expires_at = convert_str_to_datetime(expiresAt) self.used = used self.created_by_id = createdById self.__dict__.update(kwargs)