fromJSON static method

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

Implementation

static Episode 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.embed.DecryptedEpisode":
			return DecryptedEpisode.fromJSON(data);
		case "com.icure.cardinal.sdk.model.embed.EncryptedEpisode":
			return EncryptedEpisode.fromJSON(data);
		default:
			throw ArgumentError('Invalid subclass $discriminator');
	}
}