/* * 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 * as components from "../components/index.js"; import { SDKValidationError } from "../errors/sdkvalidationerror.js"; export type ListPaymentServiceDefinitionsRequest = { /** * A pointer to the page of results to return. */ cursor?: string | null | undefined; /** * The maximum number of items that are at returned. */ limit?: number | undefined; }; export type ListPaymentServiceDefinitionsResponse = { result: components.PaymentServiceDefinitions; }; /** @internal */ export type ListPaymentServiceDefinitionsRequest$Outbound = { cursor?: string | null | undefined; limit: number; }; /** @internal */ export const ListPaymentServiceDefinitionsRequest$outboundSchema: z.ZodType< ListPaymentServiceDefinitionsRequest$Outbound, z.ZodTypeDef, ListPaymentServiceDefinitionsRequest > = z.object({ cursor: z.nullable(z.string()).optional(), limit: z.number().int().default(20), }); export function listPaymentServiceDefinitionsRequestToJSON( listPaymentServiceDefinitionsRequest: ListPaymentServiceDefinitionsRequest, ): string { return JSON.stringify( ListPaymentServiceDefinitionsRequest$outboundSchema.parse( listPaymentServiceDefinitionsRequest, ), ); } /** @internal */ export const ListPaymentServiceDefinitionsResponse$inboundSchema: z.ZodType< ListPaymentServiceDefinitionsResponse, z.ZodTypeDef, unknown > = z.object({ Result: components.PaymentServiceDefinitions$inboundSchema, }).transform((v) => { return remap$(v, { "Result": "result", }); }); export function listPaymentServiceDefinitionsResponseFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => ListPaymentServiceDefinitionsResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ListPaymentServiceDefinitionsResponse' from JSON`, ); }