"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.Question$inboundSchema = exports.QuestionType$inboundSchema = exports.QuestionValue$inboundSchema = exports.QuestionSourceValue$inboundSchema = exports.Question4$inboundSchema = exports.QuestionRequired$inboundSchema = exports.Question2$inboundSchema = exports.ParentQuestion$inboundSchema = exports.ConditionType$inboundSchema = exports.QuestionSchemasValue$inboundSchema = exports.QuestionSchemasSourceValue$inboundSchema = exports.QuestionSchemas4$inboundSchema = exports.QuestionValue = exports.Question2 = exports.QuestionSchemasValue = void 0;
exports.questionSchemas4FromJSON = questionSchemas4FromJSON;
exports.questionSchemasSourceValueFromJSON = questionSchemasSourceValueFromJSON;
exports.conditionTypeFromJSON = conditionTypeFromJSON;
exports.parentQuestionFromJSON = parentQuestionFromJSON;
exports.questionRequiredFromJSON = questionRequiredFromJSON;
exports.question4FromJSON = question4FromJSON;
exports.questionSourceValueFromJSON = questionSourceValueFromJSON;
exports.questionTypeFromJSON = questionTypeFromJSON;
exports.questionFromJSON = questionFromJSON;
const z = __importStar(require("zod/v3"));
const primitives_js_1 = require("../../../lib/primitives.js");
const schemas_js_1 = require("../../../lib/schemas.js");
const openEnums = __importStar(require("../../types/enums.js"));
const questionmultiplechoiceanswers_js_1 = require("./questionmultiplechoiceanswers.js");
/**
 * The type of the question's condition
 */
var QuestionSchemasValue;
(function (QuestionSchemasValue) {
    QuestionSchemasValue["EqualsTo"] = "equals_to";
    QuestionSchemasValue["Contains"] = "contains";
    QuestionSchemasValue["UnmappedValue"] = "unmapped_value";
})(QuestionSchemasValue || (exports.QuestionSchemasValue = QuestionSchemasValue = {}));
var Question2;
(function (Question2) {
    Question2["True"] = "true";
    Question2["False"] = "false";
})(Question2 || (exports.Question2 = Question2 = {}));
/**
 * The type of the questions.
 */
var QuestionValue;
(function (QuestionValue) {
    QuestionValue["ShortText"] = "short_text";
    QuestionValue["LongText"] = "long_text";
    QuestionValue["Attachment"] = "attachment";
    QuestionValue["MultiSelect"] = "multi_select";
    QuestionValue["SingleSelect"] = "single_select";
    QuestionValue["Boolean"] = "boolean";
    QuestionValue["Number"] = "number";
    QuestionValue["Date"] = "date";
    QuestionValue["Video"] = "video";
    QuestionValue["ReferenceCheck"] = "reference_check";
    QuestionValue["Url"] = "url";
    QuestionValue["UnmappedValue"] = "unmapped_value";
})(QuestionValue || (exports.QuestionValue = QuestionValue = {}));
/** @internal */
exports.QuestionSchemas4$inboundSchema = z.object({});
function questionSchemas4FromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.QuestionSchemas4$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'QuestionSchemas4' from JSON`);
}
/** @internal */
exports.QuestionSchemasSourceValue$inboundSchema = z.union([
    z.string(),
    z.number(),
    z.boolean(),
    z.lazy(() => exports.QuestionSchemas4$inboundSchema),
    z.array(z.any()),
]);
function questionSchemasSourceValueFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.QuestionSchemasSourceValue$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'QuestionSchemasSourceValue' from JSON`);
}
/** @internal */
exports.QuestionSchemasValue$inboundSchema = openEnums.inboundSchema(QuestionSchemasValue);
/** @internal */
exports.ConditionType$inboundSchema = z.object({
    source_value: z.nullable(z.union([
        z.string(),
        z.number(),
        z.boolean(),
        z.lazy(() => exports.QuestionSchemas4$inboundSchema),
        z.array(z.any()),
    ])).optional(),
    value: z.nullable(exports.QuestionSchemasValue$inboundSchema).optional(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        "source_value": "sourceValue",
    });
});
function conditionTypeFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.ConditionType$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ConditionType' from JSON`);
}
/** @internal */
exports.ParentQuestion$inboundSchema = z.object({
    condition_type: z.nullable(z.lazy(() => exports.ConditionType$inboundSchema))
        .optional(),
    id: z.nullable(z.string()).optional(),
    option_ids: z.nullable(z.array(z.string())).optional(),
    remote_id: z.nullable(z.string()).optional(),
    remote_option_ids: z.nullable(z.array(z.string())).optional(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        "condition_type": "conditionType",
        "option_ids": "optionIds",
        "remote_id": "remoteId",
        "remote_option_ids": "remoteOptionIds",
    });
});
function parentQuestionFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.ParentQuestion$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ParentQuestion' from JSON`);
}
/** @internal */
exports.Question2$inboundSchema = z
    .nativeEnum(Question2);
/** @internal */
exports.QuestionRequired$inboundSchema = z.union([z.boolean(), exports.Question2$inboundSchema]);
function questionRequiredFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.QuestionRequired$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'QuestionRequired' from JSON`);
}
/** @internal */
exports.Question4$inboundSchema = z.object({});
function question4FromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.Question4$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Question4' from JSON`);
}
/** @internal */
exports.QuestionSourceValue$inboundSchema = z.union([
    z.string(),
    z.number(),
    z.boolean(),
    z.lazy(() => exports.Question4$inboundSchema),
    z.array(z.any()),
]);
function questionSourceValueFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.QuestionSourceValue$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'QuestionSourceValue' from JSON`);
}
/** @internal */
exports.QuestionValue$inboundSchema = openEnums.inboundSchema(QuestionValue);
/** @internal */
exports.QuestionType$inboundSchema = z.object({
    source_value: z.nullable(z.union([
        z.string(),
        z.number(),
        z.boolean(),
        z.lazy(() => exports.Question4$inboundSchema),
        z.array(z.any()),
    ])).optional(),
    value: z.nullable(exports.QuestionValue$inboundSchema).optional(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        "source_value": "sourceValue",
    });
});
function questionTypeFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.QuestionType$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'QuestionType' from JSON`);
}
/** @internal */
exports.Question$inboundSchema = z.object({
    id: z.nullable(z.string()).optional(),
    multiple_choice_answers: z.nullable(z.array(questionmultiplechoiceanswers_js_1.QuestionMultipleChoiceAnswers$inboundSchema)).optional(),
    name: z.nullable(z.string()).optional(),
    parent_question: z.nullable(z.lazy(() => exports.ParentQuestion$inboundSchema))
        .optional(),
    remote_id: z.nullable(z.string()).optional(),
    required: z.nullable(z.union([z.boolean(), exports.Question2$inboundSchema]))
        .optional(),
    text: z.nullable(z.string()).optional(),
    type: z.nullable(z.lazy(() => exports.QuestionType$inboundSchema)).optional(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        "multiple_choice_answers": "multipleChoiceAnswers",
        "parent_question": "parentQuestion",
        "remote_id": "remoteId",
    });
});
function questionFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.Question$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Question' from JSON`);
}
//# sourceMappingURL=question.js.map