/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod/v3"; import { lazySchema as lazySchema$, safeParse } from "../../lib/schemas.js"; import { Result as SafeParseResult } from "../../types/fp.js"; import * as types from "../../types/primitives.js"; import { SDKValidationError } from "../errors/sdkvalidationerror.js"; import { AttachmentReferenceType, AttachmentReferenceType$inboundSchema, } from "./attachmentreferencetype.js"; export type AttachmentReference = { type?: AttachmentReferenceType | undefined; /** * A unique identifier for an object. */ id?: string | undefined; }; /** @internal */ export const AttachmentReference$inboundSchema: z.ZodType< AttachmentReference, z.ZodTypeDef, unknown > = /* @__PURE__ */ lazySchema$(() => z.object({ type: types.optional(AttachmentReferenceType$inboundSchema), id: types.optional(types.string()), }) ); export function attachmentReferenceFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => AttachmentReference$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'AttachmentReference' from JSON`, ); }