/* * 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"; import { ChannelSettingsDto, ChannelSettingsDto$inboundSchema, } from "./channelsettingsdto.js"; export type SubscriberResponseDto = { /** * The internal ID generated by Novu for your subscriber. This ID does not match the `subscriberId` used in your queries. Refer to `subscriberId` for that identifier. */ id?: string | undefined; /** * The first name of the subscriber. */ firstName?: string | null | undefined; /** * The last name of the subscriber. */ lastName?: string | null | undefined; /** * The email address of the subscriber. */ email?: string | null | undefined; /** * The phone number of the subscriber. */ phone?: string | null | undefined; /** * The URL of the subscriber's avatar image. */ avatar?: string | null | undefined; /** * The locale setting of the subscriber, indicating their preferred language or region. */ locale?: string | null | undefined; /** * An array of channel settings associated with the subscriber. */ channels?: Array | undefined; /** * An array of topics that the subscriber is subscribed to. * * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. */ topics?: Array | undefined; /** * Indicates whether the subscriber is currently online. */ isOnline?: boolean | null | undefined; /** * The timestamp indicating when the subscriber was last online, in ISO 8601 format. */ lastOnlineAt?: string | null | undefined; /** * The version of the subscriber document. */ v?: number | undefined; /** * Additional custom data for the subscriber */ data?: { [k: string]: any } | null | undefined; /** * Timezone of the subscriber */ timezone?: string | null | undefined; /** * The identifier used to create this subscriber, which typically corresponds to the user ID in your system. */ subscriberId: string; /** * The unique identifier of the organization to which the subscriber belongs. */ organizationId: string; /** * The unique identifier of the environment associated with this subscriber. */ environmentId: string; /** * Indicates whether the subscriber has been deleted. */ deleted: boolean; /** * The timestamp indicating when the subscriber was created, in ISO 8601 format. */ createdAt: string; /** * The timestamp indicating when the subscriber was last updated, in ISO 8601 format. */ updatedAt: string; }; /** @internal */ export const SubscriberResponseDto$inboundSchema: z.ZodType< SubscriberResponseDto, z.ZodTypeDef, unknown > = z.object({ _id: z.string().optional(), 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(), channels: z.array(ChannelSettingsDto$inboundSchema).optional(), topics: z.array(z.string()).optional(), isOnline: z.nullable(z.boolean()).optional(), lastOnlineAt: z.nullable(z.string()).optional(), __v: z.number().optional(), data: z.nullable(z.record(z.any())).optional(), timezone: z.nullable(z.string()).optional(), subscriberId: z.string(), _organizationId: z.string(), _environmentId: z.string(), deleted: z.boolean(), createdAt: z.string(), updatedAt: z.string(), }).transform((v) => { return remap$(v, { "_id": "id", "__v": "v", "_organizationId": "organizationId", "_environmentId": "environmentId", }); }); export function subscriberResponseDtoFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => SubscriberResponseDto$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'SubscriberResponseDto' from JSON`, ); }