/* * 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 ListPaymentServicesGlobals = { merchantAccountId?: string | undefined; }; export type ListPaymentServicesRequest = { /** * Return any payment service for this method. */ method?: components.Method | null | undefined; /** * 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; /** * Return any deleted payment service. */ deleted?: boolean | null | undefined; /** * Include the non-secret credential and reporting fields for each payment service. Disable this to reduce response time if you don't need them. */ includeFields?: boolean | undefined; /** * The ID of the merchant account to use for this request. */ merchantAccountId?: string | null | undefined; }; export type ListPaymentServicesResponse = { result: components.PaymentServices; }; /** @internal */ export type ListPaymentServicesRequest$Outbound = { method?: string | null | undefined; cursor?: string | null | undefined; limit: number; deleted?: boolean | null | undefined; include_fields: boolean; merchantAccountId?: string | null | undefined; }; /** @internal */ export const ListPaymentServicesRequest$outboundSchema: z.ZodType< ListPaymentServicesRequest$Outbound, z.ZodTypeDef, ListPaymentServicesRequest > = z.object({ method: z.nullable(components.Method$outboundSchema).optional(), cursor: z.nullable(z.string()).optional(), limit: z.number().int().default(20), deleted: z.nullable(z.boolean()).optional(), includeFields: z.boolean().default(true), merchantAccountId: z.nullable(z.string()).optional(), }).transform((v) => { return remap$(v, { includeFields: "include_fields", }); }); export function listPaymentServicesRequestToJSON( listPaymentServicesRequest: ListPaymentServicesRequest, ): string { return JSON.stringify( ListPaymentServicesRequest$outboundSchema.parse(listPaymentServicesRequest), ); } /** @internal */ export const ListPaymentServicesResponse$inboundSchema: z.ZodType< ListPaymentServicesResponse, z.ZodTypeDef, unknown > = z.object({ Result: components.PaymentServices$inboundSchema, }).transform((v) => { return remap$(v, { "Result": "result", }); }); export function listPaymentServicesResponseFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => ListPaymentServicesResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ListPaymentServicesResponse' from JSON`, ); }