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

/**
 * Check if a given object implements the UserGroup interface.
 */
export function instanceOfUserGroup(value: object): value is UserGroup {
  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 (!('type' in value) || value['type'] === 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 UserGroupFromJSON(json: any): UserGroup {
  return UserGroupFromJSONTyped(json, false)
}

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

export function UserGroupToJSON(json: any): UserGroup {
  return UserGroupToJSONTyped(json, false)
}

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

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