/* 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 NewTicket
 */
export interface NewTicket {
  /**
   *
   * @type {string}
   * @memberof NewTicket
   */
  type: string
  /**
   *
   * @type {string}
   * @memberof NewTicket
   */
  name: string
  /**
   *
   * @type {string}
   * @memberof NewTicket
   */
  description: string
  /**
   *
   * @type {boolean}
   * @memberof NewTicket
   */
  open: boolean
  /**
   *
   * @type {string}
   * @memberof NewTicket
   */
  owner?: string
  /**
   *
   * @type {string}
   * @memberof NewTicket
   */
  resolution?: string
  /**
   *
   * @type {object}
   * @memberof NewTicket
   */
  schema: object
  /**
   *
   * @type {object}
   * @memberof NewTicket
   */
  state: object
}

/**
 * Check if a given object implements the NewTicket interface.
 */
export function instanceOfNewTicket(value: object): value is NewTicket {
  if (!('type' in value) || value['type'] === undefined) return false
  if (!('name' in value) || value['name'] === undefined) return false
  if (!('description' in value) || value['description'] === undefined) return false
  if (!('open' in value) || value['open'] === undefined) return false
  if (!('schema' in value) || value['schema'] === undefined) return false
  if (!('state' in value) || value['state'] === undefined) return false
  return true
}

export function NewTicketFromJSON(json: any): NewTicket {
  return NewTicketFromJSONTyped(json, false)
}

export function NewTicketFromJSONTyped(json: any, ignoreDiscriminator: boolean): NewTicket {
  if (json == null) {
    return json
  }
  return {
    type: json['type'],
    name: json['name'],
    description: json['description'],
    open: json['open'],
    owner: json['owner'] == null ? undefined : json['owner'],
    resolution: json['resolution'] == null ? undefined : json['resolution'],
    schema: json['schema'],
    state: json['state']
  }
}

export function NewTicketToJSON(json: any): NewTicket {
  return NewTicketToJSONTyped(json, false)
}

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

  return {
    type: value['type'],
    name: value['name'],
    description: value['description'],
    open: value['open'],
    owner: value['owner'],
    resolution: value['resolution'],
    schema: value['schema'],
    state: value['state']
  }
}
