/* * 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 { SDKValidationError } from "../errors/sdkvalidationerror.js"; import { Links, Links$inboundSchema, Links$Outbound, Links$outboundSchema, } from "./links.js"; import { Meta, Meta$inboundSchema, Meta$Outbound, Meta$outboundSchema, } from "./meta.js"; import { WebhookEventLog, WebhookEventLog$inboundSchema, WebhookEventLog$Outbound, WebhookEventLog$outboundSchema, } from "./webhookeventlog.js"; /** * EventLogs */ export type GetWebhookEventLogsResponse = { /** * HTTP Response Status Code */ statusCode: number; /** * HTTP Response Status */ status: string; data: Array; /** * Response metadata */ meta?: Meta | undefined; /** * Links to navigate to previous or next pages through the API */ links?: Links | undefined; }; /** @internal */ export const GetWebhookEventLogsResponse$inboundSchema: z.ZodType< GetWebhookEventLogsResponse, z.ZodTypeDef, unknown > = z.object({ status_code: z.number().int(), status: z.string(), data: z.array(WebhookEventLog$inboundSchema), meta: Meta$inboundSchema.optional(), links: Links$inboundSchema.optional(), }).transform((v) => { return remap$(v, { "status_code": "statusCode", }); }); /** @internal */ export type GetWebhookEventLogsResponse$Outbound = { status_code: number; status: string; data: Array; meta?: Meta$Outbound | undefined; links?: Links$Outbound | undefined; }; /** @internal */ export const GetWebhookEventLogsResponse$outboundSchema: z.ZodType< GetWebhookEventLogsResponse$Outbound, z.ZodTypeDef, GetWebhookEventLogsResponse > = z.object({ statusCode: z.number().int(), status: z.string(), data: z.array(WebhookEventLog$outboundSchema), meta: Meta$outboundSchema.optional(), links: Links$outboundSchema.optional(), }).transform((v) => { return remap$(v, { statusCode: "status_code", }); }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace GetWebhookEventLogsResponse$ { /** @deprecated use `GetWebhookEventLogsResponse$inboundSchema` instead. */ export const inboundSchema = GetWebhookEventLogsResponse$inboundSchema; /** @deprecated use `GetWebhookEventLogsResponse$outboundSchema` instead. */ export const outboundSchema = GetWebhookEventLogsResponse$outboundSchema; /** @deprecated use `GetWebhookEventLogsResponse$Outbound` instead. */ export type Outbound = GetWebhookEventLogsResponse$Outbound; } export function getWebhookEventLogsResponseToJSON( getWebhookEventLogsResponse: GetWebhookEventLogsResponse, ): string { return JSON.stringify( GetWebhookEventLogsResponse$outboundSchema.parse( getWebhookEventLogsResponse, ), ); } export function getWebhookEventLogsResponseFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => GetWebhookEventLogsResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetWebhookEventLogsResponse' from JSON`, ); }