/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. * @generated-id: 80810e75ed15 */ import * as z from "zod/v3"; import { safeParse } from "../../lib/schemas.js"; import { Result as SafeParseResult } from "../../types/fp.js"; import { SDKValidationError } from "../errors/sdkvalidationerror.js"; import { ChannelInviteInfo, ChannelInviteInfo$inboundSchema, ChannelInviteInfo$Outbound, ChannelInviteInfo$outboundSchema, } from "./channelinviteinfo.js"; import { Person, Person$inboundSchema, Person$Outbound, Person$outboundSchema, } from "./person.js"; /** * Information regarding the invite status of a person. */ export type InviteInfo = { /** * The time this person signed up in ISO format (ISO 8601). */ signUpTime?: Date | undefined; /** * Latest invites received by the user for each channel */ invites?: Array | undefined; inviter?: Person | undefined; /** * The time this person was invited in ISO format (ISO 8601). * * @deprecated field: Deprecated on 2026-02-05, removal scheduled for 2026-10-15: Use ChannelInviteInfo instead. */ inviteTime?: Date | undefined; /** * The time this person was reminded in ISO format (ISO 8601) if a reminder was sent. * * @deprecated field: Deprecated on 2026-02-05, removal scheduled for 2026-10-15: Use ChannelInviteInfo instead. */ reminderTime?: Date | undefined; }; /** @internal */ export const InviteInfo$inboundSchema: z.ZodType< InviteInfo, z.ZodTypeDef, unknown > = z.object({ signUpTime: z.string().datetime({ offset: true }).transform(v => new Date(v)) .optional(), invites: z.array(z.lazy(() => ChannelInviteInfo$inboundSchema)).optional(), inviter: z.lazy(() => Person$inboundSchema).optional(), inviteTime: z.string().datetime({ offset: true }).transform(v => new Date(v)) .optional(), reminderTime: z.string().datetime({ offset: true }).transform(v => new Date(v) ).optional(), }); /** @internal */ export type InviteInfo$Outbound = { signUpTime?: string | undefined; invites?: Array | undefined; inviter?: Person$Outbound | undefined; inviteTime?: string | undefined; reminderTime?: string | undefined; }; /** @internal */ export const InviteInfo$outboundSchema: z.ZodType< InviteInfo$Outbound, z.ZodTypeDef, InviteInfo > = z.object({ signUpTime: z.date().transform(v => v.toISOString()).optional(), invites: z.array(z.lazy(() => ChannelInviteInfo$outboundSchema)).optional(), inviter: z.lazy(() => Person$outboundSchema).optional(), inviteTime: z.date().transform(v => v.toISOString()).optional(), reminderTime: z.date().transform(v => v.toISOString()).optional(), }); export function inviteInfoToJSON(inviteInfo: InviteInfo): string { return JSON.stringify(InviteInfo$outboundSchema.parse(inviteInfo)); } export function inviteInfoFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => InviteInfo$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'InviteInfo' from JSON`, ); }