1 # Pleroma: A lightweight social networking server
2 # Copyright © 2017-2021 Pleroma Authors <https://pleroma.social/>
3 # SPDX-License-Identifier: AGPL-3.0-only
5 defmodule Pleroma.Web.ApiSpec.Schemas.Status do
6 alias OpenApiSpex.Schema
7 alias Pleroma.Web.ApiSpec.Schemas.Account
8 alias Pleroma.Web.ApiSpec.Schemas.Attachment
9 alias Pleroma.Web.ApiSpec.Schemas.Emoji
10 alias Pleroma.Web.ApiSpec.Schemas.FlakeID
11 alias Pleroma.Web.ApiSpec.Schemas.Poll
12 alias Pleroma.Web.ApiSpec.Schemas.Tag
13 alias Pleroma.Web.ApiSpec.Schemas.VisibilityScope
19 description: "Response schema for a status",
22 account: %Schema{allOf: [Account], description: "The account that authored this status"},
24 description: "The application used to post this status",
27 name: %Schema{type: :string},
28 website: %Schema{type: :string, nullable: true, format: :uri}
31 bookmarked: %Schema{type: :boolean, description: "Have you bookmarked this status?"},
35 description: "Preview card for links included within status content",
36 required: [:url, :title, :description, :type],
40 enum: ["link", "photo", "video", "rich"],
41 description: "The type of the preview card"
43 provider_name: %Schema{
46 description: "The provider of the original resource"
48 provider_url: %Schema{
51 description: "A link to the provider of the original resource"
53 url: %Schema{type: :string, format: :uri, description: "Location of linked resource"},
58 description: "Preview thumbnail"
60 title: %Schema{type: :string, description: "Title of linked resource"},
61 description: %Schema{type: :string, description: "Description of preview"}
64 content: %Schema{type: :string, format: :html, description: "HTML-encoded status content"},
67 description: "Original unformatted content in plain text",
73 description: "The date when this status was created"
78 description: "Custom emoji to be used when rendering status content"
80 favourited: %Schema{type: :boolean, description: "Have you favourited this status?"},
81 favourites_count: %Schema{
83 description: "How many favourites this status has received"
86 in_reply_to_account_id: %Schema{
89 description: "ID of the account being replied to"
91 in_reply_to_id: %Schema{
94 description: "ID of the status being replied"
99 description: "Primary language of this status"
101 media_attachments: %Schema{
104 description: "Media that is attached to this status"
108 description: "Mentions of users within the status content",
112 id: %Schema{allOf: [FlakeID], description: "The account id of the mentioned user"},
116 "The webfinger acct: URI of the mentioned user. Equivalent to `username` for local users, or `username@domain` for remote users."
118 username: %Schema{type: :string, description: "The username of the mentioned user"},
122 description: "The location of the mentioned user's profile"
129 description: "Have you muted notifications for this status's conversation?"
133 description: "Have you pinned this status? Only appears if the status is pinnable."
140 additionalProperties: %Schema{type: :string},
142 "A map consisting of alternate representations of the `content` property with the key being it's mimetype. Currently the only alternate representation supported is `text/plain`"
144 conversation_id: %Schema{
146 description: "The ID of the AP context the status is associated with (if any)"
148 direct_conversation_id: %Schema{
152 "The ID of the Mastodon direct message conversation the status is associated with (if any)"
154 emoji_reactions: %Schema{
157 "A list with emoji / reaction maps. Contains no information about the reacting users, for that use the /statuses/:id/reactions endpoint.",
161 name: %Schema{type: :string},
162 count: %Schema{type: :integer},
163 me: %Schema{type: :boolean}
172 "A datetime (ISO 8601) that states when the post will expire (be deleted automatically), or empty if the post won't expire"
174 in_reply_to_account_acct: %Schema{
177 description: "The `acct` property of User entity for replied user (if any)"
181 description: "`true` if the post was made on the local instance"
183 spoiler_text: %Schema{
185 additionalProperties: %Schema{type: :string},
187 "A map consisting of alternate representations of the `spoiler_text` property with the key being it's mimetype. Currently the only alternate representation supported is `text/plain`."
189 thread_muted: %Schema{
191 description: "`true` if the thread the post belongs to is muted"
193 parent_visible: %Schema{
195 description: "`true` if the parent post is visible to the user"
199 poll: %Schema{allOf: [Poll], nullable: true, description: "The poll attached to the status"},
201 allOf: [%OpenApiSpex.Reference{"$ref": "#/components/schemas/Status"}],
203 description: "The status being reblogged"
205 reblogged: %Schema{type: :boolean, description: "Have you boosted this status?"},
206 reblogs_count: %Schema{
208 description: "How many boosts this status has received"
210 replies_count: %Schema{
212 description: "How many replies this status has received"
216 description: "Is this status marked as sensitive content?"
218 spoiler_text: %Schema{
221 "Subject or summary line, below which status content is collapsed until expanded"
223 tags: %Schema{type: :array, items: Tag},
227 description: "URI of the status used for federation"
233 description: "A link to the status's HTML representation"
236 allOf: [VisibilityScope],
237 description: "Visibility of this status"
243 "avatar" => "http://localhost:4001/images/avi.png",
244 "avatar_static" => "http://localhost:4001/images/avi.png",
246 "created_at" => "2020-04-07T19:48:51.000Z",
247 "display_name" => "Test テスト User 6",
250 "followers_count" => 1,
251 "following_count" => 0,
252 "header" => "http://localhost:4001/images/banner.png",
253 "header_static" => "http://localhost:4001/images/banner.png",
254 "id" => "9toJCsKN7SmSf3aj5c",
255 "is_locked" => false,
256 "note" => "Tester Number 6",
258 "background_image" => nil,
259 "is_confirmed" => true,
260 "hide_favorites" => true,
261 "hide_followers" => false,
262 "hide_followers_count" => false,
263 "hide_follows" => false,
264 "hide_follows_count" => false,
266 "is_moderator" => false,
268 "blocked_by" => false,
270 "domain_blocking" => false,
272 "followed_by" => false,
274 "id" => "9toJCsKN7SmSf3aj5c",
276 "muting_notifications" => false,
277 "requested" => false,
278 "showing_reblogs" => true,
279 "subscribing" => false
281 "skip_thread_containment" => false,
286 "note" => "Tester Number 6",
287 "pleroma" => %{"actor_type" => "Person", "discoverable" => false},
290 "statuses_count" => 1,
291 "url" => "http://localhost:4001/users/nick6",
292 "username" => "nick6"
294 "application" => %{"name" => "Web", "website" => nil},
295 "bookmarked" => false,
297 "content" => "foobar",
298 "created_at" => "2020-04-07T19:48:51.000Z",
300 "favourited" => false,
301 "favourites_count" => 0,
302 "id" => "9toJCu5YZW7O7gfvH6",
303 "in_reply_to_account_id" => nil,
304 "in_reply_to_id" => nil,
306 "media_attachments" => [],
311 "content" => %{"text/plain" => "foobar"},
312 "conversation_id" => 345_972,
313 "direct_conversation_id" => nil,
314 "emoji_reactions" => [],
316 "in_reply_to_account_acct" => nil,
318 "spoiler_text" => %{"text/plain" => ""},
319 "thread_muted" => false
323 "reblogged" => false,
324 "reblogs_count" => 0,
325 "replies_count" => 0,
326 "sensitive" => false,
327 "spoiler_text" => "",
329 "uri" => "http://localhost:4001/objects/0f5dad44-0e9e-4610-b377-a2631e499190",
330 "url" => "http://localhost:4001/notice/9toJCu5YZW7O7gfvH6",
331 "visibility" => "private"