/* 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 ModelFile
 */
export interface ModelFile {
  /**
   *
   * @type {string}
   * @memberof ModelFile
   */
  id: string
  /**
   *
   * @type {string}
   * @memberof ModelFile
   */
  ticket: string
  /**
   *
   * @type {string}
   * @memberof ModelFile
   */
  name: string
  /**
   *
   * @type {number}
   * @memberof ModelFile
   */
  size: number
  /**
   *
   * @type {Date}
   * @memberof ModelFile
   */
  created: Date
  /**
   *
   * @type {Date}
   * @memberof ModelFile
   */
  updated: Date
}

/**
 * Check if a given object implements the ModelFile interface.
 */
export function instanceOfModelFile(value: object): value is ModelFile {
  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 (!('size' in value) || value['size'] === 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 ModelFileFromJSON(json: any): ModelFile {
  return ModelFileFromJSONTyped(json, false)
}

export function ModelFileFromJSONTyped(json: any, ignoreDiscriminator: boolean): ModelFile {
  if (json == null) {
    return json
  }
  return {
    id: json['id'],
    ticket: json['ticket'],
    name: json['name'],
    size: json['size'],
    created: new Date(json['created']),
    updated: new Date(json['updated'])
  }
}

export function ModelFileToJSON(json: any): ModelFile {
  return ModelFileToJSONTyped(json, false)
}

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

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