+ parameters: [%Reference{"$ref": "#/components/parameters/accountIdOrNickname"}],
+ responses: %{
+ 200 => Operation.response("Account", "application/json", Account)
+ }
+ }
+ end
+
+ def statuses_operation do
+ %Operation{
+ tags: ["accounts"],
+ summary: "Statuses",
+ operationId: "AccountController.statuses",
+ description:
+ "Statuses posted to the given account. Public (for public statuses only), or user token + `read:statuses` (for private statuses the user is authorized to see)",
+ parameters: [
+ %Reference{"$ref": "#/components/parameters/accountIdOrNickname"},
+ Operation.parameter(:pinned, :query, BooleanLike, "Pinned"),
+ Operation.parameter(:tagged, :query, :string, "With tag"),
+ Operation.parameter(:only_media, :query, BooleanLike, "Only meadia"),
+ Operation.parameter(:with_muted, :query, BooleanLike, "With muted"),
+ Operation.parameter(:exclude_reblogs, :query, BooleanLike, "Exclude reblobs"),
+ Operation.parameter(
+ :exclude_visibilities,
+ :query,
+ %Schema{type: :array, items: VisibilityScope},
+ "Exclude visibilities"
+ ),
+ Operation.parameter(:max_id, :query, :string, "Max ID"),
+ Operation.parameter(:min_id, :query, :string, "Mix ID"),
+ Operation.parameter(:since_id, :query, :string, "Since ID"),
+ Operation.parameter(
+ :limit,
+ :query,
+ %Schema{type: :integer, default: 20, maximum: 40},
+ "Limit"
+ )
+ ],
+ responses: %{
+ 200 => Operation.response("Statuses", "application/json", StatusesResponse)
+ }
+ }
+ end
+
+ def followers_operation do
+ %Operation{
+ tags: ["accounts"],
+ summary: "Followers",
+ operationId: "AccountController.followers",
+ security: [%{"oAuth" => ["read:accounts"]}],
+ description:
+ "Accounts which follow the given account, if network is not hidden by the account owner.",
+ parameters: [
+ %Reference{"$ref": "#/components/parameters/accountIdOrNickname"},
+ Operation.parameter(:max_id, :query, :string, "Max ID"),
+ Operation.parameter(:min_id, :query, :string, "Mix ID"),
+ Operation.parameter(:since_id, :query, :string, "Since ID"),
+ Operation.parameter(
+ :limit,
+ :query,
+ %Schema{type: :integer, default: 20, maximum: 40},
+ "Limit"
+ )
+ ],
+ responses: %{
+ 200 => Operation.response("Accounts", "application/json", AccountsResponse)
+ }
+ }
+ end
+
+ def following_operation do
+ %Operation{
+ tags: ["accounts"],
+ summary: "Following",
+ operationId: "AccountController.following",
+ security: [%{"oAuth" => ["read:accounts"]}],
+ description:
+ "Accounts which the given account is following, if network is not hidden by the account owner.",
+ parameters: [
+ %Reference{"$ref": "#/components/parameters/accountIdOrNickname"},
+ Operation.parameter(:max_id, :query, :string, "Max ID"),
+ Operation.parameter(:min_id, :query, :string, "Mix ID"),
+ Operation.parameter(:since_id, :query, :string, "Since ID"),
+ Operation.parameter(
+ :limit,
+ :query,
+ %Schema{type: :integer, default: 20, maximum: 40},
+ "Limit"
+ )
+ ],
+ responses: %{200 => Operation.response("Accounts", "application/json", AccountsResponse)}
+ }
+ end
+
+ def lists_operation do
+ %Operation{
+ tags: ["accounts"],
+ summary: "Lists containing this account",
+ operationId: "AccountController.lists",
+ security: [%{"oAuth" => ["read:lists"]}],
+ description: "User lists that you have added this account to.",
+ parameters: [%Reference{"$ref": "#/components/parameters/accountIdOrNickname"}],
+ responses: %{200 => Operation.response("Lists", "application/json", ListsResponse)}
+ }
+ end
+
+ def follow_operation do
+ %Operation{
+ tags: ["accounts"],
+ summary: "Follow",
+ operationId: "AccountController.follow",
+ security: [%{"oAuth" => ["follow", "write:follows"]}],
+ description: "Follow the given account",
+ parameters: [
+ %Reference{"$ref": "#/components/parameters/accountIdOrNickname"},
+ Operation.parameter(
+ :reblogs,
+ :query,
+ BooleanLike,
+ "Receive this account's reblogs in home timeline? Defaults to true."
+ )
+ ],
+ responses: %{
+ 200 => Operation.response("Relationship", "application/json", AccountRelationship)
+ }
+ }
+ end
+
+ def unfollow_operation do
+ %Operation{
+ tags: ["accounts"],
+ summary: "Unfollow",
+ operationId: "AccountController.unfollow",
+ security: [%{"oAuth" => ["follow", "write:follows"]}],
+ description: "Unfollow the given account",
+ parameters: [%Reference{"$ref": "#/components/parameters/accountIdOrNickname"}],
+ responses: %{
+ 200 => Operation.response("Relationship", "application/json", AccountRelationship)
+ }
+ }
+ end
+
+ def mute_operation do
+ %Operation{
+ tags: ["accounts"],
+ summary: "Mute",
+ operationId: "AccountController.mute",
+ security: [%{"oAuth" => ["follow", "write:mutes"]}],
+ requestBody: Helpers.request_body("Parameters", AccountMuteRequest),
+ description:
+ "Mute the given account. Clients should filter statuses and notifications from this account, if received (e.g. due to a boost in the Home timeline).",