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

/**
 * Check if a given object implements the ExtendedComment interface.
 */
export function instanceOfExtendedComment(value: object): value is ExtendedComment {
  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 (!('authorName' in value) || value['authorName'] === 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 ExtendedCommentFromJSON(json: any): ExtendedComment {
  return ExtendedCommentFromJSONTyped(json, false)
}

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

export function ExtendedCommentToJSON(json: any): ExtendedComment {
  return ExtendedCommentToJSONTyped(json, false)
}

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

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