/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. * @generated-id: 333a30022088 */ import * as z from "zod/v4"; import { safeParse } from "../../lib/schemas.js"; import { Result as SafeParseResult } from "../../types/fp.js"; import { SDKValidationError } from "../errors/sdkvalidationerror.js"; import { PipelineConfigHeader, PipelineConfigHeader$inboundSchema, PipelineConfigHeader$Outbound, PipelineConfigHeader$outboundSchema, } from "./pipelineconfigheader.js"; export type OTLPDestination = { protocol: string; endpoint: string; insecure?: boolean | undefined; headers?: { [k: string]: PipelineConfigHeader } | undefined; }; /** @internal */ export const OTLPDestination$inboundSchema: z.ZodType< OTLPDestination, unknown > = z.object({ protocol: z.string(), endpoint: z.string(), insecure: z.boolean().default(false), headers: z.record(z.string(), PipelineConfigHeader$inboundSchema).optional(), }); /** @internal */ export type OTLPDestination$Outbound = { protocol: string; endpoint: string; insecure: boolean; headers?: { [k: string]: PipelineConfigHeader$Outbound } | undefined; }; /** @internal */ export const OTLPDestination$outboundSchema: z.ZodType< OTLPDestination$Outbound, OTLPDestination > = z.object({ protocol: z.string(), endpoint: z.string(), insecure: z.boolean().default(false), headers: z.record(z.string(), PipelineConfigHeader$outboundSchema).optional(), }); export function otlpDestinationToJSON( otlpDestination: OTLPDestination, ): string { return JSON.stringify(OTLPDestination$outboundSchema.parse(otlpDestination)); } export function otlpDestinationFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => OTLPDestination$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'OTLPDestination' from JSON`, ); }