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

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

export function CreateAbsenceRequestFromJSON(json: any): CreateAbsenceRequest {
    return CreateAbsenceRequestFromJSONTyped(json, false);
}

export function CreateAbsenceRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): CreateAbsenceRequest {
    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 CreateAbsenceRequestToJSON(json: any): CreateAbsenceRequest {
    return CreateAbsenceRequestToJSONTyped(json, false);
}

export function CreateAbsenceRequestToJSONTyped(value?: CreateAbsenceRequest | 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'],
    };
}

