Package blue.starry.penicillin.extensions.models

Types

Link copied to clipboard
enum ProfileBannerSize : Enum<ProfileBannerSize>

Profile banners allow users to further customize the expressiveness of their profiles. To upload a profile banner on behalf of a user, use POST account / update_profile_banner. Profile banners come in a variety of display-enhanced sizes. The variant sizes are available through a request to GET users / profile_banner or by modifying the final path component of the profile_banner_url found in a user object according to the table below. The profile banner data available at each size variant’s URL is in PNG format.

Link copied to clipboard
enum ProfileImageSize : Enum<ProfileImageSize>

Profile images (also known as avatars) are an important component of a Twitter account’s expression of identity. To upload a profile image on behalf of a user, use POST account / update_profile_image.

Functions

Link copied to clipboard
fun CommonUser.addToList(listId: Long): EmptyApiAction
fun CommonUser.addToList(slug: String, ownerId: Long): EmptyApiAction
fun CommonUser.addToList(slug: String, ownerScreenName: String): EmptyApiAction

Creates an action to add this user to the list.

Link copied to clipboard
fun CommonUser.block(): JsonObjectApiAction<User>

Creates an action to block this user.

Link copied to clipboard
fun Status.delete(): JsonObjectApiAction<Status>

Creates an action to delete this status.

Link copied to clipboard
fun Status.favorite(): JsonObjectApiAction<Status>

Creates an action to favorite this status.

Link copied to clipboard
fun CommonUser.follow(): JsonObjectApiAction<User>

Creates an action to follow this user.

Link copied to clipboard
fun CommonUser.followerIds(): CursorJsonObjectApiAction<CursorIds, Long>

Creates an action to retrieve followers' ids of this user.

Link copied to clipboard

Creates an action to retrieve followers' users of this user.

Link copied to clipboard
fun CommonUser.friendIds(): CursorJsonObjectApiAction<CursorIds, Long>

Creates an action to retrieve friends' (follows') ids of this user.

Link copied to clipboard

Creates an action to retrieve friends' (follows') users of this user.

Link copied to clipboard
fun Status.mention(text: String): JsonObjectApiAction<Status>

Creates an action to send a mention to this status.

Link copied to clipboard
suspend operator fun TwitterList.minusAssign(user: User)

Removes the user from this list. This function is suspend-function.

suspend operator fun TwitterList.minusAssign(users: Iterable<User>)

Removes the users from this list. This function is suspend-function.

Link copied to clipboard
fun CommonUser.mute(): JsonObjectApiAction<User>

Creates an action to mute this user.

Link copied to clipboard
suspend operator fun TwitterList.plusAssign(user: User)

Adds the user to this list. This function is suspend-function.

suspend operator fun TwitterList.plusAssign(users: Iterable<User>)

Adds the users to this list. This function is suspend-function.

Link copied to clipboard
fun CommonUser.profileBannerUrlWithVariantSize(size: ProfileBannerSize): String?

Returns profile banner url with specified size.

Link copied to clipboard

Returns profile image url (HTTPS) with specified size.

Link copied to clipboard
fun CommonUser.profileImageUrlWithVariantSize(size: ProfileImageSize): String

Returns profile image url with specified size.

Link copied to clipboard
fun CommonUser.refresh(): JsonObjectApiAction<User>

Creates an action to retrieve this user.

fun Status.refresh(): JsonObjectApiAction<Status>

Creates an action to retrieve this status.

Link copied to clipboard
fun CommonUser.removeFromList(listId: Long): EmptyApiAction
fun CommonUser.removeFromList(slug: String, ownerId: Long): EmptyApiAction
fun CommonUser.removeFromList(slug: String, ownerScreenName: String): EmptyApiAction

Creates an action to remove this user from the list.

Link copied to clipboard
fun CommonUser.reportAsSpam(): JsonObjectApiAction<User>

Creates an action to report this user as spam.

Link copied to clipboard
fun Status.showCard(name: String): JsonObjectApiAction<CardState>

Creates new action to show card with name.

Link copied to clipboard
fun CommonUser.timeline(): JsonArrayApiAction<Status>

Creates an ation to retrieve the user timeline of this user.

Link copied to clipboard
fun CommonUser.unblock(): JsonObjectApiAction<User>

Creates an action to unblock this user.

Link copied to clipboard
fun Status.unfavorite(): JsonObjectApiAction<Status>

Creates an action to unfavorite this status.

Link copied to clipboard
fun CommonUser.unfollow(): JsonObjectApiAction<User>

Creates an action to unfollow this user.

Link copied to clipboard
fun CommonUser.unmute(): JsonObjectApiAction<User>

Creates an action to unmute this user.

Properties

Link copied to clipboard
val CardState.Card.choices: LinkedHashMap<String, Int>

A map of choices. Map size N must be 2 <= N <= 4.

Link copied to clipboard
val CardState.Card.endAt: String?

Card end at date.

Link copied to clipboard

Returns the direct message text whose shortened urls are each expanded.

val Status.expandedText: String

Returns full-body status text which shortened urls in are each expanded.

Link copied to clipboard
val Status.expandedTextWithIndices: String

Returns full-body status text which shortened urls in are each expanded.

Link copied to clipboard
val IndexedEntityModel.firstIndex: Int

Returns the first index of the indices.

Link copied to clipboard
val Status.hasCard: Boolean

If true, this status has card entity.

Link copied to clipboard
val CardState.Card.isFinalResult: Boolean

If true, this card is final result.

Link copied to clipboard
val CommonUser.isLockedAccount: Boolean

Whether if this account is locked.

Link copied to clipboard
val IndexedEntityModel.lastIndex: Int

Returns the last index of this indices.

Link copied to clipboard
val CardState.Card.lastUpdateAt: String?

Card last update at date.

Link copied to clipboard
val CardState.Card.minutes: Int?

Card duration in minutes.

Link copied to clipboard
val IndexedEntityModel.range: IntRange

Returns a range from firstIndex value up to but excluding lastIndex value.

Link copied to clipboard
val IndexedEntityModel.size: Int

Returns the size of the indices.

Link copied to clipboard
val Status.text: String

Returns full-body, unescaped status text. Supports both tweet modes (Extend and Compat).