/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod"; import { safeParse } from "../../lib/schemas.js"; import { Result as SafeParseResult } from "../../types/fp.js"; import { SDKValidationError } from "../errors/sdkvalidationerror.js"; export type CustomFieldFinder = { /** * Custom Field ID */ id?: string | undefined; /** * Custom Field name to use as a label if provided */ name?: string | null | undefined; /** * More information about the custom field */ description?: string | null | undefined; /** * Custom Field value */ value?: any | undefined; /** * JSONPath finder for retrieving this value when mapping a response payload from downstream */ finder?: string | undefined; }; /** @internal */ export const CustomFieldFinder$inboundSchema: z.ZodType< CustomFieldFinder, z.ZodTypeDef, unknown > = z.object({ id: z.string().optional(), name: z.nullable(z.string()).optional(), description: z.nullable(z.string()).optional(), value: z.any().optional(), finder: z.string().optional(), }); /** @internal */ export type CustomFieldFinder$Outbound = { id?: string | undefined; name?: string | null | undefined; description?: string | null | undefined; value?: any | undefined; finder?: string | undefined; }; /** @internal */ export const CustomFieldFinder$outboundSchema: z.ZodType< CustomFieldFinder$Outbound, z.ZodTypeDef, CustomFieldFinder > = z.object({ id: z.string().optional(), name: z.nullable(z.string()).optional(), description: z.nullable(z.string()).optional(), value: z.any().optional(), finder: z.string().optional(), }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace CustomFieldFinder$ { /** @deprecated use `CustomFieldFinder$inboundSchema` instead. */ export const inboundSchema = CustomFieldFinder$inboundSchema; /** @deprecated use `CustomFieldFinder$outboundSchema` instead. */ export const outboundSchema = CustomFieldFinder$outboundSchema; /** @deprecated use `CustomFieldFinder$Outbound` instead. */ export type Outbound = CustomFieldFinder$Outbound; } export function customFieldFinderToJSON( customFieldFinder: CustomFieldFinder, ): string { return JSON.stringify( CustomFieldFinder$outboundSchema.parse(customFieldFinder), ); } export function customFieldFinderFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => CustomFieldFinder$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CustomFieldFinder' from JSON`, ); }