/* * 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 EmailValidationBatchValidateResponseItem = { /** * @remarks * Valid - The email address is valid * Invalid - The email address is invalid and shouldn't be accepted * Unknown - Unable to complete the verification process (normally due to SMTP timeout) * Accept_All - The mail server is set to accept all verification requests so full verification isn't possible */ status?: string | undefined; /** * The email address that verification was attempted on. */ emailAddress?: string | undefined; /** * The account portion of the email address provided. */ account?: string | undefined; /** * The domain portion of the email address provided. */ domain?: string | undefined; /** * Whether the email address provided is a disposable mailbox (some companies create temporary mailboxes which shouldn't be used for marketing communications). */ isDisposible?: boolean | undefined; /** * Whether the email address provided is a system mailbox (e.g. sales@, support@, accounts@ etc). */ isSystemMailbox?: boolean | undefined; }; export type EmailValidationBatchValidateResponse = { items?: Array | undefined; }; /** @internal */ export const EmailValidationBatchValidateResponseItem$inboundSchema: z.ZodType< EmailValidationBatchValidateResponseItem, z.ZodTypeDef, unknown > = z.object({ Status: z.string().optional(), EmailAddress: z.string().optional(), Account: z.string().optional(), Domain: z.string().optional(), IsDisposible: z.boolean().optional(), IsSystemMailbox: z.boolean().optional(), }).transform((v) => { return remap$(v, { "Status": "status", "EmailAddress": "emailAddress", "Account": "account", "Domain": "domain", "IsDisposible": "isDisposible", "IsSystemMailbox": "isSystemMailbox", }); }); export function emailValidationBatchValidateResponseItemFromJSON( jsonString: string, ): SafeParseResult< EmailValidationBatchValidateResponseItem, SDKValidationError > { return safeParse( jsonString, (x) => EmailValidationBatchValidateResponseItem$inboundSchema.parse( JSON.parse(x), ), `Failed to parse 'EmailValidationBatchValidateResponseItem' from JSON`, ); } /** @internal */ export const EmailValidationBatchValidateResponse$inboundSchema: z.ZodType< EmailValidationBatchValidateResponse, z.ZodTypeDef, unknown > = z.object({ Items: z.array( z.lazy(() => EmailValidationBatchValidateResponseItem$inboundSchema), ).optional(), }).transform((v) => { return remap$(v, { "Items": "items", }); }); export function emailValidationBatchValidateResponseFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => EmailValidationBatchValidateResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'EmailValidationBatchValidateResponse' from JSON`, ); }