/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod/v3"; import { safeParse } from "../../lib/schemas.js"; import { Result as SafeParseResult } from "../../types/fp.js"; import { SDKValidationError } from "../errors/sdkvalidationerror.js"; import { CustomerEntity, CustomerEntity$inboundSchema, CustomerEntity$Outbound, CustomerEntity$outboundSchema, } from "./customerentity.js"; import { PaginationEntity, PaginationEntity$inboundSchema, PaginationEntity$Outbound, PaginationEntity$outboundSchema, } from "./paginationentity.js"; export type CustomerListEntity = { /** * List of customer items */ items: Array; /** * Pagination details for the list */ pagination: PaginationEntity; }; /** @internal */ export const CustomerListEntity$inboundSchema: z.ZodType< CustomerListEntity, z.ZodTypeDef, unknown > = z.object({ items: z.array(CustomerEntity$inboundSchema), pagination: PaginationEntity$inboundSchema, }); /** @internal */ export type CustomerListEntity$Outbound = { items: Array; pagination: PaginationEntity$Outbound; }; /** @internal */ export const CustomerListEntity$outboundSchema: z.ZodType< CustomerListEntity$Outbound, z.ZodTypeDef, CustomerListEntity > = z.object({ items: z.array(CustomerEntity$outboundSchema), pagination: PaginationEntity$outboundSchema, }); export function customerListEntityToJSON( customerListEntity: CustomerListEntity, ): string { return JSON.stringify( CustomerListEntity$outboundSchema.parse(customerListEntity), ); } export function customerListEntityFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => CustomerListEntity$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CustomerListEntity' from JSON`, ); }