/* * 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$, safeParse } from "../../lib/schemas.js"; import { Result as SafeParseResult } from "../../types/fp.js"; import * as types from "../../types/primitives.js"; import * as components from "../components/index.js"; import { SDKValidationError } from "../errors/sdkvalidationerror.js"; export type WebhookWebhooksDeleteGlobals = { /** * The ID of your Unify application */ appId?: string | undefined; }; export type WebhookWebhooksDeleteRequest = { /** * JWT Webhook token that represents the unifiedApi and applicationId associated to the event source. */ id: string; /** * The ID of your Unify application */ appId?: string | undefined; }; export type WebhookWebhooksDeleteResponse = { httpMeta: components.HTTPMetadata; /** * Webhooks */ deleteWebhookResponse?: components.DeleteWebhookResponse | undefined; /** * Unexpected error */ unexpectedErrorResponse?: components.UnexpectedErrorResponse | undefined; }; /** @internal */ export type WebhookWebhooksDeleteRequest$Outbound = { id: string; appId?: string | undefined; }; /** @internal */ export const WebhookWebhooksDeleteRequest$outboundSchema: z.ZodType< WebhookWebhooksDeleteRequest$Outbound, z.ZodTypeDef, WebhookWebhooksDeleteRequest > = /* @__PURE__ */ lazySchema$(() => z.object({ id: z.string(), appId: z.string().optional(), }) ); export function webhookWebhooksDeleteRequestToJSON( webhookWebhooksDeleteRequest: WebhookWebhooksDeleteRequest, ): string { return JSON.stringify( WebhookWebhooksDeleteRequest$outboundSchema.parse( webhookWebhooksDeleteRequest, ), ); } /** @internal */ export const WebhookWebhooksDeleteResponse$inboundSchema: z.ZodType< WebhookWebhooksDeleteResponse, z.ZodTypeDef, unknown > = /* @__PURE__ */ lazySchema$(() => z.object({ HttpMeta: components.HTTPMetadata$inboundSchema, DeleteWebhookResponse: types.optional( components.DeleteWebhookResponse$inboundSchema, ), UnexpectedErrorResponse: types.optional( components.UnexpectedErrorResponse$inboundSchema, ), }).transform((v) => { return remap$(v, { "HttpMeta": "httpMeta", "DeleteWebhookResponse": "deleteWebhookResponse", "UnexpectedErrorResponse": "unexpectedErrorResponse", }); }) ); export function webhookWebhooksDeleteResponseFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => WebhookWebhooksDeleteResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'WebhookWebhooksDeleteResponse' from JSON`, ); }