/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod"; import { remap as remap$ } from "../../../lib/primitives.js"; import { ClosedEnum } from "../../types/enums.js"; export const QueryParamAsc = { True: "true", } as const; export type QueryParamAsc = ClosedEnum; export const Flag = { Active: "active", New: "new", Staff: "staff", Suspended: "suspended", Blocked: "blocked", Suspect: "suspect", } as const; export type Flag = ClosedEnum; export const QueryParamOrder = { Created: "created", LastEmailed: "last_emailed", Seen: "seen", Username: "username", Email: "email", TrustLevel: "trust_level", DaysVisited: "days_visited", PostsRead: "posts_read", TopicsViewed: "topics_viewed", Posts: "posts", ReadTime: "read_time", } as const; export type QueryParamOrder = ClosedEnum; export type AdminListUsersRequest = { asc?: QueryParamAsc | undefined; /** * Filter to the user with this email address */ email?: string | undefined; flag: Flag; /** * Filter to users with this IP address */ ip?: string | undefined; order?: QueryParamOrder | undefined; page?: number | undefined; /** * Include user email addresses in response. These requests will be logged in the staff action logs. */ showEmails?: boolean | undefined; /** * Include user stats information */ stats?: boolean | undefined; }; export type AdminListUsersResponseBody = { active: boolean; admin: boolean; avatarTemplate: string; createdAt: string; createdAtAge: number | null; daysVisited: number; email?: string | undefined; id: number; lastEmailedAge: number | null; lastEmailedAt: string | null; lastSeenAge: number | null; lastSeenAt: string | null; manualLockedTrustLevel: string | null; moderator: boolean; name: string | null; postCount: number; postsReadCount: number; secondaryEmails?: Array | undefined; staged: boolean; timeRead: number; title: string | null; topicsEntered: number; trustLevel: number; username: string; }; /** @internal */ export const QueryParamAsc$inboundSchema: z.ZodNativeEnum< typeof QueryParamAsc > = z.nativeEnum(QueryParamAsc); /** @internal */ export const QueryParamAsc$outboundSchema: z.ZodNativeEnum< typeof QueryParamAsc > = QueryParamAsc$inboundSchema; /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace QueryParamAsc$ { /** @deprecated use `QueryParamAsc$inboundSchema` instead. */ export const inboundSchema = QueryParamAsc$inboundSchema; /** @deprecated use `QueryParamAsc$outboundSchema` instead. */ export const outboundSchema = QueryParamAsc$outboundSchema; } /** @internal */ export const Flag$inboundSchema: z.ZodNativeEnum = z.nativeEnum( Flag, ); /** @internal */ export const Flag$outboundSchema: z.ZodNativeEnum = Flag$inboundSchema; /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace Flag$ { /** @deprecated use `Flag$inboundSchema` instead. */ export const inboundSchema = Flag$inboundSchema; /** @deprecated use `Flag$outboundSchema` instead. */ export const outboundSchema = Flag$outboundSchema; } /** @internal */ export const QueryParamOrder$inboundSchema: z.ZodNativeEnum< typeof QueryParamOrder > = z.nativeEnum(QueryParamOrder); /** @internal */ export const QueryParamOrder$outboundSchema: z.ZodNativeEnum< typeof QueryParamOrder > = QueryParamOrder$inboundSchema; /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace QueryParamOrder$ { /** @deprecated use `QueryParamOrder$inboundSchema` instead. */ export const inboundSchema = QueryParamOrder$inboundSchema; /** @deprecated use `QueryParamOrder$outboundSchema` instead. */ export const outboundSchema = QueryParamOrder$outboundSchema; } /** @internal */ export const AdminListUsersRequest$inboundSchema: z.ZodType< AdminListUsersRequest, z.ZodTypeDef, unknown > = z.object({ asc: QueryParamAsc$inboundSchema.optional(), email: z.string().optional(), flag: Flag$inboundSchema, ip: z.string().optional(), order: QueryParamOrder$inboundSchema.optional(), page: z.number().int().optional(), show_emails: z.boolean().optional(), stats: z.boolean().optional(), }).transform((v) => { return remap$(v, { "show_emails": "showEmails", }); }); /** @internal */ export type AdminListUsersRequest$Outbound = { asc?: string | undefined; email?: string | undefined; flag: string; ip?: string | undefined; order?: string | undefined; page?: number | undefined; show_emails?: boolean | undefined; stats?: boolean | undefined; }; /** @internal */ export const AdminListUsersRequest$outboundSchema: z.ZodType< AdminListUsersRequest$Outbound, z.ZodTypeDef, AdminListUsersRequest > = z.object({ asc: QueryParamAsc$outboundSchema.optional(), email: z.string().optional(), flag: Flag$outboundSchema, ip: z.string().optional(), order: QueryParamOrder$outboundSchema.optional(), page: z.number().int().optional(), showEmails: z.boolean().optional(), stats: z.boolean().optional(), }).transform((v) => { return remap$(v, { showEmails: "show_emails", }); }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace AdminListUsersRequest$ { /** @deprecated use `AdminListUsersRequest$inboundSchema` instead. */ export const inboundSchema = AdminListUsersRequest$inboundSchema; /** @deprecated use `AdminListUsersRequest$outboundSchema` instead. */ export const outboundSchema = AdminListUsersRequest$outboundSchema; /** @deprecated use `AdminListUsersRequest$Outbound` instead. */ export type Outbound = AdminListUsersRequest$Outbound; } /** @internal */ export const AdminListUsersResponseBody$inboundSchema: z.ZodType< AdminListUsersResponseBody, z.ZodTypeDef, unknown > = z.object({ active: z.boolean(), admin: z.boolean(), avatar_template: z.string(), created_at: z.string(), created_at_age: z.nullable(z.number()), days_visited: z.number().int(), email: z.string().optional(), id: z.number().int(), last_emailed_age: z.nullable(z.number()), last_emailed_at: z.nullable(z.string()), last_seen_age: z.nullable(z.number()), last_seen_at: z.nullable(z.string()), manual_locked_trust_level: z.nullable(z.string()), moderator: z.boolean(), name: z.nullable(z.string()), post_count: z.number().int(), posts_read_count: z.number().int(), secondary_emails: z.array(z.any()).optional(), staged: z.boolean(), time_read: z.number().int(), title: z.nullable(z.string()), topics_entered: z.number().int(), trust_level: z.number().int(), username: z.string(), }).transform((v) => { return remap$(v, { "avatar_template": "avatarTemplate", "created_at": "createdAt", "created_at_age": "createdAtAge", "days_visited": "daysVisited", "last_emailed_age": "lastEmailedAge", "last_emailed_at": "lastEmailedAt", "last_seen_age": "lastSeenAge", "last_seen_at": "lastSeenAt", "manual_locked_trust_level": "manualLockedTrustLevel", "post_count": "postCount", "posts_read_count": "postsReadCount", "secondary_emails": "secondaryEmails", "time_read": "timeRead", "topics_entered": "topicsEntered", "trust_level": "trustLevel", }); }); /** @internal */ export type AdminListUsersResponseBody$Outbound = { active: boolean; admin: boolean; avatar_template: string; created_at: string; created_at_age: number | null; days_visited: number; email?: string | undefined; id: number; last_emailed_age: number | null; last_emailed_at: string | null; last_seen_age: number | null; last_seen_at: string | null; manual_locked_trust_level: string | null; moderator: boolean; name: string | null; post_count: number; posts_read_count: number; secondary_emails?: Array | undefined; staged: boolean; time_read: number; title: string | null; topics_entered: number; trust_level: number; username: string; }; /** @internal */ export const AdminListUsersResponseBody$outboundSchema: z.ZodType< AdminListUsersResponseBody$Outbound, z.ZodTypeDef, AdminListUsersResponseBody > = z.object({ active: z.boolean(), admin: z.boolean(), avatarTemplate: z.string(), createdAt: z.string(), createdAtAge: z.nullable(z.number()), daysVisited: z.number().int(), email: z.string().optional(), id: z.number().int(), lastEmailedAge: z.nullable(z.number()), lastEmailedAt: z.nullable(z.string()), lastSeenAge: z.nullable(z.number()), lastSeenAt: z.nullable(z.string()), manualLockedTrustLevel: z.nullable(z.string()), moderator: z.boolean(), name: z.nullable(z.string()), postCount: z.number().int(), postsReadCount: z.number().int(), secondaryEmails: z.array(z.any()).optional(), staged: z.boolean(), timeRead: z.number().int(), title: z.nullable(z.string()), topicsEntered: z.number().int(), trustLevel: z.number().int(), username: z.string(), }).transform((v) => { return remap$(v, { avatarTemplate: "avatar_template", createdAt: "created_at", createdAtAge: "created_at_age", daysVisited: "days_visited", lastEmailedAge: "last_emailed_age", lastEmailedAt: "last_emailed_at", lastSeenAge: "last_seen_age", lastSeenAt: "last_seen_at", manualLockedTrustLevel: "manual_locked_trust_level", postCount: "post_count", postsReadCount: "posts_read_count", secondaryEmails: "secondary_emails", timeRead: "time_read", topicsEntered: "topics_entered", trustLevel: "trust_level", }); }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace AdminListUsersResponseBody$ { /** @deprecated use `AdminListUsersResponseBody$inboundSchema` instead. */ export const inboundSchema = AdminListUsersResponseBody$inboundSchema; /** @deprecated use `AdminListUsersResponseBody$outboundSchema` instead. */ export const outboundSchema = AdminListUsersResponseBody$outboundSchema; /** @deprecated use `AdminListUsersResponseBody$Outbound` instead. */ export type Outbound = AdminListUsersResponseBody$Outbound; }