@staticmethod
def parse(wmsg):
    '\n      Verifies and parses an unserialized raw message into an actual WAMP message instance.\n\n      :param wmsg: The unserialized raw message.\n      :type wmsg: list\n\n      :returns: An instance of this class.\n      '
    assert ((len(wmsg) > 0) and (wmsg[0] == Heartbeat.MESSAGE_TYPE))
    if (len(wmsg) not in [3, 4]):
        raise ProtocolError('invalid message length {0} for HEARTBEAT'.format(len(wmsg)))
    incoming = wmsg[1]
    if (type(incoming) not in six.integer_types):
        raise ProtocolError("invalid type {0} for 'incoming' in HEARTBEAT".format(type(incoming)))
    if (incoming < 0):
        raise ProtocolError("invalid value {0} for 'incoming' in HEARTBEAT".format(incoming))
    outgoing = wmsg[2]
    if (type(outgoing) not in six.integer_types):
        raise ProtocolError("invalid type {0} for 'outgoing' in HEARTBEAT".format(type(outgoing)))
    if (outgoing <= 0):
        raise ProtocolError("invalid value {0} for 'outgoing' in HEARTBEAT".format(outgoing))
    discard = None
    if (len(wmsg) > 3):
        discard = wmsg[3]
        if (type(discard) != six.text_type):
            raise ProtocolError("invalid type {0} for 'discard' in HEARTBEAT".format(type(discard)))
    obj = Heartbeat(incoming, outgoing, discard=discard)
    return obj
Verifies and parses an unserialized raw message into an actual WAMP message instance.

:param wmsg: The unserialized raw message.
:type wmsg: list

:returns: An instance of this class.
@staticmethod
def parse(wmsg):
    '\n      Verifies and parses an unserialized raw message into an actual WAMP message instance.\n\n      :param wmsg: The unserialized raw message.\n      :type wmsg: list\n\n      :returns: An instance of this class.\n      '
    assert ((len(wmsg) > 0) and (wmsg[0] == Heartbeat.MESSAGE_TYPE))
    if (len(wmsg) not in [3, 4]):
        raise ProtocolError('invalid message length {0} for HEARTBEAT'.format(len(wmsg)))
    incoming = wmsg[1]
    if (type(incoming) not in six.integer_types):
        raise ProtocolError("invalid type {0} for 'incoming' in HEARTBEAT".format(type(incoming)))
    if (incoming < 0):
        raise ProtocolError("invalid value {0} for 'incoming' in HEARTBEAT".format(incoming))
    outgoing = wmsg[2]
    if (type(outgoing) not in six.integer_types):
        raise ProtocolError("invalid type {0} for 'outgoing' in HEARTBEAT".format(type(outgoing)))
    if (outgoing <= 0):
        raise ProtocolError("invalid value {0} for 'outgoing' in HEARTBEAT".format(outgoing))
    discard = None
    if (len(wmsg) > 3):
        discard = wmsg[3]
        if (type(discard) != six.text_type):
            raise ProtocolError("invalid type {0} for 'discard' in HEARTBEAT".format(type(discard)))
    obj = Heartbeat(incoming, outgoing, discard=discard)
    return obj