/* 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 NewUser
 */
export interface NewUser {
  /**
   *
   * @type {string}
   * @memberof NewUser
   */
  username: string
  /**
   *
   * @type {string}
   * @memberof NewUser
   */
  avatar?: string
  /**
   *
   * @type {string}
   * @memberof NewUser
   */
  email?: string
  /**
   *
   * @type {string}
   * @memberof NewUser
   */
  name?: string
  /**
   *
   * @type {boolean}
   * @memberof NewUser
   */
  active: boolean
}

/**
 * Check if a given object implements the NewUser interface.
 */
export function instanceOfNewUser(value: object): value is NewUser {
  if (!('username' in value) || value['username'] === undefined) return false
  if (!('active' in value) || value['active'] === undefined) return false
  return true
}

export function NewUserFromJSON(json: any): NewUser {
  return NewUserFromJSONTyped(json, false)
}

export function NewUserFromJSONTyped(json: any, ignoreDiscriminator: boolean): NewUser {
  if (json == null) {
    return json
  }
  return {
    username: json['username'],
    avatar: json['avatar'] == null ? undefined : json['avatar'],
    email: json['email'] == null ? undefined : json['email'],
    name: json['name'] == null ? undefined : json['name'],
    active: json['active']
  }
}

export function NewUserToJSON(json: any): NewUser {
  return NewUserToJSONTyped(json, false)
}

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

  return {
    username: value['username'],
    avatar: value['avatar'],
    email: value['email'],
    name: value['name'],
    active: value['active']
  }
}
