Merge branch 'feat/client_app_details' into 'develop'
[akkoma] / lib / pleroma / web / api_spec / schemas / scheduled_status.ex
1 # Pleroma: A lightweight social networking server
2 # Copyright © 2017-2021 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.Attachment
8 alias Pleroma.Web.ApiSpec.Schemas.VisibilityScope
9 alias Pleroma.Web.ApiSpec.StatusOperation
10
11 require OpenApiSpex
12
13 OpenApiSpex.schema(%{
14 title: "ScheduledStatus",
15 description: "Represents a status that will be published at a future scheduled date.",
16 type: :object,
17 required: [:id, :scheduled_at, :params],
18 properties: %{
19 id: %Schema{type: :string},
20 scheduled_at: %Schema{type: :string, format: :"date-time"},
21 media_attachments: %Schema{type: :array, items: Attachment},
22 params: %Schema{
23 type: :object,
24 required: [:text, :visibility],
25 properties: %{
26 text: %Schema{type: :string, nullable: true},
27 media_ids: %Schema{type: :array, nullable: true, items: %Schema{type: :string}},
28 sensitive: %Schema{type: :boolean, nullable: true},
29 spoiler_text: %Schema{type: :string, nullable: true},
30 visibility: %Schema{allOf: [VisibilityScope], nullable: true},
31 scheduled_at: %Schema{type: :string, format: :"date-time", nullable: true},
32 poll: StatusOperation.poll_params(),
33 in_reply_to_id: %Schema{type: :string, nullable: true},
34 expires_in: %Schema{type: :integer, nullable: true}
35 }
36 }
37 },
38 example: %{
39 id: "3221",
40 scheduled_at: "2019-12-05T12:33:01.000Z",
41 params: %{
42 text: "test content",
43 media_ids: nil,
44 sensitive: nil,
45 spoiler_text: nil,
46 visibility: nil,
47 scheduled_at: nil,
48 poll: nil,
49 idempotency: nil,
50 in_reply_to_id: nil,
51 expires_in: nil
52 },
53 media_attachments: [Attachment.schema().example]
54 }
55 })
56 end