/* * 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 ResponseReadFileCallInProgressEventArgs = { fileId: string; }; export type ResponseReadFileCallInProgressEvent = { type: "response.read_file_call.in_progress"; sequenceNumber: number; itemId: string; outputIndex: number; args?: ResponseReadFileCallInProgressEventArgs | undefined; }; /** @internal */ export const ResponseReadFileCallInProgressEventArgs$inboundSchema: z.ZodType< ResponseReadFileCallInProgressEventArgs, z.ZodTypeDef, unknown > = z.object({ file_id: z.string(), }).transform((v) => { return remap$(v, { "file_id": "fileId", }); }); /** @internal */ export type ResponseReadFileCallInProgressEventArgs$Outbound = { file_id: string; }; /** @internal */ export const ResponseReadFileCallInProgressEventArgs$outboundSchema: z.ZodType< ResponseReadFileCallInProgressEventArgs$Outbound, z.ZodTypeDef, ResponseReadFileCallInProgressEventArgs > = z.object({ fileId: z.string(), }).transform((v) => { return remap$(v, { fileId: "file_id", }); }); export function responseReadFileCallInProgressEventArgsToJSON( responseReadFileCallInProgressEventArgs: ResponseReadFileCallInProgressEventArgs, ): string { return JSON.stringify( ResponseReadFileCallInProgressEventArgs$outboundSchema.parse( responseReadFileCallInProgressEventArgs, ), ); } export function responseReadFileCallInProgressEventArgsFromJSON( jsonString: string, ): SafeParseResult< ResponseReadFileCallInProgressEventArgs, SDKValidationError > { return safeParse( jsonString, (x) => ResponseReadFileCallInProgressEventArgs$inboundSchema.parse( JSON.parse(x), ), `Failed to parse 'ResponseReadFileCallInProgressEventArgs' from JSON`, ); } /** @internal */ export const ResponseReadFileCallInProgressEvent$inboundSchema: z.ZodType< ResponseReadFileCallInProgressEvent, z.ZodTypeDef, unknown > = z.object({ type: z.literal("response.read_file_call.in_progress"), sequence_number: z.number().int(), item_id: z.string(), output_index: z.number().int(), args: z.lazy(() => ResponseReadFileCallInProgressEventArgs$inboundSchema) .optional(), }).transform((v) => { return remap$(v, { "sequence_number": "sequenceNumber", "item_id": "itemId", "output_index": "outputIndex", }); }); /** @internal */ export type ResponseReadFileCallInProgressEvent$Outbound = { type: "response.read_file_call.in_progress"; sequence_number: number; item_id: string; output_index: number; args?: ResponseReadFileCallInProgressEventArgs$Outbound | undefined; }; /** @internal */ export const ResponseReadFileCallInProgressEvent$outboundSchema: z.ZodType< ResponseReadFileCallInProgressEvent$Outbound, z.ZodTypeDef, ResponseReadFileCallInProgressEvent > = z.object({ type: z.literal("response.read_file_call.in_progress"), sequenceNumber: z.number().int(), itemId: z.string(), outputIndex: z.number().int(), args: z.lazy(() => ResponseReadFileCallInProgressEventArgs$outboundSchema) .optional(), }).transform((v) => { return remap$(v, { sequenceNumber: "sequence_number", itemId: "item_id", outputIndex: "output_index", }); }); export function responseReadFileCallInProgressEventToJSON( responseReadFileCallInProgressEvent: ResponseReadFileCallInProgressEvent, ): string { return JSON.stringify( ResponseReadFileCallInProgressEvent$outboundSchema.parse( responseReadFileCallInProgressEvent, ), ); } export function responseReadFileCallInProgressEventFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => ResponseReadFileCallInProgressEvent$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ResponseReadFileCallInProgressEvent' from JSON`, ); }