/* * 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 GetPostRequest = { id: string; }; export type ActionsSummary = { acted?: boolean | undefined; canAct?: boolean | undefined; canUndo?: boolean | undefined; count?: number | undefined; /** * `2`: like, `3`, `4`, `6`, `7`, `8`: flag */ id: number; }; /** * single post */ export type GetPostResponseBody = { 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 | undefined; 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 | undefined; postNumber: number; postType: number; primaryGroupName: string | null; quoteCount: number; raw: string; 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; additionalProperties: { [k: string]: any }; }; /** @internal */ export const GetPostRequest$inboundSchema: z.ZodType< GetPostRequest, z.ZodTypeDef, unknown > = z.object({ id: z.string(), }); /** @internal */ export type GetPostRequest$Outbound = { id: string; }; /** @internal */ export const GetPostRequest$outboundSchema: z.ZodType< GetPostRequest$Outbound, z.ZodTypeDef, GetPostRequest > = z.object({ id: z.string(), }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace GetPostRequest$ { /** @deprecated use `GetPostRequest$inboundSchema` instead. */ export const inboundSchema = GetPostRequest$inboundSchema; /** @deprecated use `GetPostRequest$outboundSchema` instead. */ export const outboundSchema = GetPostRequest$outboundSchema; /** @deprecated use `GetPostRequest$Outbound` instead. */ export type Outbound = GetPostRequest$Outbound; } /** @internal */ export const ActionsSummary$inboundSchema: z.ZodType< ActionsSummary, z.ZodTypeDef, unknown > = z.object({ acted: z.boolean().optional(), can_act: z.boolean().optional(), can_undo: z.boolean().optional(), count: z.number().int().optional(), id: z.number().int(), }).transform((v) => { return remap$(v, { "can_act": "canAct", "can_undo": "canUndo", }); }); /** @internal */ export type ActionsSummary$Outbound = { acted?: boolean | undefined; can_act?: boolean | undefined; can_undo?: boolean | undefined; count?: number | undefined; id: number; }; /** @internal */ export const ActionsSummary$outboundSchema: z.ZodType< ActionsSummary$Outbound, z.ZodTypeDef, ActionsSummary > = z.object({ acted: z.boolean().optional(), canAct: z.boolean().optional(), canUndo: z.boolean().optional(), count: z.number().int().optional(), id: z.number().int(), }).transform((v) => { return remap$(v, { canAct: "can_act", canUndo: "can_undo", }); }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace ActionsSummary$ { /** @deprecated use `ActionsSummary$inboundSchema` instead. */ export const inboundSchema = ActionsSummary$inboundSchema; /** @deprecated use `ActionsSummary$outboundSchema` instead. */ export const outboundSchema = ActionsSummary$outboundSchema; /** @deprecated use `ActionsSummary$Outbound` instead. */ export type Outbound = ActionsSummary$Outbound; } /** @internal */ export const GetPostResponseBody$inboundSchema: z.ZodType< GetPostResponseBody, z.ZodTypeDef, unknown > = collectExtraKeys$( z.object({ actions_summary: z.array(z.lazy(() => ActionsSummary$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()).optional(), 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()).optional(), 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(), 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(), }).catchall(z.any()), "additionalProperties", ).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", "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 GetPostResponseBody$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 | undefined; 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 | undefined; post_number: number; post_type: number; primary_group_name: string | null; quote_count: number; raw: string; 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; [additionalProperties: string]: unknown; }; /** @internal */ export const GetPostResponseBody$outboundSchema: z.ZodType< GetPostResponseBody$Outbound, z.ZodTypeDef, GetPostResponseBody > = z.object({ additionalProperties: z.record(z.any()), actionsSummary: z.array(z.lazy(() => ActionsSummary$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()).optional(), 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()).optional(), postNumber: z.number().int(), postType: z.number().int(), primaryGroupName: z.nullable(z.string()), quoteCount: z.number().int(), raw: z.string(), 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 { ...v.additionalProperties, ...remap$(v, { additionalProperties: null, 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", 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 GetPostResponseBody$ { /** @deprecated use `GetPostResponseBody$inboundSchema` instead. */ export const inboundSchema = GetPostResponseBody$inboundSchema; /** @deprecated use `GetPostResponseBody$outboundSchema` instead. */ export const outboundSchema = GetPostResponseBody$outboundSchema; /** @deprecated use `GetPostResponseBody$Outbound` instead. */ export type Outbound = GetPostResponseBody$Outbound; }