/* 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 GroupUser
 */
export interface GroupUser {
  /**
   *
   * @type {string}
   * @memberof GroupUser
   */
  id: string
  /**
   *
   * @type {string}
   * @memberof GroupUser
   */
  username: string
  /**
   *
   * @type {string}
   * @memberof GroupUser
   */
  avatar?: string
  /**
   *
   * @type {string}
   * @memberof GroupUser
   */
  email?: string
  /**
   *
   * @type {Date}
   * @memberof GroupUser
   */
  lastResetSentAt?: Date
  /**
   *
   * @type {Date}
   * @memberof GroupUser
   */
  lastVerificationSentAt?: Date
  /**
   *
   * @type {string}
   * @memberof GroupUser
   */
  name?: string
  /**
   *
   * @type {boolean}
   * @memberof GroupUser
   */
  active: boolean
  /**
   *
   * @type {string}
   * @memberof GroupUser
   */
  type: string
  /**
   *
   * @type {Date}
   * @memberof GroupUser
   */
  created: Date
  /**
   *
   * @type {Date}
   * @memberof GroupUser
   */
  updated: Date
}

/**
 * Check if a given object implements the GroupUser interface.
 */
export function instanceOfGroupUser(value: object): value is GroupUser {
  if (!('id' in value) || value['id'] === undefined) return false
  if (!('username' in value) || value['username'] === undefined) return false
  if (!('active' in value) || value['active'] === 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 GroupUserFromJSON(json: any): GroupUser {
  return GroupUserFromJSONTyped(json, false)
}

export function GroupUserFromJSONTyped(json: any, ignoreDiscriminator: boolean): GroupUser {
  if (json == null) {
    return json
  }
  return {
    id: json['id'],
    username: json['username'],
    avatar: json['avatar'] == null ? undefined : json['avatar'],
    email: json['email'] == null ? undefined : json['email'],
    lastResetSentAt:
      json['lastResetSentAt'] == null ? undefined : new Date(json['lastResetSentAt']),
    lastVerificationSentAt:
      json['lastVerificationSentAt'] == null ? undefined : new Date(json['lastVerificationSentAt']),
    name: json['name'] == null ? undefined : json['name'],
    active: json['active'],
    type: json['type'],
    created: new Date(json['created']),
    updated: new Date(json['updated'])
  }
}

export function GroupUserToJSON(json: any): GroupUser {
  return GroupUserToJSONTyped(json, false)
}

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

  return {
    id: value['id'],
    username: value['username'],
    avatar: value['avatar'],
    email: value['email'],
    lastResetSentAt:
      value['lastResetSentAt'] == null ? undefined : value['lastResetSentAt'].toISOString(),
    lastVerificationSentAt:
      value['lastVerificationSentAt'] == null
        ? undefined
        : value['lastVerificationSentAt'].toISOString(),
    name: value['name'],
    active: value['active'],
    type: value['type'],
    created: value['created'].toISOString(),
    updated: value['updated'].toISOString()
  }
}
