/* * 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 { CollectionEvent, CollectionEvent$inboundSchema, } from "./collectionevent.js"; export type CollectionEventsResponse = { events: Array | null; nextPage: string; }; /** @internal */ export const CollectionEventsResponse$inboundSchema: z.ZodType< CollectionEventsResponse, z.ZodTypeDef, unknown > = z.object({ events: z.nullable(z.array(CollectionEvent$inboundSchema)), next_page: z.string(), }).transform((v) => { return remap$(v, { "next_page": "nextPage", }); }); export function collectionEventsResponseFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => CollectionEventsResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CollectionEventsResponse' from JSON`, ); }