/*
 * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
 */
import * as z from "zod";
import { StateEnum$zodSchema } from "./stateenum.js";
/**
 * The type of the metadata field.
 */
export const Type = {
    String: "string",
    Integer: "integer",
    Date: "date",
    Enum: "enum",
    Set: "set",
};
export const Type$zodSchema = z.enum([
    "string",
    "integer",
    "date",
    "enum",
    "set",
]).describe("The type of the metadata field.");
export const DefaultValue$zodSchema = z.union([
    z.string(),
    z.int(),
]).describe("The default value of the metadata field.");
export const Restrictions$zodSchema = z.object({
    readonly_ui: z.boolean().optional().describe("Whether the metadata field is read-only in the UI. when true, the metadata field can only be updated via the API."),
}).describe("The restrictions defined for the metadata field.");
export const MetadataFieldValue$zodSchema = z
    .object({
    external_id: z.string().optional().describe("The external ID of the option."),
    position: z.int().optional().describe("The position of the option."),
    state: StateEnum$zodSchema.optional().describe("The active or inactive state."),
    value: z.string().optional().describe("The value of the option."),
});
export const Datasource$zodSchema = z.object({
    values: z.array(z.lazy(() => MetadataFieldValue$zodSchema)).optional(),
}).describe("The datasource defined for the metadata field.");
export const MetadataField$zodSchema = z.object({
    allow_dynamic_list_values: z.boolean().nullable().optional().describe("Whether the metadata field allows adding new options to the datasource dynamically."),
    datasource: z.lazy(() => Datasource$zodSchema).nullable().optional().describe("The datasource defined for the metadata field."),
    default_disabled: z.boolean().nullable().optional().describe("Whether the default value is disabled."),
    default_value: z.union([
        z.string(),
        z.int(),
    ]).nullable().optional().describe("The default value of the metadata field."),
    external_id: z.string().optional().describe("The external ID of the metadata field."),
    label: z.string().optional().describe("The label of the metadata field."),
    mandatory: z.boolean().nullable().optional().describe("Whether the metadata field is mandatory."),
    restrictions: z.lazy(() => Restrictions$zodSchema).nullable().optional()
        .describe("The restrictions defined for the metadata field."),
    type: Type$zodSchema.optional().describe("The type of the metadata field."),
    validation: z.record(z.string(), z.any()).nullable().optional().describe("The validation defined for the metadata field."),
});
//# sourceMappingURL=metadatafield.js.map