logo

pleroma

My custom branche(s) on git.pleroma.social/pleroma/pleroma git clone https://hacktivis.me/git/pleroma.git

scheduled_status.ex (1979B)


  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. defmodule Pleroma.Web.ApiSpec.Schemas.ScheduledStatus do
  5. alias OpenApiSpex.Schema
  6. alias Pleroma.Web.ApiSpec.Schemas.Attachment
  7. alias Pleroma.Web.ApiSpec.Schemas.VisibilityScope
  8. alias Pleroma.Web.ApiSpec.StatusOperation
  9. require OpenApiSpex
  10. OpenApiSpex.schema(%{
  11. title: "ScheduledStatus",
  12. description: "Represents a status that will be published at a future scheduled date.",
  13. type: :object,
  14. required: [:id, :scheduled_at, :params],
  15. properties: %{
  16. id: %Schema{type: :string},
  17. scheduled_at: %Schema{type: :string, format: :"date-time"},
  18. media_attachments: %Schema{type: :array, items: Attachment},
  19. params: %Schema{
  20. type: :object,
  21. required: [:text, :visibility],
  22. properties: %{
  23. text: %Schema{type: :string, nullable: true},
  24. media_ids: %Schema{type: :array, nullable: true, items: %Schema{type: :string}},
  25. sensitive: %Schema{type: :boolean, nullable: true},
  26. spoiler_text: %Schema{type: :string, nullable: true},
  27. visibility: %Schema{allOf: [VisibilityScope], nullable: true},
  28. scheduled_at: %Schema{type: :string, format: :"date-time", nullable: true},
  29. poll: StatusOperation.poll_params(),
  30. in_reply_to_id: %Schema{type: :string, nullable: true},
  31. expires_in: %Schema{type: :integer, nullable: true}
  32. }
  33. }
  34. },
  35. example: %{
  36. id: "3221",
  37. scheduled_at: "2019-12-05T12:33:01.000Z",
  38. params: %{
  39. text: "test content",
  40. media_ids: nil,
  41. sensitive: nil,
  42. spoiler_text: nil,
  43. visibility: nil,
  44. scheduled_at: nil,
  45. poll: nil,
  46. idempotency: nil,
  47. in_reply_to_id: nil,
  48. expires_in: nil
  49. },
  50. media_attachments: [Attachment.schema().example]
  51. }
  52. })
  53. end