/* 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 Reaction
 */
export interface Reaction {
  /**
   *
   * @type {string}
   * @memberof Reaction
   */
  id: string
  /**
   *
   * @type {string}
   * @memberof Reaction
   */
  name: string
  /**
   *
   * @type {string}
   * @memberof Reaction
   */
  action: string
  /**
   *
   * @type {object}
   * @memberof Reaction
   */
  actiondata: object
  /**
   *
   * @type {string}
   * @memberof Reaction
   */
  trigger: string
  /**
   *
   * @type {object}
   * @memberof Reaction
   */
  triggerdata: object
  /**
   *
   * @type {Date}
   * @memberof Reaction
   */
  created: Date
  /**
   *
   * @type {Date}
   * @memberof Reaction
   */
  updated: Date
}

/**
 * Check if a given object implements the Reaction interface.
 */
export function instanceOfReaction(value: object): value is Reaction {
  if (!('id' in value) || value['id'] === undefined) return false
  if (!('name' in value) || value['name'] === undefined) return false
  if (!('action' in value) || value['action'] === undefined) return false
  if (!('actiondata' in value) || value['actiondata'] === undefined) return false
  if (!('trigger' in value) || value['trigger'] === undefined) return false
  if (!('triggerdata' in value) || value['triggerdata'] === 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 ReactionFromJSON(json: any): Reaction {
  return ReactionFromJSONTyped(json, false)
}

export function ReactionFromJSONTyped(json: any, ignoreDiscriminator: boolean): Reaction {
  if (json == null) {
    return json
  }
  return {
    id: json['id'],
    name: json['name'],
    action: json['action'],
    actiondata: json['actiondata'],
    trigger: json['trigger'],
    triggerdata: json['triggerdata'],
    created: new Date(json['created']),
    updated: new Date(json['updated'])
  }
}

export function ReactionToJSON(json: any): Reaction {
  return ReactionToJSONTyped(json, false)
}

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

  return {
    id: value['id'],
    name: value['name'],
    action: value['action'],
    actiondata: value['actiondata'],
    trigger: value['trigger'],
    triggerdata: value['triggerdata'],
    created: value['created'].toISOString(),
    updated: value['updated'].toISOString()
  }
}
