/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod/v4-mini"; import { remap as remap$ } from "../../lib/primitives.js"; import { safeParse } from "../../lib/schemas.js"; import { Result as SafeParseResult } from "../../types/fp.js"; import { ListResourcePaymentMethod, ListResourcePaymentMethod$inboundSchema, } from "../components/listresourcepaymentmethod.js"; import { SDKValidationError } from "../errors/sdkvalidationerror.js"; export type CustomersListPaymentMethodsExternalRequest = { /** * The customer external ID. */ externalId: string; /** * Page number, defaults to 1. */ page?: number | undefined; /** * Size of a page, defaults to 10. Maximum is 100. */ limit?: number | undefined; }; export type CustomersListPaymentMethodsExternalResponse = { result: ListResourcePaymentMethod; }; /** @internal */ export type CustomersListPaymentMethodsExternalRequest$Outbound = { external_id: string; page: number; limit: number; }; /** @internal */ export const CustomersListPaymentMethodsExternalRequest$outboundSchema: z.ZodMiniType< CustomersListPaymentMethodsExternalRequest$Outbound, CustomersListPaymentMethodsExternalRequest > = z.pipe( z.object({ externalId: z.string(), page: z._default(z.int(), 1), limit: z._default(z.int(), 10), }), z.transform((v) => { return remap$(v, { externalId: "external_id", }); }), ); export function customersListPaymentMethodsExternalRequestToJSON( customersListPaymentMethodsExternalRequest: CustomersListPaymentMethodsExternalRequest, ): string { return JSON.stringify( CustomersListPaymentMethodsExternalRequest$outboundSchema.parse( customersListPaymentMethodsExternalRequest, ), ); } /** @internal */ export const CustomersListPaymentMethodsExternalResponse$inboundSchema: z.ZodMiniType = z.pipe( z.object({ Result: ListResourcePaymentMethod$inboundSchema, }), z.transform((v) => { return remap$(v, { "Result": "result", }); }), ); export function customersListPaymentMethodsExternalResponseFromJSON( jsonString: string, ): SafeParseResult< CustomersListPaymentMethodsExternalResponse, SDKValidationError > { return safeParse( jsonString, (x) => CustomersListPaymentMethodsExternalResponse$inboundSchema.parse( JSON.parse(x), ), `Failed to parse 'CustomersListPaymentMethodsExternalResponse' from JSON`, ); }