fromJSON static method

Message fromJSON(
  1. Map<String, dynamic> data
)
override

Implementation

static Message fromJSON(Map<String, dynamic> data) {
	if (data["kotlinType"] == null) {
		throw ArgumentError('Missing discriminator: kotlinType');
	}
	String discriminator = data["kotlinType"];
	switch (discriminator) {
		case "com.icure.cardinal.sdk.model.DecryptedMessage":
			return DecryptedMessage.fromJSON(data);
		case "com.icure.cardinal.sdk.model.EncryptedMessage":
			return EncryptedMessage.fromJSON(data);
		default:
			throw ArgumentError('Invalid subclass $discriminator');
	}
}