def __init__(self, parent, definition):
        """Constructor.

        Required Arguments:
            parent: Account object - parent is an Account object.
            definition: a dictionary of parameters. The 'message_id' parameter is
                required to make method calls.
        """

        super(Message, self).__init__(parent, 'messages/{message_id}', definition)

        if 'files' in definition:
            self.files = [File(self.parent, file) for file in definition['files']]

        # some calls optionally return a message with some extra data
        if 'body' in definition:
            self.body = definition['body']
        if 'flags' in definition:
            self.flags = definition['flags']
        if 'headers' in definition:
            self.headers = definition['headers']
dataset/ETHPy150Open contextio/Python-ContextIO/contextio/lib/resources/message.py/Message.__init__/original