/* * 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"; export type SearchActionSource = { type: "url"; url: string; }; /** @internal */ export const SearchActionSource$inboundSchema: z.ZodType< SearchActionSource, z.ZodTypeDef, unknown > = z.object({ type: z.literal("url"), url: z.string(), }); /** @internal */ export type SearchActionSource$Outbound = { type: "url"; url: string; }; /** @internal */ export const SearchActionSource$outboundSchema: z.ZodType< SearchActionSource$Outbound, z.ZodTypeDef, SearchActionSource > = z.object({ type: z.literal("url"), url: z.string(), }); export function searchActionSourceToJSON( searchActionSource: SearchActionSource, ): string { return JSON.stringify( SearchActionSource$outboundSchema.parse(searchActionSource), ); } export function searchActionSourceFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => SearchActionSource$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'SearchActionSource' from JSON`, ); }