/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. * @generated-id: 805a6a79c9fa */ 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 { Customer, Customer$inboundSchema } from "./customer.js"; import { Document, Document$inboundSchema } from "./document.js"; import { EventStrategyName, EventStrategyName$inboundSchema, } from "./eventstrategyname.js"; import { GeneratedAttachmentContent, GeneratedAttachmentContent$inboundSchema, } from "./generatedattachmentcontent.js"; import { Person, Person$inboundSchema } from "./person.js"; import { StructuredLink, StructuredLink$inboundSchema, } from "./structuredlink.js"; /** * These are attachments that aren't natively present on the event, and have been smartly suggested. */ export type GeneratedAttachment = { /** * The name of method used to surface relevant data for a given calendar event. */ strategyName?: EventStrategyName | undefined; documents?: Array | undefined; person?: Person | undefined; customer?: Customer | undefined; /** * A list of links to external sources outside of Glean. */ externalLinks?: Array | undefined; content?: Array | undefined; }; /** @internal */ export const GeneratedAttachment$inboundSchema: z.ZodType< GeneratedAttachment, z.ZodTypeDef, unknown > = z.object({ strategyName: EventStrategyName$inboundSchema.optional(), documents: z.array(Document$inboundSchema).optional(), person: Person$inboundSchema.optional(), customer: Customer$inboundSchema.optional(), externalLinks: z.array(StructuredLink$inboundSchema).optional(), content: z.array(GeneratedAttachmentContent$inboundSchema).optional(), }); export function generatedAttachmentFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => GeneratedAttachment$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GeneratedAttachment' from JSON`, ); }