move to 2.5.5
[anni] / lib / pleroma / web / api_spec / schemas / announcement.ex
1 # Pleroma: A lightweight social networking server
2 # Copyright © 2017-2022 Pleroma Authors <https://pleroma.social/>
3 # SPDX-License-Identifier: AGPL-3.0-only
4
5 defmodule Pleroma.Web.ApiSpec.Schemas.Announcement do
6   alias OpenApiSpex.Schema
7   alias Pleroma.Web.ApiSpec.Schemas.FlakeID
8
9   require OpenApiSpex
10
11   OpenApiSpex.schema(%{
12     title: "Announcement",
13     description: "Response schema for an announcement",
14     type: :object,
15     properties: %{
16       id: FlakeID,
17       content: %Schema{type: :string},
18       starts_at: %Schema{
19         type: :string,
20         format: "date-time",
21         nullable: true
22       },
23       ends_at: %Schema{
24         type: :string,
25         format: "date-time",
26         nullable: true
27       },
28       all_day: %Schema{type: :boolean},
29       published_at: %Schema{type: :string, format: "date-time"},
30       updated_at: %Schema{type: :string, format: "date-time"},
31       read: %Schema{type: :boolean},
32       mentions: %Schema{type: :array},
33       statuses: %Schema{type: :array},
34       tags: %Schema{type: :array},
35       emojis: %Schema{type: :array},
36       reactions: %Schema{type: :array},
37       pleroma: %Schema{
38         type: :object,
39         properties: %{
40           raw_content: %Schema{type: :string}
41         }
42       }
43     }
44   })
45 end