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

/**
 * Check if a given object implements the Link interface.
 */
export function instanceOfLink(value: object): value is Link {
  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 (!('url' in value) || value['url'] === 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 LinkFromJSON(json: any): Link {
  return LinkFromJSONTyped(json, false)
}

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

export function LinkToJSON(json: any): Link {
  return LinkToJSONTyped(json, false)
}

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

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