/* * 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"; /** * Inline multistream target object. Will automatically * * @remarks * create the target resource to be used by the created * stream. */ export type TargetAddPayloadSpec = { name?: string | undefined; /** * Livepeer-compatible multistream target URL (RTMP(S) or SRT) */ url: string; }; export type TargetAddPayload = { /** * Name of transcoding profile that should be sent. Use * * @remarks * "source" for pushing source stream data */ profile: string; /** * If true, the stream audio will be muted and only silent * * @remarks * video will be pushed to the target. */ videoOnly?: boolean | undefined; /** * ID of multistream target object where to push this stream */ id?: string | undefined; /** * Inline multistream target object. Will automatically * * @remarks * create the target resource to be used by the created * stream. */ spec?: TargetAddPayloadSpec | undefined; }; /** @internal */ export const TargetAddPayloadSpec$inboundSchema: z.ZodType< TargetAddPayloadSpec, z.ZodTypeDef, unknown > = z.object({ name: z.string().optional(), url: z.string(), }); /** @internal */ export type TargetAddPayloadSpec$Outbound = { name?: string | undefined; url: string; }; /** @internal */ export const TargetAddPayloadSpec$outboundSchema: z.ZodType< TargetAddPayloadSpec$Outbound, z.ZodTypeDef, TargetAddPayloadSpec > = z.object({ name: z.string().optional(), url: z.string(), }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace TargetAddPayloadSpec$ { /** @deprecated use `TargetAddPayloadSpec$inboundSchema` instead. */ export const inboundSchema = TargetAddPayloadSpec$inboundSchema; /** @deprecated use `TargetAddPayloadSpec$outboundSchema` instead. */ export const outboundSchema = TargetAddPayloadSpec$outboundSchema; /** @deprecated use `TargetAddPayloadSpec$Outbound` instead. */ export type Outbound = TargetAddPayloadSpec$Outbound; } export function targetAddPayloadSpecToJSON( targetAddPayloadSpec: TargetAddPayloadSpec, ): string { return JSON.stringify( TargetAddPayloadSpec$outboundSchema.parse(targetAddPayloadSpec), ); } export function targetAddPayloadSpecFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => TargetAddPayloadSpec$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'TargetAddPayloadSpec' from JSON`, ); } /** @internal */ export const TargetAddPayload$inboundSchema: z.ZodType< TargetAddPayload, z.ZodTypeDef, unknown > = z.object({ profile: z.string(), videoOnly: z.boolean().default(false), id: z.string().optional(), spec: z.lazy(() => TargetAddPayloadSpec$inboundSchema).optional(), }); /** @internal */ export type TargetAddPayload$Outbound = { profile: string; videoOnly: boolean; id?: string | undefined; spec?: TargetAddPayloadSpec$Outbound | undefined; }; /** @internal */ export const TargetAddPayload$outboundSchema: z.ZodType< TargetAddPayload$Outbound, z.ZodTypeDef, TargetAddPayload > = z.object({ profile: z.string(), videoOnly: z.boolean().default(false), id: z.string().optional(), spec: z.lazy(() => TargetAddPayloadSpec$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 TargetAddPayload$ { /** @deprecated use `TargetAddPayload$inboundSchema` instead. */ export const inboundSchema = TargetAddPayload$inboundSchema; /** @deprecated use `TargetAddPayload$outboundSchema` instead. */ export const outboundSchema = TargetAddPayload$outboundSchema; /** @deprecated use `TargetAddPayload$Outbound` instead. */ export type Outbound = TargetAddPayload$Outbound; } export function targetAddPayloadToJSON( targetAddPayload: TargetAddPayload, ): string { return JSON.stringify( TargetAddPayload$outboundSchema.parse(targetAddPayload), ); } export function targetAddPayloadFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => TargetAddPayload$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'TargetAddPayload' from JSON`, ); }