/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod"; import { safeParse } from "../../lib/schemas.js"; import { Result as SafeParseResult } from "../../types/fp.js"; import { SDKValidationError } from "../errors/sdkvalidationerror.js"; import { Target, Target$inboundSchema, Target$Outbound, Target$outboundSchema, } from "./target.js"; export type Multistream = { /** * References to targets where this stream will be simultaneously * * @remarks * streamed to */ targets?: Array | undefined; }; /** @internal */ export const Multistream$inboundSchema: z.ZodType< Multistream, z.ZodTypeDef, unknown > = z.object({ targets: z.array(Target$inboundSchema).optional(), }); /** @internal */ export type Multistream$Outbound = { targets?: Array | undefined; }; /** @internal */ export const Multistream$outboundSchema: z.ZodType< Multistream$Outbound, z.ZodTypeDef, Multistream > = z.object({ targets: z.array(Target$outboundSchema).optional(), }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace Multistream$ { /** @deprecated use `Multistream$inboundSchema` instead. */ export const inboundSchema = Multistream$inboundSchema; /** @deprecated use `Multistream$outboundSchema` instead. */ export const outboundSchema = Multistream$outboundSchema; /** @deprecated use `Multistream$Outbound` instead. */ export type Outbound = Multistream$Outbound; } export function multistreamToJSON(multistream: Multistream): string { return JSON.stringify(Multistream$outboundSchema.parse(multistream)); } export function multistreamFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => Multistream$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Multistream' from JSON`, ); }