/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. * @generated-id: f54e9af2d4a0 */ import * as z from "zod/v4"; 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 { Library, Library$inboundSchema } from "./library.js"; import { PaginationInfo, PaginationInfo$inboundSchema, } from "./paginationinfo.js"; export type ListLibrariesResponse = { /** * Deprecated: offset pagination metadata. Only populated for callers using the deprecated `page` parameter; omitted when `page_token` is used. While RBAC filtering is being rolled out `total_items` is a rough estimate (candidate count before per-library checks). Use `next_page_token` instead — this field will be removed once offset paging is retired. * * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. */ pagination?: PaginationInfo | null | undefined; data: Array; /** * Opaque continuation token for the next page. Pass it back as `page_token` to fetch the next page. Null when there are no more results. Prefer this over the deprecated offset `page` parameter. */ nextPageToken?: string | null | undefined; }; /** @internal */ export const ListLibrariesResponse$inboundSchema: z.ZodType< ListLibrariesResponse, unknown > = z.object({ pagination: z.nullable(PaginationInfo$inboundSchema).optional(), data: z.array(Library$inboundSchema), next_page_token: z.nullable(z.string()).optional(), }).transform((v) => { return remap$(v, { "next_page_token": "nextPageToken", }); }); export function listLibrariesResponseFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => ListLibrariesResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ListLibrariesResponse' from JSON`, ); }