Schemas: Refactor to our naming scheme.
[akkoma] / lib / pleroma / web / api_spec / schemas / chat.ex
1 # Pleroma: A lightweight social networking server
2 # Copyright © 2017-2020 Pleroma Authors <https://pleroma.social/>
3 # SPDX-License-Identifier: AGPL-3.0-only
4
5 defmodule Pleroma.Web.ApiSpec.Schemas.Chat do
6 alias OpenApiSpex.Schema
7
8 require OpenApiSpex
9
10 OpenApiSpex.schema(%{
11 title: "Chat",
12 description: "Response schema for a Chat",
13 type: :object,
14 properties: %{
15 id: %Schema{type: :string, nullable: false},
16 account: %Schema{type: :object, nullable: false},
17 unread: %Schema{type: :integer, nullable: false}
18 },
19 example: %{
20 "account" => %{
21 "pleroma" => %{
22 "is_admin" => false,
23 "confirmation_pending" => false,
24 "hide_followers_count" => false,
25 "is_moderator" => false,
26 "hide_favorites" => true,
27 "ap_id" => "https://dontbulling.me/users/lain",
28 "hide_follows_count" => false,
29 "hide_follows" => false,
30 "background_image" => nil,
31 "skip_thread_containment" => false,
32 "hide_followers" => false,
33 "relationship" => %{},
34 "tags" => []
35 },
36 "avatar" =>
37 "https://dontbulling.me/media/065a4dd3c6740dab13ff9c71ec7d240bb9f8be9205c9e7467fb2202117da1e32.jpg",
38 "following_count" => 0,
39 "header_static" => "https://originalpatchou.li/images/banner.png",
40 "source" => %{
41 "sensitive" => false,
42 "note" => "lain",
43 "pleroma" => %{
44 "discoverable" => false,
45 "actor_type" => "Person"
46 },
47 "fields" => []
48 },
49 "statuses_count" => 1,
50 "locked" => false,
51 "created_at" => "2020-04-16T13:40:15.000Z",
52 "display_name" => "lain",
53 "fields" => [],
54 "acct" => "lain@dontbulling.me",
55 "id" => "9u6Qw6TAZANpqokMkK",
56 "emojis" => [],
57 "avatar_static" =>
58 "https://dontbulling.me/media/065a4dd3c6740dab13ff9c71ec7d240bb9f8be9205c9e7467fb2202117da1e32.jpg",
59 "username" => "lain",
60 "followers_count" => 0,
61 "header" => "https://originalpatchou.li/images/banner.png",
62 "bot" => false,
63 "note" => "lain",
64 "url" => "https://dontbulling.me/users/lain"
65 },
66 "id" => "1",
67 "unread" => 2
68 }
69 })
70 end