2020-05-05 13:19:16 -06:00
|
|
|
# Pleroma: A lightweight social networking server
|
2021-01-12 23:49:20 -07:00
|
|
|
# Copyright © 2017-2021 Pleroma Authors <https://pleroma.social/>
|
2020-05-05 13:19:16 -06:00
|
|
|
# SPDX-License-Identifier: AGPL-3.0-only
|
|
|
|
|
|
|
|
defmodule Pleroma.Web.ApiSpec.Schemas.ScheduledStatus do
|
|
|
|
alias OpenApiSpex.Schema
|
2020-05-05 13:42:18 -06:00
|
|
|
alias Pleroma.Web.ApiSpec.Schemas.Attachment
|
|
|
|
alias Pleroma.Web.ApiSpec.Schemas.VisibilityScope
|
2021-02-01 08:22:26 -07:00
|
|
|
alias Pleroma.Web.ApiSpec.StatusOperation
|
2020-05-05 13:19:16 -06:00
|
|
|
|
|
|
|
require OpenApiSpex
|
|
|
|
|
|
|
|
OpenApiSpex.schema(%{
|
|
|
|
title: "ScheduledStatus",
|
|
|
|
description: "Represents a status that will be published at a future scheduled date.",
|
|
|
|
type: :object,
|
|
|
|
required: [:id, :scheduled_at, :params],
|
|
|
|
properties: %{
|
|
|
|
id: %Schema{type: :string},
|
|
|
|
scheduled_at: %Schema{type: :string, format: :"date-time"},
|
2020-05-05 13:42:18 -06:00
|
|
|
media_attachments: %Schema{type: :array, items: Attachment},
|
2020-05-05 13:19:16 -06:00
|
|
|
params: %Schema{
|
|
|
|
type: :object,
|
|
|
|
required: [:text, :visibility],
|
|
|
|
properties: %{
|
|
|
|
text: %Schema{type: :string, nullable: true},
|
|
|
|
media_ids: %Schema{type: :array, nullable: true, items: %Schema{type: :string}},
|
|
|
|
sensitive: %Schema{type: :boolean, nullable: true},
|
|
|
|
spoiler_text: %Schema{type: :string, nullable: true},
|
2020-09-18 15:50:00 -06:00
|
|
|
visibility: %Schema{allOf: [VisibilityScope], nullable: true},
|
2020-05-05 13:19:16 -06:00
|
|
|
scheduled_at: %Schema{type: :string, format: :"date-time", nullable: true},
|
2021-02-01 08:22:26 -07:00
|
|
|
poll: StatusOperation.poll_params(),
|
2021-02-11 03:01:48 -07:00
|
|
|
in_reply_to_id: %Schema{type: :string, nullable: true},
|
|
|
|
expires_in: %Schema{type: :integer, nullable: true}
|
2020-05-05 13:19:16 -06:00
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
example: %{
|
|
|
|
id: "3221",
|
|
|
|
scheduled_at: "2019-12-05T12:33:01.000Z",
|
|
|
|
params: %{
|
|
|
|
text: "test content",
|
|
|
|
media_ids: nil,
|
|
|
|
sensitive: nil,
|
|
|
|
spoiler_text: nil,
|
|
|
|
visibility: nil,
|
|
|
|
scheduled_at: nil,
|
|
|
|
poll: nil,
|
|
|
|
idempotency: nil,
|
2021-02-11 03:01:48 -07:00
|
|
|
in_reply_to_id: nil,
|
|
|
|
expires_in: nil
|
2020-05-05 13:19:16 -06:00
|
|
|
},
|
2020-05-05 13:42:18 -06:00
|
|
|
media_attachments: [Attachment.schema().example]
|
2020-05-05 13:19:16 -06:00
|
|
|
}
|
|
|
|
})
|
|
|
|
end
|