/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod/v3"; 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"; export type ResponseShellCallCompletedEvent = { type: "response.shell_call.completed"; sequenceNumber: number; itemId: string; outputIndex: number; functionCallOutput?: string | undefined; }; /** @internal */ export const ResponseShellCallCompletedEvent$inboundSchema: z.ZodType< ResponseShellCallCompletedEvent, z.ZodTypeDef, unknown > = z.object({ type: z.literal("response.shell_call.completed"), sequence_number: z.number().int(), item_id: z.string(), output_index: z.number().int(), function_call_output: z.string().optional(), }).transform((v) => { return remap$(v, { "sequence_number": "sequenceNumber", "item_id": "itemId", "output_index": "outputIndex", "function_call_output": "functionCallOutput", }); }); /** @internal */ export type ResponseShellCallCompletedEvent$Outbound = { type: "response.shell_call.completed"; sequence_number: number; item_id: string; output_index: number; function_call_output?: string | undefined; }; /** @internal */ export const ResponseShellCallCompletedEvent$outboundSchema: z.ZodType< ResponseShellCallCompletedEvent$Outbound, z.ZodTypeDef, ResponseShellCallCompletedEvent > = z.object({ type: z.literal("response.shell_call.completed"), sequenceNumber: z.number().int(), itemId: z.string(), outputIndex: z.number().int(), functionCallOutput: z.string().optional(), }).transform((v) => { return remap$(v, { sequenceNumber: "sequence_number", itemId: "item_id", outputIndex: "output_index", functionCallOutput: "function_call_output", }); }); export function responseShellCallCompletedEventToJSON( responseShellCallCompletedEvent: ResponseShellCallCompletedEvent, ): string { return JSON.stringify( ResponseShellCallCompletedEvent$outboundSchema.parse( responseShellCallCompletedEvent, ), ); } export function responseShellCallCompletedEventFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => ResponseShellCallCompletedEvent$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ResponseShellCallCompletedEvent' from JSON`, ); }