   return result
 }
 
+fileprivate func message(ofType messageType: Message.Type, typeURL: String, contentJSON: Data) throws -> Message {
+  var any = Google_Protobuf_Any()
+  any.typeURL = typeURL
+  any._storage._contentJSON = contentJSON
+  any._storage._valueData = nil
+  return try messageType.init(unpackingAny: any)
+}
+
 internal class AnyMessageStorage {
   var _typeURL: String = ""
 

      let contentJSONAsObject = asJSONObject(body: contentJSON)
      // If we can decode it, we can write the readable verbose form:
      if let messageType = Google_Protobuf_Any.messageType(forTypeURL: _typeURL) {
        var any = Google_Protobuf_Any()
        any.typeURL = _typeURL
        any._storage._contentJSON = contentJSON
        any._storage._valueData = nil
        do {
          let m = try messageType.init(unpackingAny: any)
          emitVerboseTextForm(visitor: &visitor, message: m, typeURL: _typeURL)
          return
        } catch {

      if let contentJSON = _contentJSON, !_typeURL.isEmpty {
        if let messageType = Google_Protobuf_Any.messageType(forTypeURL: _typeURL) {
          do {
            let m = try message(ofType: messageType, typeURL: _typeURL, contentJSON: contentJSON)
            return try m.serializedData(partial: true)
          } catch {
            return Data()
