/* * 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 WebhookEventLogsAllGlobals = { /** * The ID of your Unify application */ appId?: string | undefined; }; export type WebhookEventLogsAllRequest = { /** * 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 const WebhookEventLogsAllGlobals$inboundSchema: z.ZodType< WebhookEventLogsAllGlobals, z.ZodTypeDef, unknown > = z.object({ appId: z.string().optional(), }); /** @internal */ export type WebhookEventLogsAllGlobals$Outbound = { appId?: string | undefined; }; /** @internal */ export const WebhookEventLogsAllGlobals$outboundSchema: z.ZodType< WebhookEventLogsAllGlobals$Outbound, z.ZodTypeDef, WebhookEventLogsAllGlobals > = 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 WebhookEventLogsAllGlobals$ { /** @deprecated use `WebhookEventLogsAllGlobals$inboundSchema` instead. */ export const inboundSchema = WebhookEventLogsAllGlobals$inboundSchema; /** @deprecated use `WebhookEventLogsAllGlobals$outboundSchema` instead. */ export const outboundSchema = WebhookEventLogsAllGlobals$outboundSchema; /** @deprecated use `WebhookEventLogsAllGlobals$Outbound` instead. */ export type Outbound = WebhookEventLogsAllGlobals$Outbound; } export function webhookEventLogsAllGlobalsToJSON( webhookEventLogsAllGlobals: WebhookEventLogsAllGlobals, ): string { return JSON.stringify( WebhookEventLogsAllGlobals$outboundSchema.parse(webhookEventLogsAllGlobals), ); } export function webhookEventLogsAllGlobalsFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => WebhookEventLogsAllGlobals$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'WebhookEventLogsAllGlobals' from JSON`, ); } /** @internal */ export const WebhookEventLogsAllRequest$inboundSchema: z.ZodType< WebhookEventLogsAllRequest, z.ZodTypeDef, unknown > = z.object({ cursor: z.nullable(z.string()).optional(), limit: z.number().int().default(20), filter: components.WebhookEventLogsFilter$inboundSchema.optional(), }); /** @internal */ export type WebhookEventLogsAllRequest$Outbound = { cursor?: string | null | undefined; limit: number; filter?: components.WebhookEventLogsFilter$Outbound | undefined; }; /** @internal */ export const WebhookEventLogsAllRequest$outboundSchema: z.ZodType< WebhookEventLogsAllRequest$Outbound, z.ZodTypeDef, WebhookEventLogsAllRequest > = z.object({ cursor: z.nullable(z.string()).optional(), limit: z.number().int().default(20), filter: components.WebhookEventLogsFilter$outboundSchema.optional(), }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace WebhookEventLogsAllRequest$ { /** @deprecated use `WebhookEventLogsAllRequest$inboundSchema` instead. */ export const inboundSchema = WebhookEventLogsAllRequest$inboundSchema; /** @deprecated use `WebhookEventLogsAllRequest$outboundSchema` instead. */ export const outboundSchema = WebhookEventLogsAllRequest$outboundSchema; /** @deprecated use `WebhookEventLogsAllRequest$Outbound` instead. */ export type Outbound = WebhookEventLogsAllRequest$Outbound; } export function webhookEventLogsAllRequestToJSON( webhookEventLogsAllRequest: WebhookEventLogsAllRequest, ): string { return JSON.stringify( WebhookEventLogsAllRequest$outboundSchema.parse(webhookEventLogsAllRequest), ); } export function webhookEventLogsAllRequestFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => WebhookEventLogsAllRequest$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'WebhookEventLogsAllRequest' from JSON`, ); } /** @internal */ export const WebhookEventLogsAllResponse$inboundSchema: z.ZodType< WebhookEventLogsAllResponse, z.ZodTypeDef, unknown > = z.object({ HttpMeta: components.HTTPMetadata$inboundSchema, GetWebhookEventLogsResponse: components .GetWebhookEventLogsResponse$inboundSchema.optional(), UnexpectedErrorResponse: components.UnexpectedErrorResponse$inboundSchema .optional(), }).transform((v) => { return remap$(v, { "HttpMeta": "httpMeta", "GetWebhookEventLogsResponse": "getWebhookEventLogsResponse", "UnexpectedErrorResponse": "unexpectedErrorResponse", }); }); /** @internal */ export type WebhookEventLogsAllResponse$Outbound = { HttpMeta: components.HTTPMetadata$Outbound; GetWebhookEventLogsResponse?: | components.GetWebhookEventLogsResponse$Outbound | undefined; UnexpectedErrorResponse?: | components.UnexpectedErrorResponse$Outbound | undefined; }; /** @internal */ export const WebhookEventLogsAllResponse$outboundSchema: z.ZodType< WebhookEventLogsAllResponse$Outbound, z.ZodTypeDef, WebhookEventLogsAllResponse > = z.object({ httpMeta: components.HTTPMetadata$outboundSchema, getWebhookEventLogsResponse: components .GetWebhookEventLogsResponse$outboundSchema.optional(), unexpectedErrorResponse: components.UnexpectedErrorResponse$outboundSchema .optional(), }).transform((v) => { return remap$(v, { httpMeta: "HttpMeta", getWebhookEventLogsResponse: "GetWebhookEventLogsResponse", 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 WebhookEventLogsAllResponse$ { /** @deprecated use `WebhookEventLogsAllResponse$inboundSchema` instead. */ export const inboundSchema = WebhookEventLogsAllResponse$inboundSchema; /** @deprecated use `WebhookEventLogsAllResponse$outboundSchema` instead. */ export const outboundSchema = WebhookEventLogsAllResponse$outboundSchema; /** @deprecated use `WebhookEventLogsAllResponse$Outbound` instead. */ export type Outbound = WebhookEventLogsAllResponse$Outbound; } export function webhookEventLogsAllResponseToJSON( webhookEventLogsAllResponse: WebhookEventLogsAllResponse, ): string { return JSON.stringify( WebhookEventLogsAllResponse$outboundSchema.parse( webhookEventLogsAllResponse, ), ); } export function webhookEventLogsAllResponseFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => WebhookEventLogsAllResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'WebhookEventLogsAllResponse' from JSON`, ); }