/* 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 UpdateAbsenceRequest
 */
export interface UpdateAbsenceRequest {
    /**
     * 
     * @type {string}
     * @memberof UpdateAbsenceRequest
     */
    type?: string | null;
    /**
     * 
     * @type {Date}
     * @memberof UpdateAbsenceRequest
     */
    startDate?: Date;
    /**
     * 
     * @type {Date}
     * @memberof UpdateAbsenceRequest
     */
    endDate?: Date;
    /**
     * 
     * @type {string}
     * @memberof UpdateAbsenceRequest
     */
    reason?: string | null;
    /**
     * 
     * @type {string}
     * @memberof UpdateAbsenceRequest
     */
    substitute?: string | null;
    /**
     * 
     * @type {string}
     * @memberof UpdateAbsenceRequest
     */
    note?: string | null;
}

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

export function UpdateAbsenceRequestFromJSON(json: any): UpdateAbsenceRequest {
    return UpdateAbsenceRequestFromJSONTyped(json, false);
}

export function UpdateAbsenceRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): UpdateAbsenceRequest {
    if (json == null) {
        return json;
    }
    return {
        
        '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'],
    };
}

export function UpdateAbsenceRequestToJSON(json: any): UpdateAbsenceRequest {
    return UpdateAbsenceRequestToJSONTyped(json, false);
}

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

    return {
        
        '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'],
    };
}

