/* * 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 { SDKValidationError } from "../errors/sdkvalidationerror.js"; export type BalanceRefundMetadata = { transactionId: string; refundId: string; orderId?: string | undefined; orderCreatedAt?: string | undefined; productId?: string | undefined; subscriptionId?: string | undefined; amount: number; currency: string; presentmentAmount: number; presentmentCurrency: string; refundableAmount?: number | undefined; taxAmount: number; taxState?: string | null | undefined; taxCountry?: string | null | undefined; fee: number; exchangeRate?: number | undefined; }; /** @internal */ export const BalanceRefundMetadata$inboundSchema: z.ZodMiniType< BalanceRefundMetadata, unknown > = z.pipe( z.object({ transaction_id: z.string(), refund_id: z.string(), order_id: z.optional(z.string()), order_created_at: z.optional(z.string()), product_id: z.optional(z.string()), subscription_id: z.optional(z.string()), amount: z.int(), currency: z.string(), presentment_amount: z.int(), presentment_currency: z.string(), refundable_amount: z.optional(z.int()), tax_amount: z.int(), tax_state: z.optional(z.nullable(z.string())), tax_country: z.optional(z.nullable(z.string())), fee: z.int(), exchange_rate: z.optional(z.number()), }), z.transform((v) => { return remap$(v, { "transaction_id": "transactionId", "refund_id": "refundId", "order_id": "orderId", "order_created_at": "orderCreatedAt", "product_id": "productId", "subscription_id": "subscriptionId", "presentment_amount": "presentmentAmount", "presentment_currency": "presentmentCurrency", "refundable_amount": "refundableAmount", "tax_amount": "taxAmount", "tax_state": "taxState", "tax_country": "taxCountry", "exchange_rate": "exchangeRate", }); }), ); export function balanceRefundMetadataFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => BalanceRefundMetadata$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'BalanceRefundMetadata' from JSON`, ); }