/* 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 { AssignmentConflictResponse } from './AssignmentConflictResponse';
import {
    AssignmentConflictResponseFromJSON,
    AssignmentConflictResponseFromJSONTyped,
    AssignmentConflictResponseToJSON,
    AssignmentConflictResponseToJSONTyped,
} from './AssignmentConflictResponse';

/**
 * 
 * @export
 * @interface AssignmentResponse
 */
export interface AssignmentResponse {
    /**
     * 
     * @type {string}
     * @memberof AssignmentResponse
     */
    id?: string;
    /**
     * 
     * @type {string}
     * @memberof AssignmentResponse
     */
    orderId?: string;
    /**
     * 
     * @type {string}
     * @memberof AssignmentResponse
     */
    employeeId?: string;
    /**
     * 
     * @type {string}
     * @memberof AssignmentResponse
     */
    employeeFirstName?: string | null;
    /**
     * 
     * @type {string}
     * @memberof AssignmentResponse
     */
    employeeLastName?: string | null;
    /**
     * 
     * @type {Date}
     * @memberof AssignmentResponse
     */
    startDate?: Date;
    /**
     * 
     * @type {Date}
     * @memberof AssignmentResponse
     */
    endDate?: Date;
    /**
     * 
     * @type {string}
     * @memberof AssignmentResponse
     */
    note?: string | null;
    /**
     * 
     * @type {Array<AssignmentConflictResponse>}
     * @memberof AssignmentResponse
     */
    conflicts?: Array<AssignmentConflictResponse> | null;
}

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

export function AssignmentResponseFromJSON(json: any): AssignmentResponse {
    return AssignmentResponseFromJSONTyped(json, false);
}

export function AssignmentResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): AssignmentResponse {
    if (json == null) {
        return json;
    }
    return {
        
        'id': json['id'] == null ? undefined : json['id'],
        'orderId': json['orderId'] == null ? undefined : json['orderId'],
        'employeeId': json['employeeId'] == null ? undefined : json['employeeId'],
        'employeeFirstName': json['employeeFirstName'] == null ? undefined : json['employeeFirstName'],
        'employeeLastName': json['employeeLastName'] == null ? undefined : json['employeeLastName'],
        'startDate': json['startDate'] == null ? undefined : (new Date(json['startDate'])),
        'endDate': json['endDate'] == null ? undefined : (new Date(json['endDate'])),
        'note': json['note'] == null ? undefined : json['note'],
        'conflicts': json['conflicts'] == null ? undefined : ((json['conflicts'] as Array<any>).map(AssignmentConflictResponseFromJSON)),
    };
}

export function AssignmentResponseToJSON(json: any): AssignmentResponse {
    return AssignmentResponseToJSONTyped(json, false);
}

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

    return {
        
        'id': value['id'],
        'orderId': value['orderId'],
        'employeeId': value['employeeId'],
        'employeeFirstName': value['employeeFirstName'],
        'employeeLastName': value['employeeLastName'],
        'startDate': value['startDate'] == null ? undefined : ((value['startDate']).toISOString().substring(0,10)),
        'endDate': value['endDate'] == null ? undefined : ((value['endDate']).toISOString().substring(0,10)),
        'note': value['note'],
        'conflicts': value['conflicts'] == null ? undefined : ((value['conflicts'] as Array<any>).map(AssignmentConflictResponseToJSON)),
    };
}

