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

/**
 * Check if a given object implements the Comment interface.
 */
export function instanceOfComment(value: object): value is Comment {
  if (!('id' in value) || value['id'] === undefined) return false
  if (!('ticket' in value) || value['ticket'] === undefined) return false
  if (!('author' in value) || value['author'] === undefined) return false
  if (!('message' in value) || value['message'] === 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 CommentFromJSON(json: any): Comment {
  return CommentFromJSONTyped(json, false)
}

export function CommentFromJSONTyped(json: any, ignoreDiscriminator: boolean): Comment {
  if (json == null) {
    return json
  }
  return {
    id: json['id'],
    ticket: json['ticket'],
    author: json['author'],
    message: json['message'],
    created: new Date(json['created']),
    updated: new Date(json['updated'])
  }
}

export function CommentToJSON(json: any): Comment {
  return CommentToJSONTyped(json, false)
}

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

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