"use strict";
/* tslint:disable */
/* eslint-disable */
/**
 * Montelo
 * Documentation for the Montelo API.
 *
 * The version of the OpenAPI document: 1.0
 *
 *
 * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
 * https://openapi-generator.tech
 * Do not edit the class manually.
 */
Object.defineProperty(exports, "__esModule", { value: true });
exports.ExperimentWithDatapointRunsDtoToJSON = exports.ExperimentWithDatapointRunsDtoFromJSONTyped = exports.ExperimentWithDatapointRunsDtoFromJSON = exports.instanceOfExperimentWithDatapointRunsDto = void 0;
const runtime_1 = require("../runtime");
const DatasetDto_1 = require("./DatasetDto");
const FullDatapointRunDto_1 = require("./FullDatapointRunDto");
/**
 * Check if a given object implements the ExperimentWithDatapointRunsDto interface.
 */
function instanceOfExperimentWithDatapointRunsDto(value) {
    let isInstance = true;
    isInstance = isInstance && "id" in value;
    isInstance = isInstance && "datasetId" in value;
    isInstance = isInstance && "createdAt" in value;
    isInstance = isInstance && "dataset" in value;
    isInstance = isInstance && "datapointRuns" in value;
    return isInstance;
}
exports.instanceOfExperimentWithDatapointRunsDto = instanceOfExperimentWithDatapointRunsDto;
function ExperimentWithDatapointRunsDtoFromJSON(json) {
    return ExperimentWithDatapointRunsDtoFromJSONTyped(json, false);
}
exports.ExperimentWithDatapointRunsDtoFromJSON = ExperimentWithDatapointRunsDtoFromJSON;
function ExperimentWithDatapointRunsDtoFromJSONTyped(json, ignoreDiscriminator) {
    if ((json === undefined) || (json === null)) {
        return json;
    }
    return {
        'id': json['id'],
        'datasetId': json['datasetId'],
        'name': !(0, runtime_1.exists)(json, 'name') ? undefined : json['name'],
        'description': !(0, runtime_1.exists)(json, 'description') ? undefined : json['description'],
        'createdAt': json['createdAt'],
        'dataset': (0, DatasetDto_1.DatasetDtoFromJSON)(json['dataset']),
        'datapointRuns': (json['datapointRuns'].map(FullDatapointRunDto_1.FullDatapointRunDtoFromJSON)),
    };
}
exports.ExperimentWithDatapointRunsDtoFromJSONTyped = ExperimentWithDatapointRunsDtoFromJSONTyped;
function ExperimentWithDatapointRunsDtoToJSON(value) {
    if (value === undefined) {
        return undefined;
    }
    if (value === null) {
        return null;
    }
    return {
        'id': value.id,
        'datasetId': value.datasetId,
        'name': value.name,
        'description': value.description,
        'createdAt': value.createdAt,
        'dataset': (0, DatasetDto_1.DatasetDtoToJSON)(value.dataset),
        'datapointRuns': (value.datapointRuns.map(FullDatapointRunDto_1.FullDatapointRunDtoToJSON)),
    };
}
exports.ExperimentWithDatapointRunsDtoToJSON = ExperimentWithDatapointRunsDtoToJSON;
