9085f1af1b2ab460ba59d5eddd4e761d3d7e85ef
[akkoma] / lib / pleroma / web / api_spec / operations / account_operation.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.AccountOperation do
6 alias OpenApiSpex.Operation
7 alias Pleroma.Web.ApiSpec.Schemas.AccountCreateRequest
8 alias Pleroma.Web.ApiSpec.Schemas.AccountCreateResponse
9 alias Pleroma.Web.ApiSpec.Helpers
10
11 @spec open_api_operation(atom) :: Operation.t()
12 def open_api_operation(action) do
13 operation = String.to_existing_atom("#{action}_operation")
14 apply(__MODULE__, operation, [])
15 end
16
17 @spec create_operation() :: Operation.t()
18 def create_operation do
19 %Operation{
20 tags: ["accounts"],
21 summary: "Register an account",
22 description:
23 "Creates a user and account records. Returns an account access token for the app that initiated the request. The app should save this token for later, and should wait for the user to confirm their account by clicking a link in their email inbox.",
24 operationId: "AccountController.create",
25 requestBody: Helpers.request_body("Parameters", AccountCreateRequest, required: true),
26 responses: %{
27 200 => Operation.response("Account", "application/json", AccountCreateResponse)
28 }
29 }
30 end
31
32 def verify_credentials_operation do
33 :ok
34 end
35
36 def update_credentials_operation do
37 :ok
38 end
39
40 def relationships_operation do
41 :ok
42 end
43
44 def show_operation do
45 :ok
46 end
47
48 def statuses_operation do
49 :ok
50 end
51
52 def followers_operation do
53 :ok
54 end
55
56 def following_operation, do: :ok
57 def lists_operation, do: :ok
58 def follow_operation, do: :ok
59 def unfollow_operation, do: :ok
60 def mute_operation, do: :ok
61 def unmute_operation, do: :ok
62 def block_operation, do: :ok
63 def unblock_operation, do: :ok
64 def follows_operation, do: :ok
65 def mutes_operation, do: :ok
66 def blocks_operation, do: :ok
67 def endorsements_operation, do: :ok
68 end