Accounts
public struct Accounts
Undocumented
-
Fetches an account.
Parameters
id
The account id.
Return Value
Request for
Account
. -
Gets the current user.
Return Value
Request for
Account
. -
Updates the current user.
Declaration
Swift
public static func updateCurrentUser(displayName: String? = nil, note: String? = nil, avatar: MediaAttachment? = nil, header: MediaAttachment? = nil) -> Request<Account>
Parameters
displayName
The name to display in the user’s profile.
note
A new biography for the user.
avatar
The media attachment to display as the user’s avatar.
header
The media attachment to display as the user’s header image.
Return Value
Request for
Account
. -
Gets an account’s followers.
Declaration
Swift
public static func followers(id: String, range: RequestRange = .default) -> Request<[Account]>
Parameters
id
The account id.
range
The bounds used when requesting data from Mastodon.
Return Value
Request for
[Account]
. -
Gets who account is following.
Declaration
Swift
public static func following(id: String, range: RequestRange = .default) -> Request<[Account]>
Parameters
id
The account id
range
The bounds used when requesting data from Mastodon.
Return Value
Request for
[Account]
. -
Gets an account’s statuses.
Declaration
Swift
public static func statuses(id: String, mediaOnly: Bool? = nil, pinnedOnly: Bool? = nil, excludeReplies: Bool? = nil, range: RequestRange = .default) -> Request<[Status]>
Parameters
id
The account id.
mediaOnly
Only return statuses that have media attachments.
pinnedOnly
Only return statuses that have been pinned.
excludeReplies
Skip statuses that reply to other statuses.
range
The bounds used when requesting data from Mastodon.
Return Value
Request for
[Status]
. -
Follows an account.
Parameters
id
The account id.
Return Value
Request for
Account
. -
Unfollow an account.
Parameters
id
The account id.
Return Value
Request for
Account
. -
Follows a remote user:.
Parameters
uri
The ‘username@domain’ of the remote user to follow.
Return Value
Request for
Account
. -
Blocks an account.
Declaration
Swift
public static func block(id: String) -> Request<Relationship>
Parameters
id
The account id.
Return Value
Request for
Relationship
. -
Unblocks an account.
Declaration
Swift
public static func unblock(id: String) -> Request<Relationship>
Parameters
id
The account id.
Return Value
Request for
Relationship
. -
Mutes an account.
Declaration
Swift
public static func mute(id: String) -> Request<Relationship>
Parameters
id
The account id.
Return Value
Request for
Relationship
. -
Unmutes an account.
Declaration
Swift
public static func unmute(id: String) -> Request<Relationship>
Parameters
id
The account id.
Return Value
Request for
Relationship
. -
Gets an account’s relationships.
Declaration
Swift
public static func relationships(ids: [String]) -> Request<[Relationship]>
Parameters
ids
The account’s ids.
Return Value
Request for
[Relationship]
. -
Searches for accounts.
Declaration
Parameters
query
What to search for.
limit
Maximum number of matching accounts to return (default: 40).
following
Limit the search to following (default: false).
Return Value
Request for
[Account]
.