/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod"; import { remap as remap$ } from "../../../lib/primitives.js"; export type CreateInviteRequestBody = { /** * optional, for email invites */ customMessage?: string | undefined; /** * required for email invites only */ email?: string | undefined; /** * optional, if not supplied, the invite_expiry_days site setting is used */ expiresAt?: string | undefined; /** * Optional, either this or `group_names`. Comma separated list for multiple ids. */ groupIds?: string | undefined; /** * Optional, either this or `group_ids`. Comma separated list for multiple names. */ groupNames?: string | undefined; /** * optional, for link invites */ maxRedemptionsAllowed?: number | undefined; skipEmail?: boolean | undefined; topicId?: number | undefined; }; export type CreateInviteRequest = { apiKey: string; apiUsername: string; requestBody?: CreateInviteRequestBody | undefined; }; /** * success response */ export type CreateInviteResponseBody = { createdAt?: string | undefined; customMessage?: string | null | undefined; email?: string | undefined; emailed?: boolean | undefined; expired?: boolean | undefined; expiresAt?: string | undefined; groups?: Array | undefined; id?: number | undefined; link?: string | undefined; topics?: Array | undefined; updatedAt?: string | undefined; }; /** @internal */ export const CreateInviteRequestBody$inboundSchema: z.ZodType< CreateInviteRequestBody, z.ZodTypeDef, unknown > = z.object({ custom_message: z.string().optional(), email: z.string().optional(), expires_at: z.string().optional(), group_ids: z.string().optional(), group_names: z.string().optional(), max_redemptions_allowed: z.number().int().default(1), skip_email: z.boolean().default(false), topic_id: z.number().int().optional(), }).transform((v) => { return remap$(v, { "custom_message": "customMessage", "expires_at": "expiresAt", "group_ids": "groupIds", "group_names": "groupNames", "max_redemptions_allowed": "maxRedemptionsAllowed", "skip_email": "skipEmail", "topic_id": "topicId", }); }); /** @internal */ export type CreateInviteRequestBody$Outbound = { custom_message?: string | undefined; email?: string | undefined; expires_at?: string | undefined; group_ids?: string | undefined; group_names?: string | undefined; max_redemptions_allowed: number; skip_email: boolean; topic_id?: number | undefined; }; /** @internal */ export const CreateInviteRequestBody$outboundSchema: z.ZodType< CreateInviteRequestBody$Outbound, z.ZodTypeDef, CreateInviteRequestBody > = z.object({ customMessage: z.string().optional(), email: z.string().optional(), expiresAt: z.string().optional(), groupIds: z.string().optional(), groupNames: z.string().optional(), maxRedemptionsAllowed: z.number().int().default(1), skipEmail: z.boolean().default(false), topicId: z.number().int().optional(), }).transform((v) => { return remap$(v, { customMessage: "custom_message", expiresAt: "expires_at", groupIds: "group_ids", groupNames: "group_names", maxRedemptionsAllowed: "max_redemptions_allowed", skipEmail: "skip_email", topicId: "topic_id", }); }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace CreateInviteRequestBody$ { /** @deprecated use `CreateInviteRequestBody$inboundSchema` instead. */ export const inboundSchema = CreateInviteRequestBody$inboundSchema; /** @deprecated use `CreateInviteRequestBody$outboundSchema` instead. */ export const outboundSchema = CreateInviteRequestBody$outboundSchema; /** @deprecated use `CreateInviteRequestBody$Outbound` instead. */ export type Outbound = CreateInviteRequestBody$Outbound; } /** @internal */ export const CreateInviteRequest$inboundSchema: z.ZodType< CreateInviteRequest, z.ZodTypeDef, unknown > = z.object({ "Api-Key": z.string(), "Api-Username": z.string(), RequestBody: z.lazy(() => CreateInviteRequestBody$inboundSchema).optional(), }).transform((v) => { return remap$(v, { "Api-Key": "apiKey", "Api-Username": "apiUsername", "RequestBody": "requestBody", }); }); /** @internal */ export type CreateInviteRequest$Outbound = { "Api-Key": string; "Api-Username": string; RequestBody?: CreateInviteRequestBody$Outbound | undefined; }; /** @internal */ export const CreateInviteRequest$outboundSchema: z.ZodType< CreateInviteRequest$Outbound, z.ZodTypeDef, CreateInviteRequest > = z.object({ apiKey: z.string(), apiUsername: z.string(), requestBody: z.lazy(() => CreateInviteRequestBody$outboundSchema).optional(), }).transform((v) => { return remap$(v, { apiKey: "Api-Key", apiUsername: "Api-Username", requestBody: "RequestBody", }); }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace CreateInviteRequest$ { /** @deprecated use `CreateInviteRequest$inboundSchema` instead. */ export const inboundSchema = CreateInviteRequest$inboundSchema; /** @deprecated use `CreateInviteRequest$outboundSchema` instead. */ export const outboundSchema = CreateInviteRequest$outboundSchema; /** @deprecated use `CreateInviteRequest$Outbound` instead. */ export type Outbound = CreateInviteRequest$Outbound; } /** @internal */ export const CreateInviteResponseBody$inboundSchema: z.ZodType< CreateInviteResponseBody, z.ZodTypeDef, unknown > = z.object({ created_at: z.string().optional(), custom_message: z.nullable(z.string()).optional(), email: z.string().optional(), emailed: z.boolean().optional(), expired: z.boolean().optional(), expires_at: z.string().optional(), groups: z.array(z.any()).optional(), id: z.number().int().optional(), link: z.string().optional(), topics: z.array(z.any()).optional(), updated_at: z.string().optional(), }).transform((v) => { return remap$(v, { "created_at": "createdAt", "custom_message": "customMessage", "expires_at": "expiresAt", "updated_at": "updatedAt", }); }); /** @internal */ export type CreateInviteResponseBody$Outbound = { created_at?: string | undefined; custom_message?: string | null | undefined; email?: string | undefined; emailed?: boolean | undefined; expired?: boolean | undefined; expires_at?: string | undefined; groups?: Array | undefined; id?: number | undefined; link?: string | undefined; topics?: Array | undefined; updated_at?: string | undefined; }; /** @internal */ export const CreateInviteResponseBody$outboundSchema: z.ZodType< CreateInviteResponseBody$Outbound, z.ZodTypeDef, CreateInviteResponseBody > = z.object({ createdAt: z.string().optional(), customMessage: z.nullable(z.string()).optional(), email: z.string().optional(), emailed: z.boolean().optional(), expired: z.boolean().optional(), expiresAt: z.string().optional(), groups: z.array(z.any()).optional(), id: z.number().int().optional(), link: z.string().optional(), topics: z.array(z.any()).optional(), updatedAt: z.string().optional(), }).transform((v) => { return remap$(v, { createdAt: "created_at", customMessage: "custom_message", expiresAt: "expires_at", updatedAt: "updated_at", }); }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace CreateInviteResponseBody$ { /** @deprecated use `CreateInviteResponseBody$inboundSchema` instead. */ export const inboundSchema = CreateInviteResponseBody$inboundSchema; /** @deprecated use `CreateInviteResponseBody$outboundSchema` instead. */ export const outboundSchema = CreateInviteResponseBody$outboundSchema; /** @deprecated use `CreateInviteResponseBody$Outbound` instead. */ export type Outbound = CreateInviteResponseBody$Outbound; }