/*
 * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
 */

import * as z from "zod/v3";
import { safeParse } from "../lib/schemas.js";
import { Result as SafeParseResult } from "../types/fp.js";
import * as types from "../types/primitives.js";
import { SDKValidationError } from "./sdkvalidationerror.js";

/**
 * The registrant contact has not yet been verified. The contact must be verified by `verifyBy`, and a verification email is sent to `email`.
 */
export type ContactPendingVerification = {
  verified: false;
  /**
   * a string to be decoded into a Date
   */
  verifyBy: string;
  email: string;
};

/** @internal */
export const ContactPendingVerification$inboundSchema: z.ZodType<
  ContactPendingVerification,
  z.ZodTypeDef,
  unknown
> = z.object({
  verified: types.literal(false),
  verifyBy: types.string(),
  email: types.string(),
});

export function contactPendingVerificationFromJSON(
  jsonString: string,
): SafeParseResult<ContactPendingVerification, SDKValidationError> {
  return safeParse(
    jsonString,
    (x) => ContactPendingVerification$inboundSchema.parse(JSON.parse(x)),
    `Failed to parse 'ContactPendingVerification' from JSON`,
  );
}
