/* * 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"; import { Method, Method$inboundSchema } from "./method.js"; export type TransactionPaymentService = { /** * Always `payment-service`. */ type: "payment-service"; /** * The ID for the payment-service. */ id: string; /** * The definition ID of the service used to process this payment. */ paymentServiceDefinitionId: string; method: Method; /** * The display name for the payment service. */ displayName: string; }; /** @internal */ export const TransactionPaymentService$inboundSchema: z.ZodType< TransactionPaymentService, z.ZodTypeDef, unknown > = z.object({ type: z.literal("payment-service").default("payment-service"), id: z.string(), payment_service_definition_id: z.string(), method: Method$inboundSchema, display_name: z.string(), }).transform((v) => { return remap$(v, { "payment_service_definition_id": "paymentServiceDefinitionId", "display_name": "displayName", }); }); export function transactionPaymentServiceFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => TransactionPaymentService$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'TransactionPaymentService' from JSON`, ); }