/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod"; import { remap as remap$ } from "../../lib/primitives.js"; import { safeParse } from "../../lib/schemas.js"; import { Result as SafeParseResult } from "../../types/fp.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; updateWebhookRequest: components.UpdateWebhookRequest; }; export type WebhookWebhooksUpdateResponse = { httpMeta: components.HTTPMetadata; /** * Webhooks */ updateWebhookResponse?: components.UpdateWebhookResponse | undefined; /** * Unexpected error */ unexpectedErrorResponse?: components.UnexpectedErrorResponse | undefined; }; /** @internal */ export const WebhookWebhooksUpdateGlobals$inboundSchema: z.ZodType< WebhookWebhooksUpdateGlobals, z.ZodTypeDef, unknown > = z.object({ appId: z.string().optional(), }); /** @internal */ export type WebhookWebhooksUpdateGlobals$Outbound = { appId?: string | undefined; }; /** @internal */ export const WebhookWebhooksUpdateGlobals$outboundSchema: z.ZodType< WebhookWebhooksUpdateGlobals$Outbound, z.ZodTypeDef, WebhookWebhooksUpdateGlobals > = z.object({ appId: z.string().optional(), }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace WebhookWebhooksUpdateGlobals$ { /** @deprecated use `WebhookWebhooksUpdateGlobals$inboundSchema` instead. */ export const inboundSchema = WebhookWebhooksUpdateGlobals$inboundSchema; /** @deprecated use `WebhookWebhooksUpdateGlobals$outboundSchema` instead. */ export const outboundSchema = WebhookWebhooksUpdateGlobals$outboundSchema; /** @deprecated use `WebhookWebhooksUpdateGlobals$Outbound` instead. */ export type Outbound = WebhookWebhooksUpdateGlobals$Outbound; } export function webhookWebhooksUpdateGlobalsToJSON( webhookWebhooksUpdateGlobals: WebhookWebhooksUpdateGlobals, ): string { return JSON.stringify( WebhookWebhooksUpdateGlobals$outboundSchema.parse( webhookWebhooksUpdateGlobals, ), ); } export function webhookWebhooksUpdateGlobalsFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => WebhookWebhooksUpdateGlobals$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'WebhookWebhooksUpdateGlobals' from JSON`, ); } /** @internal */ export const WebhookWebhooksUpdateRequest$inboundSchema: z.ZodType< WebhookWebhooksUpdateRequest, z.ZodTypeDef, unknown > = z.object({ id: z.string(), UpdateWebhookRequest: components.UpdateWebhookRequest$inboundSchema, }).transform((v) => { return remap$(v, { "UpdateWebhookRequest": "updateWebhookRequest", }); }); /** @internal */ export type WebhookWebhooksUpdateRequest$Outbound = { id: string; UpdateWebhookRequest: components.UpdateWebhookRequest$Outbound; }; /** @internal */ export const WebhookWebhooksUpdateRequest$outboundSchema: z.ZodType< WebhookWebhooksUpdateRequest$Outbound, z.ZodTypeDef, WebhookWebhooksUpdateRequest > = z.object({ id: z.string(), updateWebhookRequest: components.UpdateWebhookRequest$outboundSchema, }).transform((v) => { return remap$(v, { updateWebhookRequest: "UpdateWebhookRequest", }); }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace WebhookWebhooksUpdateRequest$ { /** @deprecated use `WebhookWebhooksUpdateRequest$inboundSchema` instead. */ export const inboundSchema = WebhookWebhooksUpdateRequest$inboundSchema; /** @deprecated use `WebhookWebhooksUpdateRequest$outboundSchema` instead. */ export const outboundSchema = WebhookWebhooksUpdateRequest$outboundSchema; /** @deprecated use `WebhookWebhooksUpdateRequest$Outbound` instead. */ export type Outbound = WebhookWebhooksUpdateRequest$Outbound; } export function webhookWebhooksUpdateRequestToJSON( webhookWebhooksUpdateRequest: WebhookWebhooksUpdateRequest, ): string { return JSON.stringify( WebhookWebhooksUpdateRequest$outboundSchema.parse( webhookWebhooksUpdateRequest, ), ); } export function webhookWebhooksUpdateRequestFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => WebhookWebhooksUpdateRequest$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'WebhookWebhooksUpdateRequest' from JSON`, ); } /** @internal */ export const WebhookWebhooksUpdateResponse$inboundSchema: z.ZodType< WebhookWebhooksUpdateResponse, z.ZodTypeDef, unknown > = z.object({ HttpMeta: components.HTTPMetadata$inboundSchema, UpdateWebhookResponse: components.UpdateWebhookResponse$inboundSchema .optional(), UnexpectedErrorResponse: components.UnexpectedErrorResponse$inboundSchema .optional(), }).transform((v) => { return remap$(v, { "HttpMeta": "httpMeta", "UpdateWebhookResponse": "updateWebhookResponse", "UnexpectedErrorResponse": "unexpectedErrorResponse", }); }); /** @internal */ export type WebhookWebhooksUpdateResponse$Outbound = { HttpMeta: components.HTTPMetadata$Outbound; UpdateWebhookResponse?: components.UpdateWebhookResponse$Outbound | undefined; UnexpectedErrorResponse?: | components.UnexpectedErrorResponse$Outbound | undefined; }; /** @internal */ export const WebhookWebhooksUpdateResponse$outboundSchema: z.ZodType< WebhookWebhooksUpdateResponse$Outbound, z.ZodTypeDef, WebhookWebhooksUpdateResponse > = z.object({ httpMeta: components.HTTPMetadata$outboundSchema, updateWebhookResponse: components.UpdateWebhookResponse$outboundSchema .optional(), unexpectedErrorResponse: components.UnexpectedErrorResponse$outboundSchema .optional(), }).transform((v) => { return remap$(v, { httpMeta: "HttpMeta", updateWebhookResponse: "UpdateWebhookResponse", unexpectedErrorResponse: "UnexpectedErrorResponse", }); }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace WebhookWebhooksUpdateResponse$ { /** @deprecated use `WebhookWebhooksUpdateResponse$inboundSchema` instead. */ export const inboundSchema = WebhookWebhooksUpdateResponse$inboundSchema; /** @deprecated use `WebhookWebhooksUpdateResponse$outboundSchema` instead. */ export const outboundSchema = WebhookWebhooksUpdateResponse$outboundSchema; /** @deprecated use `WebhookWebhooksUpdateResponse$Outbound` instead. */ export type Outbound = WebhookWebhooksUpdateResponse$Outbound; } export function webhookWebhooksUpdateResponseToJSON( webhookWebhooksUpdateResponse: WebhookWebhooksUpdateResponse, ): string { return JSON.stringify( WebhookWebhooksUpdateResponse$outboundSchema.parse( webhookWebhooksUpdateResponse, ), ); } export function webhookWebhooksUpdateResponseFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => WebhookWebhooksUpdateResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'WebhookWebhooksUpdateResponse' from JSON`, ); }