"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.customFieldDefinitionFromJSON = exports.customFieldDefinitionToJSON = exports.CustomFieldDefinition$ = exports.CustomFieldDefinition$outboundSchema = exports.CustomFieldDefinition$inboundSchema = exports.customFieldDefinitionTypeFromJSON = exports.customFieldDefinitionTypeToJSON = exports.CustomFieldDefinitionType$ = exports.CustomFieldDefinitionType$outboundSchema = exports.CustomFieldDefinitionType$inboundSchema = exports.CustomFieldDefinitionValue$ = exports.CustomFieldDefinitionValue$outboundSchema = exports.CustomFieldDefinitionValue$inboundSchema = exports.customFieldDefinitionSourceValueFromJSON = exports.customFieldDefinitionSourceValueToJSON = exports.CustomFieldDefinitionSourceValue$ = exports.CustomFieldDefinitionSourceValue$outboundSchema = exports.CustomFieldDefinitionSourceValue$inboundSchema = exports.customFieldDefinitionSchemas4FromJSON = exports.customFieldDefinitionSchemas4ToJSON = exports.CustomFieldDefinitionSchemas4$ = exports.CustomFieldDefinitionSchemas4$outboundSchema = exports.CustomFieldDefinitionSchemas4$inboundSchema = exports.optionsFromJSON = exports.optionsToJSON = exports.Options$ = exports.Options$outboundSchema = exports.Options$inboundSchema = exports.customFieldDefinition4FromJSON = exports.customFieldDefinition4ToJSON = exports.CustomFieldDefinition4$ = exports.CustomFieldDefinition4$outboundSchema = exports.CustomFieldDefinition4$inboundSchema = exports.CustomFieldDefinitionValue = 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");
var CustomFieldDefinitionValue;
(function (CustomFieldDefinitionValue) {
    CustomFieldDefinitionValue["Date"] = "date";
    CustomFieldDefinitionValue["Float"] = "float";
    CustomFieldDefinitionValue["Integer"] = "integer";
    CustomFieldDefinitionValue["List"] = "list";
    CustomFieldDefinitionValue["Checkbox"] = "checkbox";
    CustomFieldDefinitionValue["Text"] = "text";
    CustomFieldDefinitionValue["Boolean"] = "boolean";
    CustomFieldDefinitionValue["SingleSelect"] = "single_select";
    CustomFieldDefinitionValue["MultiSelect"] = "multi_select";
    CustomFieldDefinitionValue["Url"] = "url";
    CustomFieldDefinitionValue["Other"] = "other";
    CustomFieldDefinitionValue["UnmappedValue"] = "unmapped_value";
})(CustomFieldDefinitionValue || (exports.CustomFieldDefinitionValue = CustomFieldDefinitionValue = {}));
/** @internal */
exports.CustomFieldDefinition4$inboundSchema = z.object({});
/** @internal */
exports.CustomFieldDefinition4$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 CustomFieldDefinition4$;
(function (CustomFieldDefinition4$) {
    /** @deprecated use `CustomFieldDefinition4$inboundSchema` instead. */
    CustomFieldDefinition4$.inboundSchema = exports.CustomFieldDefinition4$inboundSchema;
    /** @deprecated use `CustomFieldDefinition4$outboundSchema` instead. */
    CustomFieldDefinition4$.outboundSchema = exports.CustomFieldDefinition4$outboundSchema;
})(CustomFieldDefinition4$ || (exports.CustomFieldDefinition4$ = CustomFieldDefinition4$ = {}));
function customFieldDefinition4ToJSON(customFieldDefinition4) {
    return JSON.stringify(exports.CustomFieldDefinition4$outboundSchema.parse(customFieldDefinition4));
}
exports.customFieldDefinition4ToJSON = customFieldDefinition4ToJSON;
function customFieldDefinition4FromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.CustomFieldDefinition4$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CustomFieldDefinition4' from JSON`);
}
exports.customFieldDefinition4FromJSON = customFieldDefinition4FromJSON;
/** @internal */
exports.Options$inboundSchema = z.union([
    z.lazy(() => exports.CustomFieldDefinition4$inboundSchema),
    z.string(),
    z.number(),
    z.boolean(),
    z.array(z.any()),
]);
/** @internal */
exports.Options$outboundSchema = z.union([
    z.lazy(() => exports.CustomFieldDefinition4$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 Options$;
(function (Options$) {
    /** @deprecated use `Options$inboundSchema` instead. */
    Options$.inboundSchema = exports.Options$inboundSchema;
    /** @deprecated use `Options$outboundSchema` instead. */
    Options$.outboundSchema = exports.Options$outboundSchema;
})(Options$ || (exports.Options$ = Options$ = {}));
function optionsToJSON(options) {
    return JSON.stringify(exports.Options$outboundSchema.parse(options));
}
exports.optionsToJSON = optionsToJSON;
function optionsFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.Options$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Options' from JSON`);
}
exports.optionsFromJSON = optionsFromJSON;
/** @internal */
exports.CustomFieldDefinitionSchemas4$inboundSchema = z.object({});
/** @internal */
exports.CustomFieldDefinitionSchemas4$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 CustomFieldDefinitionSchemas4$;
(function (CustomFieldDefinitionSchemas4$) {
    /** @deprecated use `CustomFieldDefinitionSchemas4$inboundSchema` instead. */
    CustomFieldDefinitionSchemas4$.inboundSchema = exports.CustomFieldDefinitionSchemas4$inboundSchema;
    /** @deprecated use `CustomFieldDefinitionSchemas4$outboundSchema` instead. */
    CustomFieldDefinitionSchemas4$.outboundSchema = exports.CustomFieldDefinitionSchemas4$outboundSchema;
})(CustomFieldDefinitionSchemas4$ || (exports.CustomFieldDefinitionSchemas4$ = CustomFieldDefinitionSchemas4$ = {}));
function customFieldDefinitionSchemas4ToJSON(customFieldDefinitionSchemas4) {
    return JSON.stringify(exports.CustomFieldDefinitionSchemas4$outboundSchema.parse(customFieldDefinitionSchemas4));
}
exports.customFieldDefinitionSchemas4ToJSON = customFieldDefinitionSchemas4ToJSON;
function customFieldDefinitionSchemas4FromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.CustomFieldDefinitionSchemas4$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CustomFieldDefinitionSchemas4' from JSON`);
}
exports.customFieldDefinitionSchemas4FromJSON = customFieldDefinitionSchemas4FromJSON;
/** @internal */
exports.CustomFieldDefinitionSourceValue$inboundSchema = z.union([
    z.lazy(() => exports.CustomFieldDefinitionSchemas4$inboundSchema),
    z.string(),
    z.number(),
    z.boolean(),
    z.array(z.any()),
]);
/** @internal */
exports.CustomFieldDefinitionSourceValue$outboundSchema = z.union([
    z.lazy(() => exports.CustomFieldDefinitionSchemas4$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 CustomFieldDefinitionSourceValue$;
(function (CustomFieldDefinitionSourceValue$) {
    /** @deprecated use `CustomFieldDefinitionSourceValue$inboundSchema` instead. */
    CustomFieldDefinitionSourceValue$.inboundSchema = exports.CustomFieldDefinitionSourceValue$inboundSchema;
    /** @deprecated use `CustomFieldDefinitionSourceValue$outboundSchema` instead. */
    CustomFieldDefinitionSourceValue$.outboundSchema = exports.CustomFieldDefinitionSourceValue$outboundSchema;
})(CustomFieldDefinitionSourceValue$ || (exports.CustomFieldDefinitionSourceValue$ = CustomFieldDefinitionSourceValue$ = {}));
function customFieldDefinitionSourceValueToJSON(customFieldDefinitionSourceValue) {
    return JSON.stringify(exports.CustomFieldDefinitionSourceValue$outboundSchema.parse(customFieldDefinitionSourceValue));
}
exports.customFieldDefinitionSourceValueToJSON = customFieldDefinitionSourceValueToJSON;
function customFieldDefinitionSourceValueFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.CustomFieldDefinitionSourceValue$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CustomFieldDefinitionSourceValue' from JSON`);
}
exports.customFieldDefinitionSourceValueFromJSON = customFieldDefinitionSourceValueFromJSON;
/** @internal */
exports.CustomFieldDefinitionValue$inboundSchema = z
    .union([
    z.nativeEnum(CustomFieldDefinitionValue),
    z.string().transform(enums_js_1.catchUnrecognizedEnum),
]);
/** @internal */
exports.CustomFieldDefinitionValue$outboundSchema = z.union([
    z.nativeEnum(CustomFieldDefinitionValue),
    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 CustomFieldDefinitionValue$;
(function (CustomFieldDefinitionValue$) {
    /** @deprecated use `CustomFieldDefinitionValue$inboundSchema` instead. */
    CustomFieldDefinitionValue$.inboundSchema = exports.CustomFieldDefinitionValue$inboundSchema;
    /** @deprecated use `CustomFieldDefinitionValue$outboundSchema` instead. */
    CustomFieldDefinitionValue$.outboundSchema = exports.CustomFieldDefinitionValue$outboundSchema;
})(CustomFieldDefinitionValue$ || (exports.CustomFieldDefinitionValue$ = CustomFieldDefinitionValue$ = {}));
/** @internal */
exports.CustomFieldDefinitionType$inboundSchema = z.object({
    source_value: z.nullable(z.union([
        z.lazy(() => exports.CustomFieldDefinitionSchemas4$inboundSchema),
        z.string(),
        z.number(),
        z.boolean(),
        z.array(z.any()),
    ])).optional(),
    value: z.nullable(exports.CustomFieldDefinitionValue$inboundSchema).optional(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        "source_value": "sourceValue",
    });
});
/** @internal */
exports.CustomFieldDefinitionType$outboundSchema = z.object({
    sourceValue: z.nullable(z.union([
        z.lazy(() => exports.CustomFieldDefinitionSchemas4$outboundSchema),
        z.string(),
        z.number(),
        z.boolean(),
        z.array(z.any()),
    ])).optional(),
    value: z.nullable(exports.CustomFieldDefinitionValue$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 CustomFieldDefinitionType$;
(function (CustomFieldDefinitionType$) {
    /** @deprecated use `CustomFieldDefinitionType$inboundSchema` instead. */
    CustomFieldDefinitionType$.inboundSchema = exports.CustomFieldDefinitionType$inboundSchema;
    /** @deprecated use `CustomFieldDefinitionType$outboundSchema` instead. */
    CustomFieldDefinitionType$.outboundSchema = exports.CustomFieldDefinitionType$outboundSchema;
})(CustomFieldDefinitionType$ || (exports.CustomFieldDefinitionType$ = CustomFieldDefinitionType$ = {}));
function customFieldDefinitionTypeToJSON(customFieldDefinitionType) {
    return JSON.stringify(exports.CustomFieldDefinitionType$outboundSchema.parse(customFieldDefinitionType));
}
exports.customFieldDefinitionTypeToJSON = customFieldDefinitionTypeToJSON;
function customFieldDefinitionTypeFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.CustomFieldDefinitionType$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CustomFieldDefinitionType' from JSON`);
}
exports.customFieldDefinitionTypeFromJSON = customFieldDefinitionTypeFromJSON;
/** @internal */
exports.CustomFieldDefinition$inboundSchema = z.object({
    description: z.nullable(z.string()).optional(),
    id: z.nullable(z.string()).optional(),
    name: z.nullable(z.string()).optional(),
    options: z.nullable(z.array(z.union([
        z.lazy(() => exports.CustomFieldDefinition4$inboundSchema),
        z.string(),
        z.number(),
        z.boolean(),
        z.array(z.any()),
    ]))).optional(),
    remote_id: z.nullable(z.string()).optional(),
    type: z.nullable(z.lazy(() => exports.CustomFieldDefinitionType$inboundSchema))
        .optional(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        "remote_id": "remoteId",
    });
});
/** @internal */
exports.CustomFieldDefinition$outboundSchema = z.object({
    description: z.nullable(z.string()).optional(),
    id: z.nullable(z.string()).optional(),
    name: z.nullable(z.string()).optional(),
    options: z.nullable(z.array(z.union([
        z.lazy(() => exports.CustomFieldDefinition4$outboundSchema),
        z.string(),
        z.number(),
        z.boolean(),
        z.array(z.any()),
    ]))).optional(),
    remoteId: z.nullable(z.string()).optional(),
    type: z.nullable(z.lazy(() => exports.CustomFieldDefinitionType$outboundSchema))
        .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 CustomFieldDefinition$;
(function (CustomFieldDefinition$) {
    /** @deprecated use `CustomFieldDefinition$inboundSchema` instead. */
    CustomFieldDefinition$.inboundSchema = exports.CustomFieldDefinition$inboundSchema;
    /** @deprecated use `CustomFieldDefinition$outboundSchema` instead. */
    CustomFieldDefinition$.outboundSchema = exports.CustomFieldDefinition$outboundSchema;
})(CustomFieldDefinition$ || (exports.CustomFieldDefinition$ = CustomFieldDefinition$ = {}));
function customFieldDefinitionToJSON(customFieldDefinition) {
    return JSON.stringify(exports.CustomFieldDefinition$outboundSchema.parse(customFieldDefinition));
}
exports.customFieldDefinitionToJSON = customFieldDefinitionToJSON;
function customFieldDefinitionFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.CustomFieldDefinition$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CustomFieldDefinition' from JSON`);
}
exports.customFieldDefinitionFromJSON = customFieldDefinitionFromJSON;
//# sourceMappingURL=customfielddefinition.js.map