/* * 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 { safeParse } from "../../lib/schemas.js"; import { Result as SafeParseResult } from "../../types/fp.js"; import { SDKValidationError } from "../errors/sdkvalidationerror.js"; export type PayoutPaymentService = { /** * Always `payment-service`. */ type: "payment-service"; /** * The ID for the payout service. */ id?: string | null | undefined; /** * Always `card`. */ method: "card"; /** * The ID of the connection used for this payout. */ paymentServiceDefinitionId: string; /** * The display name of the connection used for this payout. */ displayName?: string | null | undefined; }; /** @internal */ export const PayoutPaymentService$inboundSchema: z.ZodType< PayoutPaymentService, z.ZodTypeDef, unknown > = z.object({ type: z.literal("payment-service").default("payment-service"), id: z.nullable(z.string()).optional(), method: z.literal("card").default("card"), payment_service_definition_id: z.string(), display_name: z.nullable(z.string()).optional(), }).transform((v) => { return remap$(v, { "payment_service_definition_id": "paymentServiceDefinitionId", "display_name": "displayName", }); }); export function payoutPaymentServiceFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => PayoutPaymentService$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'PayoutPaymentService' from JSON`, ); }