/* * 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 { Connection, Connection$inboundSchema } from "./connection.js"; import { Links, Links$inboundSchema } from "./links.js"; export type Connections = { results?: Array | undefined; /** * Current page number. */ pageNumber: number; /** * Number of items to return in results array. */ pageSize: number; /** * Total number of items. */ totalResults: number; links: Links; }; /** @internal */ export const Connections$inboundSchema: z.ZodType< Connections, z.ZodTypeDef, unknown > = z.object({ results: z.array(Connection$inboundSchema).optional(), pageNumber: z.number().int(), pageSize: z.number().int(), totalResults: z.number().int(), _links: Links$inboundSchema, }).transform((v) => { return remap$(v, { "_links": "links", }); }); export function connectionsFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => Connections$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Connections' from JSON`, ); }