/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod/v3"; import { safeParse } from "../../lib/schemas.js"; import { Result as SafeParseResult } from "../../types/fp.js"; import { SDKValidationError } from "../errors/sdkvalidationerror.js"; export type PatchTransfer = { metadata?: { [k: string]: string } | null | undefined; /** * Optional alias from a foreign/external system which can be used to reference this resource. */ foreignID?: string | undefined; }; /** @internal */ export const PatchTransfer$inboundSchema: z.ZodType< PatchTransfer, z.ZodTypeDef, unknown > = z.object({ metadata: z.nullable(z.record(z.string())).optional(), foreignID: z.string().optional(), }); /** @internal */ export type PatchTransfer$Outbound = { metadata?: { [k: string]: string } | null | undefined; foreignID?: string | undefined; }; /** @internal */ export const PatchTransfer$outboundSchema: z.ZodType< PatchTransfer$Outbound, z.ZodTypeDef, PatchTransfer > = z.object({ metadata: z.nullable(z.record(z.string())).optional(), foreignID: z.string().optional(), }); export function patchTransferToJSON(patchTransfer: PatchTransfer): string { return JSON.stringify(PatchTransfer$outboundSchema.parse(patchTransfer)); } export function patchTransferFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => PatchTransfer$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'PatchTransfer' from JSON`, ); }