/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod/v3"; import { remap as remap$ } from "../../lib/primitives.js"; import { safeParse } from "../../lib/schemas.js"; import { Result as SafeParseResult } from "../../types/fp.js"; import { SDKValidationError } from "../errors/sdkvalidationerror.js"; export type WebSearchFilters = { allowedDomains?: Array | undefined; }; /** @internal */ export const WebSearchFilters$inboundSchema: z.ZodType< WebSearchFilters, z.ZodTypeDef, unknown > = z.object({ allowed_domains: z.array(z.string()).optional(), }).transform((v) => { return remap$(v, { "allowed_domains": "allowedDomains", }); }); /** @internal */ export type WebSearchFilters$Outbound = { allowed_domains?: Array | undefined; }; /** @internal */ export const WebSearchFilters$outboundSchema: z.ZodType< WebSearchFilters$Outbound, z.ZodTypeDef, WebSearchFilters > = z.object({ allowedDomains: z.array(z.string()).optional(), }).transform((v) => { return remap$(v, { allowedDomains: "allowed_domains", }); }); export function webSearchFiltersToJSON( webSearchFilters: WebSearchFilters, ): string { return JSON.stringify( WebSearchFilters$outboundSchema.parse(webSearchFilters), ); } export function webSearchFiltersFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => WebSearchFilters$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'WebSearchFilters' from JSON`, ); }