summaryrefslogtreecommitdiff
path: root/lib/pleroma/web/api_spec/schemas/account_relationship.ex
blob: 5d9e3b56e3310f2893fb784cc2921d9c4aacfdce (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
# Pleroma: A lightweight social networking server
# Copyright © 2017-2021 Pleroma Authors <https://pleroma.social/>
# SPDX-License-Identifier: AGPL-3.0-only

defmodule Pleroma.Web.ApiSpec.Schemas.AccountRelationship do
  alias OpenApiSpex.Schema
  alias Pleroma.Web.ApiSpec.Schemas.FlakeID

  require OpenApiSpex

  OpenApiSpex.schema(%{
    title: "AccountRelationship",
    description: "Relationship between current account and requested account",
    type: :object,
    properties: %{
      blocked_by: %Schema{type: :boolean},
      blocking: %Schema{type: :boolean},
      domain_blocking: %Schema{type: :boolean},
      endorsed: %Schema{type: :boolean},
      followed_by: %Schema{type: :boolean},
      following: %Schema{type: :boolean},
      id: FlakeID,
      muting: %Schema{type: :boolean},
      muting_notifications: %Schema{type: :boolean},
      note: %Schema{type: :string},
      requested: %Schema{type: :boolean},
      showing_reblogs: %Schema{type: :boolean},
      subscribing: %Schema{type: :boolean},
      notifying: %Schema{type: :boolean}
    },
    example: %{
      "blocked_by" => false,
      "blocking" => false,
      "domain_blocking" => false,
      "endorsed" => false,
      "followed_by" => false,
      "following" => false,
      "id" => "9tKi3esbG7OQgZ2920",
      "muting" => false,
      "muting_notifications" => false,
      "note" => "",
      "requested" => false,
      "showing_reblogs" => true,
      "subscribing" => false,
      "notifying" => false
    }
  })
end