def encode_message(message):
 message.check_initialized()
 return json.dumps(message, cls=MessageJSONEncoder)

def encode_message ( message ) : message . check_initialized ( ) return json . dumps ( message , cls = MessageJSONEncoder )
encode message instance to json string .