/* * 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 WebhookEndpointDto = { /** * Webhook URL */ url: string; /** * Optional channel identifier */ channel?: string | undefined; }; /** @internal */ export const WebhookEndpointDto$inboundSchema: z.ZodType< WebhookEndpointDto, z.ZodTypeDef, unknown > = z.object({ url: z.string(), channel: z.string().optional(), }); /** @internal */ export type WebhookEndpointDto$Outbound = { url: string; channel?: string | undefined; }; /** @internal */ export const WebhookEndpointDto$outboundSchema: z.ZodType< WebhookEndpointDto$Outbound, z.ZodTypeDef, WebhookEndpointDto > = z.object({ url: z.string(), channel: z.string().optional(), }); export function webhookEndpointDtoToJSON( webhookEndpointDto: WebhookEndpointDto, ): string { return JSON.stringify( WebhookEndpointDto$outboundSchema.parse(webhookEndpointDto), ); } export function webhookEndpointDtoFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => WebhookEndpointDto$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'WebhookEndpointDto' from JSON`, ); }