/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod/v3"; import { safeParse } from "../../lib/schemas.js"; import { ClosedEnum } from "../../types/enums.js"; import { Result as SafeParseResult } from "../../types/fp.js"; import { SDKValidationError } from "../errors/sdkvalidationerror.js"; /** * Editor type of the layout. */ export const EditorType = { Html: "html", Block: "block", } as const; /** * Editor type of the layout. */ export type EditorType = ClosedEnum; export type EmailControlsDto = { /** * Body of the layout. */ body: string; /** * Editor type of the layout. */ editorType: EditorType; }; /** @internal */ export const EditorType$inboundSchema: z.ZodNativeEnum = z .nativeEnum(EditorType); /** @internal */ export const EditorType$outboundSchema: z.ZodNativeEnum = EditorType$inboundSchema; /** @internal */ export const EmailControlsDto$inboundSchema: z.ZodType< EmailControlsDto, z.ZodTypeDef, unknown > = z.object({ body: z.string(), editorType: EditorType$inboundSchema, }); /** @internal */ export type EmailControlsDto$Outbound = { body: string; editorType: string; }; /** @internal */ export const EmailControlsDto$outboundSchema: z.ZodType< EmailControlsDto$Outbound, z.ZodTypeDef, EmailControlsDto > = z.object({ body: z.string(), editorType: EditorType$outboundSchema, }); export function emailControlsDtoToJSON( emailControlsDto: EmailControlsDto, ): string { return JSON.stringify( EmailControlsDto$outboundSchema.parse(emailControlsDto), ); } export function emailControlsDtoFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => EmailControlsDto$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'EmailControlsDto' from JSON`, ); }