/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod/v3"; import { SubscriberChannelDto, SubscriberChannelDto$Outbound, SubscriberChannelDto$outboundSchema, } from "./subscriberchanneldto.js"; export type SubscriberPayloadDto = { /** * First name of the subscriber */ firstName?: string | null | undefined; /** * Last name of the subscriber */ lastName?: string | null | undefined; /** * Email address of the subscriber */ email?: string | null | undefined; /** * Phone number of the subscriber */ phone?: string | null | undefined; /** * Avatar URL or identifier */ avatar?: string | null | undefined; /** * Locale of the subscriber */ locale?: string | null | undefined; /** * Timezone of the subscriber */ timezone?: string | null | undefined; /** * Additional custom data associated with the subscriber */ data?: { [k: string]: any } | null | undefined; /** * The internal identifier you used to create this subscriber, usually correlates to the id the user in your systems */ subscriberId: string; /** * An optional array of subscriber channels. */ channels?: Array | undefined; }; /** @internal */ export type SubscriberPayloadDto$Outbound = { firstName?: string | null | undefined; lastName?: string | null | undefined; email?: string | null | undefined; phone?: string | null | undefined; avatar?: string | null | undefined; locale?: string | null | undefined; timezone?: string | null | undefined; data?: { [k: string]: any } | null | undefined; subscriberId: string; channels?: Array | undefined; }; /** @internal */ export const SubscriberPayloadDto$outboundSchema: z.ZodType< SubscriberPayloadDto$Outbound, z.ZodTypeDef, SubscriberPayloadDto > = z.object({ firstName: z.nullable(z.string()).optional(), lastName: z.nullable(z.string()).optional(), email: z.nullable(z.string()).optional(), phone: z.nullable(z.string()).optional(), avatar: z.nullable(z.string()).optional(), locale: z.nullable(z.string()).optional(), timezone: z.nullable(z.string()).optional(), data: z.nullable(z.record(z.any())).optional(), subscriberId: z.string(), channels: z.array(SubscriberChannelDto$outboundSchema).optional(), }); export function subscriberPayloadDtoToJSON( subscriberPayloadDto: SubscriberPayloadDto, ): string { return JSON.stringify( SubscriberPayloadDto$outboundSchema.parse(subscriberPayloadDto), ); }