/* tslint:disable */
/* eslint-disable */
/**
 * Tribufu API
 * API to access Tribufu services.
 *
 * The version of the OpenAPI document: 1.3.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 { GroupRank } from './GroupRank';
import {
    GroupRankFromJSON,
    GroupRankFromJSONTyped,
    GroupRankToJSON,
    GroupRankToJSONTyped,
} from './GroupRank';

/**
 * 
 * @export
 * @interface GroupMember
 */
export interface GroupMember {
    /**
     * 
     * @type {string}
     * @memberof GroupMember
     */
    id?: string;
    /**
     * 
     * @type {string}
     * @memberof GroupMember
     */
    uuid?: string;
    /**
     * 
     * @type {string}
     * @memberof GroupMember
     */
    name?: string | null;
    /**
     * 
     * @type {string}
     * @memberof GroupMember
     */
    displayName?: string | null;
    /**
     * 
     * @type {boolean}
     * @memberof GroupMember
     */
    verified?: boolean;
    /**
     * 
     * @type {string}
     * @memberof GroupMember
     */
    photoUrl?: string | null;
    /**
     * 
     * @type {Date}
     * @memberof GroupMember
     */
    lastOnline?: Date | null;
    /**
     * 
     * @type {GroupRank}
     * @memberof GroupMember
     */
    rank?: GroupRank;
    /**
     * 
     * @type {Date}
     * @memberof GroupMember
     */
    since?: Date;
}



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

export function GroupMemberFromJSON(json: any): GroupMember {
    return GroupMemberFromJSONTyped(json, false);
}

export function GroupMemberFromJSONTyped(json: any, ignoreDiscriminator: boolean): GroupMember {
    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'],
        'verified': json['verified'] == null ? undefined : json['verified'],
        'photoUrl': json['photo_url'] == null ? undefined : json['photo_url'],
        'lastOnline': json['last_online'] == null ? undefined : (new Date(json['last_online'])),
        'rank': json['rank'] == null ? undefined : GroupRankFromJSON(json['rank']),
        'since': json['since'] == null ? undefined : (new Date(json['since'])),
    };
}

export function GroupMemberToJSON(json: any): GroupMember {
    return GroupMemberToJSONTyped(json, false);
}

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

    return {
        
        'id': value['id'],
        'uuid': value['uuid'],
        'name': value['name'],
        'display_name': value['displayName'],
        'verified': value['verified'],
        'photo_url': value['photoUrl'],
        'last_online': value['lastOnline'] == null ? undefined : ((value['lastOnline'] as any).toISOString()),
        'rank': GroupRankToJSON(value['rank']),
        'since': value['since'] == null ? undefined : ((value['since']).toISOString()),
    };
}

