/* tslint:disable */
/* eslint-disable */
/**
 * CWMS Data API
 * CWMS REST API for Data Retrieval
 *
 * The version of the OpenAPI document: 2.4.0-2026.3.16
 * 
 *
 * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
 * https://openapi-generator.tech
 * Do not edit the class manually.
 */

import { exists, mapValues } from '../runtime';
/**
 * 
 * @export
 * @interface User
 */
export interface User {
    /**
     * 
     * @type {string}
     * @memberof User
     */
    userName: string;
    /**
     * Unique identifier in the upstream identity management system.
     * @type {string}
     * @memberof User
     */
    principal: string;
    /**
     * Is the current session based on CAC Authentication
     * @type {boolean}
     * @memberof User
     */
    readonly cacAuth?: boolean;
    /**
     * 
     * @type {string}
     * @memberof User
     */
    email: string;
    /**
     * Assigned user roles per office.
     * @type {{ [key: string]: Array<string>; }}
     * @memberof User
     */
    roles?: { [key: string]: Array<string>; };
}

export function UserFromJSON(json: any): User {
    return UserFromJSONTyped(json, false);
}

export function UserFromJSONTyped(json: any, ignoreDiscriminator: boolean): User {
    if ((json === undefined) || (json === null)) {
        return json;
    }
    return {
        
        'userName': json['user-name'],
        'principal': json['principal'],
        'cacAuth': !exists(json, 'cac-auth') ? undefined : json['cac-auth'],
        'email': json['email'],
        'roles': !exists(json, 'roles') ? undefined : json['roles'],
    };
}

export function UserToJSON(value?: User | null): any {
    if (value === undefined) {
        return undefined;
    }
    if (value === null) {
        return null;
    }
    return {
        
        'user-name': value.userName,
        'principal': value.principal,
        'email': value.email,
        'roles': value.roles,
    };
}

