logo

pleroma

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

conversation.ex (1222B)


  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.Conversation do
  5. alias OpenApiSpex.Schema
  6. alias Pleroma.Web.ApiSpec.Schemas.Account
  7. alias Pleroma.Web.ApiSpec.Schemas.Status
  8. require OpenApiSpex
  9. OpenApiSpex.schema(%{
  10. title: "Conversation",
  11. description: "Represents a conversation with \"direct message\" visibility.",
  12. type: :object,
  13. required: [:id, :accounts, :unread],
  14. properties: %{
  15. id: %Schema{type: :string},
  16. accounts: %Schema{
  17. type: :array,
  18. items: Account,
  19. description: "Participants in the conversation"
  20. },
  21. unread: %Schema{
  22. type: :boolean,
  23. description: "Is the conversation currently marked as unread?"
  24. },
  25. # last_status: Status
  26. last_status: %Schema{
  27. allOf: [Status],
  28. description: "The last status in the conversation, to be used for optional display"
  29. }
  30. },
  31. example: %{
  32. "id" => "418450",
  33. "unread" => true,
  34. "accounts" => [Account.schema().example],
  35. "last_status" => Status.schema().example
  36. }
  37. })
  38. end