/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod/v3"; import { safeParse } from "../../lib/schemas.js"; import { Result as SafeParseResult } from "../../types/fp.js"; import { SDKValidationError } from "../errors/sdkvalidationerror.js"; import { ActionDto, ActionDto$inboundSchema } from "./actiondto.js"; import { RedirectDto, RedirectDto$inboundSchema } from "./redirectdto.js"; export type InAppRenderOutput = { /** * Subject of the in-app notification */ subject?: string | undefined; /** * Body of the in-app notification */ body: string; /** * Avatar for the in-app notification */ avatar?: string | undefined; /** * Primary action details */ primaryAction?: ActionDto | undefined; /** * Secondary action details */ secondaryAction?: ActionDto | undefined; /** * Additional data */ data?: { [k: string]: any } | undefined; /** * Redirect details */ redirect?: RedirectDto | undefined; }; /** @internal */ export const InAppRenderOutput$inboundSchema: z.ZodType< InAppRenderOutput, z.ZodTypeDef, unknown > = z.object({ subject: z.string().optional(), body: z.string(), avatar: z.string().optional(), primaryAction: ActionDto$inboundSchema.optional(), secondaryAction: ActionDto$inboundSchema.optional(), data: z.record(z.any()).optional(), redirect: RedirectDto$inboundSchema.optional(), }); export function inAppRenderOutputFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => InAppRenderOutput$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'InAppRenderOutput' from JSON`, ); }