/* * 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 WebhookEventLogsAllGlobals = { /** * The ID of your Unify application */ appId?: string | undefined; }; export type WebhookEventLogsAllRequest = { /** * The ID of your Unify application */ appId?: string | undefined; /** * 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; /** * Filter results */ filter?: components.WebhookEventLogsFilter | undefined; }; export type WebhookEventLogsAllResponse = { httpMeta: components.HTTPMetadata; /** * EventLogs */ getWebhookEventLogsResponse?: | components.GetWebhookEventLogsResponse | undefined; /** * Unexpected error */ unexpectedErrorResponse?: components.UnexpectedErrorResponse | undefined; }; /** @internal */ export type WebhookEventLogsAllRequest$Outbound = { appId?: string | undefined; cursor?: string | null | undefined; limit: number; filter?: components.WebhookEventLogsFilter$Outbound | undefined; }; /** @internal */ export const WebhookEventLogsAllRequest$outboundSchema: z.ZodType< WebhookEventLogsAllRequest$Outbound, z.ZodTypeDef, WebhookEventLogsAllRequest > = /* @__PURE__ */ lazySchema$(() => z.object({ appId: z.string().optional(), cursor: z.nullable(z.string()).optional(), limit: z.number().int().default(20), filter: components.WebhookEventLogsFilter$outboundSchema.optional(), }) ); export function webhookEventLogsAllRequestToJSON( webhookEventLogsAllRequest: WebhookEventLogsAllRequest, ): string { return JSON.stringify( WebhookEventLogsAllRequest$outboundSchema.parse(webhookEventLogsAllRequest), ); } /** @internal */ export const WebhookEventLogsAllResponse$inboundSchema: z.ZodType< WebhookEventLogsAllResponse, z.ZodTypeDef, unknown > = /* @__PURE__ */ lazySchema$(() => z.object({ HttpMeta: components.HTTPMetadata$inboundSchema, GetWebhookEventLogsResponse: types.optional( components.GetWebhookEventLogsResponse$inboundSchema, ), UnexpectedErrorResponse: types.optional( components.UnexpectedErrorResponse$inboundSchema, ), }).transform((v) => { return remap$(v, { "HttpMeta": "httpMeta", "GetWebhookEventLogsResponse": "getWebhookEventLogsResponse", "UnexpectedErrorResponse": "unexpectedErrorResponse", }); }) ); export function webhookEventLogsAllResponseFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => WebhookEventLogsAllResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'WebhookEventLogsAllResponse' from JSON`, ); }