/* * 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 ListFeePlansGlobals = { /** * Specify an API version. * * @remarks * * API versioning follows the format `vYYYY.QQ.BB`, where * - `YYYY` is the year * - `QQ` is the two-digit month for the first month of the quarter (e.g., 01, 04, 07, 10) * - `BB` is the build number, starting at `.01`, for subsequent builds in the same quarter. * - For example, `v2024.01.00` is the initial release of the first quarter of 2024. * * The `latest` version represents the most recent development state. It may include breaking changes and should be treated as a beta release. * When no version is specified, the API defaults to `v2024.01.00`. */ xMoovVersion?: string | undefined; }; export type ListFeePlansRequest = { accountID: string; /** * A comma-separated list of plan IDs to filter the results by. */ planIDs?: Array | undefined; }; export type ListFeePlansResponse = { headers: { [k: string]: Array }; result: Array; }; /** @internal */ export const ListFeePlansGlobals$inboundSchema: z.ZodType< ListFeePlansGlobals, z.ZodTypeDef, unknown > = z.object({ "X-Moov-Version": z.string().optional(), }).transform((v) => { return remap$(v, { "X-Moov-Version": "xMoovVersion", }); }); /** @internal */ export type ListFeePlansGlobals$Outbound = { "X-Moov-Version"?: string | undefined; }; /** @internal */ export const ListFeePlansGlobals$outboundSchema: z.ZodType< ListFeePlansGlobals$Outbound, z.ZodTypeDef, ListFeePlansGlobals > = z.object({ xMoovVersion: z.string().optional(), }).transform((v) => { return remap$(v, { xMoovVersion: "X-Moov-Version", }); }); export function listFeePlansGlobalsToJSON( listFeePlansGlobals: ListFeePlansGlobals, ): string { return JSON.stringify( ListFeePlansGlobals$outboundSchema.parse(listFeePlansGlobals), ); } export function listFeePlansGlobalsFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => ListFeePlansGlobals$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ListFeePlansGlobals' from JSON`, ); } /** @internal */ export const ListFeePlansRequest$inboundSchema: z.ZodType< ListFeePlansRequest, z.ZodTypeDef, unknown > = z.object({ accountID: z.string(), planIDs: z.array(z.string()).optional(), }); /** @internal */ export type ListFeePlansRequest$Outbound = { accountID: string; planIDs?: Array | undefined; }; /** @internal */ export const ListFeePlansRequest$outboundSchema: z.ZodType< ListFeePlansRequest$Outbound, z.ZodTypeDef, ListFeePlansRequest > = z.object({ accountID: z.string(), planIDs: z.array(z.string()).optional(), }); export function listFeePlansRequestToJSON( listFeePlansRequest: ListFeePlansRequest, ): string { return JSON.stringify( ListFeePlansRequest$outboundSchema.parse(listFeePlansRequest), ); } export function listFeePlansRequestFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => ListFeePlansRequest$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ListFeePlansRequest' from JSON`, ); } /** @internal */ export const ListFeePlansResponse$inboundSchema: z.ZodType< ListFeePlansResponse, z.ZodTypeDef, unknown > = z.object({ Headers: z.record(z.array(z.string())).default({}), Result: z.array(components.FeePlan$inboundSchema), }).transform((v) => { return remap$(v, { "Headers": "headers", "Result": "result", }); }); /** @internal */ export type ListFeePlansResponse$Outbound = { Headers: { [k: string]: Array }; Result: Array; }; /** @internal */ export const ListFeePlansResponse$outboundSchema: z.ZodType< ListFeePlansResponse$Outbound, z.ZodTypeDef, ListFeePlansResponse > = z.object({ headers: z.record(z.array(z.string())), result: z.array(components.FeePlan$outboundSchema), }).transform((v) => { return remap$(v, { headers: "Headers", result: "Result", }); }); export function listFeePlansResponseToJSON( listFeePlansResponse: ListFeePlansResponse, ): string { return JSON.stringify( ListFeePlansResponse$outboundSchema.parse(listFeePlansResponse), ); } export function listFeePlansResponseFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => ListFeePlansResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ListFeePlansResponse' from JSON`, ); }