/* 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 Sidebar
 */
export interface Sidebar {
  /**
   *
   * @type {string}
   * @memberof Sidebar
   */
  id: string
  /**
   *
   * @type {string}
   * @memberof Sidebar
   */
  singular: string
  /**
   *
   * @type {string}
   * @memberof Sidebar
   */
  plural: string
  /**
   *
   * @type {string}
   * @memberof Sidebar
   */
  icon?: string
  /**
   *
   * @type {number}
   * @memberof Sidebar
   */
  count: number
}

/**
 * Check if a given object implements the Sidebar interface.
 */
export function instanceOfSidebar(value: object): value is Sidebar {
  if (!('id' in value) || value['id'] === undefined) return false
  if (!('singular' in value) || value['singular'] === undefined) return false
  if (!('plural' in value) || value['plural'] === undefined) return false
  if (!('count' in value) || value['count'] === undefined) return false
  return true
}

export function SidebarFromJSON(json: any): Sidebar {
  return SidebarFromJSONTyped(json, false)
}

export function SidebarFromJSONTyped(json: any, ignoreDiscriminator: boolean): Sidebar {
  if (json == null) {
    return json
  }
  return {
    id: json['id'],
    singular: json['singular'],
    plural: json['plural'],
    icon: json['icon'] == null ? undefined : json['icon'],
    count: json['count']
  }
}

export function SidebarToJSON(json: any): Sidebar {
  return SidebarToJSONTyped(json, false)
}

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

  return {
    id: value['id'],
    singular: value['singular'],
    plural: value['plural'],
    icon: value['icon'],
    count: value['count']
  }
}
