/* * 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 { Attempt, Attempt$inboundSchema, Attempt$Outbound, Attempt$outboundSchema, } from "./attempt.js"; import { SeekPagination, SeekPagination$inboundSchema, SeekPagination$Outbound, SeekPagination$outboundSchema, } from "./seekpagination.js"; /** * Paginated list of attempts. */ export type AttemptPaginatedResult = { /** * Array of attempt objects. */ models?: Array | undefined; /** * Cursor-based pagination metadata for list responses. */ pagination?: SeekPagination | undefined; }; /** @internal */ export const AttemptPaginatedResult$inboundSchema: z.ZodType< AttemptPaginatedResult, z.ZodTypeDef, unknown > = z.object({ models: z.array(Attempt$inboundSchema).optional(), pagination: SeekPagination$inboundSchema.optional(), }); /** @internal */ export type AttemptPaginatedResult$Outbound = { models?: Array | undefined; pagination?: SeekPagination$Outbound | undefined; }; /** @internal */ export const AttemptPaginatedResult$outboundSchema: z.ZodType< AttemptPaginatedResult$Outbound, z.ZodTypeDef, AttemptPaginatedResult > = z.object({ models: z.array(Attempt$outboundSchema).optional(), pagination: SeekPagination$outboundSchema.optional(), }); export function attemptPaginatedResultToJSON( attemptPaginatedResult: AttemptPaginatedResult, ): string { return JSON.stringify( AttemptPaginatedResult$outboundSchema.parse(attemptPaginatedResult), ); } export function attemptPaginatedResultFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => AttemptPaginatedResult$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'AttemptPaginatedResult' from JSON`, ); }