/* * 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 { SDKValidationError } from "../errors/sdkvalidationerror.js"; export type SubscriberPreferenceChannels = { /** * Email channel preference */ email?: boolean | undefined; /** * SMS channel preference */ sms?: boolean | undefined; /** * In-app channel preference */ inApp?: boolean | undefined; /** * Chat channel preference */ chat?: boolean | undefined; /** * Push notification channel preference */ push?: boolean | undefined; }; /** @internal */ export const SubscriberPreferenceChannels$inboundSchema: z.ZodType< SubscriberPreferenceChannels, z.ZodTypeDef, unknown > = z.object({ email: z.boolean().optional(), sms: z.boolean().optional(), in_app: z.boolean().optional(), chat: z.boolean().optional(), push: z.boolean().optional(), }).transform((v) => { return remap$(v, { "in_app": "inApp", }); }); export function subscriberPreferenceChannelsFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => SubscriberPreferenceChannels$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'SubscriberPreferenceChannels' from JSON`, ); }