/* * 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 openEnums from "../../types/enums.js"; import { OpenEnum } from "../../types/enums.js"; export const PurposeCode = { Mortgage: "mortgage", Utility: "utility", Loan: "loan", DependantSupport: "dependant_support", Gambling: "gambling", Retail: "retail", Salary: "salary", Personal: "personal", Government: "government", Pension: "pension", Tax: "tax", Other: "other", } as const; export type PurposeCode = OpenEnum; export type GoCardlessOptions = { /** * Specifies the high-level purpose of a mandate and/or payment using a set of pre-defined categories. Required for the PayTo scheme, optional for all others */ purposeCode?: PurposeCode | null | undefined; }; /** @internal */ export const PurposeCode$outboundSchema: z.ZodType< string, z.ZodTypeDef, PurposeCode > = openEnums.outboundSchema(PurposeCode); /** @internal */ export type GoCardlessOptions$Outbound = { purpose_code?: string | null | undefined; }; /** @internal */ export const GoCardlessOptions$outboundSchema: z.ZodType< GoCardlessOptions$Outbound, z.ZodTypeDef, GoCardlessOptions > = z.object({ purposeCode: z.nullable(PurposeCode$outboundSchema).optional(), }).transform((v) => { return remap$(v, { purposeCode: "purpose_code", }); }); export function goCardlessOptionsToJSON( goCardlessOptions: GoCardlessOptions, ): string { return JSON.stringify( GoCardlessOptions$outboundSchema.parse(goCardlessOptions), ); }