/* * 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 { ChannelCTATypeEnum, ChannelCTATypeEnum$inboundSchema, } from "./channelctatypeenum.js"; import { MessageAction, MessageAction$inboundSchema } from "./messageaction.js"; import { MessageCTAData, MessageCTAData$inboundSchema, } from "./messagectadata.js"; export type MessageCTA = { /** * Type of call to action */ type?: ChannelCTATypeEnum | undefined; /** * Data associated with the call to action */ data?: MessageCTAData | undefined; /** * Action associated with the call to action */ action?: MessageAction | undefined; }; /** @internal */ export const MessageCTA$inboundSchema: z.ZodType< MessageCTA, z.ZodTypeDef, unknown > = z.object({ type: ChannelCTATypeEnum$inboundSchema.optional(), data: MessageCTAData$inboundSchema.optional(), action: MessageAction$inboundSchema.optional(), }); export function messageCTAFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => MessageCTA$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'MessageCTA' from JSON`, ); }