/* tslint:disable */
/* eslint-disable */
/**
 * Ticketing System API
 * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
 *
 * The version of the OpenAPI document: 1.0.0
 *
 *
 * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
 * https://openapi-generator.tech
 * Do not edit the class manually.
 */
import { mapValues } from '../runtime'

/**
 *
 * @export
 * @interface TimelineEntry
 */
export interface TimelineEntry {
  /**
   *
   * @type {string}
   * @memberof TimelineEntry
   */
  id: string
  /**
   *
   * @type {string}
   * @memberof TimelineEntry
   */
  ticket: string
  /**
   *
   * @type {string}
   * @memberof TimelineEntry
   */
  message: string
  /**
   *
   * @type {Date}
   * @memberof TimelineEntry
   */
  time: Date
  /**
   *
   * @type {Date}
   * @memberof TimelineEntry
   */
  created: Date
  /**
   *
   * @type {Date}
   * @memberof TimelineEntry
   */
  updated: Date
}

/**
 * Check if a given object implements the TimelineEntry interface.
 */
export function instanceOfTimelineEntry(value: object): value is TimelineEntry {
  if (!('id' in value) || value['id'] === undefined) return false
  if (!('ticket' in value) || value['ticket'] === undefined) return false
  if (!('message' in value) || value['message'] === undefined) return false
  if (!('time' in value) || value['time'] === undefined) return false
  if (!('created' in value) || value['created'] === undefined) return false
  if (!('updated' in value) || value['updated'] === undefined) return false
  return true
}

export function TimelineEntryFromJSON(json: any): TimelineEntry {
  return TimelineEntryFromJSONTyped(json, false)
}

export function TimelineEntryFromJSONTyped(json: any, ignoreDiscriminator: boolean): TimelineEntry {
  if (json == null) {
    return json
  }
  return {
    id: json['id'],
    ticket: json['ticket'],
    message: json['message'],
    time: new Date(json['time']),
    created: new Date(json['created']),
    updated: new Date(json['updated'])
  }
}

export function TimelineEntryToJSON(json: any): TimelineEntry {
  return TimelineEntryToJSONTyped(json, false)
}

export function TimelineEntryToJSONTyped(
  value?: TimelineEntry | null,
  ignoreDiscriminator: boolean = false
): any {
  if (value == null) {
    return value
  }

  return {
    id: value['id'],
    ticket: value['ticket'],
    message: value['message'],
    time: value['time'].toISOString(),
    created: value['created'].toISOString(),
    updated: value['updated'].toISOString()
  }
}
