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

/**
 * Check if a given object implements the ExtendedTask interface.
 */
export function instanceOfExtendedTask(value: object): value is ExtendedTask {
  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 (!('ticketName' in value) || value['ticketName'] === undefined) return false
  if (!('ticketType' in value) || value['ticketType'] === 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 ExtendedTaskFromJSON(json: any): ExtendedTask {
  return ExtendedTaskFromJSONTyped(json, false)
}

export function ExtendedTaskFromJSONTyped(json: any, ignoreDiscriminator: boolean): ExtendedTask {
  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'],
    ownerName: json['owner_name'] == null ? undefined : json['owner_name'],
    ticketName: json['ticket_name'],
    ticketType: json['ticket_type'],
    created: new Date(json['created']),
    updated: new Date(json['updated'])
  }
}

export function ExtendedTaskToJSON(json: any): ExtendedTask {
  return ExtendedTaskToJSONTyped(json, false)
}

export function ExtendedTaskToJSONTyped(
  value?: ExtendedTask | 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'],
    owner_name: value['ownerName'],
    ticket_name: value['ticketName'],
    ticket_type: value['ticketType'],
    created: value['created'].toISOString(),
    updated: value['updated'].toISOString()
  }
}
