/* 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 ExtendedTicket
 */
export interface ExtendedTicket {
  /**
   *
   * @type {string}
   * @memberof ExtendedTicket
   */
  id: string
  /**
   *
   * @type {string}
   * @memberof ExtendedTicket
   */
  type: string
  /**
   *
   * @type {string}
   * @memberof ExtendedTicket
   */
  name: string
  /**
   *
   * @type {string}
   * @memberof ExtendedTicket
   */
  description: string
  /**
   *
   * @type {boolean}
   * @memberof ExtendedTicket
   */
  open: boolean
  /**
   *
   * @type {string}
   * @memberof ExtendedTicket
   */
  owner?: string
  /**
   *
   * @type {string}
   * @memberof ExtendedTicket
   */
  resolution?: string
  /**
   *
   * @type {object}
   * @memberof ExtendedTicket
   */
  schema: object
  /**
   *
   * @type {object}
   * @memberof ExtendedTicket
   */
  state: object
  /**
   *
   * @type {string}
   * @memberof ExtendedTicket
   */
  ownerName?: string
  /**
   *
   * @type {string}
   * @memberof ExtendedTicket
   */
  typeSingular: string
  /**
   *
   * @type {string}
   * @memberof ExtendedTicket
   */
  typePlural: string
  /**
   *
   * @type {Date}
   * @memberof ExtendedTicket
   */
  created: Date
  /**
   *
   * @type {Date}
   * @memberof ExtendedTicket
   */
  updated: Date
}

/**
 * Check if a given object implements the ExtendedTicket interface.
 */
export function instanceOfExtendedTicket(value: object): value is ExtendedTicket {
  if (!('id' in value) || value['id'] === undefined) return false
  if (!('type' in value) || value['type'] === undefined) return false
  if (!('name' in value) || value['name'] === undefined) return false
  if (!('description' in value) || value['description'] === undefined) return false
  if (!('open' in value) || value['open'] === undefined) return false
  if (!('schema' in value) || value['schema'] === undefined) return false
  if (!('state' in value) || value['state'] === undefined) return false
  if (!('typeSingular' in value) || value['typeSingular'] === undefined) return false
  if (!('typePlural' in value) || value['typePlural'] === 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 ExtendedTicketFromJSON(json: any): ExtendedTicket {
  return ExtendedTicketFromJSONTyped(json, false)
}

export function ExtendedTicketFromJSONTyped(
  json: any,
  ignoreDiscriminator: boolean
): ExtendedTicket {
  if (json == null) {
    return json
  }
  return {
    id: json['id'],
    type: json['type'],
    name: json['name'],
    description: json['description'],
    open: json['open'],
    owner: json['owner'] == null ? undefined : json['owner'],
    resolution: json['resolution'] == null ? undefined : json['resolution'],
    schema: json['schema'],
    state: json['state'],
    ownerName: json['owner_name'] == null ? undefined : json['owner_name'],
    typeSingular: json['type_singular'],
    typePlural: json['type_plural'],
    created: new Date(json['created']),
    updated: new Date(json['updated'])
  }
}

export function ExtendedTicketToJSON(json: any): ExtendedTicket {
  return ExtendedTicketToJSONTyped(json, false)
}

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

  return {
    id: value['id'],
    type: value['type'],
    name: value['name'],
    description: value['description'],
    open: value['open'],
    owner: value['owner'],
    resolution: value['resolution'],
    schema: value['schema'],
    state: value['state'],
    owner_name: value['ownerName'],
    type_singular: value['typeSingular'],
    type_plural: value['typePlural'],
    created: value['created'].toISOString(),
    updated: value['updated'].toISOString()
  }
}
