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