# 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
    @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')

    @property
    def lastReceivedDatetime(self):
        return self._lastReceivedDatetime

    @lastReceivedDatetime.setter
    def lastReceivedDatetime(self, value):
        self._lastReceivedDatetime = self.value_to_time(value, '%Y-%m-%dT%H:%M:%SZ')

    def __str__(self):
        return "\n".join([
            'id                   : %s' % self.id,
            'contact id           : %s' % self.contactId,
            'last used channel id : %s' % self.lastUsedChannelId,
            'message id           : %s' % self.messages.lastMessageId,
            'message total count  : %s' % self.messages.totalCount,
            'status               : %s' % self.status,
            'created date time    : %s' % self.createdDatetime,
            'updated date time    : %s' % self.updatedDatetime,
            'last received date   : %s' % self.lastReceivedDatetime,
        ])



# 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

    @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')

    @property
    def lastReceivedDatetime(self):
        return self._lastReceivedDatetime

    @lastReceivedDatetime.setter
    def lastReceivedDatetime(self, value):
        self._lastReceivedDatetime = self.value_to_time(value, '%Y-%m-%dT%H:%M:%SZ')

    def __str__(self):
        return "\n".join([
            'id                   : %s' % self.id,
            'contact id           : %s' % self.contactId,
            'last used channel id : %s' % self.lastUsedChannelId,
            'message id           : %s' % self.messages.lastMessageId,
            'message total count  : %s' % self.messages.totalCount,
            'status               : %s' % self.status,
            'created date time    : %s' % self.createdDatetime,
            'updated date time    : %s' % self.updatedDatetime,
            'last received date   : %s' % self.lastReceivedDatetime,
        ])



class ConversationList(Base):