/* tslint:disable */
/* eslint-disable */
/**
 * OmsorgCore.Api
 * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
 *
 * The version of the OpenAPI document: 1.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';
import type { PermissionDto } from './PermissionDto';
import {
    PermissionDtoFromJSON,
    PermissionDtoFromJSONTyped,
    PermissionDtoToJSON,
    PermissionDtoToJSONTyped,
} from './PermissionDto';

/**
 * 
 * @export
 * @interface MeResponse
 */
export interface MeResponse {
    /**
     * 
     * @type {string}
     * @memberof MeResponse
     */
    userId?: string;
    /**
     * 
     * @type {string}
     * @memberof MeResponse
     */
    username?: string | null;
    /**
     * 
     * @type {string}
     * @memberof MeResponse
     */
    role?: string | null;
    /**
     * 
     * @type {Array<PermissionDto>}
     * @memberof MeResponse
     */
    permissions?: Array<PermissionDto> | null;
    /**
     * 
     * @type {string}
     * @memberof MeResponse
     */
    employeeId?: string | null;
    /**
     * 
     * @type {string}
     * @memberof MeResponse
     */
    firstName?: string | null;
    /**
     * 
     * @type {string}
     * @memberof MeResponse
     */
    lastName?: string | null;
    /**
     * 
     * @type {string}
     * @memberof MeResponse
     */
    email?: string | null;
    /**
     * 
     * @type {string}
     * @memberof MeResponse
     */
    phoneNumber?: string | null;
    /**
     * 
     * @type {string}
     * @memberof MeResponse
     */
    avatarFileName?: string | null;
}

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

export function MeResponseFromJSON(json: any): MeResponse {
    return MeResponseFromJSONTyped(json, false);
}

export function MeResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): MeResponse {
    if (json == null) {
        return json;
    }
    return {
        
        'userId': json['userId'] == null ? undefined : json['userId'],
        'username': json['username'] == null ? undefined : json['username'],
        'role': json['role'] == null ? undefined : json['role'],
        'permissions': json['permissions'] == null ? undefined : ((json['permissions'] as Array<any>).map(PermissionDtoFromJSON)),
        'employeeId': json['employeeId'] == null ? undefined : json['employeeId'],
        'firstName': json['firstName'] == null ? undefined : json['firstName'],
        'lastName': json['lastName'] == null ? undefined : json['lastName'],
        'email': json['email'] == null ? undefined : json['email'],
        'phoneNumber': json['phoneNumber'] == null ? undefined : json['phoneNumber'],
        'avatarFileName': json['avatarFileName'] == null ? undefined : json['avatarFileName'],
    };
}

export function MeResponseToJSON(json: any): MeResponse {
    return MeResponseToJSONTyped(json, false);
}

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

    return {
        
        'userId': value['userId'],
        'username': value['username'],
        'role': value['role'],
        'permissions': value['permissions'] == null ? undefined : ((value['permissions'] as Array<any>).map(PermissionDtoToJSON)),
        'employeeId': value['employeeId'],
        'firstName': value['firstName'],
        'lastName': value['lastName'],
        'email': value['email'],
        'phoneNumber': value['phoneNumber'],
        'avatarFileName': value['avatarFileName'],
    };
}

