/* * 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 LayoutsControllerGetRequest = { layoutId: string; /** * A header for idempotency purposes */ idempotencyKey?: string | undefined; }; export type LayoutsControllerGetResponse = { headers: { [k: string]: Array }; result: components.LayoutResponseDto; }; /** @internal */ export type LayoutsControllerGetRequest$Outbound = { layoutId: string; "idempotency-key"?: string | undefined; }; /** @internal */ export const LayoutsControllerGetRequest$outboundSchema: z.ZodType< LayoutsControllerGetRequest$Outbound, z.ZodTypeDef, LayoutsControllerGetRequest > = z.object({ layoutId: z.string(), idempotencyKey: z.string().optional(), }).transform((v) => { return remap$(v, { idempotencyKey: "idempotency-key", }); }); export function layoutsControllerGetRequestToJSON( layoutsControllerGetRequest: LayoutsControllerGetRequest, ): string { return JSON.stringify( LayoutsControllerGetRequest$outboundSchema.parse( layoutsControllerGetRequest, ), ); } /** @internal */ export const LayoutsControllerGetResponse$inboundSchema: z.ZodType< LayoutsControllerGetResponse, z.ZodTypeDef, unknown > = z.object({ Headers: z.record(z.array(z.string())).default({}), Result: components.LayoutResponseDto$inboundSchema, }).transform((v) => { return remap$(v, { "Headers": "headers", "Result": "result", }); }); export function layoutsControllerGetResponseFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => LayoutsControllerGetResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'LayoutsControllerGetResponse' from JSON`, ); }