/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod"; import { remap as remap$ } from "../../lib/primitives.js"; import { ClosedEnum } from "../../types/enums.js"; /** * Type of custom field */ export const CustomFieldV2FieldType = { SingleSelect: "single_select", MultiSelect: "multi_select", Text: "text", Link: "link", Numeric: "numeric", } as const; /** * Type of custom field */ export type CustomFieldV2FieldType = ClosedEnum; export type CustomFieldV2 = { /** * For catalog fields, the ID of the associated catalog type */ catalogTypeId?: string | undefined; /** * When the action was created */ createdAt: Date; /** * Description of the custom field */ description: string; /** * Type of custom field */ fieldType: CustomFieldV2FieldType; /** * Unique identifier for the custom field */ id: string; /** * Human readable name for the custom field */ name: string; /** * When the action was last updated */ updatedAt: Date; }; /** @internal */ export const CustomFieldV2FieldType$inboundSchema: z.ZodNativeEnum< typeof CustomFieldV2FieldType > = z.nativeEnum(CustomFieldV2FieldType); /** @internal */ export const CustomFieldV2FieldType$outboundSchema: z.ZodNativeEnum< typeof CustomFieldV2FieldType > = CustomFieldV2FieldType$inboundSchema; /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace CustomFieldV2FieldType$ { /** @deprecated use `CustomFieldV2FieldType$inboundSchema` instead. */ export const inboundSchema = CustomFieldV2FieldType$inboundSchema; /** @deprecated use `CustomFieldV2FieldType$outboundSchema` instead. */ export const outboundSchema = CustomFieldV2FieldType$outboundSchema; } /** @internal */ export const CustomFieldV2$inboundSchema: z.ZodType< CustomFieldV2, z.ZodTypeDef, unknown > = z.object({ catalog_type_id: z.string().optional(), created_at: z.string().datetime({ offset: true }).transform(v => new Date(v)), description: z.string(), field_type: CustomFieldV2FieldType$inboundSchema, id: z.string(), name: z.string(), updated_at: z.string().datetime({ offset: true }).transform(v => new Date(v)), }).transform((v) => { return remap$(v, { "catalog_type_id": "catalogTypeId", "created_at": "createdAt", "field_type": "fieldType", "updated_at": "updatedAt", }); }); /** @internal */ export type CustomFieldV2$Outbound = { catalog_type_id?: string | undefined; created_at: string; description: string; field_type: string; id: string; name: string; updated_at: string; }; /** @internal */ export const CustomFieldV2$outboundSchema: z.ZodType< CustomFieldV2$Outbound, z.ZodTypeDef, CustomFieldV2 > = z.object({ catalogTypeId: z.string().optional(), createdAt: z.date().transform(v => v.toISOString()), description: z.string(), fieldType: CustomFieldV2FieldType$outboundSchema, id: z.string(), name: z.string(), updatedAt: z.date().transform(v => v.toISOString()), }).transform((v) => { return remap$(v, { catalogTypeId: "catalog_type_id", createdAt: "created_at", fieldType: "field_type", updatedAt: "updated_at", }); }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace CustomFieldV2$ { /** @deprecated use `CustomFieldV2$inboundSchema` instead. */ export const inboundSchema = CustomFieldV2$inboundSchema; /** @deprecated use `CustomFieldV2$outboundSchema` instead. */ export const outboundSchema = CustomFieldV2$outboundSchema; /** @deprecated use `CustomFieldV2$Outbound` instead. */ export type Outbound = CustomFieldV2$Outbound; }