# Path: messagebird/base.py
# class Base:
#     def load(self, data):
#         if data is not None:
#             for name, value in list(data.items()):
#                 if hasattr(self, name) and not callable(getattr(self, name)):
#                     setattr(self, name, value)
# 
#         return self
# 
#     @staticmethod
#     def value_to_time(value, format='%Y-%m-%dT%H:%M:%S+00:00'):
#         if value is not None:
#             return dateutil.parser.parse(value).replace(microsecond=0)
# 
# Path: messagebird/conversation_contact.py
# class ConversationContact(Base):
# 
#     def __init__(self):
#         self.id = None
#         self.href = None
#         self.msisdn = None
#         self.firstName = None
#         self.lastName = None
#         self._customDetails = None
#         self._createdDatetime = None
#         self._updatedDatetime = None
# 
#     @property
#     def customDetails(self):
#         return self._customDetails
# 
#     @customDetails.setter
#     def customDetails(self, value):
#         self._customDetails = CustomDetails().load(value)
# 
#     @property
#     def createdDatetime(self):
#         return self._createdDatetime
# 
#     @createdDatetime.setter
#     def createdDatetime(self, value):
#         self._createdDatetime = self.value_to_time(value, '%Y-%m-%dT%H:%M:%SZ')
# 
#     @property
#     def updatedDatetime(self):
#         return self._updatedDatetime
# 
#     @updatedDatetime.setter
#     def updatedDatetime(self, value):
#         self._updatedDatetime = self.value_to_time(value, '%Y-%m-%dT%H:%M:%SZ')
# 
# Path: messagebird/conversation_channel.py
# class Channel(Base):
#     def __init__(self):
#         self.id = None
#         self.name = None
#         self.platformId = None
#         self.status = None
#         self._createdDateTime = None
#         self._updatedDateTime = None
# 
#     @property
#     def createdDateTime(self):
#         return self._createdDateTime
# 
#     @createdDateTime.setter
#     def createdDateTime(self, value):
#         self._createdDateTime = self.value_to_time(value)
# 
#     @property
#     def updatedDateTime(self):
#         return self._updatedDateTime
# 
#     @updatedDateTime.setter
#     def updatedDateTime(self, value):
#         self._updatedDateTime = self.value_to_time(value)
# 
# Path: messagebird/conversation_message.py
# class ConversationMessageReference(Base):
#     def __init__(self):
#         self.totalCount = None
#         self.href = None
#         self.lastMessageId = None


from messagebird.base import Base
from messagebird.conversation_contact import ConversationContact
from messagebird.conversation_channel import Channel
from messagebird.conversation_message import ConversationMessageReference

CONVERSATION_STATUS_ACTIVE = "active"
CONVERSATION_STATUS_ARCHIVED = "archived"


class Conversation(Base):

    def __init__(self):
        self.id = None
        self.contactId = None
        self._contact = None
        self.lastUsedChannelId = None
        self._channels = None
        self._messages = None
        self.status = None
        self._createdDatetime = None
        self._updatedDatetime = None
        self._lastReceivedDatetime = None

    @property
    def contact(self):
        return self._contact

    @contact.setter
    def contact(self, value):

# Path: messagebird/base.py
# class Base:
#     def load(self, data):
#         if data is not None:
#             for name, value in list(data.items()):
#                 if hasattr(self, name) and not callable(getattr(self, name)):
#                     setattr(self, name, value)
# 
#         return self
# 
#     @staticmethod
#     def value_to_time(value, format='%Y-%m-%dT%H:%M:%S+00:00'):
#         if value is not None:
#             return dateutil.parser.parse(value).replace(microsecond=0)
# 
# Path: messagebird/conversation_contact.py
# class ConversationContact(Base):
# 
#     def __init__(self):
#         self.id = None
#         self.href = None
#         self.msisdn = None
#         self.firstName = None
#         self.lastName = None
#         self._customDetails = None
#         self._createdDatetime = None
#         self._updatedDatetime = None
# 
#     @property
#     def customDetails(self):
#         return self._customDetails
# 
#     @customDetails.setter
#     def customDetails(self, value):
#         self._customDetails = CustomDetails().load(value)
# 
#     @property
#     def createdDatetime(self):
#         return self._createdDatetime
# 
#     @createdDatetime.setter
#     def createdDatetime(self, value):
#         self._createdDatetime = self.value_to_time(value, '%Y-%m-%dT%H:%M:%SZ')
# 
#     @property
#     def updatedDatetime(self):
#         return self._updatedDatetime
# 
#     @updatedDatetime.setter
#     def updatedDatetime(self, value):
#         self._updatedDatetime = self.value_to_time(value, '%Y-%m-%dT%H:%M:%SZ')
# 
# Path: messagebird/conversation_channel.py
# class Channel(Base):
#     def __init__(self):
#         self.id = None
#         self.name = None
#         self.platformId = None
#         self.status = None
#         self._createdDateTime = None
#         self._updatedDateTime = None
# 
#     @property
#     def createdDateTime(self):
#         return self._createdDateTime
# 
#     @createdDateTime.setter
#     def createdDateTime(self, value):
#         self._createdDateTime = self.value_to_time(value)
# 
#     @property
#     def updatedDateTime(self):
#         return self._updatedDateTime
# 
#     @updatedDateTime.setter
#     def updatedDateTime(self, value):
#         self._updatedDateTime = self.value_to_time(value)
# 
# Path: messagebird/conversation_message.py
# class ConversationMessageReference(Base):
#     def __init__(self):
#         self.totalCount = None
#         self.href = None
#         self.lastMessageId = None


# Path: messagebird/conversation.py
from messagebird.base import Base
from messagebird.conversation_contact import ConversationContact
from messagebird.conversation_channel import Channel
from messagebird.conversation_message import ConversationMessageReference


CONVERSATION_STATUS_ACTIVE = "active"
CONVERSATION_STATUS_ARCHIVED = "archived"


class Conversation(Base):

    def __init__(self):
        self.id = None
        self.contactId = None
        self._contact = None
        self.lastUsedChannelId = None
        self._channels = None
        self._messages = None
        self.status = None
        self._createdDatetime = None
        self._updatedDatetime = None
        self._lastReceivedDatetime = None

    @property
    def contact(self):
        return self._contact

    @contact.setter
    def contact(self, value):

        self._contact = ConversationContact().load(value)