"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$ = exports.TaskResult$outboundSchema = exports.TaskResult$inboundSchema = exports.TaskResultData$ = exports.TaskResultData$outboundSchema = exports.TaskResultData$inboundSchema = exports.TaskResultType$ = exports.TaskResultType$outboundSchema = exports.TaskResultType$inboundSchema = exports.TaskResultSchemasValue$ = exports.TaskResultSchemasValue$outboundSchema = exports.TaskResultSchemasValue$inboundSchema = exports.TaskResultSchemasSourceValue$ = exports.TaskResultSchemasSourceValue$outboundSchema = exports.TaskResultSchemasSourceValue$inboundSchema = exports.TaskResultSchemas4$ = exports.TaskResultSchemas4$outboundSchema = exports.TaskResultSchemas4$inboundSchema = exports.TaskResultStatus$ = exports.TaskResultStatus$outboundSchema = exports.TaskResultStatus$inboundSchema = exports.TaskResultValue$ = exports.TaskResultValue$outboundSchema = exports.TaskResultValue$inboundSchema = exports.TaskResultSourceValue$ = exports.TaskResultSourceValue$outboundSchema = exports.TaskResultSourceValue$inboundSchema = exports.TaskResult4$ = exports.TaskResult4$outboundSchema = exports.TaskResult4$inboundSchema = exports.TaskResultSchemasValue = exports.TaskResultValue = void 0;
exports.taskResult4ToJSON = taskResult4ToJSON;
exports.taskResult4FromJSON = taskResult4FromJSON;
exports.taskResultSourceValueToJSON = taskResultSourceValueToJSON;
exports.taskResultSourceValueFromJSON = taskResultSourceValueFromJSON;
exports.taskResultStatusToJSON = taskResultStatusToJSON;
exports.taskResultStatusFromJSON = taskResultStatusFromJSON;
exports.taskResultSchemas4ToJSON = taskResultSchemas4ToJSON;
exports.taskResultSchemas4FromJSON = taskResultSchemas4FromJSON;
exports.taskResultSchemasSourceValueToJSON = taskResultSchemasSourceValueToJSON;
exports.taskResultSchemasSourceValueFromJSON = taskResultSchemasSourceValueFromJSON;
exports.taskResultTypeToJSON = taskResultTypeToJSON;
exports.taskResultTypeFromJSON = taskResultTypeFromJSON;
exports.taskResultDataToJSON = taskResultDataToJSON;
exports.taskResultDataFromJSON = taskResultDataFromJSON;
exports.taskResultToJSON = taskResultToJSON;
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 enums_js_1 = 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({});
/** @internal */
exports.TaskResult4$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 TaskResult4$;
(function (TaskResult4$) {
    /** @deprecated use `TaskResult4$inboundSchema` instead. */
    TaskResult4$.inboundSchema = exports.TaskResult4$inboundSchema;
    /** @deprecated use `TaskResult4$outboundSchema` instead. */
    TaskResult4$.outboundSchema = exports.TaskResult4$outboundSchema;
})(TaskResult4$ || (exports.TaskResult4$ = TaskResult4$ = {}));
function taskResult4ToJSON(taskResult4) {
    return JSON.stringify(exports.TaskResult4$outboundSchema.parse(taskResult4));
}
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()),
]);
/** @internal */
exports.TaskResultSourceValue$outboundSchema = z.union([
    z.string(),
    z.number(),
    z.boolean(),
    z.lazy(() => exports.TaskResult4$outboundSchema),
    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 TaskResultSourceValue$;
(function (TaskResultSourceValue$) {
    /** @deprecated use `TaskResultSourceValue$inboundSchema` instead. */
    TaskResultSourceValue$.inboundSchema = exports.TaskResultSourceValue$inboundSchema;
    /** @deprecated use `TaskResultSourceValue$outboundSchema` instead. */
    TaskResultSourceValue$.outboundSchema = exports.TaskResultSourceValue$outboundSchema;
})(TaskResultSourceValue$ || (exports.TaskResultSourceValue$ = TaskResultSourceValue$ = {}));
function taskResultSourceValueToJSON(taskResultSourceValue) {
    return JSON.stringify(exports.TaskResultSourceValue$outboundSchema.parse(taskResultSourceValue));
}
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 = z
    .union([
    z.nativeEnum(TaskResultValue),
    z.string().transform(enums_js_1.catchUnrecognizedEnum),
]);
/** @internal */
exports.TaskResultValue$outboundSchema = z.union([
    z.nativeEnum(TaskResultValue),
    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 TaskResultValue$;
(function (TaskResultValue$) {
    /** @deprecated use `TaskResultValue$inboundSchema` instead. */
    TaskResultValue$.inboundSchema = exports.TaskResultValue$inboundSchema;
    /** @deprecated use `TaskResultValue$outboundSchema` instead. */
    TaskResultValue$.outboundSchema = exports.TaskResultValue$outboundSchema;
})(TaskResultValue$ || (exports.TaskResultValue$ = 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",
    });
});
/** @internal */
exports.TaskResultStatus$outboundSchema = z.object({
    sourceValue: z.nullable(z.union([
        z.string(),
        z.number(),
        z.boolean(),
        z.lazy(() => exports.TaskResult4$outboundSchema),
        z.array(z.any()),
    ])).optional(),
    value: z.nullable(exports.TaskResultValue$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 TaskResultStatus$;
(function (TaskResultStatus$) {
    /** @deprecated use `TaskResultStatus$inboundSchema` instead. */
    TaskResultStatus$.inboundSchema = exports.TaskResultStatus$inboundSchema;
    /** @deprecated use `TaskResultStatus$outboundSchema` instead. */
    TaskResultStatus$.outboundSchema = exports.TaskResultStatus$outboundSchema;
})(TaskResultStatus$ || (exports.TaskResultStatus$ = TaskResultStatus$ = {}));
function taskResultStatusToJSON(taskResultStatus) {
    return JSON.stringify(exports.TaskResultStatus$outboundSchema.parse(taskResultStatus));
}
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({});
/** @internal */
exports.TaskResultSchemas4$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 TaskResultSchemas4$;
(function (TaskResultSchemas4$) {
    /** @deprecated use `TaskResultSchemas4$inboundSchema` instead. */
    TaskResultSchemas4$.inboundSchema = exports.TaskResultSchemas4$inboundSchema;
    /** @deprecated use `TaskResultSchemas4$outboundSchema` instead. */
    TaskResultSchemas4$.outboundSchema = exports.TaskResultSchemas4$outboundSchema;
})(TaskResultSchemas4$ || (exports.TaskResultSchemas4$ = TaskResultSchemas4$ = {}));
function taskResultSchemas4ToJSON(taskResultSchemas4) {
    return JSON.stringify(exports.TaskResultSchemas4$outboundSchema.parse(taskResultSchemas4));
}
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()),
]);
/** @internal */
exports.TaskResultSchemasSourceValue$outboundSchema = z.union([
    z.string(),
    z.number(),
    z.boolean(),
    z.lazy(() => exports.TaskResultSchemas4$outboundSchema),
    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 TaskResultSchemasSourceValue$;
(function (TaskResultSchemasSourceValue$) {
    /** @deprecated use `TaskResultSchemasSourceValue$inboundSchema` instead. */
    TaskResultSchemasSourceValue$.inboundSchema = exports.TaskResultSchemasSourceValue$inboundSchema;
    /** @deprecated use `TaskResultSchemasSourceValue$outboundSchema` instead. */
    TaskResultSchemasSourceValue$.outboundSchema = exports.TaskResultSchemasSourceValue$outboundSchema;
})(TaskResultSchemasSourceValue$ || (exports.TaskResultSchemasSourceValue$ = TaskResultSchemasSourceValue$ = {}));
function taskResultSchemasSourceValueToJSON(taskResultSchemasSourceValue) {
    return JSON.stringify(exports.TaskResultSchemasSourceValue$outboundSchema.parse(taskResultSchemasSourceValue));
}
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 = z
    .union([
    z.nativeEnum(TaskResultSchemasValue),
    z.string().transform(enums_js_1.catchUnrecognizedEnum),
]);
/** @internal */
exports.TaskResultSchemasValue$outboundSchema = z.union([
    z.nativeEnum(TaskResultSchemasValue),
    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 TaskResultSchemasValue$;
(function (TaskResultSchemasValue$) {
    /** @deprecated use `TaskResultSchemasValue$inboundSchema` instead. */
    TaskResultSchemasValue$.inboundSchema = exports.TaskResultSchemasValue$inboundSchema;
    /** @deprecated use `TaskResultSchemasValue$outboundSchema` instead. */
    TaskResultSchemasValue$.outboundSchema = exports.TaskResultSchemasValue$outboundSchema;
})(TaskResultSchemasValue$ || (exports.TaskResultSchemasValue$ = 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",
    });
});
/** @internal */
exports.TaskResultType$outboundSchema = z.object({
    sourceValue: z.nullable(z.union([
        z.string(),
        z.number(),
        z.boolean(),
        z.lazy(() => exports.TaskResultSchemas4$outboundSchema),
        z.array(z.any()),
    ])).optional(),
    value: z.nullable(exports.TaskResultSchemasValue$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 TaskResultType$;
(function (TaskResultType$) {
    /** @deprecated use `TaskResultType$inboundSchema` instead. */
    TaskResultType$.inboundSchema = exports.TaskResultType$inboundSchema;
    /** @deprecated use `TaskResultType$outboundSchema` instead. */
    TaskResultType$.outboundSchema = exports.TaskResultType$outboundSchema;
})(TaskResultType$ || (exports.TaskResultType$ = TaskResultType$ = {}));
function taskResultTypeToJSON(taskResultType) {
    return JSON.stringify(exports.TaskResultType$outboundSchema.parse(taskResultType));
}
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",
    });
});
/** @internal */
exports.TaskResultData$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.TaskResultStatus$outboundSchema)).optional(),
    type: z.nullable(z.lazy(() => exports.TaskResultType$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 TaskResultData$;
(function (TaskResultData$) {
    /** @deprecated use `TaskResultData$inboundSchema` instead. */
    TaskResultData$.inboundSchema = exports.TaskResultData$inboundSchema;
    /** @deprecated use `TaskResultData$outboundSchema` instead. */
    TaskResultData$.outboundSchema = exports.TaskResultData$outboundSchema;
})(TaskResultData$ || (exports.TaskResultData$ = TaskResultData$ = {}));
function taskResultDataToJSON(taskResultData) {
    return JSON.stringify(exports.TaskResultData$outboundSchema.parse(taskResultData));
}
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(),
});
/** @internal */
exports.TaskResult$outboundSchema = z.object({
    data: z.nullable(z.lazy(() => exports.TaskResultData$outboundSchema)).optional(),
    raw: z.nullable(z.array(rawresponse_js_1.RawResponse$outboundSchema)).optional(),
});
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
var TaskResult$;
(function (TaskResult$) {
    /** @deprecated use `TaskResult$inboundSchema` instead. */
    TaskResult$.inboundSchema = exports.TaskResult$inboundSchema;
    /** @deprecated use `TaskResult$outboundSchema` instead. */
    TaskResult$.outboundSchema = exports.TaskResult$outboundSchema;
})(TaskResult$ || (exports.TaskResult$ = TaskResult$ = {}));
function taskResultToJSON(taskResult) {
    return JSON.stringify(exports.TaskResult$outboundSchema.parse(taskResult));
}
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