/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod/v3"; import { safeParse } from "../../lib/schemas.js"; import { Result as SafeParseResult } from "../../types/fp.js"; import { SDKValidationError } from "../errors/sdkvalidationerror.js"; import { Entity, Entity$inboundSchema, Entity$Outbound, Entity$outboundSchema, } from "./entity.js"; import { Pagination, Pagination$inboundSchema, Pagination$Outbound, Pagination$outboundSchema, } from "./pagination.js"; export type EntityList = { pagination: Pagination; entities: Array; }; /** @internal */ export const EntityList$inboundSchema: z.ZodType< EntityList, z.ZodTypeDef, unknown > = z.object({ pagination: Pagination$inboundSchema, entities: z.array(Entity$inboundSchema), }); /** @internal */ export type EntityList$Outbound = { pagination: Pagination$Outbound; entities: Array; }; /** @internal */ export const EntityList$outboundSchema: z.ZodType< EntityList$Outbound, z.ZodTypeDef, EntityList > = z.object({ pagination: Pagination$outboundSchema, entities: z.array(Entity$outboundSchema), }); export function entityListToJSON(entityList: EntityList): string { return JSON.stringify(EntityList$outboundSchema.parse(entityList)); } export function entityListFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => EntityList$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'EntityList' from JSON`, ); }