'Create a new message.
Args:
message_type (str): The type associated with this message. Most be `WARNING` or `ERROR`.
message_text (unicode): The textual message.
action_label (unicode): Text to show on a "fix-up" action (optional). If present, either `action_class`
or `action_runtime_event` should be specified.
action_class (str): A class to link to the "fix-up" action (optional). A click handler must be added
for this class, unless it is "edit-button", "duplicate-button", or "delete-button" (which are all
handled in general for xblock instances.
action_runtime_event (str): An event name to be triggered on the xblock client-side runtime when
the "fix-up" action is clicked (optional).'

def __init__(self, message_type, message_text, action_label=None, action_class=None, action_runtime_event=None):

    super(StudioValidationMessage, self).__init__(message_type, message_text)
    if (action_label is not None):
        if (not isinstance(action_label, unicode)):
            raise TypeError('Action    label    must    be    unicode.')
        self.action_label = action_label
    if (action_class is not None):
        if (not isinstance(action_class, basestring)):
            raise TypeError('Action    class    must    be    a    string.')
        self.action_class = action_class
    if (action_runtime_event is not None):
        if (not isinstance(action_runtime_event, basestring)):
            raise TypeError('Action    runtime    event    must    be    a    string.')
        self.action_runtime_event = action_runtime_event
