/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod/v4-mini"; import { safeParse } from "../../lib/schemas.js"; import { Result as SafeParseResult } from "../../types/fp.js"; import * as types from "../../types/primitives.js"; import { SDKValidationError } from "../errors/sdk-validation-error.js"; export type DeleteWebhookRequest = { /** * The ID of the webhook to delete. */ id: string; /** * The project to act on, when you call with an organization key. Optional when the organization has one project. A project key acts on its own project: naming another one is an error. */ projectId?: string | undefined; }; /** * Webhook deleted successfully */ export type DeleteWebhookResponse = { /** * Whether the webhook was deleted. */ deleted: boolean; /** * The ID of the webhook. */ id: string; }; /** @internal */ export type DeleteWebhookRequest$Outbound = { id: string; projectId?: string | undefined; }; /** @internal */ export const DeleteWebhookRequest$outboundSchema: z.ZodMiniType< DeleteWebhookRequest$Outbound, DeleteWebhookRequest > = z.object({ id: z.string(), projectId: z.optional(z.string()), }); export function deleteWebhookRequestToJSON( deleteWebhookRequest: DeleteWebhookRequest, ): string { return JSON.stringify( DeleteWebhookRequest$outboundSchema.parse(deleteWebhookRequest), ); } /** @internal */ export const DeleteWebhookResponse$inboundSchema: z.ZodMiniType< DeleteWebhookResponse, unknown > = z.object({ deleted: types.boolean(), id: types.string(), }); export function deleteWebhookResponseFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => DeleteWebhookResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'DeleteWebhookResponse' from JSON`, ); }