/* * 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 { SDKValidationError } from "../errors/sdkvalidationerror.js"; import { FineTuningCheckpoint, FineTuningCheckpoint$inboundSchema, FineTuningCheckpoint$Outbound, FineTuningCheckpoint$outboundSchema, } from "./finetuningcheckpoint.js"; export type ListCheckpointsResponse = { object: "list"; data: Array; hasMore: boolean; firstId?: string | null | undefined; lastId?: string | null | undefined; }; /** @internal */ export const ListCheckpointsResponse$inboundSchema: z.ZodType< ListCheckpointsResponse, z.ZodTypeDef, unknown > = z.object({ object: z.literal("list"), data: z.array(FineTuningCheckpoint$inboundSchema), has_more: z.boolean(), first_id: z.nullable(z.string()).optional(), last_id: z.nullable(z.string()).optional(), }).transform((v) => { return remap$(v, { "has_more": "hasMore", "first_id": "firstId", "last_id": "lastId", }); }); /** @internal */ export type ListCheckpointsResponse$Outbound = { object: "list"; data: Array; has_more: boolean; first_id?: string | null | undefined; last_id?: string | null | undefined; }; /** @internal */ export const ListCheckpointsResponse$outboundSchema: z.ZodType< ListCheckpointsResponse$Outbound, z.ZodTypeDef, ListCheckpointsResponse > = z.object({ object: z.literal("list"), data: z.array(FineTuningCheckpoint$outboundSchema), hasMore: z.boolean(), firstId: z.nullable(z.string()).optional(), lastId: z.nullable(z.string()).optional(), }).transform((v) => { return remap$(v, { hasMore: "has_more", firstId: "first_id", lastId: "last_id", }); }); export function listCheckpointsResponseToJSON( listCheckpointsResponse: ListCheckpointsResponse, ): string { return JSON.stringify( ListCheckpointsResponse$outboundSchema.parse(listCheckpointsResponse), ); } export function listCheckpointsResponseFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => ListCheckpointsResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ListCheckpointsResponse' from JSON`, ); }