"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.ApplicationChanges$ = exports.ApplicationChanges$outboundSchema = exports.ApplicationChanges$inboundSchema = exports.ChangeType$ = exports.ChangeType$outboundSchema = exports.ChangeType$inboundSchema = exports.ApplicationChangesValue$ = exports.ApplicationChangesValue$outboundSchema = exports.ApplicationChangesValue$inboundSchema = exports.ApplicationChangesSourceValue$ = exports.ApplicationChangesSourceValue$outboundSchema = exports.ApplicationChangesSourceValue$inboundSchema = exports.ApplicationChanges4$ = exports.ApplicationChanges4$outboundSchema = exports.ApplicationChanges4$inboundSchema = exports.Actor$ = exports.Actor$outboundSchema = exports.Actor$inboundSchema = exports.ApplicationChangesValue = void 0;
exports.actorToJSON = actorToJSON;
exports.actorFromJSON = actorFromJSON;
exports.applicationChanges4ToJSON = applicationChanges4ToJSON;
exports.applicationChanges4FromJSON = applicationChanges4FromJSON;
exports.applicationChangesSourceValueToJSON = applicationChangesSourceValueToJSON;
exports.applicationChangesSourceValueFromJSON = applicationChangesSourceValueFromJSON;
exports.changeTypeToJSON = changeTypeToJSON;
exports.changeTypeFromJSON = changeTypeFromJSON;
exports.applicationChangesToJSON = applicationChangesToJSON;
exports.applicationChangesFromJSON = applicationChangesFromJSON;
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 applicationchangesdatamodel_js_1 = require("./applicationchangesdatamodel.js");
/**
 * The type of change that occurred to the application
 */
var ApplicationChangesValue;
(function (ApplicationChangesValue) {
    ApplicationChangesValue["ApplicationStatus"] = "application_status";
    ApplicationChangesValue["InterviewStage"] = "interview_stage";
    ApplicationChangesValue["RejectedReasons"] = "rejected_reasons";
    ApplicationChangesValue["UnmappedValue"] = "unmapped_value";
})(ApplicationChangesValue || (exports.ApplicationChangesValue = ApplicationChangesValue = {}));
/** @internal */
exports.Actor$inboundSchema = z
    .object({
    id: z.nullable(z.string()).optional(),
    remote_id: z.nullable(z.string()).optional(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        "remote_id": "remoteId",
    });
});
/** @internal */
exports.Actor$outboundSchema = z.object({
    id: z.nullable(z.string()).optional(),
    remoteId: z.nullable(z.string()).optional(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        remoteId: "remote_id",
    });
});
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
var Actor$;
(function (Actor$) {
    /** @deprecated use `Actor$inboundSchema` instead. */
    Actor$.inboundSchema = exports.Actor$inboundSchema;
    /** @deprecated use `Actor$outboundSchema` instead. */
    Actor$.outboundSchema = exports.Actor$outboundSchema;
})(Actor$ || (exports.Actor$ = Actor$ = {}));
function actorToJSON(actor) {
    return JSON.stringify(exports.Actor$outboundSchema.parse(actor));
}
function actorFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.Actor$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Actor' from JSON`);
}
/** @internal */
exports.ApplicationChanges4$inboundSchema = z.object({});
/** @internal */
exports.ApplicationChanges4$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 ApplicationChanges4$;
(function (ApplicationChanges4$) {
    /** @deprecated use `ApplicationChanges4$inboundSchema` instead. */
    ApplicationChanges4$.inboundSchema = exports.ApplicationChanges4$inboundSchema;
    /** @deprecated use `ApplicationChanges4$outboundSchema` instead. */
    ApplicationChanges4$.outboundSchema = exports.ApplicationChanges4$outboundSchema;
})(ApplicationChanges4$ || (exports.ApplicationChanges4$ = ApplicationChanges4$ = {}));
function applicationChanges4ToJSON(applicationChanges4) {
    return JSON.stringify(exports.ApplicationChanges4$outboundSchema.parse(applicationChanges4));
}
function applicationChanges4FromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.ApplicationChanges4$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ApplicationChanges4' from JSON`);
}
/** @internal */
exports.ApplicationChangesSourceValue$inboundSchema = z.union([
    z.string(),
    z.number(),
    z.boolean(),
    z.lazy(() => exports.ApplicationChanges4$inboundSchema),
    z.array(z.any()),
]);
/** @internal */
exports.ApplicationChangesSourceValue$outboundSchema = z.union([
    z.string(),
    z.number(),
    z.boolean(),
    z.lazy(() => exports.ApplicationChanges4$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 ApplicationChangesSourceValue$;
(function (ApplicationChangesSourceValue$) {
    /** @deprecated use `ApplicationChangesSourceValue$inboundSchema` instead. */
    ApplicationChangesSourceValue$.inboundSchema = exports.ApplicationChangesSourceValue$inboundSchema;
    /** @deprecated use `ApplicationChangesSourceValue$outboundSchema` instead. */
    ApplicationChangesSourceValue$.outboundSchema = exports.ApplicationChangesSourceValue$outboundSchema;
})(ApplicationChangesSourceValue$ || (exports.ApplicationChangesSourceValue$ = ApplicationChangesSourceValue$ = {}));
function applicationChangesSourceValueToJSON(applicationChangesSourceValue) {
    return JSON.stringify(exports.ApplicationChangesSourceValue$outboundSchema.parse(applicationChangesSourceValue));
}
function applicationChangesSourceValueFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.ApplicationChangesSourceValue$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ApplicationChangesSourceValue' from JSON`);
}
/** @internal */
exports.ApplicationChangesValue$inboundSchema = z
    .union([
    z.nativeEnum(ApplicationChangesValue),
    z.string().transform(enums_js_1.catchUnrecognizedEnum),
]);
/** @internal */
exports.ApplicationChangesValue$outboundSchema = z.union([
    z.nativeEnum(ApplicationChangesValue),
    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 ApplicationChangesValue$;
(function (ApplicationChangesValue$) {
    /** @deprecated use `ApplicationChangesValue$inboundSchema` instead. */
    ApplicationChangesValue$.inboundSchema = exports.ApplicationChangesValue$inboundSchema;
    /** @deprecated use `ApplicationChangesValue$outboundSchema` instead. */
    ApplicationChangesValue$.outboundSchema = exports.ApplicationChangesValue$outboundSchema;
})(ApplicationChangesValue$ || (exports.ApplicationChangesValue$ = ApplicationChangesValue$ = {}));
/** @internal */
exports.ChangeType$inboundSchema = z.object({
    source_value: z.nullable(z.union([
        z.string(),
        z.number(),
        z.boolean(),
        z.lazy(() => exports.ApplicationChanges4$inboundSchema),
        z.array(z.any()),
    ])).optional(),
    value: z.nullable(exports.ApplicationChangesValue$inboundSchema).optional(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        "source_value": "sourceValue",
    });
});
/** @internal */
exports.ChangeType$outboundSchema = z.object({
    sourceValue: z.nullable(z.union([
        z.string(),
        z.number(),
        z.boolean(),
        z.lazy(() => exports.ApplicationChanges4$outboundSchema),
        z.array(z.any()),
    ])).optional(),
    value: z.nullable(exports.ApplicationChangesValue$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 ChangeType$;
(function (ChangeType$) {
    /** @deprecated use `ChangeType$inboundSchema` instead. */
    ChangeType$.inboundSchema = exports.ChangeType$inboundSchema;
    /** @deprecated use `ChangeType$outboundSchema` instead. */
    ChangeType$.outboundSchema = exports.ChangeType$outboundSchema;
})(ChangeType$ || (exports.ChangeType$ = ChangeType$ = {}));
function changeTypeToJSON(changeType) {
    return JSON.stringify(exports.ChangeType$outboundSchema.parse(changeType));
}
function changeTypeFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.ChangeType$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ChangeType' from JSON`);
}
/** @internal */
exports.ApplicationChanges$inboundSchema = z.object({
    actor: z.nullable(z.lazy(() => exports.Actor$inboundSchema)).optional(),
    change_type: z.nullable(z.lazy(() => exports.ChangeType$inboundSchema)).optional(),
    created_at: z.string().datetime({ offset: true }).transform(v => new Date(v)),
    effective_at: z.nullable(z.string().datetime({ offset: true }).transform(v => new Date(v))).optional(),
    id: z.nullable(z.string()).optional(),
    new_values: applicationchangesdatamodel_js_1.ApplicationChangesDataModel$inboundSchema,
    remote_id: z.nullable(z.string()).optional(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        "change_type": "changeType",
        "created_at": "createdAt",
        "effective_at": "effectiveAt",
        "new_values": "newValues",
        "remote_id": "remoteId",
    });
});
/** @internal */
exports.ApplicationChanges$outboundSchema = z.object({
    actor: z.nullable(z.lazy(() => exports.Actor$outboundSchema)).optional(),
    changeType: z.nullable(z.lazy(() => exports.ChangeType$outboundSchema)).optional(),
    createdAt: z.date().transform(v => v.toISOString()),
    effectiveAt: z.nullable(z.date().transform(v => v.toISOString())).optional(),
    id: z.nullable(z.string()).optional(),
    newValues: applicationchangesdatamodel_js_1.ApplicationChangesDataModel$outboundSchema,
    remoteId: z.nullable(z.string()).optional(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        changeType: "change_type",
        createdAt: "created_at",
        effectiveAt: "effective_at",
        newValues: "new_values",
        remoteId: "remote_id",
    });
});
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
var ApplicationChanges$;
(function (ApplicationChanges$) {
    /** @deprecated use `ApplicationChanges$inboundSchema` instead. */
    ApplicationChanges$.inboundSchema = exports.ApplicationChanges$inboundSchema;
    /** @deprecated use `ApplicationChanges$outboundSchema` instead. */
    ApplicationChanges$.outboundSchema = exports.ApplicationChanges$outboundSchema;
})(ApplicationChanges$ || (exports.ApplicationChanges$ = ApplicationChanges$ = {}));
function applicationChangesToJSON(applicationChanges) {
    return JSON.stringify(exports.ApplicationChanges$outboundSchema.parse(applicationChanges));
}
function applicationChangesFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.ApplicationChanges$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ApplicationChanges' from JSON`);
}
//# sourceMappingURL=applicationchanges.js.map