/* 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 Task
 */
export interface Task {
  /**
   *
   * @type {string}
   * @memberof Task
   */
  id: string
  /**
   *
   * @type {string}
   * @memberof Task
   */
  ticket: string
  /**
   *
   * @type {string}
   * @memberof Task
   */
  name: string
  /**
   *
   * @type {boolean}
   * @memberof Task
   */
  open: boolean
  /**
   *
   * @type {string}
   * @memberof Task
   */
  owner?: string
  /**
   *
   * @type {Date}
   * @memberof Task
   */
  created: Date
  /**
   *
   * @type {Date}
   * @memberof Task
   */
  updated: Date
}

/**
 * Check if a given object implements the Task interface.
 */
export function instanceOfTask(value: object): value is Task {
  if (!('id' in value) || value['id'] === undefined) return false
  if (!('ticket' in value) || value['ticket'] === undefined) return false
  if (!('name' in value) || value['name'] === undefined) return false
  if (!('open' in value) || value['open'] === 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 TaskFromJSON(json: any): Task {
  return TaskFromJSONTyped(json, false)
}

export function TaskFromJSONTyped(json: any, ignoreDiscriminator: boolean): Task {
  if (json == null) {
    return json
  }
  return {
    id: json['id'],
    ticket: json['ticket'],
    name: json['name'],
    open: json['open'],
    owner: json['owner'] == null ? undefined : json['owner'],
    created: new Date(json['created']),
    updated: new Date(json['updated'])
  }
}

export function TaskToJSON(json: any): Task {
  return TaskToJSONTyped(json, false)
}

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

  return {
    id: value['id'],
    ticket: value['ticket'],
    name: value['name'],
    open: value['open'],
    owner: value['owner'],
    created: value['created'].toISOString(),
    updated: value['updated'].toISOString()
  }
}
