f0bc4ee3c6f84c9ea768c351c985b6ecc6ef43a6
[akkoma] / lib / pleroma / web / api_spec / schemas / scheduled_status.ex
1 # Pleroma: A lightweight social networking server
2 # Copyright © 2017-2020 Pleroma Authors <https://pleroma.social/>
3 # SPDX-License-Identifier: AGPL-3.0-only
4
5 defmodule Pleroma.Web.ApiSpec.Schemas.ScheduledStatus do
6 alias OpenApiSpex.Schema
7 alias Pleroma.Web.ApiSpec.Schemas.VisibilityScope
8 alias Pleroma.Web.ApiSpec.Schemas.Poll
9
10 require OpenApiSpex
11
12 OpenApiSpex.schema(%{
13 title: "ScheduledStatus",
14 description: "Represents a status that will be published at a future scheduled date.",
15 type: :object,
16 required: [:id, :scheduled_at, :params],
17 properties: %{
18 id: %Schema{type: :string},
19 scheduled_at: %Schema{type: :string, format: :"date-time"},
20 media_attachments: %Schema{type: :array, format: :"date-time"},
21 params: %Schema{
22 type: :object,
23 required: [:text, :visibility],
24 properties: %{
25 text: %Schema{type: :string, nullable: true},
26 media_ids: %Schema{type: :array, nullable: true, items: %Schema{type: :string}},
27 sensitive: %Schema{type: :boolean, nullable: true},
28 spoiler_text: %Schema{type: :string, nullable: true},
29 visibility: %Schema{type: VisibilityScope, nullable: true},
30 scheduled_at: %Schema{type: :string, format: :"date-time", nullable: true},
31 poll: %Schema{type: Poll, nullable: true},
32 in_reply_to_id: %Schema{type: :string, nullable: true}
33 }
34 }
35 },
36 example: %{
37 id: "3221",
38 scheduled_at: "2019-12-05T12:33:01.000Z",
39 params: %{
40 text: "test content",
41 media_ids: nil,
42 sensitive: nil,
43 spoiler_text: nil,
44 visibility: nil,
45 scheduled_at: nil,
46 poll: nil,
47 idempotency: nil,
48 in_reply_to_id: nil
49 },
50 media_attachments: []
51 }
52 })
53 end