/* tslint:disable */
/* eslint-disable */
/**
 * Dash API
 * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
 *
 * The version of the OpenAPI document: 0.1
 * 
 *
 * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
 * https://openapi-generator.tech
 * Do not edit the class manually.
 */

import { exists, mapValues } from '../runtime';
import type { TrackingItem } from './TrackingItem';
import {
    TrackingItemFromJSON,
    TrackingItemFromJSONTyped,
    TrackingItemToJSON,
} from './TrackingItem';

/**
 * 
 * @export
 * @interface TrackingEntry
 */
export interface TrackingEntry {
    /**
     * 
     * @type {Date}
     * @memberof TrackingEntry
     */
    date: Date;
    /**
     * 
     * @type {Array<TrackingItem>}
     * @memberof TrackingEntry
     */
    items: Array<TrackingItem>;
}

/**
 * Check if a given object implements the TrackingEntry interface.
 */
export function instanceOfTrackingEntry(value: object): boolean {
    let isInstance = true;
    isInstance = isInstance && "date" in value;
    isInstance = isInstance && "items" in value;

    return isInstance;
}

export function TrackingEntryFromJSON(json: any): TrackingEntry {
    return TrackingEntryFromJSONTyped(json, false);
}

export function TrackingEntryFromJSONTyped(json: any, ignoreDiscriminator: boolean): TrackingEntry {
    if ((json === undefined) || (json === null)) {
        return json;
    }
    return {
        
        'date': (new Date(json['date'])),
        'items': ((json['items'] as Array<any>).map(TrackingItemFromJSON)),
    };
}

export function TrackingEntryToJSON(value?: TrackingEntry | null): any {
    if (value === undefined) {
        return undefined;
    }
    if (value === null) {
        return null;
    }
    return {
        
        'date': (value.date.toISOString().substr(0,10)),
        'items': ((value.items as Array<any>).map(TrackingItemToJSON)),
    };
}

