/* * 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 { EventAssetChange, EventAssetChange$inboundSchema, } from "./eventassetchange.js"; import { EventStatusChange, EventStatusChange$inboundSchema, } from "./eventstatuschange.js"; export type CollectionEvent = { assetChange?: EventAssetChange | undefined; statusChange?: EventStatusChange | undefined; }; /** @internal */ export const CollectionEvent$inboundSchema: z.ZodType< CollectionEvent, z.ZodTypeDef, unknown > = z.object({ asset_change: EventAssetChange$inboundSchema.optional(), status_change: EventStatusChange$inboundSchema.optional(), }).transform((v) => { return remap$(v, { "asset_change": "assetChange", "status_change": "statusChange", }); }); export function collectionEventFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => CollectionEvent$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CollectionEvent' from JSON`, ); }