/* * 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"; /** * The secret used to verify webhook payloads. */ export type WebhookSecret = { /** * The secret key used to sign webhook payloads. Use this to verify the authenticity of incoming webhooks. */ secret: string; }; /** @internal */ export const WebhookSecret$inboundSchema: z.ZodType< WebhookSecret, z.ZodTypeDef, unknown > = z.object({ secret: z.string(), }); /** @internal */ export type WebhookSecret$Outbound = { secret: string; }; /** @internal */ export const WebhookSecret$outboundSchema: z.ZodType< WebhookSecret$Outbound, z.ZodTypeDef, WebhookSecret > = z.object({ secret: z.string(), }); export function webhookSecretToJSON(webhookSecret: WebhookSecret): string { return JSON.stringify(WebhookSecret$outboundSchema.parse(webhookSecret)); } export function webhookSecretFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => WebhookSecret$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'WebhookSecret' from JSON`, ); }