/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. * @generated-id: 895c67a63ffd */ 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 * as components from "../components/index.js"; import { SDKValidationError } from "../errors/sdkvalidationerror.js"; export type AgentsApiV1AgentsListPagesRequest = { /** * Number of agents per page */ pageSize?: number | undefined; deploymentChat?: boolean | null | undefined; sources?: Array | null | undefined; /** * Filter by agent name */ name?: string | null | undefined; /** * Search agents by name or ID */ search?: string | null | undefined; id?: string | null | undefined; metadata?: { [k: string]: any } | null | undefined; /** * Opaque cursor from a previous response's next_page_token. When set, results page forward from the cursor. */ pageToken?: string | null | undefined; }; export type AgentsApiV1AgentsListPagesResponse = { result: components.AgentListPage; }; /** @internal */ export type AgentsApiV1AgentsListPagesRequest$Outbound = { page_size: number; deployment_chat?: boolean | null | undefined; sources?: Array | null | undefined; name?: string | null | undefined; search?: string | null | undefined; id?: string | null | undefined; metadata?: { [k: string]: any } | null | undefined; page_token?: string | null | undefined; }; /** @internal */ export const AgentsApiV1AgentsListPagesRequest$outboundSchema: z.ZodType< AgentsApiV1AgentsListPagesRequest$Outbound, AgentsApiV1AgentsListPagesRequest > = z.object({ pageSize: z.int().default(20), deploymentChat: z.nullable(z.boolean()).optional(), sources: z.nullable(z.array(components.RequestSource$outboundSchema)) .optional(), name: z.nullable(z.string()).optional(), search: z.nullable(z.string()).optional(), id: z.nullable(z.string()).optional(), metadata: z.nullable(z.record(z.string(), z.any())).optional(), pageToken: z.nullable(z.string()).optional(), }).transform((v) => { return remap$(v, { pageSize: "page_size", deploymentChat: "deployment_chat", pageToken: "page_token", }); }); export function agentsApiV1AgentsListPagesRequestToJSON( agentsApiV1AgentsListPagesRequest: AgentsApiV1AgentsListPagesRequest, ): string { return JSON.stringify( AgentsApiV1AgentsListPagesRequest$outboundSchema.parse( agentsApiV1AgentsListPagesRequest, ), ); } /** @internal */ export const AgentsApiV1AgentsListPagesResponse$inboundSchema: z.ZodType< AgentsApiV1AgentsListPagesResponse, unknown > = z.object({ Result: components.AgentListPage$inboundSchema, }).transform((v) => { return remap$(v, { "Result": "result", }); }); export function agentsApiV1AgentsListPagesResponseFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => AgentsApiV1AgentsListPagesResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'AgentsApiV1AgentsListPagesResponse' from JSON`, ); }