/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod/v4-mini"; import { smartUnion } from "../../types/smartUnion.js"; import { CustomFieldTextProperties, CustomFieldTextProperties$Outbound, CustomFieldTextProperties$outboundSchema, } from "./customfieldtextproperties.js"; export type CustomFieldUpdateTextMetadata = string | number | number | boolean; /** * Schema to update a custom field of type text. */ export type CustomFieldUpdateText = { /** * Key-value object allowing you to store additional information. * * @remarks * * The key must be a string with a maximum length of **40 characters**. * The value must be either: * * * A string with a maximum length of **500 characters** * * An integer * * A floating-point number * * A boolean * * You can store up to **50 key-value pairs**. */ metadata?: { [k: string]: string | number | number | boolean } | undefined; name?: string | null | undefined; slug?: string | null | undefined; type: "text"; properties?: CustomFieldTextProperties | null | undefined; }; /** @internal */ export type CustomFieldUpdateTextMetadata$Outbound = | string | number | number | boolean; /** @internal */ export const CustomFieldUpdateTextMetadata$outboundSchema: z.ZodMiniType< CustomFieldUpdateTextMetadata$Outbound, CustomFieldUpdateTextMetadata > = smartUnion([z.string(), z.int(), z.number(), z.boolean()]); export function customFieldUpdateTextMetadataToJSON( customFieldUpdateTextMetadata: CustomFieldUpdateTextMetadata, ): string { return JSON.stringify( CustomFieldUpdateTextMetadata$outboundSchema.parse( customFieldUpdateTextMetadata, ), ); } /** @internal */ export type CustomFieldUpdateText$Outbound = { metadata?: { [k: string]: string | number | number | boolean } | undefined; name?: string | null | undefined; slug?: string | null | undefined; type: "text"; properties?: CustomFieldTextProperties$Outbound | null | undefined; }; /** @internal */ export const CustomFieldUpdateText$outboundSchema: z.ZodMiniType< CustomFieldUpdateText$Outbound, CustomFieldUpdateText > = z.object({ metadata: z.optional( z.record( z.string(), smartUnion([z.string(), z.int(), z.number(), z.boolean()]), ), ), name: z.optional(z.nullable(z.string())), slug: z.optional(z.nullable(z.string())), type: z.literal("text"), properties: z.optional(z.nullable(CustomFieldTextProperties$outboundSchema)), }); export function customFieldUpdateTextToJSON( customFieldUpdateText: CustomFieldUpdateText, ): string { return JSON.stringify( CustomFieldUpdateText$outboundSchema.parse(customFieldUpdateText), ); }