/* * 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 SubscriberDto = { /** * The identifier of the subscriber */ id: string; /** * The external identifier of the subscriber */ subscriberId: string; /** * The avatar URL of the subscriber */ avatar?: string | null | undefined; /** * The first name of the subscriber */ firstName?: string | null | undefined; /** * The last name of the subscriber */ lastName?: string | null | undefined; /** * The email of the subscriber */ email?: string | null | undefined; }; /** @internal */ export const SubscriberDto$inboundSchema: z.ZodType< SubscriberDto, z.ZodTypeDef, unknown > = z.object({ _id: z.string(), subscriberId: z.string(), avatar: z.nullable(z.string()).optional(), firstName: z.nullable(z.string()).optional(), lastName: z.nullable(z.string()).optional(), email: z.nullable(z.string()).optional(), }).transform((v) => { return remap$(v, { "_id": "id", }); }); export function subscriberDtoFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => SubscriberDto$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'SubscriberDto' from JSON`, ); }