/* * 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 WebhookWebhooksAddGlobals = { /** * The ID of your Unify application */ appId?: string | undefined; }; export type WebhookWebhooksAddResponse = { httpMeta: components.HTTPMetadata; /** * Webhooks */ createWebhookResponse?: components.CreateWebhookResponse | undefined; /** * Unexpected error */ unexpectedErrorResponse?: components.UnexpectedErrorResponse | undefined; }; /** @internal */ export const WebhookWebhooksAddGlobals$inboundSchema: z.ZodType< WebhookWebhooksAddGlobals, z.ZodTypeDef, unknown > = z.object({ appId: z.string().optional(), }); /** @internal */ export type WebhookWebhooksAddGlobals$Outbound = { appId?: string | undefined; }; /** @internal */ export const WebhookWebhooksAddGlobals$outboundSchema: z.ZodType< WebhookWebhooksAddGlobals$Outbound, z.ZodTypeDef, WebhookWebhooksAddGlobals > = 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 WebhookWebhooksAddGlobals$ { /** @deprecated use `WebhookWebhooksAddGlobals$inboundSchema` instead. */ export const inboundSchema = WebhookWebhooksAddGlobals$inboundSchema; /** @deprecated use `WebhookWebhooksAddGlobals$outboundSchema` instead. */ export const outboundSchema = WebhookWebhooksAddGlobals$outboundSchema; /** @deprecated use `WebhookWebhooksAddGlobals$Outbound` instead. */ export type Outbound = WebhookWebhooksAddGlobals$Outbound; } export function webhookWebhooksAddGlobalsToJSON( webhookWebhooksAddGlobals: WebhookWebhooksAddGlobals, ): string { return JSON.stringify( WebhookWebhooksAddGlobals$outboundSchema.parse(webhookWebhooksAddGlobals), ); } export function webhookWebhooksAddGlobalsFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => WebhookWebhooksAddGlobals$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'WebhookWebhooksAddGlobals' from JSON`, ); } /** @internal */ export const WebhookWebhooksAddResponse$inboundSchema: z.ZodType< WebhookWebhooksAddResponse, z.ZodTypeDef, unknown > = z.object({ HttpMeta: components.HTTPMetadata$inboundSchema, CreateWebhookResponse: components.CreateWebhookResponse$inboundSchema .optional(), UnexpectedErrorResponse: components.UnexpectedErrorResponse$inboundSchema .optional(), }).transform((v) => { return remap$(v, { "HttpMeta": "httpMeta", "CreateWebhookResponse": "createWebhookResponse", "UnexpectedErrorResponse": "unexpectedErrorResponse", }); }); /** @internal */ export type WebhookWebhooksAddResponse$Outbound = { HttpMeta: components.HTTPMetadata$Outbound; CreateWebhookResponse?: components.CreateWebhookResponse$Outbound | undefined; UnexpectedErrorResponse?: | components.UnexpectedErrorResponse$Outbound | undefined; }; /** @internal */ export const WebhookWebhooksAddResponse$outboundSchema: z.ZodType< WebhookWebhooksAddResponse$Outbound, z.ZodTypeDef, WebhookWebhooksAddResponse > = z.object({ httpMeta: components.HTTPMetadata$outboundSchema, createWebhookResponse: components.CreateWebhookResponse$outboundSchema .optional(), unexpectedErrorResponse: components.UnexpectedErrorResponse$outboundSchema .optional(), }).transform((v) => { return remap$(v, { httpMeta: "HttpMeta", createWebhookResponse: "CreateWebhookResponse", 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 WebhookWebhooksAddResponse$ { /** @deprecated use `WebhookWebhooksAddResponse$inboundSchema` instead. */ export const inboundSchema = WebhookWebhooksAddResponse$inboundSchema; /** @deprecated use `WebhookWebhooksAddResponse$outboundSchema` instead. */ export const outboundSchema = WebhookWebhooksAddResponse$outboundSchema; /** @deprecated use `WebhookWebhooksAddResponse$Outbound` instead. */ export type Outbound = WebhookWebhooksAddResponse$Outbound; } export function webhookWebhooksAddResponseToJSON( webhookWebhooksAddResponse: WebhookWebhooksAddResponse, ): string { return JSON.stringify( WebhookWebhooksAddResponse$outboundSchema.parse(webhookWebhooksAddResponse), ); } export function webhookWebhooksAddResponseFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => WebhookWebhooksAddResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'WebhookWebhooksAddResponse' from JSON`, ); }