/* * 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 LayoutsControllerUpdateRequest = { layoutId: string; /** * A header for idempotency purposes */ idempotencyKey?: string | undefined; /** * Layout update details */ updateLayoutDto: components.UpdateLayoutDto; }; export type LayoutsControllerUpdateResponse = { headers: { [k: string]: Array }; result: components.LayoutResponseDto; }; /** @internal */ export type LayoutsControllerUpdateRequest$Outbound = { layoutId: string; "idempotency-key"?: string | undefined; UpdateLayoutDto: components.UpdateLayoutDto$Outbound; }; /** @internal */ export const LayoutsControllerUpdateRequest$outboundSchema: z.ZodType< LayoutsControllerUpdateRequest$Outbound, z.ZodTypeDef, LayoutsControllerUpdateRequest > = z.object({ layoutId: z.string(), idempotencyKey: z.string().optional(), updateLayoutDto: components.UpdateLayoutDto$outboundSchema, }).transform((v) => { return remap$(v, { idempotencyKey: "idempotency-key", updateLayoutDto: "UpdateLayoutDto", }); }); export function layoutsControllerUpdateRequestToJSON( layoutsControllerUpdateRequest: LayoutsControllerUpdateRequest, ): string { return JSON.stringify( LayoutsControllerUpdateRequest$outboundSchema.parse( layoutsControllerUpdateRequest, ), ); } /** @internal */ export const LayoutsControllerUpdateResponse$inboundSchema: z.ZodType< LayoutsControllerUpdateResponse, 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 layoutsControllerUpdateResponseFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => LayoutsControllerUpdateResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'LayoutsControllerUpdateResponse' from JSON`, ); }