/* tslint:disable */
/* eslint-disable */
/**
 * Tribufu API
 * REST API to access Tribufu services.
 *
 * The version of the OpenAPI document: 1.1.0
 * Contact: contact@tribufu.com
 *
 * 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';
import type { UserType } from './UserType';
import {
    UserTypeFromJSON,
    UserTypeFromJSONTyped,
    UserTypeToJSON,
    UserTypeToJSONTyped,
} from './UserType';

/**
 * 
 * @export
 * @interface UserInfo
 */
export interface UserInfo {
    /**
     * 
     * @type {string}
     * @memberof UserInfo
     */
    id?: string;
    /**
     * 
     * @type {string}
     * @memberof UserInfo
     */
    uuid?: string;
    /**
     * 
     * @type {string}
     * @memberof UserInfo
     */
    name?: string | null;
    /**
     * 
     * @type {string}
     * @memberof UserInfo
     */
    displayName?: string | null;
    /**
     * 
     * @type {string}
     * @memberof UserInfo
     */
    email?: string | null;
    /**
     * 
     * @type {UserType}
     * @memberof UserInfo
     */
    type?: UserType;
    /**
     * 
     * @type {string}
     * @memberof UserInfo
     */
    flags?: string;
    /**
     * 
     * @type {string}
     * @memberof UserInfo
     */
    permissions?: string;
    /**
     * 
     * @type {boolean}
     * @memberof UserInfo
     */
    verified?: boolean;
    /**
     * 
     * @type {number}
     * @memberof UserInfo
     */
    level?: number;
    /**
     * 
     * @type {number}
     * @memberof UserInfo
     */
    experience?: number;
    /**
     * 
     * @type {boolean}
     * @memberof UserInfo
     */
    publicBirthday?: boolean;
    /**
     * 
     * @type {Date}
     * @memberof UserInfo
     */
    birthday?: Date | null;
    /**
     * 
     * @type {number}
     * @memberof UserInfo
     */
    points?: number;
    /**
     * 
     * @type {string}
     * @memberof UserInfo
     */
    location?: string | null;
    /**
     * 
     * @type {string}
     * @memberof UserInfo
     */
    language?: string | null;
    /**
     * 
     * @type {string}
     * @memberof UserInfo
     */
    timezone?: string | null;
    /**
     * 
     * @type {string}
     * @memberof UserInfo
     */
    currency?: string | null;
    /**
     * 
     * @type {string}
     * @memberof UserInfo
     */
    photoUrl?: string | null;
    /**
     * 
     * @type {string}
     * @memberof UserInfo
     */
    bannerUrl?: string | null;
    /**
     * 
     * @type {Date}
     * @memberof UserInfo
     */
    lastOnline?: Date | null;
    /**
     * 
     * @type {string}
     * @memberof UserInfo
     */
    biography?: string | null;
    /**
     * 
     * @type {number}
     * @memberof UserInfo
     */
    viewCount?: number;
    /**
     * 
     * @type {Date}
     * @memberof UserInfo
     */
    created?: Date;
    /**
     * 
     * @type {Date}
     * @memberof UserInfo
     */
    updated?: Date | null;
}



/**
 * Check if a given object implements the UserInfo interface.
 */
export function instanceOfUserInfo(value: object): value is UserInfo {
    return true;
}

export function UserInfoFromJSON(json: any): UserInfo {
    return UserInfoFromJSONTyped(json, false);
}

export function UserInfoFromJSONTyped(json: any, ignoreDiscriminator: boolean): UserInfo {
    if (json == null) {
        return json;
    }
    return {
        
        'id': json['id'] == null ? undefined : json['id'],
        'uuid': json['uuid'] == null ? undefined : json['uuid'],
        'name': json['name'] == null ? undefined : json['name'],
        'displayName': json['display_name'] == null ? undefined : json['display_name'],
        'email': json['email'] == null ? undefined : json['email'],
        'type': json['type'] == null ? undefined : UserTypeFromJSON(json['type']),
        'flags': json['flags'] == null ? undefined : json['flags'],
        'permissions': json['permissions'] == null ? undefined : json['permissions'],
        'verified': json['verified'] == null ? undefined : json['verified'],
        'level': json['level'] == null ? undefined : json['level'],
        'experience': json['experience'] == null ? undefined : json['experience'],
        'publicBirthday': json['public_birthday'] == null ? undefined : json['public_birthday'],
        'birthday': json['birthday'] == null ? undefined : (new Date(json['birthday'])),
        'points': json['points'] == null ? undefined : json['points'],
        'location': json['location'] == null ? undefined : json['location'],
        'language': json['language'] == null ? undefined : json['language'],
        'timezone': json['timezone'] == null ? undefined : json['timezone'],
        'currency': json['currency'] == null ? undefined : json['currency'],
        'photoUrl': json['photo_url'] == null ? undefined : json['photo_url'],
        'bannerUrl': json['banner_url'] == null ? undefined : json['banner_url'],
        'lastOnline': json['last_online'] == null ? undefined : (new Date(json['last_online'])),
        'biography': json['biography'] == null ? undefined : json['biography'],
        'viewCount': json['view_count'] == null ? undefined : json['view_count'],
        'created': json['created'] == null ? undefined : (new Date(json['created'])),
        'updated': json['updated'] == null ? undefined : (new Date(json['updated'])),
    };
}

export function UserInfoToJSON(json: any): UserInfo {
    return UserInfoToJSONTyped(json, false);
}

export function UserInfoToJSONTyped(value?: UserInfo | null, ignoreDiscriminator: boolean = false): any {
    if (value == null) {
        return value;
    }

    return {
        
        'id': value['id'],
        'uuid': value['uuid'],
        'name': value['name'],
        'display_name': value['displayName'],
        'email': value['email'],
        'type': UserTypeToJSON(value['type']),
        'flags': value['flags'],
        'permissions': value['permissions'],
        'verified': value['verified'],
        'level': value['level'],
        'experience': value['experience'],
        'public_birthday': value['publicBirthday'],
        'birthday': value['birthday'] == null ? undefined : ((value['birthday'] as any).toISOString().substring(0,10)),
        'points': value['points'],
        'location': value['location'],
        'language': value['language'],
        'timezone': value['timezone'],
        'currency': value['currency'],
        'photo_url': value['photoUrl'],
        'banner_url': value['bannerUrl'],
        'last_online': value['lastOnline'] == null ? undefined : ((value['lastOnline'] as any).toISOString()),
        'biography': value['biography'],
        'view_count': value['viewCount'],
        'created': value['created'] == null ? undefined : ((value['created']).toISOString()),
        'updated': value['updated'] == null ? undefined : ((value['updated'] as any).toISOString()),
    };
}

