/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod/v4-mini"; import { safeParse } from "../lib/schemas.js"; import { Result as SafeParseResult } from "../types/fp.js"; import * as types from "../types/primitives.js"; import { SDKValidationError } from "./errors/sdk-validation-error.js"; export type IdOrganizationIdEmail = { /** * Invitation ID */ id: string; /** * Organization ID */ organizationId: string; /** * Invited email address */ email: string | null; /** * Invitation token (for sharing) */ token: string; /** * Invitation URL (for sharing) */ inviteUrl: string; /** * Role to assign on accept */ role: string; /** * Invitation status */ status: string; /** * ISO timestamp of expiration */ expiresAt: string; /** * ISO timestamp when accepted */ acceptedAt: string | null; /** * User ID who accepted */ acceptedBy: string | null; /** * User ID who created */ createdBy: string | null; /** * User ID who sent invitation */ invitedByUserId: string | null; /** * ISO timestamp of creation */ createdAt: string; /** * ISO timestamp of last update */ updatedAt: string; }; /** @internal */ export const IdOrganizationIdEmail$inboundSchema: z.ZodMiniType< IdOrganizationIdEmail, unknown > = z.object({ id: types.string(), organizationId: types.string(), email: types.nullable(types.string()), token: types.string(), inviteUrl: types.string(), role: types.string(), status: types.string(), expiresAt: types.string(), acceptedAt: types.nullable(types.string()), acceptedBy: types.nullable(types.string()), createdBy: types.nullable(types.string()), invitedByUserId: types.nullable(types.string()), createdAt: types.string(), updatedAt: types.string(), }); export function idOrganizationIdEmailFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => IdOrganizationIdEmail$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'IdOrganizationIdEmail' from JSON`, ); }