/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. * @generated-id: 879f11b50f31 */ 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 { Person, Person$inboundSchema, Person$Outbound, Person$outboundSchema, } from "./person.js"; import { QuerySuggestion, QuerySuggestion$inboundSchema, QuerySuggestion$Outbound, QuerySuggestion$outboundSchema, } from "./querysuggestion.js"; export type QuerySuggestionList = { suggestions?: Array | undefined; person?: Person | undefined; }; /** @internal */ export const QuerySuggestionList$inboundSchema: z.ZodType< QuerySuggestionList, z.ZodTypeDef, unknown > = z.object({ suggestions: z.array(z.lazy(() => QuerySuggestion$inboundSchema)).optional(), person: z.lazy(() => Person$inboundSchema).optional(), }); /** @internal */ export type QuerySuggestionList$Outbound = { suggestions?: Array | undefined; person?: Person$Outbound | undefined; }; /** @internal */ export const QuerySuggestionList$outboundSchema: z.ZodType< QuerySuggestionList$Outbound, z.ZodTypeDef, QuerySuggestionList > = z.object({ suggestions: z.array(z.lazy(() => QuerySuggestion$outboundSchema)).optional(), person: z.lazy(() => Person$outboundSchema).optional(), }); export function querySuggestionListToJSON( querySuggestionList: QuerySuggestionList, ): string { return JSON.stringify( QuerySuggestionList$outboundSchema.parse(querySuggestionList), ); } export function querySuggestionListFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => QuerySuggestionList$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'QuerySuggestionList' from JSON`, ); }