# -*- coding: utf-8 -*-

"""
    apimaticcalculatorlatest

    This file was automatically generated by APIMATIC v2.0 ( https://apimatic.io ).
"""


class MessageModel(object):

    """Implementation of the 'MessageModel' model.

    Model for one message

    Attributes:
        message (string): Message text
        created_at (string): Time when message created
        user (UserEnum): TODO: type description here.

    """

    # Create a mapping from Model property names to API property names
    _names = {
        "message":'message',
        "created_at":'createdAt',
        "user":'user'
    }

    def __init__(self,
                 message=None,
                 created_at=None,
                 user=None):
        """Constructor for the MessageModel class"""

        # Initialize members of the class
        self.message = message
        self.created_at = created_at
        self.user = user


    @classmethod
    def from_dictionary(cls,
                        dictionary):
        """Creates an instance of this model from a dictionary

        Args:
            dictionary (dictionary): A dictionary representation of the object as
            obtained from the deserialization of the server's response. The keys
            MUST match property names in the API description.

        Returns:
            object: An instance of this structure class.

        """
        if dictionary is None:
            return None

        # Extract variables from the dictionary
        message = dictionary.get('message')
        created_at = dictionary.get('createdAt')
        user = dictionary.get('user')

        # Return an object of this model
        return cls(message,
                   created_at,
                   user)


