/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod/v3"; import { remap as remap$ } from "../../lib/primitives.js"; import { lazySchema as lazySchema$ } from "../../lib/schemas.js"; import { Status, Status$outboundSchema } from "./status.js"; import { WebhookEventType, WebhookEventType$outboundSchema, } from "./webhookeventtype.js"; export type UpdateWebhookRequest = { /** * A description of the object. */ description?: string | null | undefined; /** * The status of the webhook. */ status?: Status | undefined; /** * The delivery url of the webhook endpoint. The endpoint must respond within 60 seconds or the delivery is recorded as failed. */ deliveryUrl?: string | undefined; /** * The list of subscribed events for this webhook. [`*`] indicates that all events are enabled. */ events?: Array | undefined; }; /** @internal */ export type UpdateWebhookRequest$Outbound = { description?: string | null | undefined; status?: string | undefined; delivery_url?: string | undefined; events?: Array | undefined; }; /** @internal */ export const UpdateWebhookRequest$outboundSchema: z.ZodType< UpdateWebhookRequest$Outbound, z.ZodTypeDef, UpdateWebhookRequest > = /* @__PURE__ */ lazySchema$(() => z.object({ description: z.nullable(z.string()).optional(), status: Status$outboundSchema.optional(), deliveryUrl: z.string().optional(), events: z.array(WebhookEventType$outboundSchema).optional(), }).transform((v) => { return remap$(v, { deliveryUrl: "delivery_url", }); }) ); export function updateWebhookRequestToJSON( updateWebhookRequest: UpdateWebhookRequest, ): string { return JSON.stringify( UpdateWebhookRequest$outboundSchema.parse(updateWebhookRequest), ); }