fromJSON static method

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

Implementation

static CryptoActor 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.CryptoActorStub":
			return CryptoActorStub.fromJSON(data);
		case "com.icure.cardinal.sdk.model.EncryptedPatient":
			return EncryptedPatient.fromJSON(data);
		case "com.icure.cardinal.sdk.model.DecryptedPatient":
			return DecryptedPatient.fromJSON(data);
		case "com.icure.cardinal.sdk.model.Device":
			return Device.fromJSON(data);
		case "com.icure.cardinal.sdk.model.HealthcareParty":
			return HealthcareParty.fromJSON(data);
		default:
			throw ArgumentError('Invalid subclass $discriminator');
	}
}