/* * 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 CreateTopicPostPMRequestBody = { /** * Required for new private message. */ archetype?: string | undefined; /** * Optional if creating a new topic, and ignored if creating a new post. */ category?: number | undefined; createdAt?: string | undefined; /** * Provide a URL from a remote system to associate a forum topic with that URL, typically for using Discourse as a comments system for an external blog. */ embedUrl?: string | undefined; /** * Provide an external_id from a remote system to associate a forum topic with that id. */ externalId?: string | undefined; raw: string; /** * Optional, the post number to reply to inside a topic. */ replyToPostNumber?: number | undefined; /** * Required for private message, comma separated. */ targetRecipients?: string | undefined; /** * Deprecated. Use target_recipients instead. * * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. */ targetUsernames?: string | undefined; /** * Required if creating a new topic or new private message. */ title?: string | undefined; /** * Required if creating a new post. */ topicId?: number | undefined; }; export type CreateTopicPostPMActionsSummary = { canAct: boolean; id: number; }; /** * post created */ export type CreateTopicPostPMResponseBody = { actionsSummary: Array; admin: boolean; avatarTemplate: string; bookmarked: boolean; canDelete: boolean; canEdit: boolean; canRecover: boolean; canSeeHiddenPost?: boolean | undefined; canViewEditHistory: boolean; canWiki: boolean; cooked: string; createdAt: string; deletedAt: string | null; displayUsername: string | null; draftSequence: number; editReason: string | null; flairBgColor: string | null; flairColor: string | null; flairGroupId?: string | null | undefined; flairName: string | null; flairUrl: string | null; hidden: boolean; id: number; incomingLinkCount: number; mentionedUsers?: Array | undefined; moderator: boolean; name: string | null; postNumber: number; postType: number; primaryGroupName: string | null; quoteCount: number; raw?: string | undefined; readersCount: number; reads: number; replyCount: number; replyToPostNumber: string | null; reviewableId: string | null; reviewableScoreCount: number; reviewableScorePendingCount: number; score: number; staff: boolean; topicId: number; topicSlug: string; trustLevel: number; updatedAt: string; userDeleted: boolean; userId: number; userTitle: string | null; username: string; version: number; wiki: boolean; yours: boolean; }; /** @internal */ export const CreateTopicPostPMRequestBody$inboundSchema: z.ZodType< CreateTopicPostPMRequestBody, z.ZodTypeDef, unknown > = z.object({ archetype: z.string().optional(), category: z.number().int().optional(), created_at: z.string().optional(), embed_url: z.string().optional(), external_id: z.string().optional(), raw: z.string(), reply_to_post_number: z.number().int().optional(), target_recipients: z.string().optional(), target_usernames: z.string().optional(), title: z.string().optional(), topic_id: z.number().int().optional(), }).transform((v) => { return remap$(v, { "created_at": "createdAt", "embed_url": "embedUrl", "external_id": "externalId", "reply_to_post_number": "replyToPostNumber", "target_recipients": "targetRecipients", "target_usernames": "targetUsernames", "topic_id": "topicId", }); }); /** @internal */ export type CreateTopicPostPMRequestBody$Outbound = { archetype?: string | undefined; category?: number | undefined; created_at?: string | undefined; embed_url?: string | undefined; external_id?: string | undefined; raw: string; reply_to_post_number?: number | undefined; target_recipients?: string | undefined; target_usernames?: string | undefined; title?: string | undefined; topic_id?: number | undefined; }; /** @internal */ export const CreateTopicPostPMRequestBody$outboundSchema: z.ZodType< CreateTopicPostPMRequestBody$Outbound, z.ZodTypeDef, CreateTopicPostPMRequestBody > = z.object({ archetype: z.string().optional(), category: z.number().int().optional(), createdAt: z.string().optional(), embedUrl: z.string().optional(), externalId: z.string().optional(), raw: z.string(), replyToPostNumber: z.number().int().optional(), targetRecipients: z.string().optional(), targetUsernames: z.string().optional(), title: z.string().optional(), topicId: z.number().int().optional(), }).transform((v) => { return remap$(v, { createdAt: "created_at", embedUrl: "embed_url", externalId: "external_id", replyToPostNumber: "reply_to_post_number", targetRecipients: "target_recipients", targetUsernames: "target_usernames", 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 CreateTopicPostPMRequestBody$ { /** @deprecated use `CreateTopicPostPMRequestBody$inboundSchema` instead. */ export const inboundSchema = CreateTopicPostPMRequestBody$inboundSchema; /** @deprecated use `CreateTopicPostPMRequestBody$outboundSchema` instead. */ export const outboundSchema = CreateTopicPostPMRequestBody$outboundSchema; /** @deprecated use `CreateTopicPostPMRequestBody$Outbound` instead. */ export type Outbound = CreateTopicPostPMRequestBody$Outbound; } /** @internal */ export const CreateTopicPostPMActionsSummary$inboundSchema: z.ZodType< CreateTopicPostPMActionsSummary, z.ZodTypeDef, unknown > = z.object({ can_act: z.boolean(), id: z.number().int(), }).transform((v) => { return remap$(v, { "can_act": "canAct", }); }); /** @internal */ export type CreateTopicPostPMActionsSummary$Outbound = { can_act: boolean; id: number; }; /** @internal */ export const CreateTopicPostPMActionsSummary$outboundSchema: z.ZodType< CreateTopicPostPMActionsSummary$Outbound, z.ZodTypeDef, CreateTopicPostPMActionsSummary > = z.object({ canAct: z.boolean(), id: z.number().int(), }).transform((v) => { return remap$(v, { canAct: "can_act", }); }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace CreateTopicPostPMActionsSummary$ { /** @deprecated use `CreateTopicPostPMActionsSummary$inboundSchema` instead. */ export const inboundSchema = CreateTopicPostPMActionsSummary$inboundSchema; /** @deprecated use `CreateTopicPostPMActionsSummary$outboundSchema` instead. */ export const outboundSchema = CreateTopicPostPMActionsSummary$outboundSchema; /** @deprecated use `CreateTopicPostPMActionsSummary$Outbound` instead. */ export type Outbound = CreateTopicPostPMActionsSummary$Outbound; } /** @internal */ export const CreateTopicPostPMResponseBody$inboundSchema: z.ZodType< CreateTopicPostPMResponseBody, z.ZodTypeDef, unknown > = z.object({ actions_summary: z.array( z.lazy(() => CreateTopicPostPMActionsSummary$inboundSchema), ), admin: z.boolean(), avatar_template: z.string(), bookmarked: z.boolean(), can_delete: z.boolean(), can_edit: z.boolean(), can_recover: z.boolean(), can_see_hidden_post: z.boolean().optional(), can_view_edit_history: z.boolean(), can_wiki: z.boolean(), cooked: z.string(), created_at: z.string(), deleted_at: z.nullable(z.string()), display_username: z.nullable(z.string()), draft_sequence: z.number().int(), edit_reason: z.nullable(z.string()), flair_bg_color: z.nullable(z.string()), flair_color: z.nullable(z.string()), flair_group_id: z.nullable(z.string()).optional(), flair_name: z.nullable(z.string()), flair_url: z.nullable(z.string()), hidden: z.boolean(), id: z.number().int(), incoming_link_count: z.number().int(), mentioned_users: z.array(z.any()).optional(), moderator: z.boolean(), name: z.nullable(z.string()), post_number: z.number().int(), post_type: z.number().int(), primary_group_name: z.nullable(z.string()), quote_count: z.number().int(), raw: z.string().optional(), readers_count: z.number().int(), reads: z.number().int(), reply_count: z.number().int(), reply_to_post_number: z.nullable(z.string()), reviewable_id: z.nullable(z.string()), reviewable_score_count: z.number().int(), reviewable_score_pending_count: z.number().int(), score: z.number().int(), staff: z.boolean(), topic_id: z.number().int(), topic_slug: z.string(), trust_level: z.number().int(), updated_at: z.string(), user_deleted: z.boolean(), user_id: z.number().int(), user_title: z.nullable(z.string()), username: z.string(), version: z.number().int(), wiki: z.boolean(), yours: z.boolean(), }).transform((v) => { return remap$(v, { "actions_summary": "actionsSummary", "avatar_template": "avatarTemplate", "can_delete": "canDelete", "can_edit": "canEdit", "can_recover": "canRecover", "can_see_hidden_post": "canSeeHiddenPost", "can_view_edit_history": "canViewEditHistory", "can_wiki": "canWiki", "created_at": "createdAt", "deleted_at": "deletedAt", "display_username": "displayUsername", "draft_sequence": "draftSequence", "edit_reason": "editReason", "flair_bg_color": "flairBgColor", "flair_color": "flairColor", "flair_group_id": "flairGroupId", "flair_name": "flairName", "flair_url": "flairUrl", "incoming_link_count": "incomingLinkCount", "mentioned_users": "mentionedUsers", "post_number": "postNumber", "post_type": "postType", "primary_group_name": "primaryGroupName", "quote_count": "quoteCount", "readers_count": "readersCount", "reply_count": "replyCount", "reply_to_post_number": "replyToPostNumber", "reviewable_id": "reviewableId", "reviewable_score_count": "reviewableScoreCount", "reviewable_score_pending_count": "reviewableScorePendingCount", "topic_id": "topicId", "topic_slug": "topicSlug", "trust_level": "trustLevel", "updated_at": "updatedAt", "user_deleted": "userDeleted", "user_id": "userId", "user_title": "userTitle", }); }); /** @internal */ export type CreateTopicPostPMResponseBody$Outbound = { actions_summary: Array; admin: boolean; avatar_template: string; bookmarked: boolean; can_delete: boolean; can_edit: boolean; can_recover: boolean; can_see_hidden_post?: boolean | undefined; can_view_edit_history: boolean; can_wiki: boolean; cooked: string; created_at: string; deleted_at: string | null; display_username: string | null; draft_sequence: number; edit_reason: string | null; flair_bg_color: string | null; flair_color: string | null; flair_group_id?: string | null | undefined; flair_name: string | null; flair_url: string | null; hidden: boolean; id: number; incoming_link_count: number; mentioned_users?: Array | undefined; moderator: boolean; name: string | null; post_number: number; post_type: number; primary_group_name: string | null; quote_count: number; raw?: string | undefined; readers_count: number; reads: number; reply_count: number; reply_to_post_number: string | null; reviewable_id: string | null; reviewable_score_count: number; reviewable_score_pending_count: number; score: number; staff: boolean; topic_id: number; topic_slug: string; trust_level: number; updated_at: string; user_deleted: boolean; user_id: number; user_title: string | null; username: string; version: number; wiki: boolean; yours: boolean; }; /** @internal */ export const CreateTopicPostPMResponseBody$outboundSchema: z.ZodType< CreateTopicPostPMResponseBody$Outbound, z.ZodTypeDef, CreateTopicPostPMResponseBody > = z.object({ actionsSummary: z.array( z.lazy(() => CreateTopicPostPMActionsSummary$outboundSchema), ), admin: z.boolean(), avatarTemplate: z.string(), bookmarked: z.boolean(), canDelete: z.boolean(), canEdit: z.boolean(), canRecover: z.boolean(), canSeeHiddenPost: z.boolean().optional(), canViewEditHistory: z.boolean(), canWiki: z.boolean(), cooked: z.string(), createdAt: z.string(), deletedAt: z.nullable(z.string()), displayUsername: z.nullable(z.string()), draftSequence: z.number().int(), editReason: z.nullable(z.string()), flairBgColor: z.nullable(z.string()), flairColor: z.nullable(z.string()), flairGroupId: z.nullable(z.string()).optional(), flairName: z.nullable(z.string()), flairUrl: z.nullable(z.string()), hidden: z.boolean(), id: z.number().int(), incomingLinkCount: z.number().int(), mentionedUsers: z.array(z.any()).optional(), moderator: z.boolean(), name: z.nullable(z.string()), postNumber: z.number().int(), postType: z.number().int(), primaryGroupName: z.nullable(z.string()), quoteCount: z.number().int(), raw: z.string().optional(), readersCount: z.number().int(), reads: z.number().int(), replyCount: z.number().int(), replyToPostNumber: z.nullable(z.string()), reviewableId: z.nullable(z.string()), reviewableScoreCount: z.number().int(), reviewableScorePendingCount: z.number().int(), score: z.number().int(), staff: z.boolean(), topicId: z.number().int(), topicSlug: z.string(), trustLevel: z.number().int(), updatedAt: z.string(), userDeleted: z.boolean(), userId: z.number().int(), userTitle: z.nullable(z.string()), username: z.string(), version: z.number().int(), wiki: z.boolean(), yours: z.boolean(), }).transform((v) => { return remap$(v, { actionsSummary: "actions_summary", avatarTemplate: "avatar_template", canDelete: "can_delete", canEdit: "can_edit", canRecover: "can_recover", canSeeHiddenPost: "can_see_hidden_post", canViewEditHistory: "can_view_edit_history", canWiki: "can_wiki", createdAt: "created_at", deletedAt: "deleted_at", displayUsername: "display_username", draftSequence: "draft_sequence", editReason: "edit_reason", flairBgColor: "flair_bg_color", flairColor: "flair_color", flairGroupId: "flair_group_id", flairName: "flair_name", flairUrl: "flair_url", incomingLinkCount: "incoming_link_count", mentionedUsers: "mentioned_users", postNumber: "post_number", postType: "post_type", primaryGroupName: "primary_group_name", quoteCount: "quote_count", readersCount: "readers_count", replyCount: "reply_count", replyToPostNumber: "reply_to_post_number", reviewableId: "reviewable_id", reviewableScoreCount: "reviewable_score_count", reviewableScorePendingCount: "reviewable_score_pending_count", topicId: "topic_id", topicSlug: "topic_slug", trustLevel: "trust_level", updatedAt: "updated_at", userDeleted: "user_deleted", userId: "user_id", userTitle: "user_title", }); }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace CreateTopicPostPMResponseBody$ { /** @deprecated use `CreateTopicPostPMResponseBody$inboundSchema` instead. */ export const inboundSchema = CreateTopicPostPMResponseBody$inboundSchema; /** @deprecated use `CreateTopicPostPMResponseBody$outboundSchema` instead. */ export const outboundSchema = CreateTopicPostPMResponseBody$outboundSchema; /** @deprecated use `CreateTopicPostPMResponseBody$Outbound` instead. */ export type Outbound = CreateTopicPostPMResponseBody$Outbound; }