/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod"; import { remap as remap$ } from "../../../lib/primitives.js"; import { collectExtraKeys as collectExtraKeys$ } from "../../../lib/schemas.js"; export type Permissions = { everyone?: number | undefined; staff?: number | undefined; additionalProperties: { [k: string]: any }; }; export type CreateCategoryRequestBody = { allowBadges?: boolean | undefined; color?: string | undefined; formTemplateIds?: Array | undefined; name: string; parentCategoryId?: number | undefined; permissions?: Permissions | undefined; searchPriority?: number | undefined; slug?: string | undefined; textColor?: string | undefined; topicFeaturedLinksAllowed?: boolean | undefined; }; export type CustomFields = {}; export type GroupPermissions = { groupName: string; permissionType: number; }; export type RequiredTagGroups = { minCount: number; name: string; }; export type Category = { allTopicsWiki: boolean; allowBadges: boolean; allowGlobalTags?: boolean | undefined; allowUnlimitedOwnerEditsOnFirstPost: boolean; allowedTagGroups?: Array | undefined; allowedTags?: Array | undefined; autoCloseBasedOnLastPost: boolean; autoCloseHours: string | null; availableGroups: Array; canDelete: boolean; canEdit: boolean; categorySetting?: any | undefined; color: string; customFields: CustomFields; defaultListFilter: string; defaultSlowModeSeconds: string | null; defaultTopPeriod: string; defaultView: string | null; description: string | null; descriptionExcerpt: string | null; descriptionText: string | null; emailIn: string | null; emailInAllowStrangers: boolean; formTemplateIds?: Array | undefined; groupPermissions: Array; hasChildren: boolean | null; id: number; mailinglistMirror: boolean; minimumRequiredTags: number; name: string; navigateToFirstPostAfterRead: boolean; notificationLevel: number; numFeaturedTopics: number; permission: number | null; position: number; postCount: number; readOnlyBanner: string | null; readRestricted: boolean; requiredTagGroups: Array; searchPriority: number; showSubcategoryList: boolean; slug: string; sortAscending: string | null; sortOrder: string | null; subcategoryListStyle: string; textColor: string; topicCount: number; topicFeaturedLinkAllowed: boolean; topicTemplate: string | null; topicUrl: string | null; uploadedBackground: string | null; uploadedBackgroundDark: string | null; uploadedLogo: string | null; uploadedLogoDark: string | null; }; /** * success response */ export type CreateCategoryResponseBody = { category: Category; }; /** @internal */ export const Permissions$inboundSchema: z.ZodType< Permissions, z.ZodTypeDef, unknown > = collectExtraKeys$( z.object({ everyone: z.number().int().optional(), staff: z.number().int().optional(), }).catchall(z.any()), "additionalProperties", ); /** @internal */ export type Permissions$Outbound = { everyone?: number | undefined; staff?: number | undefined; [additionalProperties: string]: unknown; }; /** @internal */ export const Permissions$outboundSchema: z.ZodType< Permissions$Outbound, z.ZodTypeDef, Permissions > = z.object({ additionalProperties: z.record(z.any()), everyone: z.number().int().optional(), staff: z.number().int().optional(), }).transform((v) => { return { ...v.additionalProperties, ...remap$(v, { additionalProperties: null, }), }; }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace Permissions$ { /** @deprecated use `Permissions$inboundSchema` instead. */ export const inboundSchema = Permissions$inboundSchema; /** @deprecated use `Permissions$outboundSchema` instead. */ export const outboundSchema = Permissions$outboundSchema; /** @deprecated use `Permissions$Outbound` instead. */ export type Outbound = Permissions$Outbound; } /** @internal */ export const CreateCategoryRequestBody$inboundSchema: z.ZodType< CreateCategoryRequestBody, z.ZodTypeDef, unknown > = z.object({ allow_badges: z.boolean().optional(), color: z.string().optional(), form_template_ids: z.array(z.any()).optional(), name: z.string(), parent_category_id: z.number().int().optional(), permissions: z.lazy(() => Permissions$inboundSchema).optional(), search_priority: z.number().int().optional(), slug: z.string().optional(), text_color: z.string().optional(), topic_featured_links_allowed: z.boolean().optional(), }).transform((v) => { return remap$(v, { "allow_badges": "allowBadges", "form_template_ids": "formTemplateIds", "parent_category_id": "parentCategoryId", "search_priority": "searchPriority", "text_color": "textColor", "topic_featured_links_allowed": "topicFeaturedLinksAllowed", }); }); /** @internal */ export type CreateCategoryRequestBody$Outbound = { allow_badges?: boolean | undefined; color?: string | undefined; form_template_ids?: Array | undefined; name: string; parent_category_id?: number | undefined; permissions?: Permissions$Outbound | undefined; search_priority?: number | undefined; slug?: string | undefined; text_color?: string | undefined; topic_featured_links_allowed?: boolean | undefined; }; /** @internal */ export const CreateCategoryRequestBody$outboundSchema: z.ZodType< CreateCategoryRequestBody$Outbound, z.ZodTypeDef, CreateCategoryRequestBody > = z.object({ allowBadges: z.boolean().optional(), color: z.string().optional(), formTemplateIds: z.array(z.any()).optional(), name: z.string(), parentCategoryId: z.number().int().optional(), permissions: z.lazy(() => Permissions$outboundSchema).optional(), searchPriority: z.number().int().optional(), slug: z.string().optional(), textColor: z.string().optional(), topicFeaturedLinksAllowed: z.boolean().optional(), }).transform((v) => { return remap$(v, { allowBadges: "allow_badges", formTemplateIds: "form_template_ids", parentCategoryId: "parent_category_id", searchPriority: "search_priority", textColor: "text_color", topicFeaturedLinksAllowed: "topic_featured_links_allowed", }); }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace CreateCategoryRequestBody$ { /** @deprecated use `CreateCategoryRequestBody$inboundSchema` instead. */ export const inboundSchema = CreateCategoryRequestBody$inboundSchema; /** @deprecated use `CreateCategoryRequestBody$outboundSchema` instead. */ export const outboundSchema = CreateCategoryRequestBody$outboundSchema; /** @deprecated use `CreateCategoryRequestBody$Outbound` instead. */ export type Outbound = CreateCategoryRequestBody$Outbound; } /** @internal */ export const CustomFields$inboundSchema: z.ZodType< CustomFields, z.ZodTypeDef, unknown > = z.object({}); /** @internal */ export type CustomFields$Outbound = {}; /** @internal */ export const CustomFields$outboundSchema: z.ZodType< CustomFields$Outbound, z.ZodTypeDef, CustomFields > = z.object({}); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace CustomFields$ { /** @deprecated use `CustomFields$inboundSchema` instead. */ export const inboundSchema = CustomFields$inboundSchema; /** @deprecated use `CustomFields$outboundSchema` instead. */ export const outboundSchema = CustomFields$outboundSchema; /** @deprecated use `CustomFields$Outbound` instead. */ export type Outbound = CustomFields$Outbound; } /** @internal */ export const GroupPermissions$inboundSchema: z.ZodType< GroupPermissions, z.ZodTypeDef, unknown > = z.object({ group_name: z.string(), permission_type: z.number().int(), }).transform((v) => { return remap$(v, { "group_name": "groupName", "permission_type": "permissionType", }); }); /** @internal */ export type GroupPermissions$Outbound = { group_name: string; permission_type: number; }; /** @internal */ export const GroupPermissions$outboundSchema: z.ZodType< GroupPermissions$Outbound, z.ZodTypeDef, GroupPermissions > = z.object({ groupName: z.string(), permissionType: z.number().int(), }).transform((v) => { return remap$(v, { groupName: "group_name", permissionType: "permission_type", }); }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace GroupPermissions$ { /** @deprecated use `GroupPermissions$inboundSchema` instead. */ export const inboundSchema = GroupPermissions$inboundSchema; /** @deprecated use `GroupPermissions$outboundSchema` instead. */ export const outboundSchema = GroupPermissions$outboundSchema; /** @deprecated use `GroupPermissions$Outbound` instead. */ export type Outbound = GroupPermissions$Outbound; } /** @internal */ export const RequiredTagGroups$inboundSchema: z.ZodType< RequiredTagGroups, z.ZodTypeDef, unknown > = z.object({ min_count: z.number().int(), name: z.string(), }).transform((v) => { return remap$(v, { "min_count": "minCount", }); }); /** @internal */ export type RequiredTagGroups$Outbound = { min_count: number; name: string; }; /** @internal */ export const RequiredTagGroups$outboundSchema: z.ZodType< RequiredTagGroups$Outbound, z.ZodTypeDef, RequiredTagGroups > = z.object({ minCount: z.number().int(), name: z.string(), }).transform((v) => { return remap$(v, { minCount: "min_count", }); }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace RequiredTagGroups$ { /** @deprecated use `RequiredTagGroups$inboundSchema` instead. */ export const inboundSchema = RequiredTagGroups$inboundSchema; /** @deprecated use `RequiredTagGroups$outboundSchema` instead. */ export const outboundSchema = RequiredTagGroups$outboundSchema; /** @deprecated use `RequiredTagGroups$Outbound` instead. */ export type Outbound = RequiredTagGroups$Outbound; } /** @internal */ export const Category$inboundSchema: z.ZodType< Category, z.ZodTypeDef, unknown > = z.object({ all_topics_wiki: z.boolean(), allow_badges: z.boolean(), allow_global_tags: z.boolean().optional(), allow_unlimited_owner_edits_on_first_post: z.boolean(), allowed_tag_groups: z.array(z.any()).optional(), allowed_tags: z.array(z.any()).optional(), auto_close_based_on_last_post: z.boolean(), auto_close_hours: z.nullable(z.string()), available_groups: z.array(z.any()), can_delete: z.boolean(), can_edit: z.boolean(), category_setting: z.any().optional(), color: z.string(), custom_fields: z.lazy(() => CustomFields$inboundSchema), default_list_filter: z.string(), default_slow_mode_seconds: z.nullable(z.string()), default_top_period: z.string(), default_view: z.nullable(z.string()), description: z.nullable(z.string()), description_excerpt: z.nullable(z.string()), description_text: z.nullable(z.string()), email_in: z.nullable(z.string()), email_in_allow_strangers: z.boolean(), form_template_ids: z.array(z.any()).optional(), group_permissions: z.array(z.lazy(() => GroupPermissions$inboundSchema)), has_children: z.nullable(z.boolean()), id: z.number().int(), mailinglist_mirror: z.boolean(), minimum_required_tags: z.number().int(), name: z.string(), navigate_to_first_post_after_read: z.boolean(), notification_level: z.number().int(), num_featured_topics: z.number().int(), permission: z.nullable(z.number().int()), position: z.number().int(), post_count: z.number().int(), read_only_banner: z.nullable(z.string()), read_restricted: z.boolean(), required_tag_groups: z.array(z.lazy(() => RequiredTagGroups$inboundSchema)), search_priority: z.number().int(), show_subcategory_list: z.boolean(), slug: z.string(), sort_ascending: z.nullable(z.string()), sort_order: z.nullable(z.string()), subcategory_list_style: z.string(), text_color: z.string(), topic_count: z.number().int(), topic_featured_link_allowed: z.boolean(), topic_template: z.nullable(z.string()), topic_url: z.nullable(z.string()), uploaded_background: z.nullable(z.string()), uploaded_background_dark: z.nullable(z.string()), uploaded_logo: z.nullable(z.string()), uploaded_logo_dark: z.nullable(z.string()), }).transform((v) => { return remap$(v, { "all_topics_wiki": "allTopicsWiki", "allow_badges": "allowBadges", "allow_global_tags": "allowGlobalTags", "allow_unlimited_owner_edits_on_first_post": "allowUnlimitedOwnerEditsOnFirstPost", "allowed_tag_groups": "allowedTagGroups", "allowed_tags": "allowedTags", "auto_close_based_on_last_post": "autoCloseBasedOnLastPost", "auto_close_hours": "autoCloseHours", "available_groups": "availableGroups", "can_delete": "canDelete", "can_edit": "canEdit", "category_setting": "categorySetting", "custom_fields": "customFields", "default_list_filter": "defaultListFilter", "default_slow_mode_seconds": "defaultSlowModeSeconds", "default_top_period": "defaultTopPeriod", "default_view": "defaultView", "description_excerpt": "descriptionExcerpt", "description_text": "descriptionText", "email_in": "emailIn", "email_in_allow_strangers": "emailInAllowStrangers", "form_template_ids": "formTemplateIds", "group_permissions": "groupPermissions", "has_children": "hasChildren", "mailinglist_mirror": "mailinglistMirror", "minimum_required_tags": "minimumRequiredTags", "navigate_to_first_post_after_read": "navigateToFirstPostAfterRead", "notification_level": "notificationLevel", "num_featured_topics": "numFeaturedTopics", "post_count": "postCount", "read_only_banner": "readOnlyBanner", "read_restricted": "readRestricted", "required_tag_groups": "requiredTagGroups", "search_priority": "searchPriority", "show_subcategory_list": "showSubcategoryList", "sort_ascending": "sortAscending", "sort_order": "sortOrder", "subcategory_list_style": "subcategoryListStyle", "text_color": "textColor", "topic_count": "topicCount", "topic_featured_link_allowed": "topicFeaturedLinkAllowed", "topic_template": "topicTemplate", "topic_url": "topicUrl", "uploaded_background": "uploadedBackground", "uploaded_background_dark": "uploadedBackgroundDark", "uploaded_logo": "uploadedLogo", "uploaded_logo_dark": "uploadedLogoDark", }); }); /** @internal */ export type Category$Outbound = { all_topics_wiki: boolean; allow_badges: boolean; allow_global_tags?: boolean | undefined; allow_unlimited_owner_edits_on_first_post: boolean; allowed_tag_groups?: Array | undefined; allowed_tags?: Array | undefined; auto_close_based_on_last_post: boolean; auto_close_hours: string | null; available_groups: Array; can_delete: boolean; can_edit: boolean; category_setting?: any | undefined; color: string; custom_fields: CustomFields$Outbound; default_list_filter: string; default_slow_mode_seconds: string | null; default_top_period: string; default_view: string | null; description: string | null; description_excerpt: string | null; description_text: string | null; email_in: string | null; email_in_allow_strangers: boolean; form_template_ids?: Array | undefined; group_permissions: Array; has_children: boolean | null; id: number; mailinglist_mirror: boolean; minimum_required_tags: number; name: string; navigate_to_first_post_after_read: boolean; notification_level: number; num_featured_topics: number; permission: number | null; position: number; post_count: number; read_only_banner: string | null; read_restricted: boolean; required_tag_groups: Array; search_priority: number; show_subcategory_list: boolean; slug: string; sort_ascending: string | null; sort_order: string | null; subcategory_list_style: string; text_color: string; topic_count: number; topic_featured_link_allowed: boolean; topic_template: string | null; topic_url: string | null; uploaded_background: string | null; uploaded_background_dark: string | null; uploaded_logo: string | null; uploaded_logo_dark: string | null; }; /** @internal */ export const Category$outboundSchema: z.ZodType< Category$Outbound, z.ZodTypeDef, Category > = z.object({ allTopicsWiki: z.boolean(), allowBadges: z.boolean(), allowGlobalTags: z.boolean().optional(), allowUnlimitedOwnerEditsOnFirstPost: z.boolean(), allowedTagGroups: z.array(z.any()).optional(), allowedTags: z.array(z.any()).optional(), autoCloseBasedOnLastPost: z.boolean(), autoCloseHours: z.nullable(z.string()), availableGroups: z.array(z.any()), canDelete: z.boolean(), canEdit: z.boolean(), categorySetting: z.any().optional(), color: z.string(), customFields: z.lazy(() => CustomFields$outboundSchema), defaultListFilter: z.string(), defaultSlowModeSeconds: z.nullable(z.string()), defaultTopPeriod: z.string(), defaultView: z.nullable(z.string()), description: z.nullable(z.string()), descriptionExcerpt: z.nullable(z.string()), descriptionText: z.nullable(z.string()), emailIn: z.nullable(z.string()), emailInAllowStrangers: z.boolean(), formTemplateIds: z.array(z.any()).optional(), groupPermissions: z.array(z.lazy(() => GroupPermissions$outboundSchema)), hasChildren: z.nullable(z.boolean()), id: z.number().int(), mailinglistMirror: z.boolean(), minimumRequiredTags: z.number().int(), name: z.string(), navigateToFirstPostAfterRead: z.boolean(), notificationLevel: z.number().int(), numFeaturedTopics: z.number().int(), permission: z.nullable(z.number().int()), position: z.number().int(), postCount: z.number().int(), readOnlyBanner: z.nullable(z.string()), readRestricted: z.boolean(), requiredTagGroups: z.array(z.lazy(() => RequiredTagGroups$outboundSchema)), searchPriority: z.number().int(), showSubcategoryList: z.boolean(), slug: z.string(), sortAscending: z.nullable(z.string()), sortOrder: z.nullable(z.string()), subcategoryListStyle: z.string(), textColor: z.string(), topicCount: z.number().int(), topicFeaturedLinkAllowed: z.boolean(), topicTemplate: z.nullable(z.string()), topicUrl: z.nullable(z.string()), uploadedBackground: z.nullable(z.string()), uploadedBackgroundDark: z.nullable(z.string()), uploadedLogo: z.nullable(z.string()), uploadedLogoDark: z.nullable(z.string()), }).transform((v) => { return remap$(v, { allTopicsWiki: "all_topics_wiki", allowBadges: "allow_badges", allowGlobalTags: "allow_global_tags", allowUnlimitedOwnerEditsOnFirstPost: "allow_unlimited_owner_edits_on_first_post", allowedTagGroups: "allowed_tag_groups", allowedTags: "allowed_tags", autoCloseBasedOnLastPost: "auto_close_based_on_last_post", autoCloseHours: "auto_close_hours", availableGroups: "available_groups", canDelete: "can_delete", canEdit: "can_edit", categorySetting: "category_setting", customFields: "custom_fields", defaultListFilter: "default_list_filter", defaultSlowModeSeconds: "default_slow_mode_seconds", defaultTopPeriod: "default_top_period", defaultView: "default_view", descriptionExcerpt: "description_excerpt", descriptionText: "description_text", emailIn: "email_in", emailInAllowStrangers: "email_in_allow_strangers", formTemplateIds: "form_template_ids", groupPermissions: "group_permissions", hasChildren: "has_children", mailinglistMirror: "mailinglist_mirror", minimumRequiredTags: "minimum_required_tags", navigateToFirstPostAfterRead: "navigate_to_first_post_after_read", notificationLevel: "notification_level", numFeaturedTopics: "num_featured_topics", postCount: "post_count", readOnlyBanner: "read_only_banner", readRestricted: "read_restricted", requiredTagGroups: "required_tag_groups", searchPriority: "search_priority", showSubcategoryList: "show_subcategory_list", sortAscending: "sort_ascending", sortOrder: "sort_order", subcategoryListStyle: "subcategory_list_style", textColor: "text_color", topicCount: "topic_count", topicFeaturedLinkAllowed: "topic_featured_link_allowed", topicTemplate: "topic_template", topicUrl: "topic_url", uploadedBackground: "uploaded_background", uploadedBackgroundDark: "uploaded_background_dark", uploadedLogo: "uploaded_logo", uploadedLogoDark: "uploaded_logo_dark", }); }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace Category$ { /** @deprecated use `Category$inboundSchema` instead. */ export const inboundSchema = Category$inboundSchema; /** @deprecated use `Category$outboundSchema` instead. */ export const outboundSchema = Category$outboundSchema; /** @deprecated use `Category$Outbound` instead. */ export type Outbound = Category$Outbound; } /** @internal */ export const CreateCategoryResponseBody$inboundSchema: z.ZodType< CreateCategoryResponseBody, z.ZodTypeDef, unknown > = z.object({ category: z.lazy(() => Category$inboundSchema), }); /** @internal */ export type CreateCategoryResponseBody$Outbound = { category: Category$Outbound; }; /** @internal */ export const CreateCategoryResponseBody$outboundSchema: z.ZodType< CreateCategoryResponseBody$Outbound, z.ZodTypeDef, CreateCategoryResponseBody > = z.object({ category: z.lazy(() => Category$outboundSchema), }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace CreateCategoryResponseBody$ { /** @deprecated use `CreateCategoryResponseBody$inboundSchema` instead. */ export const inboundSchema = CreateCategoryResponseBody$inboundSchema; /** @deprecated use `CreateCategoryResponseBody$outboundSchema` instead. */ export const outboundSchema = CreateCategoryResponseBody$outboundSchema; /** @deprecated use `CreateCategoryResponseBody$Outbound` instead. */ export type Outbound = CreateCategoryResponseBody$Outbound; }