/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod"; import { remap as remap$ } from "../../lib/primitives.js"; import { safeParse } from "../../lib/schemas.js"; import { Result as SafeParseResult } from "../../types/fp.js"; import { SDKValidationError } from "../errors/sdkvalidationerror.js"; import { ContributionSummary, ContributionSummary$inboundSchema, ContributionSummary$Outbound, ContributionSummary$outboundSchema, } from "./contributionsummary.js"; /** * Response object for aggregated contribution retirement summaries */ export type ListContributionSummariesResponse = { /** * List of contribution amount(s) and rollover amount(s), with their corresponding tax year(s) Entries will be sorted in descending order by tax year Starting with the current year */ contributionSummaries?: Array | undefined; /** * Can be sent as `page_token` in the request to retrieve the next page If this field is omitted, there are no subsequent pages */ nextPageToken?: string | undefined; }; /** @internal */ export const ListContributionSummariesResponse$inboundSchema: z.ZodType< ListContributionSummariesResponse, z.ZodTypeDef, unknown > = z.object({ contribution_summaries: z.array(ContributionSummary$inboundSchema).optional(), next_page_token: z.string().optional(), }).transform((v) => { return remap$(v, { "contribution_summaries": "contributionSummaries", "next_page_token": "nextPageToken", }); }); /** @internal */ export type ListContributionSummariesResponse$Outbound = { contribution_summaries?: Array | undefined; next_page_token?: string | undefined; }; /** @internal */ export const ListContributionSummariesResponse$outboundSchema: z.ZodType< ListContributionSummariesResponse$Outbound, z.ZodTypeDef, ListContributionSummariesResponse > = z.object({ contributionSummaries: z.array(ContributionSummary$outboundSchema).optional(), nextPageToken: z.string().optional(), }).transform((v) => { return remap$(v, { contributionSummaries: "contribution_summaries", nextPageToken: "next_page_token", }); }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace ListContributionSummariesResponse$ { /** @deprecated use `ListContributionSummariesResponse$inboundSchema` instead. */ export const inboundSchema = ListContributionSummariesResponse$inboundSchema; /** @deprecated use `ListContributionSummariesResponse$outboundSchema` instead. */ export const outboundSchema = ListContributionSummariesResponse$outboundSchema; /** @deprecated use `ListContributionSummariesResponse$Outbound` instead. */ export type Outbound = ListContributionSummariesResponse$Outbound; } export function listContributionSummariesResponseToJSON( listContributionSummariesResponse: ListContributionSummariesResponse, ): string { return JSON.stringify( ListContributionSummariesResponse$outboundSchema.parse( listContributionSummariesResponse, ), ); } export function listContributionSummariesResponseFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => ListContributionSummariesResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ListContributionSummariesResponse' from JSON`, ); }