/* tslint:disable */
/* eslint-disable */
/**
 * elkar-app
 * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
 *
 * The version of the OpenAPI document: 0.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 { TaskPushNotificationConfig } from './TaskPushNotificationConfig';
import {
    TaskPushNotificationConfigFromJSON,
    TaskPushNotificationConfigFromJSONTyped,
    TaskPushNotificationConfigToJSON,
    TaskPushNotificationConfigToJSONTyped,
} from './TaskPushNotificationConfig';
import type { Task } from './Task';
import {
    TaskFromJSON,
    TaskFromJSONTyped,
    TaskToJSON,
    TaskToJSONTyped,
} from './Task';
import type { TaskType } from './TaskType';
import {
    TaskTypeFromJSON,
    TaskTypeFromJSONTyped,
    TaskTypeToJSON,
    TaskTypeToJSONTyped,
} from './TaskType';

/**
 * 
 * @export
 * @interface TaskResponse
 */
export interface TaskResponse {
    /**
     * 
     * @type {Task}
     * @memberof TaskResponse
     */
    a2aTask?: Task | null;
    /**
     * 
     * @type {Date}
     * @memberof TaskResponse
     */
    createdAt: Date;
    /**
     * 
     * @type {string}
     * @memberof TaskResponse
     */
    id: string;
    /**
     * 
     * @type {TaskPushNotificationConfig}
     * @memberof TaskResponse
     */
    pushNotification?: TaskPushNotificationConfig | null;
    /**
     * 
     * @type {TaskType}
     * @memberof TaskResponse
     */
    taskType: TaskType;
    /**
     * 
     * @type {Date}
     * @memberof TaskResponse
     */
    updatedAt: Date;
}



/**
 * Check if a given object implements the TaskResponse interface.
 */
export function instanceOfTaskResponse(value: object): value is TaskResponse {
    if (!('createdAt' in value) || value['createdAt'] === undefined) return false;
    if (!('id' in value) || value['id'] === undefined) return false;
    if (!('taskType' in value) || value['taskType'] === undefined) return false;
    if (!('updatedAt' in value) || value['updatedAt'] === undefined) return false;
    return true;
}

export function TaskResponseFromJSON(json: any): TaskResponse {
    return TaskResponseFromJSONTyped(json, false);
}

export function TaskResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): TaskResponse {
    if (json == null) {
        return json;
    }
    return {
        
        'a2aTask': json['a2a_task'] == null ? undefined : TaskFromJSON(json['a2a_task']),
        'createdAt': (new Date(json['created_at'])),
        'id': json['id'],
        'pushNotification': json['push_notification'] == null ? undefined : TaskPushNotificationConfigFromJSON(json['push_notification']),
        'taskType': TaskTypeFromJSON(json['task_type']),
        'updatedAt': (new Date(json['updated_at'])),
    };
}

export function TaskResponseToJSON(json: any): TaskResponse {
    return TaskResponseToJSONTyped(json, false);
}

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

    return {
        
        'a2a_task': TaskToJSON(value['a2aTask']),
        'created_at': ((value['createdAt']).toISOString()),
        'id': value['id'],
        'push_notification': TaskPushNotificationConfigToJSON(value['pushNotification']),
        'task_type': TaskTypeToJSON(value['taskType']),
        'updated_at': ((value['updatedAt']).toISOString()),
    };
}

