/* 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';
/**
 * 
 * @export
 * @interface JournalEntry
 */
export interface JournalEntry {
    /**
     * 
     * @type {Date}
     * @memberof JournalEntry
     */
    date: Date;
    /**
     * 
     * @type {Array<string>}
     * @memberof JournalEntry
     */
    thankful?: Array<string>;
    /**
     * 
     * @type {Array<string>}
     * @memberof JournalEntry
     */
    lookingForward?: Array<string>;
    /**
     * 
     * @type {Array<string>}
     * @memberof JournalEntry
     */
    beenGreat?: Array<string>;
    /**
     * 
     * @type {Array<string>}
     * @memberof JournalEntry
     */
    doBetter?: Array<string>;
    /**
     * 
     * @type {string}
     * @memberof JournalEntry
     */
    journal?: string;
}

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

    return isInstance;
}

export function JournalEntryFromJSON(json: any): JournalEntry {
    return JournalEntryFromJSONTyped(json, false);
}

export function JournalEntryFromJSONTyped(json: any, ignoreDiscriminator: boolean): JournalEntry {
    if ((json === undefined) || (json === null)) {
        return json;
    }
    return {
        
        'date': (new Date(json['date'])),
        'thankful': !exists(json, 'thankful') ? undefined : json['thankful'],
        'lookingForward': !exists(json, 'looking_forward') ? undefined : json['looking_forward'],
        'beenGreat': !exists(json, 'been_great') ? undefined : json['been_great'],
        'doBetter': !exists(json, 'do_better') ? undefined : json['do_better'],
        'journal': !exists(json, 'journal') ? undefined : json['journal'],
    };
}

export function JournalEntryToJSON(value?: JournalEntry | null): any {
    if (value === undefined) {
        return undefined;
    }
    if (value === null) {
        return null;
    }
    return {
        
        'date': (value.date.toISOString().substr(0,10)),
        'thankful': value.thankful,
        'looking_forward': value.lookingForward,
        'been_great': value.beenGreat,
        'do_better': value.doBetter,
        'journal': value.journal,
    };
}

