/* * 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 { EntityChangeBehaviour, EntityChangeBehaviour$outboundSchema, } from "./entity-change-behaviour.js"; export type EntityChangePolicy = { defaultBehaviour?: EntityChangeBehaviour | undefined; /** * Overrides is keyed by addon_associations.id (instance), not catalogue addon_id. * * @remarks * That is the id an EntityChangeResult reports as EntityID. */ overrides?: { [k: string]: EntityChangeBehaviour } | undefined; }; /** @internal */ export type EntityChangePolicy$Outbound = { default_behaviour?: string | undefined; overrides?: { [k: string]: string } | undefined; }; /** @internal */ export const EntityChangePolicy$outboundSchema: z.ZodMiniType< EntityChangePolicy$Outbound, EntityChangePolicy > = z.pipe( z.object({ defaultBehaviour: z.optional(EntityChangeBehaviour$outboundSchema), overrides: z.optional( z.record(z.string(), EntityChangeBehaviour$outboundSchema), ), }), z.transform((v) => { return remap$(v, { defaultBehaviour: "default_behaviour", }); }), ); export function entityChangePolicyToJSON( entityChangePolicy: EntityChangePolicy, ): string { return JSON.stringify( EntityChangePolicy$outboundSchema.parse(entityChangePolicy), ); }