2020-04-21 09:51:06 -06:00
|
|
|
# Pleroma: A lightweight social networking server
|
2023-01-02 13:38:50 -07:00
|
|
|
# Copyright © 2017-2022 Pleroma Authors <https://pleroma.social/>
|
2020-04-21 09:51:06 -06:00
|
|
|
# SPDX-License-Identifier: AGPL-3.0-only
|
|
|
|
|
2020-05-04 03:08:00 -06:00
|
|
|
defmodule Pleroma.Web.ApiSpec.Schemas.Chat do
|
2020-04-21 09:51:06 -06:00
|
|
|
alias OpenApiSpex.Schema
|
2020-05-10 05:08:01 -06:00
|
|
|
alias Pleroma.Web.ApiSpec.Schemas.ChatMessage
|
2020-04-21 09:51:06 -06:00
|
|
|
|
|
|
|
require OpenApiSpex
|
|
|
|
|
|
|
|
OpenApiSpex.schema(%{
|
2020-05-04 03:08:00 -06:00
|
|
|
title: "Chat",
|
2020-04-21 09:51:06 -06:00
|
|
|
description: "Response schema for a Chat",
|
|
|
|
type: :object,
|
|
|
|
properties: %{
|
2020-05-10 05:08:01 -06:00
|
|
|
id: %Schema{type: :string},
|
|
|
|
account: %Schema{type: :object},
|
|
|
|
unread: %Schema{type: :integer},
|
2020-05-15 05:18:41 -06:00
|
|
|
last_message: ChatMessage,
|
|
|
|
updated_at: %Schema{type: :string, format: :"date-time"}
|
2020-04-21 09:51:06 -06:00
|
|
|
},
|
|
|
|
example: %{
|
2020-04-27 09:48:34 -06:00
|
|
|
"account" => %{
|
2020-04-21 09:51:06 -06:00
|
|
|
"pleroma" => %{
|
|
|
|
"is_admin" => false,
|
2020-10-13 13:29:34 -06:00
|
|
|
"is_confirmed" => true,
|
2020-04-21 09:51:06 -06:00
|
|
|
"hide_followers_count" => false,
|
|
|
|
"is_moderator" => false,
|
|
|
|
"hide_favorites" => true,
|
|
|
|
"ap_id" => "https://dontbulling.me/users/lain",
|
|
|
|
"hide_follows_count" => false,
|
|
|
|
"hide_follows" => false,
|
|
|
|
"background_image" => nil,
|
|
|
|
"skip_thread_containment" => false,
|
|
|
|
"hide_followers" => false,
|
|
|
|
"relationship" => %{},
|
|
|
|
"tags" => []
|
|
|
|
},
|
|
|
|
"avatar" =>
|
|
|
|
"https://dontbulling.me/media/065a4dd3c6740dab13ff9c71ec7d240bb9f8be9205c9e7467fb2202117da1e32.jpg",
|
|
|
|
"following_count" => 0,
|
|
|
|
"header_static" => "https://originalpatchou.li/images/banner.png",
|
|
|
|
"source" => %{
|
|
|
|
"sensitive" => false,
|
|
|
|
"note" => "lain",
|
|
|
|
"pleroma" => %{
|
|
|
|
"discoverable" => false,
|
|
|
|
"actor_type" => "Person"
|
|
|
|
},
|
|
|
|
"fields" => []
|
|
|
|
},
|
|
|
|
"statuses_count" => 1,
|
2020-10-13 08:31:13 -06:00
|
|
|
"is_locked" => false,
|
2020-04-21 09:51:06 -06:00
|
|
|
"created_at" => "2020-04-16T13:40:15.000Z",
|
|
|
|
"display_name" => "lain",
|
|
|
|
"fields" => [],
|
|
|
|
"acct" => "lain@dontbulling.me",
|
|
|
|
"id" => "9u6Qw6TAZANpqokMkK",
|
|
|
|
"emojis" => [],
|
|
|
|
"avatar_static" =>
|
|
|
|
"https://dontbulling.me/media/065a4dd3c6740dab13ff9c71ec7d240bb9f8be9205c9e7467fb2202117da1e32.jpg",
|
|
|
|
"username" => "lain",
|
|
|
|
"followers_count" => 0,
|
|
|
|
"header" => "https://originalpatchou.li/images/banner.png",
|
|
|
|
"bot" => false,
|
|
|
|
"note" => "lain",
|
|
|
|
"url" => "https://dontbulling.me/users/lain"
|
|
|
|
},
|
|
|
|
"id" => "1",
|
2020-05-10 05:08:01 -06:00
|
|
|
"unread" => 2,
|
2020-05-15 05:18:41 -06:00
|
|
|
"last_message" => ChatMessage.schema().example(),
|
|
|
|
"updated_at" => "2020-04-21T15:06:45.000Z"
|
2020-04-21 09:51:06 -06:00
|
|
|
}
|
|
|
|
})
|
|
|
|
end
|