/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. * @generated-id: 43ada972a9b4 */ 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 SearchProviderInfo = { /** * Name of the search provider. */ name?: string | undefined; /** * URL to the provider's logo. */ logoUrl?: string | undefined; /** * URL template that can be used to perform the suggested search by replacing the {query} placeholder with the query suggestion. */ searchLinkUrlTemplate?: string | undefined; }; /** @internal */ export const SearchProviderInfo$inboundSchema: z.ZodType< SearchProviderInfo, z.ZodTypeDef, unknown > = z.object({ name: z.string().optional(), logoUrl: z.string().optional(), searchLinkUrlTemplate: z.string().optional(), }); /** @internal */ export type SearchProviderInfo$Outbound = { name?: string | undefined; logoUrl?: string | undefined; searchLinkUrlTemplate?: string | undefined; }; /** @internal */ export const SearchProviderInfo$outboundSchema: z.ZodType< SearchProviderInfo$Outbound, z.ZodTypeDef, SearchProviderInfo > = z.object({ name: z.string().optional(), logoUrl: z.string().optional(), searchLinkUrlTemplate: z.string().optional(), }); export function searchProviderInfoToJSON( searchProviderInfo: SearchProviderInfo, ): string { return JSON.stringify( SearchProviderInfo$outboundSchema.parse(searchProviderInfo), ); } export function searchProviderInfoFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => SearchProviderInfo$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'SearchProviderInfo' from JSON`, ); }