/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod/v4-mini"; import { smartUnion } from "../../types/smart-union.js"; import * as models from "../index.js"; export type RequestBody2 = { paymentIntentId: string; /** * Non-negative integer amount in USDC atomic units. */ finalAmountWei?: string | undefined; meter: models.MeteredInput; }; export type RequestBody1 = { paymentIntentId: string; /** * Non-negative integer amount in USDC atomic units. */ finalAmountWei: string; meter?: models.MeteredInput | undefined; }; export type SettleRequest = RequestBody1 | RequestBody2; /** @internal */ export type RequestBody2$Outbound = { paymentIntentId: string; finalAmountWei?: string | undefined; meter: models.MeteredInput$Outbound; }; /** @internal */ export const RequestBody2$outboundSchema: z.ZodMiniType< RequestBody2$Outbound, RequestBody2 > = z.object({ paymentIntentId: z.string(), finalAmountWei: z.optional(z.string()), meter: models.MeteredInput$outboundSchema, }); export function requestBody2ToJSON(requestBody2: RequestBody2): string { return JSON.stringify(RequestBody2$outboundSchema.parse(requestBody2)); } /** @internal */ export type RequestBody1$Outbound = { paymentIntentId: string; finalAmountWei: string; meter?: models.MeteredInput$Outbound | undefined; }; /** @internal */ export const RequestBody1$outboundSchema: z.ZodMiniType< RequestBody1$Outbound, RequestBody1 > = z.object({ paymentIntentId: z.string(), finalAmountWei: z.string(), meter: z.optional(models.MeteredInput$outboundSchema), }); export function requestBody1ToJSON(requestBody1: RequestBody1): string { return JSON.stringify(RequestBody1$outboundSchema.parse(requestBody1)); } /** @internal */ export type SettleRequest$Outbound = | RequestBody1$Outbound | RequestBody2$Outbound; /** @internal */ export const SettleRequest$outboundSchema: z.ZodMiniType< SettleRequest$Outbound, SettleRequest > = smartUnion([ z.lazy(() => RequestBody1$outboundSchema), z.lazy(() => RequestBody2$outboundSchema), ]); export function settleRequestToJSON(settleRequest: SettleRequest): string { return JSON.stringify(SettleRequest$outboundSchema.parse(settleRequest)); }