/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod/v3"; import { remap as remap$ } from "../../lib/primitives.js"; import * as components from "../components/index.js"; export type CreateFullTransactionRefundGlobals = { merchantAccountId?: string | undefined; }; export type CreateFullTransactionRefundRequest = { /** * The ID of the transaction */ transactionId: string; /** * The ID of the merchant account to use for this request. */ merchantAccountId?: string | null | undefined; /** * A unique key that identifies this request. Providing this header will make this an idempotent request. We recommend using V4 UUIDs, or another random string with enough entropy to avoid collisions. */ idempotencyKey?: string | null | undefined; transactionRefundAllCreate?: | components.TransactionRefundAllCreate | null | undefined; }; /** @internal */ export type CreateFullTransactionRefundRequest$Outbound = { transaction_id: string; merchantAccountId?: string | null | undefined; "idempotency-key"?: string | null | undefined; TransactionRefundAllCreate?: | components.TransactionRefundAllCreate$Outbound | null | undefined; }; /** @internal */ export const CreateFullTransactionRefundRequest$outboundSchema: z.ZodType< CreateFullTransactionRefundRequest$Outbound, z.ZodTypeDef, CreateFullTransactionRefundRequest > = z.object({ transactionId: z.string(), merchantAccountId: z.nullable(z.string()).optional(), idempotencyKey: z.nullable(z.string()).optional(), transactionRefundAllCreate: z.nullable( components.TransactionRefundAllCreate$outboundSchema, ).optional(), }).transform((v) => { return remap$(v, { transactionId: "transaction_id", idempotencyKey: "idempotency-key", transactionRefundAllCreate: "TransactionRefundAllCreate", }); }); export function createFullTransactionRefundRequestToJSON( createFullTransactionRefundRequest: CreateFullTransactionRefundRequest, ): string { return JSON.stringify( CreateFullTransactionRefundRequest$outboundSchema.parse( createFullTransactionRefundRequest, ), ); }