/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod"; import { remap as remap$ } from "../../lib/primitives.js"; import { safeParse } from "../../lib/schemas.js"; import { Result as SafeParseResult } from "../../types/fp.js"; import { SDKValidationError } from "../errors/sdkvalidationerror.js"; /** * Request to determine if a potential cash journal will be considered first party or third party */ export type CheckPartyTypeRequestCreate = { /** * The destination account of the potential cash journal */ destinationAccount: string; /** * The source account of the potential cash journal */ sourceAccount: string; }; /** @internal */ export const CheckPartyTypeRequestCreate$inboundSchema: z.ZodType< CheckPartyTypeRequestCreate, z.ZodTypeDef, unknown > = z.object({ destination_account: z.string(), source_account: z.string(), }).transform((v) => { return remap$(v, { "destination_account": "destinationAccount", "source_account": "sourceAccount", }); }); /** @internal */ export type CheckPartyTypeRequestCreate$Outbound = { destination_account: string; source_account: string; }; /** @internal */ export const CheckPartyTypeRequestCreate$outboundSchema: z.ZodType< CheckPartyTypeRequestCreate$Outbound, z.ZodTypeDef, CheckPartyTypeRequestCreate > = z.object({ destinationAccount: z.string(), sourceAccount: z.string(), }).transform((v) => { return remap$(v, { destinationAccount: "destination_account", sourceAccount: "source_account", }); }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace CheckPartyTypeRequestCreate$ { /** @deprecated use `CheckPartyTypeRequestCreate$inboundSchema` instead. */ export const inboundSchema = CheckPartyTypeRequestCreate$inboundSchema; /** @deprecated use `CheckPartyTypeRequestCreate$outboundSchema` instead. */ export const outboundSchema = CheckPartyTypeRequestCreate$outboundSchema; /** @deprecated use `CheckPartyTypeRequestCreate$Outbound` instead. */ export type Outbound = CheckPartyTypeRequestCreate$Outbound; } export function checkPartyTypeRequestCreateToJSON( checkPartyTypeRequestCreate: CheckPartyTypeRequestCreate, ): string { return JSON.stringify( CheckPartyTypeRequestCreate$outboundSchema.parse( checkPartyTypeRequestCreate, ), ); } export function checkPartyTypeRequestCreateFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => CheckPartyTypeRequestCreate$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CheckPartyTypeRequestCreate' from JSON`, ); }