/* * 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 { ClosedEnum } from "../../types/enums.js"; import { Result as SafeParseResult } from "../../types/fp.js"; import { SDKValidationError } from "../errors/sdkvalidationerror.js"; export const QueryParamInclude = { WebSearchCallActionSources: "web_search_call.action.sources", CodeInterpreterCallOutputs: "code_interpreter_call.outputs", ComputerCallOutputOutputImageUrl: "computer_call_output.output.image_url", FileSearchCallResults: "file_search_call.results", MessageInputImageImageUrl: "message.input_image.image_url", MessageOutputTextLogprobs: "message.output_text.logprobs", ReasoningEncryptedContent: "reasoning.encrypted_content", } as const; export type QueryParamInclude = ClosedEnum; /** * The order to return the input items in. 'asc' returns oldest items first, 'desc' returns newest items first. Defaults to 'desc' (newest first). */ export const ListInputItemsQueryParamOrder = { Asc: "asc", Desc: "desc", } as const; /** * The order to return the input items in. 'asc' returns oldest items first, 'desc' returns newest items first. Defaults to 'desc' (newest first). */ export type ListInputItemsQueryParamOrder = ClosedEnum< typeof ListInputItemsQueryParamOrder >; export type ListInputItemsRequest = { responseId: string; after?: string | undefined; include?: Array | undefined; limit?: number | undefined; /** * The order to return the input items in. 'asc' returns oldest items first, 'desc' returns newest items first. Defaults to 'desc' (newest first). */ order?: ListInputItemsQueryParamOrder | undefined; /** * Optional external end-user identifier forwarded by the API gateway. */ xOnBehalfOf?: string | undefined; }; /** @internal */ export const QueryParamInclude$inboundSchema: z.ZodNativeEnum< typeof QueryParamInclude > = z.nativeEnum(QueryParamInclude); /** @internal */ export const QueryParamInclude$outboundSchema: z.ZodNativeEnum< typeof QueryParamInclude > = QueryParamInclude$inboundSchema; /** @internal */ export const ListInputItemsQueryParamOrder$inboundSchema: z.ZodNativeEnum< typeof ListInputItemsQueryParamOrder > = z.nativeEnum(ListInputItemsQueryParamOrder); /** @internal */ export const ListInputItemsQueryParamOrder$outboundSchema: z.ZodNativeEnum< typeof ListInputItemsQueryParamOrder > = ListInputItemsQueryParamOrder$inboundSchema; /** @internal */ export const ListInputItemsRequest$inboundSchema: z.ZodType< ListInputItemsRequest, z.ZodTypeDef, unknown > = z.object({ response_id: z.string(), after: z.string().optional(), include: z.array(QueryParamInclude$inboundSchema).optional(), limit: z.number().int().default(20), order: ListInputItemsQueryParamOrder$inboundSchema.optional(), "X-On-Behalf-Of": z.string().optional(), }).transform((v) => { return remap$(v, { "response_id": "responseId", "X-On-Behalf-Of": "xOnBehalfOf", }); }); /** @internal */ export type ListInputItemsRequest$Outbound = { response_id: string; after?: string | undefined; include?: Array | undefined; limit: number; order?: string | undefined; "X-On-Behalf-Of"?: string | undefined; }; /** @internal */ export const ListInputItemsRequest$outboundSchema: z.ZodType< ListInputItemsRequest$Outbound, z.ZodTypeDef, ListInputItemsRequest > = z.object({ responseId: z.string(), after: z.string().optional(), include: z.array(QueryParamInclude$outboundSchema).optional(), limit: z.number().int().default(20), order: ListInputItemsQueryParamOrder$outboundSchema.optional(), xOnBehalfOf: z.string().optional(), }).transform((v) => { return remap$(v, { responseId: "response_id", xOnBehalfOf: "X-On-Behalf-Of", }); }); export function listInputItemsRequestToJSON( listInputItemsRequest: ListInputItemsRequest, ): string { return JSON.stringify( ListInputItemsRequest$outboundSchema.parse(listInputItemsRequest), ); } export function listInputItemsRequestFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => ListInputItemsRequest$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ListInputItemsRequest' from JSON`, ); }