/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ 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 { Item, Item$inboundSchema, Item$Outbound, Item$outboundSchema, } from "./item.js"; export type CreateItemsRequest = { /** * Items to add to the conversation. Min 1, max 20 items at a time. */ items: Array; /** * Additional fields to include (TODO: not implemented yet) */ include?: Array | undefined; }; /** @internal */ export const CreateItemsRequest$inboundSchema: z.ZodType< CreateItemsRequest, z.ZodTypeDef, unknown > = z.object({ items: z.array(Item$inboundSchema), include: z.array(z.string()).optional(), }); /** @internal */ export type CreateItemsRequest$Outbound = { items: Array; include?: Array | undefined; }; /** @internal */ export const CreateItemsRequest$outboundSchema: z.ZodType< CreateItemsRequest$Outbound, z.ZodTypeDef, CreateItemsRequest > = z.object({ items: z.array(Item$outboundSchema), include: z.array(z.string()).optional(), }); export function createItemsRequestToJSON( createItemsRequest: CreateItemsRequest, ): string { return JSON.stringify( CreateItemsRequest$outboundSchema.parse(createItemsRequest), ); } export function createItemsRequestFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => CreateItemsRequest$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CreateItemsRequest' from JSON`, ); }