"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.atsCreateOfferRequestDtoFromJSON = exports.atsCreateOfferRequestDtoToJSON = exports.AtsCreateOfferRequestDto$ = exports.AtsCreateOfferRequestDto$outboundSchema = exports.AtsCreateOfferRequestDto$inboundSchema = exports.offerStatusFromJSON = exports.offerStatusToJSON = exports.OfferStatus$ = exports.OfferStatus$outboundSchema = exports.OfferStatus$inboundSchema = exports.AtsCreateOfferRequestDtoValue$ = exports.AtsCreateOfferRequestDtoValue$outboundSchema = exports.AtsCreateOfferRequestDtoValue$inboundSchema = exports.atsCreateOfferRequestDtoSourceValueFromJSON = exports.atsCreateOfferRequestDtoSourceValueToJSON = exports.AtsCreateOfferRequestDtoSourceValue$ = exports.AtsCreateOfferRequestDtoSourceValue$outboundSchema = exports.AtsCreateOfferRequestDtoSourceValue$inboundSchema = exports.atsCreateOfferRequestDto4FromJSON = exports.atsCreateOfferRequestDto4ToJSON = exports.AtsCreateOfferRequestDto4$ = exports.AtsCreateOfferRequestDto4$outboundSchema = exports.AtsCreateOfferRequestDto4$inboundSchema = exports.AtsCreateOfferRequestDtoValue = 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 offerhistory_js_1 = require("./offerhistory.js");
/**
 * The status of the offer.
 */
var AtsCreateOfferRequestDtoValue;
(function (AtsCreateOfferRequestDtoValue) {
    AtsCreateOfferRequestDtoValue["Pending"] = "pending";
    AtsCreateOfferRequestDtoValue["Retracted"] = "retracted";
    AtsCreateOfferRequestDtoValue["Accepted"] = "accepted";
    AtsCreateOfferRequestDtoValue["Rejected"] = "rejected";
    AtsCreateOfferRequestDtoValue["Created"] = "created";
    AtsCreateOfferRequestDtoValue["Approved"] = "approved";
    AtsCreateOfferRequestDtoValue["NotApproved"] = "not_approved";
    AtsCreateOfferRequestDtoValue["UnmappedValue"] = "unmapped_value";
})(AtsCreateOfferRequestDtoValue || (exports.AtsCreateOfferRequestDtoValue = AtsCreateOfferRequestDtoValue = {}));
/** @internal */
exports.AtsCreateOfferRequestDto4$inboundSchema = z.object({});
/** @internal */
exports.AtsCreateOfferRequestDto4$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 AtsCreateOfferRequestDto4$;
(function (AtsCreateOfferRequestDto4$) {
    /** @deprecated use `AtsCreateOfferRequestDto4$inboundSchema` instead. */
    AtsCreateOfferRequestDto4$.inboundSchema = exports.AtsCreateOfferRequestDto4$inboundSchema;
    /** @deprecated use `AtsCreateOfferRequestDto4$outboundSchema` instead. */
    AtsCreateOfferRequestDto4$.outboundSchema = exports.AtsCreateOfferRequestDto4$outboundSchema;
})(AtsCreateOfferRequestDto4$ || (exports.AtsCreateOfferRequestDto4$ = AtsCreateOfferRequestDto4$ = {}));
function atsCreateOfferRequestDto4ToJSON(atsCreateOfferRequestDto4) {
    return JSON.stringify(exports.AtsCreateOfferRequestDto4$outboundSchema.parse(atsCreateOfferRequestDto4));
}
exports.atsCreateOfferRequestDto4ToJSON = atsCreateOfferRequestDto4ToJSON;
function atsCreateOfferRequestDto4FromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.AtsCreateOfferRequestDto4$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'AtsCreateOfferRequestDto4' from JSON`);
}
exports.atsCreateOfferRequestDto4FromJSON = atsCreateOfferRequestDto4FromJSON;
/** @internal */
exports.AtsCreateOfferRequestDtoSourceValue$inboundSchema = z.union([
    z.lazy(() => exports.AtsCreateOfferRequestDto4$inboundSchema),
    z.string(),
    z.number(),
    z.boolean(),
    z.array(z.any()),
]);
/** @internal */
exports.AtsCreateOfferRequestDtoSourceValue$outboundSchema = z.union([
    z.lazy(() => exports.AtsCreateOfferRequestDto4$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 AtsCreateOfferRequestDtoSourceValue$;
(function (AtsCreateOfferRequestDtoSourceValue$) {
    /** @deprecated use `AtsCreateOfferRequestDtoSourceValue$inboundSchema` instead. */
    AtsCreateOfferRequestDtoSourceValue$.inboundSchema = exports.AtsCreateOfferRequestDtoSourceValue$inboundSchema;
    /** @deprecated use `AtsCreateOfferRequestDtoSourceValue$outboundSchema` instead. */
    AtsCreateOfferRequestDtoSourceValue$.outboundSchema = exports.AtsCreateOfferRequestDtoSourceValue$outboundSchema;
})(AtsCreateOfferRequestDtoSourceValue$ || (exports.AtsCreateOfferRequestDtoSourceValue$ = AtsCreateOfferRequestDtoSourceValue$ = {}));
function atsCreateOfferRequestDtoSourceValueToJSON(atsCreateOfferRequestDtoSourceValue) {
    return JSON.stringify(exports.AtsCreateOfferRequestDtoSourceValue$outboundSchema.parse(atsCreateOfferRequestDtoSourceValue));
}
exports.atsCreateOfferRequestDtoSourceValueToJSON = atsCreateOfferRequestDtoSourceValueToJSON;
function atsCreateOfferRequestDtoSourceValueFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.AtsCreateOfferRequestDtoSourceValue$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'AtsCreateOfferRequestDtoSourceValue' from JSON`);
}
exports.atsCreateOfferRequestDtoSourceValueFromJSON = atsCreateOfferRequestDtoSourceValueFromJSON;
/** @internal */
exports.AtsCreateOfferRequestDtoValue$inboundSchema = z
    .union([
    z.nativeEnum(AtsCreateOfferRequestDtoValue),
    z.string().transform(enums_js_1.catchUnrecognizedEnum),
]);
/** @internal */
exports.AtsCreateOfferRequestDtoValue$outboundSchema = z.union([
    z.nativeEnum(AtsCreateOfferRequestDtoValue),
    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 AtsCreateOfferRequestDtoValue$;
(function (AtsCreateOfferRequestDtoValue$) {
    /** @deprecated use `AtsCreateOfferRequestDtoValue$inboundSchema` instead. */
    AtsCreateOfferRequestDtoValue$.inboundSchema = exports.AtsCreateOfferRequestDtoValue$inboundSchema;
    /** @deprecated use `AtsCreateOfferRequestDtoValue$outboundSchema` instead. */
    AtsCreateOfferRequestDtoValue$.outboundSchema = exports.AtsCreateOfferRequestDtoValue$outboundSchema;
})(AtsCreateOfferRequestDtoValue$ || (exports.AtsCreateOfferRequestDtoValue$ = AtsCreateOfferRequestDtoValue$ = {}));
/** @internal */
exports.OfferStatus$inboundSchema = z.object({
    source_value: z.nullable(z.union([
        z.lazy(() => exports.AtsCreateOfferRequestDto4$inboundSchema),
        z.string(),
        z.number(),
        z.boolean(),
        z.array(z.any()),
    ])).optional(),
    value: z.nullable(exports.AtsCreateOfferRequestDtoValue$inboundSchema).optional(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        "source_value": "sourceValue",
    });
});
/** @internal */
exports.OfferStatus$outboundSchema = z.object({
    sourceValue: z.nullable(z.union([
        z.lazy(() => exports.AtsCreateOfferRequestDto4$outboundSchema),
        z.string(),
        z.number(),
        z.boolean(),
        z.array(z.any()),
    ])).optional(),
    value: z.nullable(exports.AtsCreateOfferRequestDtoValue$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 OfferStatus$;
(function (OfferStatus$) {
    /** @deprecated use `OfferStatus$inboundSchema` instead. */
    OfferStatus$.inboundSchema = exports.OfferStatus$inboundSchema;
    /** @deprecated use `OfferStatus$outboundSchema` instead. */
    OfferStatus$.outboundSchema = exports.OfferStatus$outboundSchema;
})(OfferStatus$ || (exports.OfferStatus$ = OfferStatus$ = {}));
function offerStatusToJSON(offerStatus) {
    return JSON.stringify(exports.OfferStatus$outboundSchema.parse(offerStatus));
}
exports.offerStatusToJSON = offerStatusToJSON;
function offerStatusFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.OfferStatus$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'OfferStatus' from JSON`);
}
exports.offerStatusFromJSON = offerStatusFromJSON;
/** @internal */
exports.AtsCreateOfferRequestDto$inboundSchema = z.object({
    application_id: z.nullable(z.string()).optional(),
    currency: z.nullable(z.string()).optional(),
    offer_history: z.nullable(z.array(offerhistory_js_1.OfferHistory$inboundSchema)).optional(),
    offer_status: z.nullable(z.lazy(() => exports.OfferStatus$inboundSchema)).optional(),
    passthrough: z.nullable(z.record(z.any())).optional(),
    salary: z.nullable(z.number()).optional(),
    start_date: z.nullable(z.string().datetime({ offset: true }).transform(v => new Date(v))).optional(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        "application_id": "applicationId",
        "offer_history": "offerHistory",
        "offer_status": "offerStatus",
        "start_date": "startDate",
    });
});
/** @internal */
exports.AtsCreateOfferRequestDto$outboundSchema = z.object({
    applicationId: z.nullable(z.string()).optional(),
    currency: z.nullable(z.string()).optional(),
    offerHistory: z.nullable(z.array(offerhistory_js_1.OfferHistory$outboundSchema)).optional(),
    offerStatus: z.nullable(z.lazy(() => exports.OfferStatus$outboundSchema)).optional(),
    passthrough: z.nullable(z.record(z.any())).optional(),
    salary: z.nullable(z.number()).optional(),
    startDate: z.nullable(z.date().transform(v => v.toISOString())).optional(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        applicationId: "application_id",
        offerHistory: "offer_history",
        offerStatus: "offer_status",
        startDate: "start_date",
    });
});
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
var AtsCreateOfferRequestDto$;
(function (AtsCreateOfferRequestDto$) {
    /** @deprecated use `AtsCreateOfferRequestDto$inboundSchema` instead. */
    AtsCreateOfferRequestDto$.inboundSchema = exports.AtsCreateOfferRequestDto$inboundSchema;
    /** @deprecated use `AtsCreateOfferRequestDto$outboundSchema` instead. */
    AtsCreateOfferRequestDto$.outboundSchema = exports.AtsCreateOfferRequestDto$outboundSchema;
})(AtsCreateOfferRequestDto$ || (exports.AtsCreateOfferRequestDto$ = AtsCreateOfferRequestDto$ = {}));
function atsCreateOfferRequestDtoToJSON(atsCreateOfferRequestDto) {
    return JSON.stringify(exports.AtsCreateOfferRequestDto$outboundSchema.parse(atsCreateOfferRequestDto));
}
exports.atsCreateOfferRequestDtoToJSON = atsCreateOfferRequestDtoToJSON;
function atsCreateOfferRequestDtoFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.AtsCreateOfferRequestDto$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'AtsCreateOfferRequestDto' from JSON`);
}
exports.atsCreateOfferRequestDtoFromJSON = atsCreateOfferRequestDtoFromJSON;
//# sourceMappingURL=atscreateofferrequestdto.js.map