/* * 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 { ClosedEnum } from "../../types/enums.js"; import { Result as SafeParseResult } from "../../types/fp.js"; import { SDKValidationError } from "../errors/sdkvalidationerror.js"; import { AgentVersion, AgentVersion$inboundSchema, AgentVersion$Outbound, AgentVersion$outboundSchema, } from "./agentversion.js"; export const AgentVersionListObject = { List: "list", } as const; export type AgentVersionListObject = ClosedEnum; export type AgentVersionList = { object: AgentVersionListObject; data: Array; firstId: string | null; lastId: string | null; hasMore: boolean; }; /** @internal */ export const AgentVersionListObject$inboundSchema: z.ZodNativeEnum< typeof AgentVersionListObject > = z.nativeEnum(AgentVersionListObject); /** @internal */ export const AgentVersionListObject$outboundSchema: z.ZodNativeEnum< typeof AgentVersionListObject > = AgentVersionListObject$inboundSchema; /** @internal */ export const AgentVersionList$inboundSchema: z.ZodType< AgentVersionList, z.ZodTypeDef, unknown > = z.object({ object: AgentVersionListObject$inboundSchema, data: z.array(AgentVersion$inboundSchema), first_id: z.nullable(z.string()), last_id: z.nullable(z.string()), has_more: z.boolean(), }).transform((v) => { return remap$(v, { "first_id": "firstId", "last_id": "lastId", "has_more": "hasMore", }); }); /** @internal */ export type AgentVersionList$Outbound = { object: string; data: Array; first_id: string | null; last_id: string | null; has_more: boolean; }; /** @internal */ export const AgentVersionList$outboundSchema: z.ZodType< AgentVersionList$Outbound, z.ZodTypeDef, AgentVersionList > = z.object({ object: AgentVersionListObject$outboundSchema, data: z.array(AgentVersion$outboundSchema), firstId: z.nullable(z.string()), lastId: z.nullable(z.string()), hasMore: z.boolean(), }).transform((v) => { return remap$(v, { firstId: "first_id", lastId: "last_id", hasMore: "has_more", }); }); export function agentVersionListToJSON( agentVersionList: AgentVersionList, ): string { return JSON.stringify( AgentVersionList$outboundSchema.parse(agentVersionList), ); } export function agentVersionListFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => AgentVersionList$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'AgentVersionList' from JSON`, ); }