"use strict";
/*
 * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
 */
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
    if (k2 === undefined) k2 = k;
    var desc = Object.getOwnPropertyDescriptor(m, k);
    if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
      desc = { enumerable: true, get: function() { return m[k]; } };
    }
    Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
    if (k2 === undefined) k2 = k;
    o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
    Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
    o["default"] = v;
});
var __importStar = (this && this.__importStar) || (function () {
    var ownKeys = function(o) {
        ownKeys = Object.getOwnPropertyNames || function (o) {
            var ar = [];
            for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
            return ar;
        };
        return ownKeys(o);
    };
    return function (mod) {
        if (mod && mod.__esModule) return mod;
        var result = {};
        if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
        __setModuleDefault(result, mod);
        return result;
    };
})();
Object.defineProperty(exports, "__esModule", { value: true });
exports.Task$inboundSchema = exports.TaskType$inboundSchema = exports.TaskSchemasValue$inboundSchema = exports.TaskSchemasSourceValue$inboundSchema = exports.TaskSchemas4$inboundSchema = exports.TaskStatus$inboundSchema = exports.TaskValue$inboundSchema = exports.TaskSourceValue$inboundSchema = exports.Task4$inboundSchema = exports.TaskSchemasValue = exports.TaskValue = void 0;
exports.task4FromJSON = task4FromJSON;
exports.taskSourceValueFromJSON = taskSourceValueFromJSON;
exports.taskStatusFromJSON = taskStatusFromJSON;
exports.taskSchemas4FromJSON = taskSchemas4FromJSON;
exports.taskSchemasSourceValueFromJSON = taskSchemasSourceValueFromJSON;
exports.taskTypeFromJSON = taskTypeFromJSON;
exports.taskFromJSON = taskFromJSON;
const z = __importStar(require("zod/v3"));
const primitives_js_1 = require("../../../lib/primitives.js");
const schemas_js_1 = require("../../../lib/schemas.js");
const openEnums = __importStar(require("../../types/enums.js"));
const file_js_1 = require("./file.js");
const taskcommentapimodel_js_1 = require("./taskcommentapimodel.js");
/**
 * The unified value for the status of the task. If the provider does not specify this status, the value will be set to UnmappedValue
 */
var TaskValue;
(function (TaskValue) {
    TaskValue["Open"] = "open";
    TaskValue["InProgress"] = "in_progress";
    TaskValue["Blocked"] = "blocked";
    TaskValue["Completed"] = "completed";
    TaskValue["Cancelled"] = "cancelled";
    TaskValue["UnmappedValue"] = "unmapped_value";
})(TaskValue || (exports.TaskValue = TaskValue = {}));
/**
 * The unified value for the type of the task. If the provider does not specify this type, the value will be set to UnmappedValue
 */
var TaskSchemasValue;
(function (TaskSchemasValue) {
    TaskSchemasValue["Action"] = "action";
    TaskSchemasValue["Review"] = "review";
    TaskSchemasValue["Acknowledgment"] = "acknowledgment";
    TaskSchemasValue["Edit"] = "edit";
    TaskSchemasValue["Approve"] = "approve";
    TaskSchemasValue["UnmappedValue"] = "unmapped_value";
})(TaskSchemasValue || (exports.TaskSchemasValue = TaskSchemasValue = {}));
/** @internal */
exports.Task4$inboundSchema = z
    .object({});
function task4FromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.Task4$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Task4' from JSON`);
}
/** @internal */
exports.TaskSourceValue$inboundSchema = z.union([
    z.string(),
    z.number(),
    z.boolean(),
    z.lazy(() => exports.Task4$inboundSchema),
    z.array(z.any()),
]);
function taskSourceValueFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.TaskSourceValue$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'TaskSourceValue' from JSON`);
}
/** @internal */
exports.TaskValue$inboundSchema = openEnums.inboundSchema(TaskValue);
/** @internal */
exports.TaskStatus$inboundSchema = z.object({
    source_value: z.nullable(z.union([
        z.string(),
        z.number(),
        z.boolean(),
        z.lazy(() => exports.Task4$inboundSchema),
        z.array(z.any()),
    ])).optional(),
    value: z.nullable(exports.TaskValue$inboundSchema).optional(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        "source_value": "sourceValue",
    });
});
function taskStatusFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.TaskStatus$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'TaskStatus' from JSON`);
}
/** @internal */
exports.TaskSchemas4$inboundSchema = z.object({});
function taskSchemas4FromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.TaskSchemas4$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'TaskSchemas4' from JSON`);
}
/** @internal */
exports.TaskSchemasSourceValue$inboundSchema = z.union([
    z.string(),
    z.number(),
    z.boolean(),
    z.lazy(() => exports.TaskSchemas4$inboundSchema),
    z.array(z.any()),
]);
function taskSchemasSourceValueFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.TaskSchemasSourceValue$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'TaskSchemasSourceValue' from JSON`);
}
/** @internal */
exports.TaskSchemasValue$inboundSchema = openEnums.inboundSchema(TaskSchemasValue);
/** @internal */
exports.TaskType$inboundSchema = z.object({
    source_value: z.nullable(z.union([
        z.string(),
        z.number(),
        z.boolean(),
        z.lazy(() => exports.TaskSchemas4$inboundSchema),
        z.array(z.any()),
    ])).optional(),
    value: z.nullable(exports.TaskSchemasValue$inboundSchema).optional(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        "source_value": "sourceValue",
    });
});
function taskTypeFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.TaskType$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'TaskType' from JSON`);
}
/** @internal */
exports.Task$inboundSchema = z
    .object({
    assigned_by_employee_id: z.nullable(z.string()).optional(),
    assigned_by_employee_name: z.nullable(z.string()).optional(),
    attachments: z.nullable(z.array(file_js_1.FileT$inboundSchema)).optional(),
    comments: z.nullable(z.array(taskcommentapimodel_js_1.TaskCommentApiModel$inboundSchema)).optional(),
    completion_date: z.nullable(z.string().datetime({ offset: true }).transform(v => new Date(v))).optional(),
    created_at: z.nullable(z.string().datetime({ offset: true }).transform(v => new Date(v))).optional(),
    description: z.nullable(z.string()).optional(),
    due_date: z.nullable(z.string().datetime({ offset: true }).transform(v => new Date(v))).optional(),
    employee_id: z.nullable(z.string()).optional(),
    extracted_links: z.nullable(z.array(z.string())).optional(),
    id: z.nullable(z.string()).optional(),
    link_to_task: z.nullable(z.string()).optional(),
    name: z.nullable(z.string()).optional(),
    next_task_id: z.nullable(z.string()).optional(),
    parent_process_name: z.nullable(z.string()).optional(),
    remote_id: z.nullable(z.string()).optional(),
    status: z.nullable(z.lazy(() => exports.TaskStatus$inboundSchema)).optional(),
    type: z.nullable(z.lazy(() => exports.TaskType$inboundSchema)).optional(),
    updated_at: z.nullable(z.string().datetime({ offset: true }).transform(v => new Date(v))).optional(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        "assigned_by_employee_id": "assignedByEmployeeId",
        "assigned_by_employee_name": "assignedByEmployeeName",
        "completion_date": "completionDate",
        "created_at": "createdAt",
        "due_date": "dueDate",
        "employee_id": "employeeId",
        "extracted_links": "extractedLinks",
        "link_to_task": "linkToTask",
        "next_task_id": "nextTaskId",
        "parent_process_name": "parentProcessName",
        "remote_id": "remoteId",
        "updated_at": "updatedAt",
    });
});
function taskFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.Task$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Task' from JSON`);
}
//# sourceMappingURL=task.js.map