/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod/v4-mini"; import { remap as remap$ } from "../../lib/primitives.js"; import { safeParse } from "../../lib/schemas.js"; import { Result as SafeParseResult } from "../../types/fp.js"; import * as types from "../../types/primitives.js"; import { EntityChangeBehaviour, EntityChangeBehaviour$inboundSchema, } from "./entity-change-behaviour.js"; import { SDKValidationError } from "./sdk-validation-error.js"; import { SubscriptionChangeEntityType, SubscriptionChangeEntityType$inboundSchema, } from "./subscription-change-entity-type.js"; export type EntityChangeResult = { behaviour?: EntityChangeBehaviour | undefined; entityId?: string | undefined; entityType?: SubscriptionChangeEntityType | undefined; referenceId?: string | undefined; }; /** @internal */ export const EntityChangeResult$inboundSchema: z.ZodMiniType< EntityChangeResult, unknown > = z.pipe( z.object({ behaviour: types.optional(EntityChangeBehaviour$inboundSchema), entity_id: types.optional(types.string()), entity_type: types.optional(SubscriptionChangeEntityType$inboundSchema), reference_id: types.optional(types.string()), }), z.transform((v) => { return remap$(v, { "entity_id": "entityId", "entity_type": "entityType", "reference_id": "referenceId", }); }), ); export function entityChangeResultFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => EntityChangeResult$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'EntityChangeResult' from JSON`, ); }