/* * 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 { SeekPagination, SeekPagination$inboundSchema, SeekPagination$Outbound, SeekPagination$outboundSchema, } from "./seekpagination.js"; import { Tenant, Tenant$inboundSchema, Tenant$Outbound, Tenant$outboundSchema, } from "./tenant.js"; /** * Paginated list of tenants. */ export type TenantPaginatedResult = { /** * Array of tenant objects. */ models?: Array | undefined; /** * Cursor-based pagination metadata for list responses. */ pagination?: SeekPagination | undefined; /** * Total count of all tenants. */ count?: number | undefined; }; /** @internal */ export const TenantPaginatedResult$inboundSchema: z.ZodType< TenantPaginatedResult, z.ZodTypeDef, unknown > = z.object({ models: z.array(Tenant$inboundSchema).optional(), pagination: SeekPagination$inboundSchema.optional(), count: z.number().int().optional(), }); /** @internal */ export type TenantPaginatedResult$Outbound = { models?: Array | undefined; pagination?: SeekPagination$Outbound | undefined; count?: number | undefined; }; /** @internal */ export const TenantPaginatedResult$outboundSchema: z.ZodType< TenantPaginatedResult$Outbound, z.ZodTypeDef, TenantPaginatedResult > = z.object({ models: z.array(Tenant$outboundSchema).optional(), pagination: SeekPagination$outboundSchema.optional(), count: z.number().int().optional(), }); export function tenantPaginatedResultToJSON( tenantPaginatedResult: TenantPaginatedResult, ): string { return JSON.stringify( TenantPaginatedResult$outboundSchema.parse(tenantPaginatedResult), ); } export function tenantPaginatedResultFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => TenantPaginatedResult$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'TenantPaginatedResult' from JSON`, ); }