/* * 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 WebhookWebhooksOneGlobals = { /** * The ID of your Unify application */ appId?: string | undefined; }; export type WebhookWebhooksOneRequest = { /** * 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 WebhookWebhooksOneResponse = { httpMeta: components.HTTPMetadata; /** * Webhooks */ getWebhookResponse?: components.GetWebhookResponse | undefined; /** * Unexpected error */ unexpectedErrorResponse?: components.UnexpectedErrorResponse | undefined; }; /** @internal */ export type WebhookWebhooksOneRequest$Outbound = { id: string; appId?: string | undefined; }; /** @internal */ export const WebhookWebhooksOneRequest$outboundSchema: z.ZodType< WebhookWebhooksOneRequest$Outbound, z.ZodTypeDef, WebhookWebhooksOneRequest > = /* @__PURE__ */ lazySchema$(() => z.object({ id: z.string(), appId: z.string().optional(), }) ); export function webhookWebhooksOneRequestToJSON( webhookWebhooksOneRequest: WebhookWebhooksOneRequest, ): string { return JSON.stringify( WebhookWebhooksOneRequest$outboundSchema.parse(webhookWebhooksOneRequest), ); } /** @internal */ export const WebhookWebhooksOneResponse$inboundSchema: z.ZodType< WebhookWebhooksOneResponse, z.ZodTypeDef, unknown > = /* @__PURE__ */ lazySchema$(() => z.object({ HttpMeta: components.HTTPMetadata$inboundSchema, GetWebhookResponse: types.optional( components.GetWebhookResponse$inboundSchema, ), UnexpectedErrorResponse: types.optional( components.UnexpectedErrorResponse$inboundSchema, ), }).transform((v) => { return remap$(v, { "HttpMeta": "httpMeta", "GetWebhookResponse": "getWebhookResponse", "UnexpectedErrorResponse": "unexpectedErrorResponse", }); }) ); export function webhookWebhooksOneResponseFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => WebhookWebhooksOneResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'WebhookWebhooksOneResponse' from JSON`, ); }