/* 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 { ClientType } from './ClientType';
import {
    ClientTypeFromJSON,
    ClientTypeFromJSONTyped,
    ClientTypeToJSON,
    ClientTypeToJSONTyped,
} from './ClientType';

/**
 * 
 * @export
 * @interface ClientInfo
 */
export interface ClientInfo {
    /**
     * 
     * @type {string}
     * @memberof ClientInfo
     */
    id?: string;
    /**
     * 
     * @type {string}
     * @memberof ClientInfo
     */
    name: string | null;
    /**
     * 
     * @type {ClientType}
     * @memberof ClientInfo
     */
    type?: ClientType;
    /**
     * 
     * @type {string}
     * @memberof ClientInfo
     */
    photoUrl?: string | null;
    /**
     * 
     * @type {Array<string>}
     * @memberof ClientInfo
     */
    permissions?: Array<string> | null;
}



/**
 * Check if a given object implements the ClientInfo interface.
 */
export function instanceOfClientInfo(value: object): value is ClientInfo {
    if (!('name' in value) || value['name'] === undefined) return false;
    return true;
}

export function ClientInfoFromJSON(json: any): ClientInfo {
    return ClientInfoFromJSONTyped(json, false);
}

export function ClientInfoFromJSONTyped(json: any, ignoreDiscriminator: boolean): ClientInfo {
    if (json == null) {
        return json;
    }
    return {
        
        'id': json['id'] == null ? undefined : json['id'],
        'name': json['name'],
        'type': json['type'] == null ? undefined : ClientTypeFromJSON(json['type']),
        'photoUrl': json['photo_url'] == null ? undefined : json['photo_url'],
        'permissions': json['permissions'] == null ? undefined : json['permissions'],
    };
}

export function ClientInfoToJSON(json: any): ClientInfo {
    return ClientInfoToJSONTyped(json, false);
}

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

    return {
        
        'id': value['id'],
        'name': value['name'],
        'type': ClientTypeToJSON(value['type']),
        'photo_url': value['photoUrl'],
        'permissions': value['permissions'],
    };
}

