"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.TraceWithLogsDtoToJSON = exports.TraceWithLogsDtoFromJSONTyped = exports.TraceWithLogsDtoFromJSON = exports.instanceOfTraceWithLogsDto = void 0;
const runtime_1 = require("../runtime");
const LogDto_1 = require("./LogDto");
/**
 * Check if a given object implements the TraceWithLogsDto interface.
 */
function instanceOfTraceWithLogsDto(value) {
    let isInstance = true;
    isInstance = isInstance && "id" in value;
    isInstance = isInstance && "envId" in value;
    isInstance = isInstance && "name" in value;
    isInstance = isInstance && "inputTokens" in value;
    isInstance = isInstance && "outputTokens" in value;
    isInstance = isInstance && "totalTokens" in value;
    isInstance = isInstance && "inputCost" in value;
    isInstance = isInstance && "outputCost" in value;
    isInstance = isInstance && "totalCost" in value;
    isInstance = isInstance && "startTime" in value;
    isInstance = isInstance && "endTime" in value;
    isInstance = isInstance && "duration" in value;
    isInstance = isInstance && "tags" in value;
    isInstance = isInstance && "extra" in value;
    isInstance = isInstance && "logs" in value;
    return isInstance;
}
exports.instanceOfTraceWithLogsDto = instanceOfTraceWithLogsDto;
function TraceWithLogsDtoFromJSON(json) {
    return TraceWithLogsDtoFromJSONTyped(json, false);
}
exports.TraceWithLogsDtoFromJSON = TraceWithLogsDtoFromJSON;
function TraceWithLogsDtoFromJSONTyped(json, ignoreDiscriminator) {
    if ((json === undefined) || (json === null)) {
        return json;
    }
    return {
        'id': json['id'],
        'envId': json['envId'],
        'name': json['name'],
        'inputTokens': json['inputTokens'],
        'outputTokens': json['outputTokens'],
        'totalTokens': json['totalTokens'],
        'inputCost': json['inputCost'],
        'outputCost': json['outputCost'],
        'totalCost': json['totalCost'],
        'startTime': json['startTime'],
        'endTime': json['endTime'],
        'duration': json['duration'],
        'userId': !(0, runtime_1.exists)(json, 'userId') ? undefined : json['userId'],
        'tags': json['tags'],
        'extra': json['extra'],
        'logs': (json['logs'].map(LogDto_1.LogDtoFromJSON)),
    };
}
exports.TraceWithLogsDtoFromJSONTyped = TraceWithLogsDtoFromJSONTyped;
function TraceWithLogsDtoToJSON(value) {
    if (value === undefined) {
        return undefined;
    }
    if (value === null) {
        return null;
    }
    return {
        'id': value.id,
        'envId': value.envId,
        'name': value.name,
        'inputTokens': value.inputTokens,
        'outputTokens': value.outputTokens,
        'totalTokens': value.totalTokens,
        'inputCost': value.inputCost,
        'outputCost': value.outputCost,
        'totalCost': value.totalCost,
        'startTime': value.startTime,
        'endTime': value.endTime,
        'duration': value.duration,
        'userId': value.userId,
        'tags': value.tags,
        'extra': value.extra,
        'logs': (value.logs.map(LogDto_1.LogDtoToJSON)),
    };
}
exports.TraceWithLogsDtoToJSON = TraceWithLogsDtoToJSON;
