/* 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 TicketSearch
 */
export interface TicketSearch {
  /**
   *
   * @type {string}
   * @memberof TicketSearch
   */
  id: string
  /**
   *
   * @type {string}
   * @memberof TicketSearch
   */
  name: string
  /**
   *
   * @type {string}
   * @memberof TicketSearch
   */
  description: string
  /**
   *
   * @type {boolean}
   * @memberof TicketSearch
   */
  open: boolean
  /**
   *
   * @type {string}
   * @memberof TicketSearch
   */
  type: string
  /**
   *
   * @type {object}
   * @memberof TicketSearch
   */
  state: object
  /**
   *
   * @type {string}
   * @memberof TicketSearch
   */
  ownerName: string
  /**
   *
   * @type {Date}
   * @memberof TicketSearch
   */
  created: Date
}

/**
 * Check if a given object implements the TicketSearch interface.
 */
export function instanceOfTicketSearch(value: object): value is TicketSearch {
  if (!('id' in value) || value['id'] === 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 (!('type' in value) || value['type'] === undefined) return false
  if (!('state' in value) || value['state'] === undefined) return false
  if (!('ownerName' in value) || value['ownerName'] === undefined) return false
  if (!('created' in value) || value['created'] === undefined) return false
  return true
}

export function TicketSearchFromJSON(json: any): TicketSearch {
  return TicketSearchFromJSONTyped(json, false)
}

export function TicketSearchFromJSONTyped(json: any, ignoreDiscriminator: boolean): TicketSearch {
  if (json == null) {
    return json
  }
  return {
    id: json['id'],
    name: json['name'],
    description: json['description'],
    open: json['open'],
    type: json['type'],
    state: json['state'],
    ownerName: json['owner_name'],
    created: new Date(json['created'])
  }
}

export function TicketSearchToJSON(json: any): TicketSearch {
  return TicketSearchToJSONTyped(json, false)
}

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

  return {
    id: value['id'],
    name: value['name'],
    description: value['description'],
    open: value['open'],
    type: value['type'],
    state: value['state'],
    owner_name: value['ownerName'],
    created: value['created'].toISOString()
  }
}
