/* 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'
import type { Table } from './Table'
import { TableFromJSON, TableFromJSONTyped, TableToJSON, TableToJSONTyped } from './Table'

/**
 *
 * @export
 * @interface Config
 */
export interface Config {
  /**
   *
   * @type {Array<string>}
   * @memberof Config
   */
  flags: Array<string>
  /**
   *
   * @type {Array<string>}
   * @memberof Config
   */
  permissions: Array<string>
  /**
   *
   * @type {Array<Table>}
   * @memberof Config
   */
  tables: Array<Table>
}

/**
 * Check if a given object implements the Config interface.
 */
export function instanceOfConfig(value: object): value is Config {
  if (!('flags' in value) || value['flags'] === undefined) return false
  if (!('permissions' in value) || value['permissions'] === undefined) return false
  if (!('tables' in value) || value['tables'] === undefined) return false
  return true
}

export function ConfigFromJSON(json: any): Config {
  return ConfigFromJSONTyped(json, false)
}

export function ConfigFromJSONTyped(json: any, ignoreDiscriminator: boolean): Config {
  if (json == null) {
    return json
  }
  return {
    flags: json['flags'],
    permissions: json['permissions'],
    tables: (json['tables'] as Array<any>).map(TableFromJSON)
  }
}

export function ConfigToJSON(json: any): Config {
  return ConfigToJSONTyped(json, false)
}

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

  return {
    flags: value['flags'],
    permissions: value['permissions'],
    tables: (value['tables'] as Array<any>).map(TableToJSON)
  }
}
