def decode_message(self, message_type, encoded_message):
        """Merge JSON structure to Message instance.

        Args:
          message_type: Message to decode data to.
          encoded_message: JSON encoded version of message.

        Returns:
          Decoded instance of message_type.

        Raises:
          ValueError: If encoded_message is not valid JSON.
          messages.ValidationError if merged message is not initialized.
        """
        encoded_message = six.ensure_str(encoded_message)
        if not encoded_message.strip():
            return message_type()

        dictionary = json.loads(encoded_message)
        message = self.__decode_dictionary(message_type, dictionary)
        message.check_initialized()
        return message
def decode_message ( self , message_type , encoded_message ) : encoded_message = six . ensure_str ( encoded_message ) if not encoded_message . strip ( ) : return message_type ( ) dictionary = json . loads ( encoded_message ) message = self . __decode_dictionary ( message_type , dictionary ) message . check_initialized ( ) return message
Merge JSON structure to Message instance.

        Args:
          message_type: Message to decode data to.
          encoded_message: JSON encoded version of message.

        Returns:
          Decoded instance of message_type.

        Raises:
          ValueError: If encoded_message is not valid JSON.
          messages.ValidationError if merged message is not initialized.