/* * 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 WebhookWebhooksAllGlobals = { /** * The ID of your Unify application */ appId?: string | undefined; }; export type WebhookWebhooksAllRequest = { /** * Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. */ cursor?: string | null | undefined; /** * Number of results to return. Minimum 1, Maximum 200, Default 20 */ limit?: number | undefined; }; export type WebhookWebhooksAllResponse = { httpMeta: components.HTTPMetadata; /** * Webhooks */ getWebhooksResponse?: components.GetWebhooksResponse | undefined; /** * Unexpected error */ unexpectedErrorResponse?: components.UnexpectedErrorResponse | undefined; }; /** @internal */ export const WebhookWebhooksAllGlobals$inboundSchema: z.ZodType< WebhookWebhooksAllGlobals, z.ZodTypeDef, unknown > = z.object({ appId: z.string().optional(), }); /** @internal */ export type WebhookWebhooksAllGlobals$Outbound = { appId?: string | undefined; }; /** @internal */ export const WebhookWebhooksAllGlobals$outboundSchema: z.ZodType< WebhookWebhooksAllGlobals$Outbound, z.ZodTypeDef, WebhookWebhooksAllGlobals > = 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 WebhookWebhooksAllGlobals$ { /** @deprecated use `WebhookWebhooksAllGlobals$inboundSchema` instead. */ export const inboundSchema = WebhookWebhooksAllGlobals$inboundSchema; /** @deprecated use `WebhookWebhooksAllGlobals$outboundSchema` instead. */ export const outboundSchema = WebhookWebhooksAllGlobals$outboundSchema; /** @deprecated use `WebhookWebhooksAllGlobals$Outbound` instead. */ export type Outbound = WebhookWebhooksAllGlobals$Outbound; } export function webhookWebhooksAllGlobalsToJSON( webhookWebhooksAllGlobals: WebhookWebhooksAllGlobals, ): string { return JSON.stringify( WebhookWebhooksAllGlobals$outboundSchema.parse(webhookWebhooksAllGlobals), ); } export function webhookWebhooksAllGlobalsFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => WebhookWebhooksAllGlobals$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'WebhookWebhooksAllGlobals' from JSON`, ); } /** @internal */ export const WebhookWebhooksAllRequest$inboundSchema: z.ZodType< WebhookWebhooksAllRequest, z.ZodTypeDef, unknown > = z.object({ cursor: z.nullable(z.string()).optional(), limit: z.number().int().default(20), }); /** @internal */ export type WebhookWebhooksAllRequest$Outbound = { cursor?: string | null | undefined; limit: number; }; /** @internal */ export const WebhookWebhooksAllRequest$outboundSchema: z.ZodType< WebhookWebhooksAllRequest$Outbound, z.ZodTypeDef, WebhookWebhooksAllRequest > = z.object({ cursor: z.nullable(z.string()).optional(), limit: z.number().int().default(20), }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace WebhookWebhooksAllRequest$ { /** @deprecated use `WebhookWebhooksAllRequest$inboundSchema` instead. */ export const inboundSchema = WebhookWebhooksAllRequest$inboundSchema; /** @deprecated use `WebhookWebhooksAllRequest$outboundSchema` instead. */ export const outboundSchema = WebhookWebhooksAllRequest$outboundSchema; /** @deprecated use `WebhookWebhooksAllRequest$Outbound` instead. */ export type Outbound = WebhookWebhooksAllRequest$Outbound; } export function webhookWebhooksAllRequestToJSON( webhookWebhooksAllRequest: WebhookWebhooksAllRequest, ): string { return JSON.stringify( WebhookWebhooksAllRequest$outboundSchema.parse(webhookWebhooksAllRequest), ); } export function webhookWebhooksAllRequestFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => WebhookWebhooksAllRequest$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'WebhookWebhooksAllRequest' from JSON`, ); } /** @internal */ export const WebhookWebhooksAllResponse$inboundSchema: z.ZodType< WebhookWebhooksAllResponse, z.ZodTypeDef, unknown > = z.object({ HttpMeta: components.HTTPMetadata$inboundSchema, GetWebhooksResponse: components.GetWebhooksResponse$inboundSchema.optional(), UnexpectedErrorResponse: components.UnexpectedErrorResponse$inboundSchema .optional(), }).transform((v) => { return remap$(v, { "HttpMeta": "httpMeta", "GetWebhooksResponse": "getWebhooksResponse", "UnexpectedErrorResponse": "unexpectedErrorResponse", }); }); /** @internal */ export type WebhookWebhooksAllResponse$Outbound = { HttpMeta: components.HTTPMetadata$Outbound; GetWebhooksResponse?: components.GetWebhooksResponse$Outbound | undefined; UnexpectedErrorResponse?: | components.UnexpectedErrorResponse$Outbound | undefined; }; /** @internal */ export const WebhookWebhooksAllResponse$outboundSchema: z.ZodType< WebhookWebhooksAllResponse$Outbound, z.ZodTypeDef, WebhookWebhooksAllResponse > = z.object({ httpMeta: components.HTTPMetadata$outboundSchema, getWebhooksResponse: components.GetWebhooksResponse$outboundSchema.optional(), unexpectedErrorResponse: components.UnexpectedErrorResponse$outboundSchema .optional(), }).transform((v) => { return remap$(v, { httpMeta: "HttpMeta", getWebhooksResponse: "GetWebhooksResponse", 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 WebhookWebhooksAllResponse$ { /** @deprecated use `WebhookWebhooksAllResponse$inboundSchema` instead. */ export const inboundSchema = WebhookWebhooksAllResponse$inboundSchema; /** @deprecated use `WebhookWebhooksAllResponse$outboundSchema` instead. */ export const outboundSchema = WebhookWebhooksAllResponse$outboundSchema; /** @deprecated use `WebhookWebhooksAllResponse$Outbound` instead. */ export type Outbound = WebhookWebhooksAllResponse$Outbound; } export function webhookWebhooksAllResponseToJSON( webhookWebhooksAllResponse: WebhookWebhooksAllResponse, ): string { return JSON.stringify( WebhookWebhooksAllResponse$outboundSchema.parse(webhookWebhooksAllResponse), ); } export function webhookWebhooksAllResponseFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => WebhookWebhooksAllResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'WebhookWebhooksAllResponse' from JSON`, ); }