/* * 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"; import { UpdatePromptResponse, UpdatePromptResponse$inboundSchema, UpdatePromptResponse$Outbound, UpdatePromptResponse$outboundSchema, } from "./updatepromptresponse.js"; export type ListPromptsResponse = { /** * Object type */ object: "list"; /** * Array of prompt objects */ data: Array; /** * Whether there are more results available */ hasMore: boolean; /** * ID of the first item in the list */ firstId?: string | undefined; /** * ID of the last item in the list */ lastId?: string | undefined; }; /** @internal */ export const ListPromptsResponse$inboundSchema: z.ZodType< ListPromptsResponse, z.ZodTypeDef, unknown > = z.object({ object: z.literal("list"), data: z.array(UpdatePromptResponse$inboundSchema), has_more: z.boolean(), first_id: z.string().optional(), last_id: z.string().optional(), }).transform((v) => { return remap$(v, { "has_more": "hasMore", "first_id": "firstId", "last_id": "lastId", }); }); /** @internal */ export type ListPromptsResponse$Outbound = { object: "list"; data: Array; has_more: boolean; first_id?: string | undefined; last_id?: string | undefined; }; /** @internal */ export const ListPromptsResponse$outboundSchema: z.ZodType< ListPromptsResponse$Outbound, z.ZodTypeDef, ListPromptsResponse > = z.object({ object: z.literal("list"), data: z.array(UpdatePromptResponse$outboundSchema), hasMore: z.boolean(), firstId: z.string().optional(), lastId: z.string().optional(), }).transform((v) => { return remap$(v, { hasMore: "has_more", firstId: "first_id", lastId: "last_id", }); }); export function listPromptsResponseToJSON( listPromptsResponse: ListPromptsResponse, ): string { return JSON.stringify( ListPromptsResponse$outboundSchema.parse(listPromptsResponse), ); } export function listPromptsResponseFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => ListPromptsResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ListPromptsResponse' from JSON`, ); }