/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. * @generated-id: 0ccb0860c1e6 */ import * as z from "zod/v4"; import { safeParse } from "../lib/schemas.js"; import { Result as SafeParseResult } from "../types/fp.js"; import { AgentSessionSubject, AgentSessionSubject$inboundSchema, } from "./agentsessionsubject.js"; import { SDKValidationError } from "./errors/sdkvalidationerror.js"; export type PendingApproval = { approvalId: string; toolCallId: string; toolName: string; input?: any | null | undefined; }; export type AgentSessionDetail = { id: string; triggerType: string; subjectId: string; subject: AgentSessionSubject; status: string; createdAt: string; updatedAt: string; resultText: string | null; toolNames: Array | null; error: string | null; pendingApproval: PendingApproval | null; }; /** @internal */ export const PendingApproval$inboundSchema: z.ZodType< PendingApproval, unknown > = z.object({ approvalId: z.string(), toolCallId: z.string(), toolName: z.string(), input: z.nullable(z.any()).optional(), }); export function pendingApprovalFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => PendingApproval$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'PendingApproval' from JSON`, ); } /** @internal */ export const AgentSessionDetail$inboundSchema: z.ZodType< AgentSessionDetail, unknown > = z.object({ id: z.string(), triggerType: z.string(), subjectId: z.string(), subject: AgentSessionSubject$inboundSchema, status: z.string(), createdAt: z.string(), updatedAt: z.string(), resultText: z.nullable(z.string()), toolNames: z.nullable(z.array(z.string())), error: z.nullable(z.string()), pendingApproval: z.nullable(z.lazy(() => PendingApproval$inboundSchema)), }); export function agentSessionDetailFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => AgentSessionDetail$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'AgentSessionDetail' from JSON`, ); }