Include new attributes in some Entities
parent
605a062c86
commit
f578833eef
|
@ -7,7 +7,7 @@ defmodule Hunter.Account do
|
|||
|
||||
## Fields
|
||||
|
||||
* `id` - the account id
|
||||
* `id` - the id of the account
|
||||
* `username` - the username of the account
|
||||
* `acct` - equals `username` for local users, includes `@domain` for remote ones
|
||||
* `display_name` - the account's display name
|
||||
|
@ -142,6 +142,11 @@ defmodule Hunter.Account do
|
|||
* `since_id` - get a list of followers with id greater than this value
|
||||
* `limit` - maximum number of followers to get, default: 40, maximum: 80
|
||||
|
||||
**Note:** `max_id` and `since_id` for next and previous pages are provided in
|
||||
the `Link` header. It is **not** possible to use the `id` of the returned
|
||||
objects to construct your own URLs, because the results are sorted by an
|
||||
internal key.
|
||||
|
||||
"""
|
||||
@spec followers(Hunter.Client.t(), non_neg_integer, Keyword.t()) :: [Hunter.Account.t()]
|
||||
def followers(conn, id, options \\ []) do
|
||||
|
@ -163,6 +168,11 @@ defmodule Hunter.Account do
|
|||
* `since_id` - get a list of followings with id greater than this value
|
||||
* `limit` - maximum number of followings to get, default: 40, maximum: 80
|
||||
|
||||
**Note:** `max_id` and `since_id` for next and previous pages are provided in
|
||||
the `Link` header. It is **not** possible to use the `id` of the returned
|
||||
objects to construct your own URLs, because the results are sorted by an
|
||||
internal key.
|
||||
|
||||
"""
|
||||
@spec following(Hunter.Client.t(), non_neg_integer, Keyword.t()) :: [Hunter.Account.t()]
|
||||
def following(conn, id, options \\ []) do
|
||||
|
|
|
@ -8,12 +8,14 @@ defmodule Hunter.Attachment do
|
|||
## Fields
|
||||
|
||||
* `id` - ID of the attachment
|
||||
* `type` - One of: "image", "video", "gifv"
|
||||
* `type` - One of: "image", "video", "gifv", "unknown"
|
||||
* `url` - URL of the locally hosted version of the image
|
||||
* `remote_url` - For remote images, the remote URL of the original image
|
||||
* `preview_url` - URL of the preview image
|
||||
* `text_url` - Shorter URL for the image, for insertion into text (only present on local images)
|
||||
* `meta` - Specifies `width`, `height`, `size` (width x height), `aspect`
|
||||
* `meta` - `small` and `original` containing: `width`, `height`, `size`, `aspect`
|
||||
|
||||
**Note**: When the type is "unknown", it is likely only `remote_url` is available and local `url` is missing
|
||||
|
||||
"""
|
||||
@hunter_api Hunter.Config.hunter_api()
|
||||
|
|
|
@ -7,10 +7,10 @@ defmodule Hunter.Card do
|
|||
|
||||
## Fields
|
||||
|
||||
* `url`- The url associated with the card
|
||||
* `title` - The title of the card
|
||||
* `description` - The card description
|
||||
* `image` - The image associated with the card, if any
|
||||
* `url`- the url associated with the card
|
||||
* `title` - the title of the card
|
||||
* `description` - the card description
|
||||
* `image` - the image associated with the card, if any
|
||||
* `type` - `link`, `photo`, `video`, or `rich`
|
||||
* `author_name` - name of the author/owner of the resource
|
||||
* `author_url` - URL for the author/owner of the resource
|
||||
|
|
|
@ -12,6 +12,7 @@ defmodule Hunter.Instance do
|
|||
* `description` - A description for the instance
|
||||
* `email` - An email address which can be used to contact the instance administrator
|
||||
* `version` - The Mastodon version used by instance.
|
||||
* `urls` - `streaming_api`
|
||||
|
||||
"""
|
||||
@hunter_api Hunter.Config.hunter_api()
|
||||
|
@ -21,11 +22,12 @@ defmodule Hunter.Instance do
|
|||
title: String.t(),
|
||||
description: String.t(),
|
||||
email: String.t(),
|
||||
version: String.t()
|
||||
version: String.t(),
|
||||
urls: String.t()
|
||||
}
|
||||
|
||||
@derive [Poison.Encoder]
|
||||
defstruct [:uri, :title, :description, :email, :version]
|
||||
defstruct [:uri, :title, :description, :email, :version, :urls]
|
||||
|
||||
@doc """
|
||||
Retrieve instance information
|
||||
|
|
|
@ -17,6 +17,7 @@ defmodule Hunter.Status do
|
|||
* `favourites_count` - number of favourites for the status
|
||||
* `reblogged` - whether the authenticated user has reblogged the status
|
||||
* `favourited` - whether the authenticated user has favourited the status
|
||||
* `muted` - whether the authenticated user has muted the conversation this status from
|
||||
* `sensitive` - whether media attachments should be hidden by default
|
||||
* `spoiler_text` - if not empty, warning text that should be displayed before the actual content
|
||||
* `visibility` - one of: `public`, `unlisted`, `private`, `direct`
|
||||
|
@ -26,6 +27,8 @@ defmodule Hunter.Status do
|
|||
* `application` - `Hunter.Application` from which the status was posted
|
||||
* `language` - detected language for the status, default: en
|
||||
|
||||
**NOTE**: When `spoiler_text` is present, `sensitive` is true
|
||||
|
||||
"""
|
||||
@hunter_api Hunter.Config.hunter_api()
|
||||
|
||||
|
@ -42,6 +45,7 @@ defmodule Hunter.Status do
|
|||
favourites_count: non_neg_integer,
|
||||
reblogged: boolean,
|
||||
favourited: boolean,
|
||||
muted: boolean,
|
||||
sensitive: boolean,
|
||||
spoiler_text: String.t(),
|
||||
media_attachments: [Hunter.Attachment.t()],
|
||||
|
@ -68,6 +72,7 @@ defmodule Hunter.Status do
|
|||
:favourites_count,
|
||||
:reblogged,
|
||||
:favourited,
|
||||
:muted,
|
||||
:sensitive,
|
||||
:spoiler_text,
|
||||
:visibility,
|
||||
|
|
Loading…
Reference in New Issue