Retrieve user's reports

master
Milton Mazzarri 2017-04-10 21:45:45 -05:00
parent ddf464fb72
commit 9893753462
No known key found for this signature in database
GPG Key ID: CF3DE6E356E17F1E
1 changed files with 37 additions and 0 deletions

View File

@ -11,5 +11,42 @@ defmodule Hunter.Report do
* `action_taken` - The action taken in response to the report
"""
@hunter_api Application.get_env(:hunter, :hunter_api)
@type t :: %__MODULE__{
id: non_neg_integer,
action_taken: String.t
}
@derive [Poison.Encoder]
defstruct [:id, :action_taken]
@doc """
Retrieve a user's reports
## Parameters
* `conn` - connection credentials
"""
@spec reports(Hunter.Client.t) :: [Hunter.Report.t]
def reports(conn) do
@hunter_api.reports(conn)
end
@doc """
Report a user
## Parameters
* `conn` - connection credentials
* `account_id` - the ID of the account to report
* `status_ids` - the IDs of statuses to report
* `comment` - a comment to associate with the report
"""
@spec report(Hunter.Client.t, non_neg_integer, [non_neg_integer], String.t) :: Hunter.Report.t
def report(conn, account_id, status_ids, comment) do
@hunter_api.report(conn, account_id, status_ids, comment)
end
end