/* 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 Type
 */
export interface Type {
  /**
   *
   * @type {string}
   * @memberof Type
   */
  id: string
  /**
   *
   * @type {string}
   * @memberof Type
   */
  icon?: string
  /**
   *
   * @type {string}
   * @memberof Type
   */
  plural: string
  /**
   *
   * @type {object}
   * @memberof Type
   */
  schema: object
  /**
   *
   * @type {string}
   * @memberof Type
   */
  singular: string
  /**
   *
   * @type {Date}
   * @memberof Type
   */
  created: Date
  /**
   *
   * @type {Date}
   * @memberof Type
   */
  updated: Date
}

/**
 * Check if a given object implements the Type interface.
 */
export function instanceOfType(value: object): value is Type {
  if (!('id' in value) || value['id'] === undefined) return false
  if (!('plural' in value) || value['plural'] === undefined) return false
  if (!('schema' in value) || value['schema'] === undefined) return false
  if (!('singular' in value) || value['singular'] === 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 TypeFromJSON(json: any): Type {
  return TypeFromJSONTyped(json, false)
}

export function TypeFromJSONTyped(json: any, ignoreDiscriminator: boolean): Type {
  if (json == null) {
    return json
  }
  return {
    id: json['id'],
    icon: json['icon'] == null ? undefined : json['icon'],
    plural: json['plural'],
    schema: json['schema'],
    singular: json['singular'],
    created: new Date(json['created']),
    updated: new Date(json['updated'])
  }
}

export function TypeToJSON(json: any): Type {
  return TypeToJSONTyped(json, false)
}

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

  return {
    id: value['id'],
    icon: value['icon'],
    plural: value['plural'],
    schema: value['schema'],
    singular: value['singular'],
    created: value['created'].toISOString(),
    updated: value['updated'].toISOString()
  }
}
