/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod/v4-mini"; import { remap as remap$ } from "../../lib/primitives.js"; import { safeParse } from "../../lib/schemas.js"; import { Result as SafeParseResult } from "../../types/fp.js"; import * as types from "../../types/primitives.js"; import { SDKValidationError } from "./sdk-validation-error.js"; export type PaymentAttemptResponse = { attemptNumber?: number | undefined; createdAt?: Date | undefined; createdBy?: string | undefined; errorMessage?: string | undefined; id?: string | undefined; metadata?: { [k: string]: string } | undefined; paymentId?: string | undefined; tenantId?: string | undefined; updatedAt?: Date | undefined; updatedBy?: string | undefined; }; /** @internal */ export const PaymentAttemptResponse$inboundSchema: z.ZodMiniType< PaymentAttemptResponse, unknown > = z.pipe( z.object({ attempt_number: types.optional(types.number()), created_at: types.optional(types.date()), created_by: types.optional(types.string()), error_message: types.optional(types.string()), id: types.optional(types.string()), metadata: types.optional(z.record(z.string(), types.string())), payment_id: types.optional(types.string()), tenant_id: types.optional(types.string()), updated_at: types.optional(types.date()), updated_by: types.optional(types.string()), }), z.transform((v) => { return remap$(v, { "attempt_number": "attemptNumber", "created_at": "createdAt", "created_by": "createdBy", "error_message": "errorMessage", "payment_id": "paymentId", "tenant_id": "tenantId", "updated_at": "updatedAt", "updated_by": "updatedBy", }); }), ); export function paymentAttemptResponseFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => PaymentAttemptResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'PaymentAttemptResponse' from JSON`, ); }