"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.DataOwnerWithType = void 0;
/**
 * iCure Data Stack API Documentation
 * The iCure Data Stack Application API is the native interface to iCure. This version is obsolete, please use v2.
 *
 * OpenAPI spec version: v1
 *
 *
 * NOTE: This class is auto generated by the swagger code generator program.
 * https://github.com/swagger-api/swagger-codegen.git
 * Do not edit the class manually.
 */
const DataOwnerTypeEnum_1 = require("./DataOwnerTypeEnum");
const HealthcareParty_1 = require("./HealthcareParty");
const Patient_1 = require("./Patient");
const Device_1 = require("./Device");
var DataOwnerWithType;
(function (DataOwnerWithType) {
    function fromJson(json) {
        if (json.type === DataOwnerTypeEnum_1.DataOwnerTypeEnum.Hcp) {
            return { type: DataOwnerTypeEnum_1.DataOwnerTypeEnum.Hcp, dataOwner: new HealthcareParty_1.HealthcareParty(json.dataOwner) };
        }
        else if (json.type === DataOwnerTypeEnum_1.DataOwnerTypeEnum.Patient) {
            return { type: DataOwnerTypeEnum_1.DataOwnerTypeEnum.Patient, dataOwner: new Patient_1.Patient(json.dataOwner) };
        }
        else if (json.type === DataOwnerTypeEnum_1.DataOwnerTypeEnum.Device) {
            return { type: DataOwnerTypeEnum_1.DataOwnerTypeEnum.Device, dataOwner: new Device_1.Device(json.dataOwner) };
        }
        else
            throw new Error(`Unknown data owner type ${json.type}`);
    }
    DataOwnerWithType.fromJson = fromJson;
})(DataOwnerWithType || (exports.DataOwnerWithType = DataOwnerWithType = {}));
//# sourceMappingURL=DataOwnerWithType.js.map