/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod/v3"; import { remap as remap$ } from "../../lib/primitives.js"; import { lazySchema as lazySchema$, safeParse } from "../../lib/schemas.js"; import { Result as SafeParseResult } from "../../types/fp.js"; import * as types from "../../types/primitives.js"; import { SDKValidationError } from "../errors/sdkvalidationerror.js"; export type CustomMapping = { /** * Target Field ID */ id?: string | undefined; /** * Target Field name to use as a label */ label?: string | undefined; /** * Target Field description */ description?: string | null | undefined; /** * Target Field Mapping value */ value?: string | undefined; /** * Target Field Key */ key?: string | undefined; /** * Target Field Mapping is required */ required?: boolean | undefined; /** * This mapping represents a finder for a custom field */ customField?: boolean | undefined; /** * Consumer ID */ consumerId?: string | null | undefined; /** * Target Field Mapping example value from downstream */ example?: string | null | undefined; }; /** @internal */ export const CustomMapping$inboundSchema: z.ZodType< CustomMapping, z.ZodTypeDef, unknown > = /* @__PURE__ */ lazySchema$(() => z.object({ id: types.optional(types.string()), label: types.optional(types.string()), description: z.nullable(types.string()).optional(), value: types.optional(types.string()), key: types.optional(types.string()), required: types.optional(types.boolean()), custom_field: types.optional(types.boolean()), consumer_id: z.nullable(types.string()).optional(), example: z.nullable(types.string()).optional(), }).transform((v) => { return remap$(v, { "custom_field": "customField", "consumer_id": "consumerId", }); }) ); export function customMappingFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => CustomMapping$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CustomMapping' from JSON`, ); }