/* * 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"; import { ZeromqGreeting, ZeromqGreeting$inboundSchema, } from "./zeromqgreeting.js"; import { ZeromqHandshake, ZeromqHandshake$inboundSchema, } from "./zeromqhandshake.js"; export type Zeromq = { greeting?: ZeromqGreeting | undefined; handshake?: ZeromqHandshake | undefined; subscriptionData?: string | undefined; subscriptionMatch?: { [k: string]: boolean } | undefined; }; /** @internal */ export const Zeromq$inboundSchema: z.ZodType = z .object({ greeting: ZeromqGreeting$inboundSchema.optional(), handshake: ZeromqHandshake$inboundSchema.optional(), subscription_data: z.string().optional(), subscription_match: z.record(z.boolean()).optional(), }).transform((v) => { return remap$(v, { "subscription_data": "subscriptionData", "subscription_match": "subscriptionMatch", }); }); export function zeromqFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => Zeromq$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Zeromq' from JSON`, ); }