/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod/v3"; import { safeParse } from "../../lib/schemas.js"; import { ClosedEnum } from "../../types/enums.js"; import { Result as SafeParseResult } from "../../types/fp.js"; import { SDKValidationError } from "../errors/sdkvalidationerror.js"; /** * Current status of the member portal invitation. * * @remarks * - `pending`: The invitation record has been created but the invitation email has not yet been delivered. * - `sent`: The invitation email has been delivered to the member. * - `verified`: The member has been verified by the member portal partner. * - `complete`: The member has fully completed their member portal registration. * - `cancelled`: The invitation has been cancelled, either via `DELETE` on this endpoint or because it was superseded. */ export const MemberPortalInvitationStatus1 = { Pending: "pending", Sent: "sent", Verified: "verified", Complete: "complete", Cancelled: "cancelled", } as const; /** * Current status of the member portal invitation. * * @remarks * - `pending`: The invitation record has been created but the invitation email has not yet been delivered. * - `sent`: The invitation email has been delivered to the member. * - `verified`: The member has been verified by the member portal partner. * - `complete`: The member has fully completed their member portal registration. * - `cancelled`: The invitation has been cancelled, either via `DELETE` on this endpoint or because it was superseded. */ export type MemberPortalInvitationStatus1 = ClosedEnum< typeof MemberPortalInvitationStatus1 >; /** * The status of a member portal invitation for an employee or contractor. Returned by `GET /v1/employees/{employee_id}/member_portal_invitations` and `GET /v1/contractors/{contractor_uuid}/member_portal_invitations`. * * @remarks */ export type MemberPortalInvitation = { /** * Current status of the member portal invitation. * * @remarks * - `pending`: The invitation record has been created but the invitation email has not yet been delivered. * - `sent`: The invitation email has been delivered to the member. * - `verified`: The member has been verified by the member portal partner. * - `complete`: The member has fully completed their member portal registration. * - `cancelled`: The invitation has been cancelled, either via `DELETE` on this endpoint or because it was superseded. */ status: MemberPortalInvitationStatus1; /** * Whether the invitation can no longer be acted on by the member. Returns `true` when the invitation token has expired or when the invitation has been `cancelled`. To reissue an expired invitation, call `POST` on this endpoint again — a new token will be generated and will override the prior one. * * @remarks */ expired: boolean; }; /** @internal */ export const MemberPortalInvitationStatus1$inboundSchema: z.ZodNativeEnum< typeof MemberPortalInvitationStatus1 > = z.nativeEnum(MemberPortalInvitationStatus1); /** @internal */ export const MemberPortalInvitation$inboundSchema: z.ZodType< MemberPortalInvitation, z.ZodTypeDef, unknown > = z.object({ status: MemberPortalInvitationStatus1$inboundSchema, expired: z.boolean(), }); export function memberPortalInvitationFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => MemberPortalInvitation$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'MemberPortalInvitation' from JSON`, ); }