"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.answerFromJSON = exports.answerToJSON = exports.Answer$ = exports.Answer$outboundSchema = exports.Answer$inboundSchema = exports.typeFromJSON = exports.typeToJSON = exports.Type$ = exports.Type$outboundSchema = exports.Type$inboundSchema = exports.AnswerValue$ = exports.AnswerValue$outboundSchema = exports.AnswerValue$inboundSchema = exports.answerSourceValueFromJSON = exports.answerSourceValueToJSON = exports.AnswerSourceValue$ = exports.AnswerSourceValue$outboundSchema = exports.AnswerSourceValue$inboundSchema = exports.answer4FromJSON = exports.answer4ToJSON = exports.Answer4$ = exports.Answer4$outboundSchema = exports.Answer4$inboundSchema = exports.AnswerValue = 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");
/**
 * 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));
}
exports.answer4ToJSON = answer4ToJSON;
function answer4FromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.Answer4$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Answer4' from JSON`);
}
exports.answer4FromJSON = answer4FromJSON;
/** @internal */
exports.AnswerSourceValue$inboundSchema = z.union([
    z.lazy(() => exports.Answer4$inboundSchema),
    z.string(),
    z.number(),
    z.boolean(),
    z.array(z.any()),
]);
/** @internal */
exports.AnswerSourceValue$outboundSchema = z.union([
    z.lazy(() => exports.Answer4$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 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));
}
exports.answerSourceValueToJSON = answerSourceValueToJSON;
function answerSourceValueFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.AnswerSourceValue$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'AnswerSourceValue' from JSON`);
}
exports.answerSourceValueFromJSON = answerSourceValueFromJSON;
/** @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.Type$inboundSchema = z
    .object({
    source_value: z.nullable(z.union([
        z.lazy(() => exports.Answer4$inboundSchema),
        z.string(),
        z.number(),
        z.boolean(),
        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.Type$outboundSchema = z.object({
    sourceValue: z.nullable(z.union([
        z.lazy(() => exports.Answer4$outboundSchema),
        z.string(),
        z.number(),
        z.boolean(),
        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 Type$;
(function (Type$) {
    /** @deprecated use `Type$inboundSchema` instead. */
    Type$.inboundSchema = exports.Type$inboundSchema;
    /** @deprecated use `Type$outboundSchema` instead. */
    Type$.outboundSchema = exports.Type$outboundSchema;
})(Type$ || (exports.Type$ = Type$ = {}));
function typeToJSON(type) {
    return JSON.stringify(exports.Type$outboundSchema.parse(type));
}
exports.typeToJSON = typeToJSON;
function typeFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.Type$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Type' from JSON`);
}
exports.typeFromJSON = typeFromJSON;
/** @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.Type$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.Type$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));
}
exports.answerToJSON = answerToJSON;
function answerFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.Answer$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Answer' from JSON`);
}
exports.answerFromJSON = answerFromJSON;
//# sourceMappingURL=answer.js.map