"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.Answer$ = exports.Answer$outboundSchema = exports.Answer$inboundSchema = exports.AnswerType$ = exports.AnswerType$outboundSchema = exports.AnswerType$inboundSchema = exports.AnswerValue$ = exports.AnswerValue$outboundSchema = exports.AnswerValue$inboundSchema = exports.AnswerSourceValue$ = exports.AnswerSourceValue$outboundSchema = exports.AnswerSourceValue$inboundSchema = exports.Answer4$ = exports.Answer4$outboundSchema = exports.Answer4$inboundSchema = exports.AnswerValue = void 0;
exports.answer4ToJSON = answer4ToJSON;
exports.answer4FromJSON = answer4FromJSON;
exports.answerSourceValueToJSON = answerSourceValueToJSON;
exports.answerSourceValueFromJSON = answerSourceValueFromJSON;
exports.answerTypeToJSON = answerTypeToJSON;
exports.answerTypeFromJSON = answerTypeFromJSON;
exports.answerToJSON = answerToJSON;
exports.answerFromJSON = answerFromJSON;
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");
/**
 * The type of the answer.
 */
var AnswerValue;
(function (AnswerValue) {
    AnswerValue["ShortText"] = "short_text";
    AnswerValue["LongText"] = "long_text";
    AnswerValue["Attachment"] = "attachment";
    AnswerValue["MultiSelect"] = "multi_select";
    AnswerValue["SingleSelect"] = "single_select";
    AnswerValue["Boolean"] = "boolean";
    AnswerValue["Number"] = "number";
    AnswerValue["Date"] = "date";
    AnswerValue["Video"] = "video";
    AnswerValue["ReferenceCheck"] = "reference_check";
    AnswerValue["Url"] = "url";
    AnswerValue["UnmappedValue"] = "unmapped_value";
})(AnswerValue || (exports.AnswerValue = AnswerValue = {}));
/** @internal */
exports.Answer4$inboundSchema = z.object({});
/** @internal */
exports.Answer4$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 Answer4$;
(function (Answer4$) {
    /** @deprecated use `Answer4$inboundSchema` instead. */
    Answer4$.inboundSchema = exports.Answer4$inboundSchema;
    /** @deprecated use `Answer4$outboundSchema` instead. */
    Answer4$.outboundSchema = exports.Answer4$outboundSchema;
})(Answer4$ || (exports.Answer4$ = Answer4$ = {}));
function answer4ToJSON(answer4) {
    return JSON.stringify(exports.Answer4$outboundSchema.parse(answer4));
}
function answer4FromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.Answer4$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Answer4' from JSON`);
}
/** @internal */
exports.AnswerSourceValue$inboundSchema = z.union([
    z.string(),
    z.number(),
    z.boolean(),
    z.lazy(() => exports.Answer4$inboundSchema),
    z.array(z.any()),
]);
/** @internal */
exports.AnswerSourceValue$outboundSchema = z.union([
    z.string(),
    z.number(),
    z.boolean(),
    z.lazy(() => exports.Answer4$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 AnswerSourceValue$;
(function (AnswerSourceValue$) {
    /** @deprecated use `AnswerSourceValue$inboundSchema` instead. */
    AnswerSourceValue$.inboundSchema = exports.AnswerSourceValue$inboundSchema;
    /** @deprecated use `AnswerSourceValue$outboundSchema` instead. */
    AnswerSourceValue$.outboundSchema = exports.AnswerSourceValue$outboundSchema;
})(AnswerSourceValue$ || (exports.AnswerSourceValue$ = AnswerSourceValue$ = {}));
function answerSourceValueToJSON(answerSourceValue) {
    return JSON.stringify(exports.AnswerSourceValue$outboundSchema.parse(answerSourceValue));
}
function answerSourceValueFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.AnswerSourceValue$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'AnswerSourceValue' from JSON`);
}
/** @internal */
exports.AnswerValue$inboundSchema = z
    .union([
    z.nativeEnum(AnswerValue),
    z.string().transform(enums_js_1.catchUnrecognizedEnum),
]);
/** @internal */
exports.AnswerValue$outboundSchema = z.union([
    z.nativeEnum(AnswerValue),
    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 AnswerValue$;
(function (AnswerValue$) {
    /** @deprecated use `AnswerValue$inboundSchema` instead. */
    AnswerValue$.inboundSchema = exports.AnswerValue$inboundSchema;
    /** @deprecated use `AnswerValue$outboundSchema` instead. */
    AnswerValue$.outboundSchema = exports.AnswerValue$outboundSchema;
})(AnswerValue$ || (exports.AnswerValue$ = AnswerValue$ = {}));
/** @internal */
exports.AnswerType$inboundSchema = z.object({
    source_value: z.nullable(z.union([
        z.string(),
        z.number(),
        z.boolean(),
        z.lazy(() => exports.Answer4$inboundSchema),
        z.array(z.any()),
    ])).optional(),
    value: z.nullable(exports.AnswerValue$inboundSchema).optional(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        "source_value": "sourceValue",
    });
});
/** @internal */
exports.AnswerType$outboundSchema = z.object({
    sourceValue: z.nullable(z.union([
        z.string(),
        z.number(),
        z.boolean(),
        z.lazy(() => exports.Answer4$outboundSchema),
        z.array(z.any()),
    ])).optional(),
    value: z.nullable(exports.AnswerValue$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 AnswerType$;
(function (AnswerType$) {
    /** @deprecated use `AnswerType$inboundSchema` instead. */
    AnswerType$.inboundSchema = exports.AnswerType$inboundSchema;
    /** @deprecated use `AnswerType$outboundSchema` instead. */
    AnswerType$.outboundSchema = exports.AnswerType$outboundSchema;
})(AnswerType$ || (exports.AnswerType$ = AnswerType$ = {}));
function answerTypeToJSON(answerType) {
    return JSON.stringify(exports.AnswerType$outboundSchema.parse(answerType));
}
function answerTypeFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.AnswerType$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'AnswerType' from JSON`);
}
/** @internal */
exports.Answer$inboundSchema = z
    .object({
    id: z.nullable(z.string()).optional(),
    remote_id: z.nullable(z.string()).optional(),
    type: z.nullable(z.lazy(() => exports.AnswerType$inboundSchema)).optional(),
    values: z.nullable(z.array(z.string())).optional(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        "remote_id": "remoteId",
    });
});
/** @internal */
exports.Answer$outboundSchema = z.object({
    id: z.nullable(z.string()).optional(),
    remoteId: z.nullable(z.string()).optional(),
    type: z.nullable(z.lazy(() => exports.AnswerType$outboundSchema)).optional(),
    values: z.nullable(z.array(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 Answer$;
(function (Answer$) {
    /** @deprecated use `Answer$inboundSchema` instead. */
    Answer$.inboundSchema = exports.Answer$inboundSchema;
    /** @deprecated use `Answer$outboundSchema` instead. */
    Answer$.outboundSchema = exports.Answer$outboundSchema;
})(Answer$ || (exports.Answer$ = Answer$ = {}));
function answerToJSON(answer) {
    return JSON.stringify(exports.Answer$outboundSchema.parse(answer));
}
function answerFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.Answer$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Answer' from JSON`);
}
//# sourceMappingURL=answer.js.map