/* 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 Group
 */
export interface Group {
  /**
   *
   * @type {string}
   * @memberof Group
   */
  id: string
  /**
   *
   * @type {string}
   * @memberof Group
   */
  name: string
  /**
   *
   * @type {Array<string>}
   * @memberof Group
   */
  permissions: Array<string>
  /**
   *
   * @type {Date}
   * @memberof Group
   */
  created: Date
  /**
   *
   * @type {Date}
   * @memberof Group
   */
  updated: Date
}

/**
 * Check if a given object implements the Group interface.
 */
export function instanceOfGroup(value: object): value is Group {
  if (!('id' in value) || value['id'] === undefined) return false
  if (!('name' in value) || value['name'] === undefined) return false
  if (!('permissions' in value) || value['permissions'] === 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 GroupFromJSON(json: any): Group {
  return GroupFromJSONTyped(json, false)
}

export function GroupFromJSONTyped(json: any, ignoreDiscriminator: boolean): Group {
  if (json == null) {
    return json
  }
  return {
    id: json['id'],
    name: json['name'],
    permissions: json['permissions'],
    created: new Date(json['created']),
    updated: new Date(json['updated'])
  }
}

export function GroupToJSON(json: any): Group {
  return GroupToJSONTyped(json, false)
}

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

  return {
    id: value['id'],
    name: value['name'],
    permissions: value['permissions'],
    created: value['created'].toISOString(),
    updated: value['updated'].toISOString()
  }
}
