/* tslint:disable */
/* eslint-disable */
/**
 * zrok
 * zrok client access
 *
 * 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 Principal
 */
export interface Principal {
    /**
     * 
     * @type {number}
     * @memberof Principal
     */
    id?: number;
    /**
     * 
     * @type {string}
     * @memberof Principal
     */
    email?: string;
    /**
     * 
     * @type {string}
     * @memberof Principal
     */
    token?: string;
    /**
     * 
     * @type {boolean}
     * @memberof Principal
     */
    limitless?: boolean;
    /**
     * 
     * @type {boolean}
     * @memberof Principal
     */
    admin?: boolean;
}

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

export function PrincipalFromJSON(json: any): Principal {
    return PrincipalFromJSONTyped(json, false);
}

export function PrincipalFromJSONTyped(json: any, ignoreDiscriminator: boolean): Principal {
    if (json == null) {
        return json;
    }
    return {
        
        'id': json['id'] == null ? undefined : json['id'],
        'email': json['email'] == null ? undefined : json['email'],
        'token': json['token'] == null ? undefined : json['token'],
        'limitless': json['limitless'] == null ? undefined : json['limitless'],
        'admin': json['admin'] == null ? undefined : json['admin'],
    };
}

export function PrincipalToJSON(value?: Principal | null): any {
    if (value == null) {
        return value;
    }
    return {
        
        'id': value['id'],
        'email': value['email'],
        'token': value['token'],
        'limitless': value['limitless'],
        'admin': value['admin'],
    };
}

