/* * 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 ResponseFileSearchCallSearchingEvent = { type: "response.file_search_call.searching"; sequenceNumber: number; itemId: string; outputIndex: number; }; /** @internal */ export const ResponseFileSearchCallSearchingEvent$inboundSchema: z.ZodType< ResponseFileSearchCallSearchingEvent, z.ZodTypeDef, unknown > = z.object({ type: z.literal("response.file_search_call.searching"), sequence_number: z.number().int(), item_id: z.string(), output_index: z.number().int(), }).transform((v) => { return remap$(v, { "sequence_number": "sequenceNumber", "item_id": "itemId", "output_index": "outputIndex", }); }); /** @internal */ export type ResponseFileSearchCallSearchingEvent$Outbound = { type: "response.file_search_call.searching"; sequence_number: number; item_id: string; output_index: number; }; /** @internal */ export const ResponseFileSearchCallSearchingEvent$outboundSchema: z.ZodType< ResponseFileSearchCallSearchingEvent$Outbound, z.ZodTypeDef, ResponseFileSearchCallSearchingEvent > = z.object({ type: z.literal("response.file_search_call.searching"), sequenceNumber: z.number().int(), itemId: z.string(), outputIndex: z.number().int(), }).transform((v) => { return remap$(v, { sequenceNumber: "sequence_number", itemId: "item_id", outputIndex: "output_index", }); }); export function responseFileSearchCallSearchingEventToJSON( responseFileSearchCallSearchingEvent: ResponseFileSearchCallSearchingEvent, ): string { return JSON.stringify( ResponseFileSearchCallSearchingEvent$outboundSchema.parse( responseFileSearchCallSearchingEvent, ), ); } export function responseFileSearchCallSearchingEventFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => ResponseFileSearchCallSearchingEvent$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ResponseFileSearchCallSearchingEvent' from JSON`, ); }