/* * 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 * as components from "../components/index.js"; import { SDKValidationError } from "../errors/sdkvalidationerror.js"; export type LayoutsControllerListRequest = { /** * Number of items to return per page */ limit?: number | undefined; /** * Number of items to skip before starting to return results */ offset?: number | undefined; /** * Direction of sorting */ orderDirection?: components.DirectionEnum | undefined; /** * Field to sort the results by */ orderBy?: components.LayoutResponseDtoSortField | undefined; /** * Search query to filter layouts */ query?: string | undefined; /** * A header for idempotency purposes */ idempotencyKey?: string | undefined; }; export type LayoutsControllerListResponse = { headers: { [k: string]: Array }; result: components.ListLayoutResponseDto; }; /** @internal */ export type LayoutsControllerListRequest$Outbound = { limit?: number | undefined; offset?: number | undefined; orderDirection?: string | undefined; orderBy?: string | undefined; query?: string | undefined; "idempotency-key"?: string | undefined; }; /** @internal */ export const LayoutsControllerListRequest$outboundSchema: z.ZodType< LayoutsControllerListRequest$Outbound, z.ZodTypeDef, LayoutsControllerListRequest > = z.object({ limit: z.number().optional(), offset: z.number().optional(), orderDirection: components.DirectionEnum$outboundSchema.optional(), orderBy: components.LayoutResponseDtoSortField$outboundSchema.optional(), query: z.string().optional(), idempotencyKey: z.string().optional(), }).transform((v) => { return remap$(v, { idempotencyKey: "idempotency-key", }); }); export function layoutsControllerListRequestToJSON( layoutsControllerListRequest: LayoutsControllerListRequest, ): string { return JSON.stringify( LayoutsControllerListRequest$outboundSchema.parse( layoutsControllerListRequest, ), ); } /** @internal */ export const LayoutsControllerListResponse$inboundSchema: z.ZodType< LayoutsControllerListResponse, z.ZodTypeDef, unknown > = z.object({ Headers: z.record(z.array(z.string())).default({}), Result: components.ListLayoutResponseDto$inboundSchema, }).transform((v) => { return remap$(v, { "Headers": "headers", "Result": "result", }); }); export function layoutsControllerListResponseFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => LayoutsControllerListResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'LayoutsControllerListResponse' from JSON`, ); }