/* * 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 { safeParse } from "../../lib/schemas.js"; import { Result as SafeParseResult } from "../../types/fp.js"; import { SDKValidationError } from "../errors/sdkvalidationerror.js"; import { Pagination, Pagination$inboundSchema, Pagination$Outbound, Pagination$outboundSchema, } from "./pagination.js"; import { WebhookEndpoint, WebhookEndpoint$inboundSchema, WebhookEndpoint$Outbound, WebhookEndpoint$outboundSchema, } from "./webhookendpoint.js"; export type WebhookEndpointList = { pagination: Pagination; webhookEndpoints: Array; }; /** @internal */ export const WebhookEndpointList$inboundSchema: z.ZodType< WebhookEndpointList, z.ZodTypeDef, unknown > = z.object({ pagination: Pagination$inboundSchema, webhook_endpoints: z.array(WebhookEndpoint$inboundSchema), }).transform((v) => { return remap$(v, { "webhook_endpoints": "webhookEndpoints", }); }); /** @internal */ export type WebhookEndpointList$Outbound = { pagination: Pagination$Outbound; webhook_endpoints: Array; }; /** @internal */ export const WebhookEndpointList$outboundSchema: z.ZodType< WebhookEndpointList$Outbound, z.ZodTypeDef, WebhookEndpointList > = z.object({ pagination: Pagination$outboundSchema, webhookEndpoints: z.array(WebhookEndpoint$outboundSchema), }).transform((v) => { return remap$(v, { webhookEndpoints: "webhook_endpoints", }); }); export function webhookEndpointListToJSON( webhookEndpointList: WebhookEndpointList, ): string { return JSON.stringify( WebhookEndpointList$outboundSchema.parse(webhookEndpointList), ); } export function webhookEndpointListFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => WebhookEndpointList$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'WebhookEndpointList' from JSON`, ); }