/* * 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 { ButtonTypeEnum, ButtonTypeEnum$inboundSchema, } from "./buttontypeenum.js"; export type MessageActionResult = { /** * Payload of the action result */ payload?: { [k: string]: any } | undefined; /** * Type of button for the action result */ type?: ButtonTypeEnum | undefined; }; /** @internal */ export const MessageActionResult$inboundSchema: z.ZodType< MessageActionResult, z.ZodTypeDef, unknown > = z.object({ payload: z.record(z.any()).optional(), type: ButtonTypeEnum$inboundSchema.optional(), }); export function messageActionResultFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => MessageActionResult$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'MessageActionResult' from JSON`, ); }