/* * 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 { FindAction, FindAction$inboundSchema, FindAction$Outbound, FindAction$outboundSchema, } from "./findaction.js"; import { OpenPageAction, OpenPageAction$inboundSchema, OpenPageAction$Outbound, OpenPageAction$outboundSchema, } from "./openpageaction.js"; import { SearchAction, SearchAction$inboundSchema, SearchAction$Outbound, SearchAction$outboundSchema, } from "./searchaction.js"; export type WebSearchAction = SearchAction | OpenPageAction | FindAction; /** @internal */ export const WebSearchAction$inboundSchema: z.ZodType< WebSearchAction, z.ZodTypeDef, unknown > = z.union([ SearchAction$inboundSchema, OpenPageAction$inboundSchema, FindAction$inboundSchema, ]); /** @internal */ export type WebSearchAction$Outbound = | SearchAction$Outbound | OpenPageAction$Outbound | FindAction$Outbound; /** @internal */ export const WebSearchAction$outboundSchema: z.ZodType< WebSearchAction$Outbound, z.ZodTypeDef, WebSearchAction > = z.union([ SearchAction$outboundSchema, OpenPageAction$outboundSchema, FindAction$outboundSchema, ]); export function webSearchActionToJSON( webSearchAction: WebSearchAction, ): string { return JSON.stringify(WebSearchAction$outboundSchema.parse(webSearchAction)); } export function webSearchActionFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => WebSearchAction$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'WebSearchAction' from JSON`, ); }