/* 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';
/**
 * 
 * @export
 * @interface AbsenceResponse
 */
export interface AbsenceResponse {
    /**
     * 
     * @type {string}
     * @memberof AbsenceResponse
     */
    id?: string;
    /**
     * 
     * @type {string}
     * @memberof AbsenceResponse
     */
    employeeId?: string;
    /**
     * 
     * @type {string}
     * @memberof AbsenceResponse
     */
    employeeName?: string | null;
    /**
     * 
     * @type {string}
     * @memberof AbsenceResponse
     */
    type?: string | null;
    /**
     * 
     * @type {Date}
     * @memberof AbsenceResponse
     */
    startDate?: Date;
    /**
     * 
     * @type {Date}
     * @memberof AbsenceResponse
     */
    endDate?: Date;
    /**
     * 
     * @type {string}
     * @memberof AbsenceResponse
     */
    reason?: string | null;
    /**
     * 
     * @type {string}
     * @memberof AbsenceResponse
     */
    substitute?: string | null;
    /**
     * 
     * @type {string}
     * @memberof AbsenceResponse
     */
    note?: string | null;
    /**
     * 
     * @type {string}
     * @memberof AbsenceResponse
     */
    status?: string | null;
    /**
     * 
     * @type {string}
     * @memberof AbsenceResponse
     */
    adminNote?: string | null;
    /**
     * 
     * @type {Date}
     * @memberof AbsenceResponse
     */
    createdAt?: Date;
}

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

export function AbsenceResponseFromJSON(json: any): AbsenceResponse {
    return AbsenceResponseFromJSONTyped(json, false);
}

export function AbsenceResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): AbsenceResponse {
    if (json == null) {
        return json;
    }
    return {
        
        'id': json['id'] == null ? undefined : json['id'],
        'employeeId': json['employeeId'] == null ? undefined : json['employeeId'],
        'employeeName': json['employeeName'] == null ? undefined : json['employeeName'],
        'type': json['type'] == null ? undefined : json['type'],
        'startDate': json['startDate'] == null ? undefined : (new Date(json['startDate'])),
        'endDate': json['endDate'] == null ? undefined : (new Date(json['endDate'])),
        'reason': json['reason'] == null ? undefined : json['reason'],
        'substitute': json['substitute'] == null ? undefined : json['substitute'],
        'note': json['note'] == null ? undefined : json['note'],
        'status': json['status'] == null ? undefined : json['status'],
        'adminNote': json['adminNote'] == null ? undefined : json['adminNote'],
        'createdAt': json['createdAt'] == null ? undefined : (new Date(json['createdAt'])),
    };
}

export function AbsenceResponseToJSON(json: any): AbsenceResponse {
    return AbsenceResponseToJSONTyped(json, false);
}

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

    return {
        
        'id': value['id'],
        'employeeId': value['employeeId'],
        'employeeName': value['employeeName'],
        'type': value['type'],
        'startDate': value['startDate'] == null ? undefined : ((value['startDate']).toISOString().substring(0,10)),
        'endDate': value['endDate'] == null ? undefined : ((value['endDate']).toISOString().substring(0,10)),
        'reason': value['reason'],
        'substitute': value['substitute'],
        'note': value['note'],
        'status': value['status'],
        'adminNote': value['adminNote'],
        'createdAt': value['createdAt'] == null ? undefined : ((value['createdAt']).toISOString()),
    };
}

