/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. * @generated-id: 7e6054cd6360 */ import * as z from "zod/v4"; import { remap as remap$ } from "../../lib/primitives.js"; import { safeParse } from "../../lib/schemas.js"; import { Result as SafeParseResult } from "../../types/fp.js"; import * as components from "../components/index.js"; import { SDKValidationError } from "../errors/sdkvalidationerror.js"; export type PromptsListRequest = { pageSize?: number | undefined; pageToken?: string | undefined; alias?: string | undefined; fields?: Array | undefined; /** * Defaults to created_at when omitted. */ sortField?: components.ListSortField | undefined; /** * Defaults to descending for timestamp fields and ascending for text fields. */ sortDirectionQueryParameter?: components.ListSortDirection | undefined; /** * REST-friendly alias for sort.field. Supported values: created_at, last_modified_at, name, title. */ sortBy?: string | undefined; /** * REST-friendly alias for sort.direction. Supported values: asc, desc. */ sortDirectionQueryParameter1?: string | undefined; }; export type PromptsListResponse = { result: components.ListPromptsResponse; }; /** @internal */ export type PromptsListRequest$Outbound = { pageSize?: number | undefined; pageToken?: string | undefined; alias?: string | undefined; fields?: Array | undefined; "sort.field"?: string | undefined; "sort.directionQueryParameter"?: string | undefined; sort_by?: string | undefined; sort_directionQueryParameter1?: string | undefined; }; /** @internal */ export const PromptsListRequest$outboundSchema: z.ZodType< PromptsListRequest$Outbound, PromptsListRequest > = z.object({ pageSize: z.int().optional(), pageToken: z.string().optional(), alias: z.string().optional(), fields: z.array(z.string()).optional(), sortField: components.ListSortField$outboundSchema.optional(), sortDirectionQueryParameter: components.ListSortDirection$outboundSchema .optional(), sortBy: z.string().optional(), sortDirectionQueryParameter1: z.string().optional(), }).transform((v) => { return remap$(v, { sortField: "sort.field", sortDirectionQueryParameter: "sort.directionQueryParameter", sortBy: "sort_by", sortDirectionQueryParameter1: "sort_directionQueryParameter1", }); }); export function promptsListRequestToJSON( promptsListRequest: PromptsListRequest, ): string { return JSON.stringify( PromptsListRequest$outboundSchema.parse(promptsListRequest), ); } /** @internal */ export const PromptsListResponse$inboundSchema: z.ZodType< PromptsListResponse, unknown > = z.object({ Result: components.ListPromptsResponse$inboundSchema, }).transform((v) => { return remap$(v, { "Result": "result", }); }); export function promptsListResponseFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => PromptsListResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'PromptsListResponse' from JSON`, ); }