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