"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.TaskResult$inboundSchema = exports.TaskResultData$inboundSchema = exports.TaskResultType$inboundSchema = exports.TaskResultSchemasValue$inboundSchema = exports.TaskResultSchemasSourceValue$inboundSchema = exports.TaskResultSchemas4$inboundSchema = exports.TaskResultStatus$inboundSchema = exports.TaskResultValue$inboundSchema = exports.TaskResultSourceValue$inboundSchema = exports.TaskResult4$inboundSchema = exports.TaskResultSchemasValue = exports.TaskResultValue = void 0;
exports.taskResult4FromJSON = taskResult4FromJSON;
exports.taskResultSourceValueFromJSON = taskResultSourceValueFromJSON;
exports.taskResultStatusFromJSON = taskResultStatusFromJSON;
exports.taskResultSchemas4FromJSON = taskResultSchemas4FromJSON;
exports.taskResultSchemasSourceValueFromJSON = taskResultSchemasSourceValueFromJSON;
exports.taskResultTypeFromJSON = taskResultTypeFromJSON;
exports.taskResultDataFromJSON = taskResultDataFromJSON;
exports.taskResultFromJSON = taskResultFromJSON;
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 rawresponse_js_1 = require("./rawresponse.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 TaskResultValue;
(function (TaskResultValue) {
    TaskResultValue["Open"] = "open";
    TaskResultValue["InProgress"] = "in_progress";
    TaskResultValue["Blocked"] = "blocked";
    TaskResultValue["Completed"] = "completed";
    TaskResultValue["Cancelled"] = "cancelled";
    TaskResultValue["UnmappedValue"] = "unmapped_value";
})(TaskResultValue || (exports.TaskResultValue = TaskResultValue = {}));
/**
 * 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 TaskResultSchemasValue;
(function (TaskResultSchemasValue) {
    TaskResultSchemasValue["Action"] = "action";
    TaskResultSchemasValue["Review"] = "review";
    TaskResultSchemasValue["Acknowledgment"] = "acknowledgment";
    TaskResultSchemasValue["Edit"] = "edit";
    TaskResultSchemasValue["Approve"] = "approve";
    TaskResultSchemasValue["UnmappedValue"] = "unmapped_value";
})(TaskResultSchemasValue || (exports.TaskResultSchemasValue = TaskResultSchemasValue = {}));
/** @internal */
exports.TaskResult4$inboundSchema = z.object({});
function taskResult4FromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.TaskResult4$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'TaskResult4' from JSON`);
}
/** @internal */
exports.TaskResultSourceValue$inboundSchema = z.union([
    z.string(),
    z.number(),
    z.boolean(),
    z.lazy(() => exports.TaskResult4$inboundSchema),
    z.array(z.any()),
]);
function taskResultSourceValueFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.TaskResultSourceValue$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'TaskResultSourceValue' from JSON`);
}
/** @internal */
exports.TaskResultValue$inboundSchema = openEnums.inboundSchema(TaskResultValue);
/** @internal */
exports.TaskResultStatus$inboundSchema = z.object({
    source_value: z.nullable(z.union([
        z.string(),
        z.number(),
        z.boolean(),
        z.lazy(() => exports.TaskResult4$inboundSchema),
        z.array(z.any()),
    ])).optional(),
    value: z.nullable(exports.TaskResultValue$inboundSchema).optional(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        "source_value": "sourceValue",
    });
});
function taskResultStatusFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.TaskResultStatus$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'TaskResultStatus' from JSON`);
}
/** @internal */
exports.TaskResultSchemas4$inboundSchema = z.object({});
function taskResultSchemas4FromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.TaskResultSchemas4$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'TaskResultSchemas4' from JSON`);
}
/** @internal */
exports.TaskResultSchemasSourceValue$inboundSchema = z.union([
    z.string(),
    z.number(),
    z.boolean(),
    z.lazy(() => exports.TaskResultSchemas4$inboundSchema),
    z.array(z.any()),
]);
function taskResultSchemasSourceValueFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.TaskResultSchemasSourceValue$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'TaskResultSchemasSourceValue' from JSON`);
}
/** @internal */
exports.TaskResultSchemasValue$inboundSchema = openEnums.inboundSchema(TaskResultSchemasValue);
/** @internal */
exports.TaskResultType$inboundSchema = z.object({
    source_value: z.nullable(z.union([
        z.string(),
        z.number(),
        z.boolean(),
        z.lazy(() => exports.TaskResultSchemas4$inboundSchema),
        z.array(z.any()),
    ])).optional(),
    value: z.nullable(exports.TaskResultSchemasValue$inboundSchema).optional(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        "source_value": "sourceValue",
    });
});
function taskResultTypeFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.TaskResultType$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'TaskResultType' from JSON`);
}
/** @internal */
exports.TaskResultData$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.TaskResultStatus$inboundSchema)).optional(),
    type: z.nullable(z.lazy(() => exports.TaskResultType$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 taskResultDataFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.TaskResultData$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'TaskResultData' from JSON`);
}
/** @internal */
exports.TaskResult$inboundSchema = z.object({
    data: z.nullable(z.lazy(() => exports.TaskResultData$inboundSchema)).optional(),
    raw: z.nullable(z.array(rawresponse_js_1.RawResponse$inboundSchema)).optional(),
});
function taskResultFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.TaskResult$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'TaskResult' from JSON`);
}
//# sourceMappingURL=taskresult.js.map