/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. * @generated-id: 802c67fce64f */ import * as z from "zod/v3"; import { safeParse } from "../../lib/schemas.js"; import { Result as SafeParseResult } from "../../types/fp.js"; import { SDKValidationError } from "../errors/sdkvalidationerror.js"; import { EntityType, EntityType$inboundSchema, EntityType$outboundSchema, } from "./entitytype.js"; /** * A disambiguation between multiple entities with the same name */ export type Disambiguation = { /** * Name of the ambiguous entity */ name?: string | undefined; /** * The unique id of the entity in the knowledge graph */ id?: string | undefined; /** * The type of entity. */ type?: EntityType | undefined; }; /** @internal */ export const Disambiguation$inboundSchema: z.ZodType< Disambiguation, z.ZodTypeDef, unknown > = z.object({ name: z.string().optional(), id: z.string().optional(), type: EntityType$inboundSchema.optional(), }); /** @internal */ export type Disambiguation$Outbound = { name?: string | undefined; id?: string | undefined; type?: string | undefined; }; /** @internal */ export const Disambiguation$outboundSchema: z.ZodType< Disambiguation$Outbound, z.ZodTypeDef, Disambiguation > = z.object({ name: z.string().optional(), id: z.string().optional(), type: EntityType$outboundSchema.optional(), }); export function disambiguationToJSON(disambiguation: Disambiguation): string { return JSON.stringify(Disambiguation$outboundSchema.parse(disambiguation)); } export function disambiguationFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => Disambiguation$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Disambiguation' from JSON`, ); }