/* * 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 Result = { /** * The error status code for the attempted creation of the source account. */ statusCode?: string | undefined; /** * The error description for the attempted creation of the source account. */ error?: string | undefined; }; /** * Describes the error that occured when trying to create the specified source account. */ export type SourceAccountBatchErrorResponse = { /** * Unique ID for the source account. */ sourceAccountId?: string | undefined; result?: Result | undefined; }; /** @internal */ export const Result$inboundSchema: z.ZodType = z .object({ statusCode: z.string().optional(), error: z.string().optional(), }); export function resultFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => Result$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Result' from JSON`, ); } /** @internal */ export const SourceAccountBatchErrorResponse$inboundSchema: z.ZodType< SourceAccountBatchErrorResponse, z.ZodTypeDef, unknown > = z.object({ sourceAccountId: z.string().optional(), result: z.lazy(() => Result$inboundSchema).optional(), }); export function sourceAccountBatchErrorResponseFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => SourceAccountBatchErrorResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'SourceAccountBatchErrorResponse' from JSON`, ); }