"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 (mod) {
    if (mod && mod.__esModule) return mod;
    var result = {};
    if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
    __setModuleDefault(result, mod);
    return result;
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.taskFromJSON = exports.taskToJSON = exports.Task$ = exports.Task$outboundSchema = exports.Task$inboundSchema = exports.taskTypeFromJSON = exports.taskTypeToJSON = exports.TaskType$ = exports.TaskType$outboundSchema = exports.TaskType$inboundSchema = exports.TaskSchemasValue$ = exports.TaskSchemasValue$outboundSchema = exports.TaskSchemasValue$inboundSchema = exports.taskSchemasSourceValueFromJSON = exports.taskSchemasSourceValueToJSON = exports.TaskSchemasSourceValue$ = exports.TaskSchemasSourceValue$outboundSchema = exports.TaskSchemasSourceValue$inboundSchema = exports.taskSchemas4FromJSON = exports.taskSchemas4ToJSON = exports.TaskSchemas4$ = exports.TaskSchemas4$outboundSchema = exports.TaskSchemas4$inboundSchema = exports.taskStatusFromJSON = exports.taskStatusToJSON = exports.TaskStatus$ = exports.TaskStatus$outboundSchema = exports.TaskStatus$inboundSchema = exports.TaskValue$ = exports.TaskValue$outboundSchema = exports.TaskValue$inboundSchema = exports.taskSourceValueFromJSON = exports.taskSourceValueToJSON = exports.TaskSourceValue$ = exports.TaskSourceValue$outboundSchema = exports.TaskSourceValue$inboundSchema = exports.task4FromJSON = exports.task4ToJSON = exports.Task4$ = exports.Task4$outboundSchema = exports.Task4$inboundSchema = exports.TaskSchemasValue = exports.TaskValue = void 0;
const z = __importStar(require("zod"));
const primitives_js_1 = require("../../../lib/primitives.js");
const schemas_js_1 = require("../../../lib/schemas.js");
const enums_js_1 = 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({});
/** @internal */
exports.Task4$outboundSchema = z.object({});
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
var Task4$;
(function (Task4$) {
    /** @deprecated use `Task4$inboundSchema` instead. */
    Task4$.inboundSchema = exports.Task4$inboundSchema;
    /** @deprecated use `Task4$outboundSchema` instead. */
    Task4$.outboundSchema = exports.Task4$outboundSchema;
})(Task4$ || (exports.Task4$ = Task4$ = {}));
function task4ToJSON(task4) {
    return JSON.stringify(exports.Task4$outboundSchema.parse(task4));
}
exports.task4ToJSON = task4ToJSON;
function task4FromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.Task4$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Task4' from JSON`);
}
exports.task4FromJSON = task4FromJSON;
/** @internal */
exports.TaskSourceValue$inboundSchema = z.union([
    z.lazy(() => exports.Task4$inboundSchema),
    z.string(),
    z.number(),
    z.boolean(),
    z.array(z.any()),
]);
/** @internal */
exports.TaskSourceValue$outboundSchema = z.union([
    z.lazy(() => exports.Task4$outboundSchema),
    z.string(),
    z.number(),
    z.boolean(),
    z.array(z.any()),
]);
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
var TaskSourceValue$;
(function (TaskSourceValue$) {
    /** @deprecated use `TaskSourceValue$inboundSchema` instead. */
    TaskSourceValue$.inboundSchema = exports.TaskSourceValue$inboundSchema;
    /** @deprecated use `TaskSourceValue$outboundSchema` instead. */
    TaskSourceValue$.outboundSchema = exports.TaskSourceValue$outboundSchema;
})(TaskSourceValue$ || (exports.TaskSourceValue$ = TaskSourceValue$ = {}));
function taskSourceValueToJSON(taskSourceValue) {
    return JSON.stringify(exports.TaskSourceValue$outboundSchema.parse(taskSourceValue));
}
exports.taskSourceValueToJSON = taskSourceValueToJSON;
function taskSourceValueFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.TaskSourceValue$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'TaskSourceValue' from JSON`);
}
exports.taskSourceValueFromJSON = taskSourceValueFromJSON;
/** @internal */
exports.TaskValue$inboundSchema = z
    .union([
    z.nativeEnum(TaskValue),
    z.string().transform(enums_js_1.catchUnrecognizedEnum),
]);
/** @internal */
exports.TaskValue$outboundSchema = z.union([
    z.nativeEnum(TaskValue),
    z.string().and(z.custom()),
]);
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
var TaskValue$;
(function (TaskValue$) {
    /** @deprecated use `TaskValue$inboundSchema` instead. */
    TaskValue$.inboundSchema = exports.TaskValue$inboundSchema;
    /** @deprecated use `TaskValue$outboundSchema` instead. */
    TaskValue$.outboundSchema = exports.TaskValue$outboundSchema;
})(TaskValue$ || (exports.TaskValue$ = TaskValue$ = {}));
/** @internal */
exports.TaskStatus$inboundSchema = z.object({
    source_value: z.nullable(z.union([
        z.lazy(() => exports.Task4$inboundSchema),
        z.string(),
        z.number(),
        z.boolean(),
        z.array(z.any()),
    ])).optional(),
    value: z.nullable(exports.TaskValue$inboundSchema).optional(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        "source_value": "sourceValue",
    });
});
/** @internal */
exports.TaskStatus$outboundSchema = z.object({
    sourceValue: z.nullable(z.union([
        z.lazy(() => exports.Task4$outboundSchema),
        z.string(),
        z.number(),
        z.boolean(),
        z.array(z.any()),
    ])).optional(),
    value: z.nullable(exports.TaskValue$outboundSchema).optional(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        sourceValue: "source_value",
    });
});
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
var TaskStatus$;
(function (TaskStatus$) {
    /** @deprecated use `TaskStatus$inboundSchema` instead. */
    TaskStatus$.inboundSchema = exports.TaskStatus$inboundSchema;
    /** @deprecated use `TaskStatus$outboundSchema` instead. */
    TaskStatus$.outboundSchema = exports.TaskStatus$outboundSchema;
})(TaskStatus$ || (exports.TaskStatus$ = TaskStatus$ = {}));
function taskStatusToJSON(taskStatus) {
    return JSON.stringify(exports.TaskStatus$outboundSchema.parse(taskStatus));
}
exports.taskStatusToJSON = taskStatusToJSON;
function taskStatusFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.TaskStatus$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'TaskStatus' from JSON`);
}
exports.taskStatusFromJSON = taskStatusFromJSON;
/** @internal */
exports.TaskSchemas4$inboundSchema = z.object({});
/** @internal */
exports.TaskSchemas4$outboundSchema = z.object({});
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
var TaskSchemas4$;
(function (TaskSchemas4$) {
    /** @deprecated use `TaskSchemas4$inboundSchema` instead. */
    TaskSchemas4$.inboundSchema = exports.TaskSchemas4$inboundSchema;
    /** @deprecated use `TaskSchemas4$outboundSchema` instead. */
    TaskSchemas4$.outboundSchema = exports.TaskSchemas4$outboundSchema;
})(TaskSchemas4$ || (exports.TaskSchemas4$ = TaskSchemas4$ = {}));
function taskSchemas4ToJSON(taskSchemas4) {
    return JSON.stringify(exports.TaskSchemas4$outboundSchema.parse(taskSchemas4));
}
exports.taskSchemas4ToJSON = taskSchemas4ToJSON;
function taskSchemas4FromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.TaskSchemas4$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'TaskSchemas4' from JSON`);
}
exports.taskSchemas4FromJSON = taskSchemas4FromJSON;
/** @internal */
exports.TaskSchemasSourceValue$inboundSchema = z.union([
    z.lazy(() => exports.TaskSchemas4$inboundSchema),
    z.string(),
    z.number(),
    z.boolean(),
    z.array(z.any()),
]);
/** @internal */
exports.TaskSchemasSourceValue$outboundSchema = z.union([
    z.lazy(() => exports.TaskSchemas4$outboundSchema),
    z.string(),
    z.number(),
    z.boolean(),
    z.array(z.any()),
]);
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
var TaskSchemasSourceValue$;
(function (TaskSchemasSourceValue$) {
    /** @deprecated use `TaskSchemasSourceValue$inboundSchema` instead. */
    TaskSchemasSourceValue$.inboundSchema = exports.TaskSchemasSourceValue$inboundSchema;
    /** @deprecated use `TaskSchemasSourceValue$outboundSchema` instead. */
    TaskSchemasSourceValue$.outboundSchema = exports.TaskSchemasSourceValue$outboundSchema;
})(TaskSchemasSourceValue$ || (exports.TaskSchemasSourceValue$ = TaskSchemasSourceValue$ = {}));
function taskSchemasSourceValueToJSON(taskSchemasSourceValue) {
    return JSON.stringify(exports.TaskSchemasSourceValue$outboundSchema.parse(taskSchemasSourceValue));
}
exports.taskSchemasSourceValueToJSON = taskSchemasSourceValueToJSON;
function taskSchemasSourceValueFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.TaskSchemasSourceValue$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'TaskSchemasSourceValue' from JSON`);
}
exports.taskSchemasSourceValueFromJSON = taskSchemasSourceValueFromJSON;
/** @internal */
exports.TaskSchemasValue$inboundSchema = z
    .union([
    z.nativeEnum(TaskSchemasValue),
    z.string().transform(enums_js_1.catchUnrecognizedEnum),
]);
/** @internal */
exports.TaskSchemasValue$outboundSchema = z.union([
    z.nativeEnum(TaskSchemasValue),
    z.string().and(z.custom()),
]);
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
var TaskSchemasValue$;
(function (TaskSchemasValue$) {
    /** @deprecated use `TaskSchemasValue$inboundSchema` instead. */
    TaskSchemasValue$.inboundSchema = exports.TaskSchemasValue$inboundSchema;
    /** @deprecated use `TaskSchemasValue$outboundSchema` instead. */
    TaskSchemasValue$.outboundSchema = exports.TaskSchemasValue$outboundSchema;
})(TaskSchemasValue$ || (exports.TaskSchemasValue$ = TaskSchemasValue$ = {}));
/** @internal */
exports.TaskType$inboundSchema = z.object({
    source_value: z.nullable(z.union([
        z.lazy(() => exports.TaskSchemas4$inboundSchema),
        z.string(),
        z.number(),
        z.boolean(),
        z.array(z.any()),
    ])).optional(),
    value: z.nullable(exports.TaskSchemasValue$inboundSchema).optional(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        "source_value": "sourceValue",
    });
});
/** @internal */
exports.TaskType$outboundSchema = z.object({
    sourceValue: z.nullable(z.union([
        z.lazy(() => exports.TaskSchemas4$outboundSchema),
        z.string(),
        z.number(),
        z.boolean(),
        z.array(z.any()),
    ])).optional(),
    value: z.nullable(exports.TaskSchemasValue$outboundSchema).optional(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        sourceValue: "source_value",
    });
});
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
var TaskType$;
(function (TaskType$) {
    /** @deprecated use `TaskType$inboundSchema` instead. */
    TaskType$.inboundSchema = exports.TaskType$inboundSchema;
    /** @deprecated use `TaskType$outboundSchema` instead. */
    TaskType$.outboundSchema = exports.TaskType$outboundSchema;
})(TaskType$ || (exports.TaskType$ = TaskType$ = {}));
function taskTypeToJSON(taskType) {
    return JSON.stringify(exports.TaskType$outboundSchema.parse(taskType));
}
exports.taskTypeToJSON = taskTypeToJSON;
function taskTypeFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.TaskType$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'TaskType' from JSON`);
}
exports.taskTypeFromJSON = taskTypeFromJSON;
/** @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",
    });
});
/** @internal */
exports.Task$outboundSchema = z.object({
    assignedByEmployeeId: z.nullable(z.string()).optional(),
    assignedByEmployeeName: z.nullable(z.string()).optional(),
    attachments: z.nullable(z.array(file_js_1.FileT$outboundSchema)).optional(),
    comments: z.nullable(z.array(taskcommentapimodel_js_1.TaskCommentApiModel$outboundSchema))
        .optional(),
    completionDate: z.nullable(z.date().transform(v => v.toISOString()))
        .optional(),
    createdAt: z.nullable(z.date().transform(v => v.toISOString())).optional(),
    description: z.nullable(z.string()).optional(),
    dueDate: z.nullable(z.date().transform(v => v.toISOString())).optional(),
    employeeId: z.nullable(z.string()).optional(),
    extractedLinks: z.nullable(z.array(z.string())).optional(),
    id: z.nullable(z.string()).optional(),
    linkToTask: z.nullable(z.string()).optional(),
    name: z.nullable(z.string()).optional(),
    nextTaskId: z.nullable(z.string()).optional(),
    parentProcessName: z.nullable(z.string()).optional(),
    remoteId: z.nullable(z.string()).optional(),
    status: z.nullable(z.lazy(() => exports.TaskStatus$outboundSchema)).optional(),
    type: z.nullable(z.lazy(() => exports.TaskType$outboundSchema)).optional(),
    updatedAt: z.nullable(z.date().transform(v => v.toISOString())).optional(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        assignedByEmployeeId: "assigned_by_employee_id",
        assignedByEmployeeName: "assigned_by_employee_name",
        completionDate: "completion_date",
        createdAt: "created_at",
        dueDate: "due_date",
        employeeId: "employee_id",
        extractedLinks: "extracted_links",
        linkToTask: "link_to_task",
        nextTaskId: "next_task_id",
        parentProcessName: "parent_process_name",
        remoteId: "remote_id",
        updatedAt: "updated_at",
    });
});
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
var Task$;
(function (Task$) {
    /** @deprecated use `Task$inboundSchema` instead. */
    Task$.inboundSchema = exports.Task$inboundSchema;
    /** @deprecated use `Task$outboundSchema` instead. */
    Task$.outboundSchema = exports.Task$outboundSchema;
})(Task$ || (exports.Task$ = Task$ = {}));
function taskToJSON(task) {
    return JSON.stringify(exports.Task$outboundSchema.parse(task));
}
exports.taskToJSON = taskToJSON;
function taskFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.Task$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Task' from JSON`);
}
exports.taskFromJSON = taskFromJSON;
//# sourceMappingURL=task.js.map