{-# LANGUAGE DataKinds #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE TypeOperators #-}
module Web.Twitter.Conduit.Api (
StatusesMentionsTimeline,
statusesMentionsTimeline,
StatusesUserTimeline,
statusesUserTimeline,
StatusesHomeTimeline,
statusesHomeTimeline,
StatusesRetweetsOfMe,
statusesRetweetsOfMe,
StatusesRetweetsId,
statusesRetweetsId,
StatusesShowId,
statusesShowId,
StatusesDestroyId,
statusesDestroyId,
StatusesUpdate,
statusesUpdate,
StatusesRetweetId,
statusesRetweetId,
StatusesUpdateWithMedia,
statusesUpdateWithMedia,
StatusesLookup,
statusesLookup,
SearchTweets,
searchTweets,
search,
DirectMessages,
directMessages,
DirectMessagesSent,
directMessagesSent,
DirectMessagesShow,
directMessagesShow,
DirectMessagesDestroy,
directMessagesDestroy,
DirectMessagesNew,
directMessagesNew,
FriendshipsNoRetweetsIds,
friendshipsNoRetweetsIds,
FriendsIds,
friendsIds,
FollowersIds,
followersIds,
FriendshipsIncoming,
friendshipsIncoming,
FriendshipsOutgoing,
friendshipsOutgoing,
FriendshipsCreate,
friendshipsCreate,
FriendshipsDestroy,
friendshipsDestroy,
FriendsList,
friendsList,
FollowersList,
followersList,
AccountVerifyCredentials,
accountVerifyCredentials,
AccountUpdateProfile,
accountUpdateProfile,
UsersLookup,
usersLookup,
UsersShow,
usersShow,
FavoritesList,
favoritesList,
FavoritesDestroy,
favoritesDestroy,
FavoritesCreate,
favoritesCreate,
ListsStatuses,
listsStatuses,
ListsMembersDestroy,
listsMembersDestroy,
ListsMemberships,
listsMemberships,
ListsSubscribers,
listsSubscribers,
ListsMembersCreateAll,
listsMembersCreateAll,
ListsMembers,
listsMembers,
ListsMembersCreate,
listsMembersCreate,
ListsDestroy,
listsDestroy,
ListsUpdate,
listsUpdate,
ListsCreate,
listsCreate,
ListsShow,
listsShow,
ListsSubscriptions,
listsSubscriptions,
ListsMembersDestroyAll,
listsMembersDestroyAll,
ListsOwnerships,
listsOwnerships,
MediaUpload,
mediaUpload,
) where
import Web.Twitter.Conduit.Base
import Web.Twitter.Conduit.Cursor
import Web.Twitter.Conduit.Parameters
import Web.Twitter.Conduit.Request
import Web.Twitter.Conduit.Request.Internal
import Web.Twitter.Types
import Data.Aeson
import Data.Default
import qualified Data.Text as T
import Data.Time.Calendar (Day)
import Network.HTTP.Client.MultipartFormData
statusesMentionsTimeline :: APIRequest StatusesMentionsTimeline [Status]
statusesMentionsTimeline :: APIRequest StatusesMentionsTimeline [Status]
statusesMentionsTimeline = Method
-> String
-> APIQuery
-> APIRequest StatusesMentionsTimeline [Status]
forall (supports :: [Param Symbol *]) responseType.
Method -> String -> APIQuery -> APIRequest supports responseType
APIRequest Method
"GET" (String
endpoint String -> String -> String
forall a. [a] -> [a] -> [a]
++ String
"statuses/mentions_timeline.json") APIQuery
forall a. Default a => a
def
type StatusesMentionsTimeline =
'[ "count" ':= Integer
, "since_id" ':= Integer
, "max_id" ':= Integer
, "trim_user" ':= Bool
, "contributor_details" ':= Bool
, "include_entities" ':= Bool
, "tweet_mode" ':= TweetMode
]
statusesUserTimeline :: UserParam -> APIRequest StatusesUserTimeline [Status]
statusesUserTimeline :: UserParam -> APIRequest StatusesUserTimeline [Status]
statusesUserTimeline UserParam
q = Method
-> String -> APIQuery -> APIRequest StatusesUserTimeline [Status]
forall (supports :: [Param Symbol *]) responseType.
Method -> String -> APIQuery -> APIRequest supports responseType
APIRequest Method
"GET" (String
endpoint String -> String -> String
forall a. [a] -> [a] -> [a]
++ String
"statuses/user_timeline.json") (UserParam -> APIQuery
mkUserParam UserParam
q)
type StatusesUserTimeline =
'[ "count" ':= Integer
, "since_id" ':= Integer
, "max_id" ':= Integer
, "trim_user" ':= Bool
, "exclude_replies" ':= Bool
, "contributor_details" ':= Bool
, "include_rts" ':= Bool
, "tweet_mode" ':= TweetMode
]
statusesHomeTimeline :: APIRequest StatusesHomeTimeline [Status]
statusesHomeTimeline :: APIRequest StatusesHomeTimeline [Status]
statusesHomeTimeline = Method
-> String -> APIQuery -> APIRequest StatusesHomeTimeline [Status]
forall (supports :: [Param Symbol *]) responseType.
Method -> String -> APIQuery -> APIRequest supports responseType
APIRequest Method
"GET" (String
endpoint String -> String -> String
forall a. [a] -> [a] -> [a]
++ String
"statuses/home_timeline.json") APIQuery
forall a. Default a => a
def
type StatusesHomeTimeline =
'[ "count" ':= Integer
, "since_id" ':= Integer
, "max_id" ':= Integer
, "trim_user" ':= Bool
, "exclude_replies" ':= Bool
, "contributor_details" ':= Bool
, "include_entities" ':= Bool
, "tweet_mode" ':= TweetMode
]
statusesRetweetsOfMe :: APIRequest StatusesRetweetsOfMe [Status]
= Method
-> String -> APIQuery -> APIRequest StatusesRetweetsOfMe [Status]
forall (supports :: [Param Symbol *]) responseType.
Method -> String -> APIQuery -> APIRequest supports responseType
APIRequest Method
"GET" (String
endpoint String -> String -> String
forall a. [a] -> [a] -> [a]
++ String
"statuses/retweets_of_me.json") APIQuery
forall a. Default a => a
def
type =
'[ "count" ':= Integer
, "since_id" ':= Integer
, "max_id" ':= Integer
, "trim_user" ':= Bool
, "include_entities" ':= Bool
, "include_user_entities" ':= Bool
, "tweet_mode" ':= TweetMode
]
statusesRetweetsId :: StatusId -> APIRequest StatusesRetweetsId [RetweetedStatus]
StatusId
status_id = Method
-> String
-> APIQuery
-> APIRequest StatusesRetweetsId [RetweetedStatus]
forall (supports :: [Param Symbol *]) responseType.
Method -> String -> APIQuery -> APIRequest supports responseType
APIRequest Method
"GET" String
uri APIQuery
forall a. Default a => a
def
where
uri :: String
uri = String
endpoint String -> String -> String
forall a. [a] -> [a] -> [a]
++ String
"statuses/retweets/" String -> String -> String
forall a. [a] -> [a] -> [a]
++ StatusId -> String
forall a. Show a => a -> String
show StatusId
status_id String -> String -> String
forall a. [a] -> [a] -> [a]
++ String
".json"
type =
'[ "count" ':= Integer
, "trim_user" ':= Bool
, "tweet_mode" ':= TweetMode
]
statusesShowId :: StatusId -> APIRequest StatusesShowId Status
statusesShowId :: StatusId -> APIRequest StatusesShowId Status
statusesShowId StatusId
status_id = Method -> String -> APIQuery -> APIRequest StatusesShowId Status
forall (supports :: [Param Symbol *]) responseType.
Method -> String -> APIQuery -> APIRequest supports responseType
APIRequest Method
"GET" String
uri APIQuery
forall a. Default a => a
def
where
uri :: String
uri = String
endpoint String -> String -> String
forall a. [a] -> [a] -> [a]
++ String
"statuses/show/" String -> String -> String
forall a. [a] -> [a] -> [a]
++ StatusId -> String
forall a. Show a => a -> String
show StatusId
status_id String -> String -> String
forall a. [a] -> [a] -> [a]
++ String
".json"
type StatusesShowId =
'[ "trim_user" ':= Bool
, "include_my_retweet" ':= Bool
, "include_entities" ':= Bool
, "include_ext_alt_text" ':= Bool
, "tweet_mode" ':= TweetMode
]
statusesDestroyId :: StatusId -> APIRequest StatusesDestroyId Status
statusesDestroyId :: StatusId -> APIRequest StatusesDestroyId Status
statusesDestroyId StatusId
status_id = Method -> String -> APIQuery -> APIRequest StatusesDestroyId Status
forall (supports :: [Param Symbol *]) responseType.
Method -> String -> APIQuery -> APIRequest supports responseType
APIRequest Method
"POST" String
uri APIQuery
forall a. Default a => a
def
where
uri :: String
uri = String
endpoint String -> String -> String
forall a. [a] -> [a] -> [a]
++ String
"statuses/destroy/" String -> String -> String
forall a. [a] -> [a] -> [a]
++ StatusId -> String
forall a. Show a => a -> String
show StatusId
status_id String -> String -> String
forall a. [a] -> [a] -> [a]
++ String
".json"
type StatusesDestroyId =
'[ "trim_user" ':= Bool
, "tweet_mode" ':= TweetMode
]
statusesUpdate :: T.Text -> APIRequest StatusesUpdate Status
statusesUpdate :: Text -> APIRequest StatusesUpdate Status
statusesUpdate Text
status = Method -> String -> APIQuery -> APIRequest StatusesUpdate Status
forall (supports :: [Param Symbol *]) responseType.
Method -> String -> APIQuery -> APIRequest supports responseType
APIRequest Method
"POST" String
uri [(Method
"status", Text -> PV
PVString Text
status)]
where
uri :: String
uri = String
endpoint String -> String -> String
forall a. [a] -> [a] -> [a]
++ String
"statuses/update.json"
type StatusesUpdate =
'[ "in_reply_to_status_id" ':= Integer
,
"display_coordinates" ':= Bool
, "trim_user" ':= Bool
, "media_ids" ':= [Integer]
, "tweet_mode" ':= TweetMode
]
statusesRetweetId :: StatusId -> APIRequest StatusesRetweetId RetweetedStatus
StatusId
status_id = Method
-> String
-> APIQuery
-> APIRequest StatusesDestroyId RetweetedStatus
forall (supports :: [Param Symbol *]) responseType.
Method -> String -> APIQuery -> APIRequest supports responseType
APIRequest Method
"POST" String
uri APIQuery
forall a. Default a => a
def
where
uri :: String
uri = String
endpoint String -> String -> String
forall a. [a] -> [a] -> [a]
++ String
"statuses/retweet/" String -> String -> String
forall a. [a] -> [a] -> [a]
++ StatusId -> String
forall a. Show a => a -> String
show StatusId
status_id String -> String -> String
forall a. [a] -> [a] -> [a]
++ String
".json"
type =
'[ "trim_user" ':= Bool
, "tweet_mode" ':= TweetMode
]
statusesUpdateWithMedia ::
T.Text ->
MediaData ->
APIRequest StatusesUpdateWithMedia Status
statusesUpdateWithMedia :: Text -> MediaData -> APIRequest StatusesUpdateWithMedia Status
statusesUpdateWithMedia Text
tweet MediaData
mediaData =
Method
-> String
-> APIQuery
-> [Part]
-> APIRequest StatusesUpdateWithMedia Status
forall (supports :: [Param Symbol *]) responseType.
Method
-> String -> APIQuery -> [Part] -> APIRequest supports responseType
APIRequestMultipart Method
"POST" String
uri [(Method
"status", Text -> PV
PVString Text
tweet)] [MediaData -> Part
mediaBody MediaData
mediaData]
where
uri :: String
uri = String
endpoint String -> String -> String
forall a. [a] -> [a] -> [a]
++ String
"statuses/update_with_media.json"
mediaBody :: MediaData -> Part
mediaBody (MediaFromFile String
fp) = Text -> String -> Part
partFileSource Text
"media[]" String
fp
mediaBody (MediaRequestBody String
filename RequestBody
filebody) = Text -> String -> RequestBody -> Part
forall (m :: * -> *).
Applicative m =>
Text -> String -> RequestBody -> PartM m
partFileRequestBody Text
"media[]" String
filename RequestBody
filebody
type StatusesUpdateWithMedia =
'[ "possibly_sensitive" ':= Bool
, "in_reply_to_status_id" ':= Integer
,
"display_coordinates" ':= Bool
, "tweet_mode" ':= TweetMode
]
statusesLookup :: [StatusId] -> APIRequest StatusesLookup [Status]
statusesLookup :: [StatusId] -> APIRequest StatusesLookup [Status]
statusesLookup [StatusId]
ids = Method -> String -> APIQuery -> APIRequest StatusesLookup [Status]
forall (supports :: [Param Symbol *]) responseType.
Method -> String -> APIQuery -> APIRequest supports responseType
APIRequest Method
"GET" (String
endpoint String -> String -> String
forall a. [a] -> [a] -> [a]
++ String
"statuses/lookup.json") [(Method
"id", [StatusId] -> PV
PVIntegerArray [StatusId]
ids)]
type StatusesLookup =
'[ "include_entities" ':= Bool
, "trim_user" ':= Bool
, "map" ':= Bool
, "tweet_mode" ':= TweetMode
]
searchTweets ::
T.Text ->
APIRequest SearchTweets (SearchResult [Status])
Text
q = Method
-> String
-> APIQuery
-> APIRequest SearchTweets (SearchResult [Status])
forall (supports :: [Param Symbol *]) responseType.
Method -> String -> APIQuery -> APIRequest supports responseType
APIRequest Method
"GET" (String
endpoint String -> String -> String
forall a. [a] -> [a] -> [a]
++ String
"search/tweets.json") [(Method
"q", Text -> PV
PVString Text
q)]
type =
'[ "lang" ':= T.Text
, "locale" ':= T.Text
, "result_type" ':= T.Text
, "count" ':= Integer
, "until" ':= Day
, "since_id" ':= Integer
, "max_id" ':= Integer
, "include_entities" ':= Bool
, "tweet_mode" ':= TweetMode
]
search ::
T.Text ->
APIRequest SearchTweets (SearchResult [Status])
search :: Text -> APIRequest SearchTweets (SearchResult [Status])
search = Text -> APIRequest SearchTweets (SearchResult [Status])
searchTweets
{-# DEPRECATED search "Please use Web.Twitter.Conduit.searchTweets" #-}
directMessages :: APIRequest DirectMessages (WithCursor T.Text EventsCursorKey DirectMessage)
directMessages :: APIRequest
DirectMessages (WithCursor Text EventsCursorKey DirectMessage)
directMessages = Method
-> String
-> APIQuery
-> APIRequest
DirectMessages (WithCursor Text EventsCursorKey DirectMessage)
forall (supports :: [Param Symbol *]) responseType.
Method -> String -> APIQuery -> APIRequest supports responseType
APIRequest Method
"GET" (String
endpoint String -> String -> String
forall a. [a] -> [a] -> [a]
++ String
"direct_messages/events/list.json") APIQuery
forall a. Default a => a
def
type DirectMessages =
'[ "count" ':= Integer
, "include_entities" ':= Bool
, "skip_status" ':= Bool
, "full_text" ':= Bool
, "cursor" ':= T.Text
]
directMessagesSent :: APIRequest DirectMessagesSent [DirectMessage]
directMessagesSent :: APIRequest DirectMessagesSent [DirectMessage]
directMessagesSent = Method
-> String
-> APIQuery
-> APIRequest DirectMessagesSent [DirectMessage]
forall (supports :: [Param Symbol *]) responseType.
Method -> String -> APIQuery -> APIRequest supports responseType
APIRequest Method
"GET" (String
endpoint String -> String -> String
forall a. [a] -> [a] -> [a]
++ String
"direct_messages/sent.json") APIQuery
forall a. Default a => a
def
type DirectMessagesSent =
'[ "since_id" ':= Integer
, "max_id" ':= Integer
, "count" ':= Integer
, "include_entities" ':= Bool
, "page" ':= Integer
, "skip_status" ':= Bool
, "full_text" ':= Bool
]
directMessagesShow :: StatusId -> APIRequest DirectMessagesShow DirectMessage
directMessagesShow :: StatusId -> APIRequest DirectMessagesShow DirectMessage
directMessagesShow StatusId
sId = Method
-> String
-> APIQuery
-> APIRequest DirectMessagesShow DirectMessage
forall (supports :: [Param Symbol *]) responseType.
Method -> String -> APIQuery -> APIRequest supports responseType
APIRequest Method
"GET" (String
endpoint String -> String -> String
forall a. [a] -> [a] -> [a]
++ String
"direct_messages/show.json") [(Method
"id", StatusId -> PV
PVInteger StatusId
sId)]
type DirectMessagesShow =
'[ "full_text" ':= Bool
]
directMessagesDestroy :: StatusId -> APIRequest DirectMessagesDestroy NoContent
directMessagesDestroy :: StatusId -> APIRequest DirectMessagesDestroy NoContent
directMessagesDestroy StatusId
sId = Method
-> String -> APIQuery -> APIRequest DirectMessagesDestroy NoContent
forall (supports :: [Param Symbol *]) responseType.
Method -> String -> APIQuery -> APIRequest supports responseType
APIRequest Method
"DELETE" (String
endpoint String -> String -> String
forall a. [a] -> [a] -> [a]
++ String
"direct_messages/events/destroy.json") [(Method
"id", StatusId -> PV
PVInteger StatusId
sId)]
type DirectMessagesDestroy = EmptyParams
newtype DirectMessagesNewResponse = DirectMessagesNewResponse
{ DirectMessagesNewResponse -> DirectMessage
directMessageBody :: DirectMessage
}
deriving (Int -> DirectMessagesNewResponse -> String -> String
[DirectMessagesNewResponse] -> String -> String
DirectMessagesNewResponse -> String
(Int -> DirectMessagesNewResponse -> String -> String)
-> (DirectMessagesNewResponse -> String)
-> ([DirectMessagesNewResponse] -> String -> String)
-> Show DirectMessagesNewResponse
forall a.
(Int -> a -> String -> String)
-> (a -> String) -> ([a] -> String -> String) -> Show a
showList :: [DirectMessagesNewResponse] -> String -> String
$cshowList :: [DirectMessagesNewResponse] -> String -> String
show :: DirectMessagesNewResponse -> String
$cshow :: DirectMessagesNewResponse -> String
showsPrec :: Int -> DirectMessagesNewResponse -> String -> String
$cshowsPrec :: Int -> DirectMessagesNewResponse -> String -> String
Show, DirectMessagesNewResponse -> DirectMessagesNewResponse -> Bool
(DirectMessagesNewResponse -> DirectMessagesNewResponse -> Bool)
-> (DirectMessagesNewResponse -> DirectMessagesNewResponse -> Bool)
-> Eq DirectMessagesNewResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DirectMessagesNewResponse -> DirectMessagesNewResponse -> Bool
$c/= :: DirectMessagesNewResponse -> DirectMessagesNewResponse -> Bool
== :: DirectMessagesNewResponse -> DirectMessagesNewResponse -> Bool
$c== :: DirectMessagesNewResponse -> DirectMessagesNewResponse -> Bool
Eq)
instance FromJSON DirectMessagesNewResponse where
parseJSON :: Value -> Parser DirectMessagesNewResponse
parseJSON = String
-> (Object -> Parser DirectMessagesNewResponse)
-> Value
-> Parser DirectMessagesNewResponse
forall a. String -> (Object -> Parser a) -> Value -> Parser a
withObject String
"DirectMessagesNewResponse" ((Object -> Parser DirectMessagesNewResponse)
-> Value -> Parser DirectMessagesNewResponse)
-> (Object -> Parser DirectMessagesNewResponse)
-> Value
-> Parser DirectMessagesNewResponse
forall a b. (a -> b) -> a -> b
$ \Object
o -> DirectMessage -> DirectMessagesNewResponse
DirectMessagesNewResponse (DirectMessage -> DirectMessagesNewResponse)
-> Parser DirectMessage -> Parser DirectMessagesNewResponse
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Object
o Object -> Key -> Parser DirectMessage
forall a. FromJSON a => Object -> Key -> Parser a
.: Key
"event"
directMessagesNew :: RecipientId -> T.Text -> APIRequest DirectMessagesNew DirectMessagesNewResponse
directMessagesNew :: StatusId
-> Text
-> APIRequest DirectMessagesDestroy DirectMessagesNewResponse
directMessagesNew StatusId
up Text
msg =
Method
-> String
-> APIQuery
-> Value
-> APIRequest DirectMessagesDestroy DirectMessagesNewResponse
forall (supports :: [Param Symbol *]) responseType.
Method
-> String -> APIQuery -> Value -> APIRequest supports responseType
APIRequestJSON Method
"POST" (String
endpoint String -> String -> String
forall a. [a] -> [a] -> [a]
++ String
"direct_messages/events/new.json") [] Value
body
where
body :: Value
body =
[Pair] -> Value
object
[ Key
"event"
Key -> Value -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
.= [Pair] -> Value
object
[ Key
"type" Key -> String -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
.= (String
"message_create" :: String)
, Key
"message_create"
Key -> Value -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
.= [Pair] -> Value
object
[ Key
"target" Key -> Value -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
.= [Pair] -> Value
object [Key
"recipient_id" Key -> StatusId -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
.= StatusId
up]
, Key
"message_data" Key -> Value -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
.= [Pair] -> Value
object [Key
"text" Key -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
.= Text
msg]
]
]
]
type DirectMessagesNew = EmptyParams
type RecipientId = Integer
friendshipsNoRetweetsIds :: APIRequest FriendshipsNoRetweetsIds [UserId]
= Method
-> String
-> APIQuery
-> APIRequest DirectMessagesDestroy [StatusId]
forall (supports :: [Param Symbol *]) responseType.
Method -> String -> APIQuery -> APIRequest supports responseType
APIRequest Method
"GET" (String
endpoint String -> String -> String
forall a. [a] -> [a] -> [a]
++ String
"friendships/no_retweets/ids.json") []
type = EmptyParams
friendsIds :: UserParam -> APIRequest FriendsIds (WithCursor Integer IdsCursorKey UserId)
friendsIds :: UserParam
-> APIRequest
FriendsIds (WithCursor StatusId IdsCursorKey StatusId)
friendsIds UserParam
q = Method
-> String
-> APIQuery
-> APIRequest
FriendsIds (WithCursor StatusId IdsCursorKey StatusId)
forall (supports :: [Param Symbol *]) responseType.
Method -> String -> APIQuery -> APIRequest supports responseType
APIRequest Method
"GET" (String
endpoint String -> String -> String
forall a. [a] -> [a] -> [a]
++ String
"friends/ids.json") (UserParam -> APIQuery
mkUserParam UserParam
q)
type FriendsIds =
'[ "count" ':= Integer
, "cursor" ':= Integer
]
followersIds :: UserParam -> APIRequest FollowersIds (WithCursor Integer IdsCursorKey UserId)
followersIds :: UserParam
-> APIRequest
FriendsIds (WithCursor StatusId IdsCursorKey StatusId)
followersIds UserParam
q = Method
-> String
-> APIQuery
-> APIRequest
FriendsIds (WithCursor StatusId IdsCursorKey StatusId)
forall (supports :: [Param Symbol *]) responseType.
Method -> String -> APIQuery -> APIRequest supports responseType
APIRequest Method
"GET" (String
endpoint String -> String -> String
forall a. [a] -> [a] -> [a]
++ String
"followers/ids.json") (UserParam -> APIQuery
mkUserParam UserParam
q)
type FollowersIds =
'[ "count" ':= Integer
, "cursor" ':= Integer
]
friendshipsIncoming :: APIRequest FriendshipsIncoming (WithCursor Integer IdsCursorKey UserId)
friendshipsIncoming :: APIRequest
FriendshipsIncoming (WithCursor StatusId IdsCursorKey StatusId)
friendshipsIncoming = Method
-> String
-> APIQuery
-> APIRequest
FriendshipsIncoming (WithCursor StatusId IdsCursorKey StatusId)
forall (supports :: [Param Symbol *]) responseType.
Method -> String -> APIQuery -> APIRequest supports responseType
APIRequest Method
"GET" (String
endpoint String -> String -> String
forall a. [a] -> [a] -> [a]
++ String
"friendships/incoming.json") APIQuery
forall a. Default a => a
def
type FriendshipsIncoming =
'[ "cursor" ':= Integer
]
friendshipsOutgoing :: APIRequest FriendshipsOutgoing (WithCursor Integer IdsCursorKey UserId)
friendshipsOutgoing :: APIRequest
FriendshipsIncoming (WithCursor StatusId IdsCursorKey StatusId)
friendshipsOutgoing = Method
-> String
-> APIQuery
-> APIRequest
FriendshipsIncoming (WithCursor StatusId IdsCursorKey StatusId)
forall (supports :: [Param Symbol *]) responseType.
Method -> String -> APIQuery -> APIRequest supports responseType
APIRequest Method
"GET" (String
endpoint String -> String -> String
forall a. [a] -> [a] -> [a]
++ String
"friendships/outgoing.json") APIQuery
forall a. Default a => a
def
type FriendshipsOutgoing =
'[ "cursor" ':= Integer
]
friendshipsCreate :: UserParam -> APIRequest FriendshipsCreate User
friendshipsCreate :: UserParam -> APIRequest FriendshipsCreate User
friendshipsCreate UserParam
user = Method -> String -> APIQuery -> APIRequest FriendshipsCreate User
forall (supports :: [Param Symbol *]) responseType.
Method -> String -> APIQuery -> APIRequest supports responseType
APIRequest Method
"POST" (String
endpoint String -> String -> String
forall a. [a] -> [a] -> [a]
++ String
"friendships/create.json") (UserParam -> APIQuery
mkUserParam UserParam
user)
type FriendshipsCreate =
'[ "follow" ':= Bool
]
friendshipsDestroy :: UserParam -> APIRequest FriendshipsDestroy User
friendshipsDestroy :: UserParam -> APIRequest DirectMessagesDestroy User
friendshipsDestroy UserParam
user = Method
-> String -> APIQuery -> APIRequest DirectMessagesDestroy User
forall (supports :: [Param Symbol *]) responseType.
Method -> String -> APIQuery -> APIRequest supports responseType
APIRequest Method
"POST" (String
endpoint String -> String -> String
forall a. [a] -> [a] -> [a]
++ String
"friendships/destroy.json") (UserParam -> APIQuery
mkUserParam UserParam
user)
type FriendshipsDestroy = EmptyParams
friendsList :: UserParam -> APIRequest FriendsList (WithCursor Integer UsersCursorKey User)
friendsList :: UserParam
-> APIRequest FriendsList (WithCursor StatusId UsersCursorKey User)
friendsList UserParam
q = Method
-> String
-> APIQuery
-> APIRequest FriendsList (WithCursor StatusId UsersCursorKey User)
forall (supports :: [Param Symbol *]) responseType.
Method -> String -> APIQuery -> APIRequest supports responseType
APIRequest Method
"GET" (String
endpoint String -> String -> String
forall a. [a] -> [a] -> [a]
++ String
"friends/list.json") (UserParam -> APIQuery
mkUserParam UserParam
q)
type FriendsList =
'[ "count" ':= Integer
, "cursor" ':= Integer
, "skip_status" ':= Bool
, "include_user_entities" ':= Bool
]
followersList :: UserParam -> APIRequest FollowersList (WithCursor Integer UsersCursorKey User)
followersList :: UserParam
-> APIRequest FriendsList (WithCursor StatusId UsersCursorKey User)
followersList UserParam
q = Method
-> String
-> APIQuery
-> APIRequest FriendsList (WithCursor StatusId UsersCursorKey User)
forall (supports :: [Param Symbol *]) responseType.
Method -> String -> APIQuery -> APIRequest supports responseType
APIRequest Method
"GET" (String
endpoint String -> String -> String
forall a. [a] -> [a] -> [a]
++ String
"followers/list.json") (UserParam -> APIQuery
mkUserParam UserParam
q)
type FollowersList =
'[ "count" ':= Integer
, "cursor" ':= Integer
, "skip_status" ':= Bool
, "include_user_entities" ':= Bool
]
accountVerifyCredentials :: APIRequest AccountVerifyCredentials User
accountVerifyCredentials :: APIRequest AccountVerifyCredentials User
accountVerifyCredentials = Method
-> String -> APIQuery -> APIRequest AccountVerifyCredentials User
forall (supports :: [Param Symbol *]) responseType.
Method -> String -> APIQuery -> APIRequest supports responseType
APIRequest Method
"GET" (String
endpoint String -> String -> String
forall a. [a] -> [a] -> [a]
++ String
"account/verify_credentials.json") []
type AccountVerifyCredentials =
'[ "include_entities" ':= Bool
, "skip_status" ':= Bool
, "include_email" ':= Bool
]
accountUpdateProfile :: APIRequest AccountUpdateProfile User
accountUpdateProfile :: APIRequest AccountUpdateProfile User
accountUpdateProfile = Method
-> String -> APIQuery -> APIRequest AccountUpdateProfile User
forall (supports :: [Param Symbol *]) responseType.
Method -> String -> APIQuery -> APIRequest supports responseType
APIRequest Method
"POST" (String
endpoint String -> String -> String
forall a. [a] -> [a] -> [a]
++ String
"account/update_profile.json") []
type AccountUpdateProfile =
'[ "include_entities" ':= Bool
, "skip_status" ':= Bool
, "name" ':= T.Text
, "url" ':= URIString
, "location" ':= T.Text
, "description" ':= T.Text
, "profile_link_color" ':= T.Text
]
usersLookup :: UserListParam -> APIRequest UsersLookup [User]
usersLookup :: UserListParam -> APIRequest UsersLookup [User]
usersLookup UserListParam
q = Method -> String -> APIQuery -> APIRequest UsersLookup [User]
forall (supports :: [Param Symbol *]) responseType.
Method -> String -> APIQuery -> APIRequest supports responseType
APIRequest Method
"GET" (String
endpoint String -> String -> String
forall a. [a] -> [a] -> [a]
++ String
"users/lookup.json") (UserListParam -> APIQuery
mkUserListParam UserListParam
q)
type UsersLookup =
'[ "include_entities" ':= Bool
]
usersShow :: UserParam -> APIRequest UsersShow User
UserParam
q = Method -> String -> APIQuery -> APIRequest UsersLookup User
forall (supports :: [Param Symbol *]) responseType.
Method -> String -> APIQuery -> APIRequest supports responseType
APIRequest Method
"GET" (String
endpoint String -> String -> String
forall a. [a] -> [a] -> [a]
++ String
"users/show.json") (UserParam -> APIQuery
mkUserParam UserParam
q)
type =
'[ "include_entities" ':= Bool
]
favoritesList :: Maybe UserParam -> APIRequest FavoritesList [Status]
favoritesList :: Maybe UserParam -> APIRequest FavoritesList [Status]
favoritesList Maybe UserParam
mbuser = Method -> String -> APIQuery -> APIRequest FavoritesList [Status]
forall (supports :: [Param Symbol *]) responseType.
Method -> String -> APIQuery -> APIRequest supports responseType
APIRequest Method
"GET" (String
endpoint String -> String -> String
forall a. [a] -> [a] -> [a]
++ String
"favorites/list.json") (Maybe UserParam -> APIQuery
mkParam Maybe UserParam
mbuser)
where
mkParam :: Maybe UserParam -> APIQuery
mkParam Maybe UserParam
Nothing = []
mkParam (Just UserParam
usr) = UserParam -> APIQuery
mkUserParam UserParam
usr
type FavoritesList =
'[ "count" ':= Integer
, "since_id" ':= Integer
, "max_id" ':= Integer
, "include_entities" ':= Bool
, "tweet_mode" ':= TweetMode
]
favoritesCreate :: StatusId -> APIRequest FavoritesCreate Status
favoritesCreate :: StatusId -> APIRequest FavoritesCreate Status
favoritesCreate StatusId
sid = Method -> String -> APIQuery -> APIRequest FavoritesCreate Status
forall (supports :: [Param Symbol *]) responseType.
Method -> String -> APIQuery -> APIRequest supports responseType
APIRequest Method
"POST" (String
endpoint String -> String -> String
forall a. [a] -> [a] -> [a]
++ String
"favorites/create.json") [(Method
"id", StatusId -> PV
PVInteger StatusId
sid)]
type FavoritesCreate =
'[ "include_entities" ':= Bool
, "tweet_mode" ':= TweetMode
]
favoritesDestroy :: StatusId -> APIRequest FavoritesDestroy Status
favoritesDestroy :: StatusId -> APIRequest FavoritesCreate Status
favoritesDestroy StatusId
sid = Method -> String -> APIQuery -> APIRequest FavoritesCreate Status
forall (supports :: [Param Symbol *]) responseType.
Method -> String -> APIQuery -> APIRequest supports responseType
APIRequest Method
"POST" (String
endpoint String -> String -> String
forall a. [a] -> [a] -> [a]
++ String
"favorites/destroy.json") [(Method
"id", StatusId -> PV
PVInteger StatusId
sid)]
type FavoritesDestroy =
'[ "include_entities" ':= Bool
, "tweet_mode" ':= TweetMode
]
listsStatuses :: ListParam -> APIRequest ListsStatuses [Status]
listsStatuses :: ListParam -> APIRequest ListsStatuses [Status]
listsStatuses ListParam
q = Method -> String -> APIQuery -> APIRequest ListsStatuses [Status]
forall (supports :: [Param Symbol *]) responseType.
Method -> String -> APIQuery -> APIRequest supports responseType
APIRequest Method
"GET" (String
endpoint String -> String -> String
forall a. [a] -> [a] -> [a]
++ String
"lists/statuses.json") (ListParam -> APIQuery
mkListParam ListParam
q)
type ListsStatuses =
'[ "since_id" ':= Integer
, "max_id" ':= Integer
, "count" ':= Integer
, "include_entities" ':= Bool
, "include_rts" ':= Bool
, "tweet_mode" ':= TweetMode
]
listsMembersDestroy :: ListParam -> UserParam -> APIRequest ListsMembersDestroy List
listsMembersDestroy :: ListParam -> UserParam -> APIRequest DirectMessagesDestroy List
listsMembersDestroy ListParam
list UserParam
user = Method
-> String -> APIQuery -> APIRequest DirectMessagesDestroy List
forall (supports :: [Param Symbol *]) responseType.
Method -> String -> APIQuery -> APIRequest supports responseType
APIRequest Method
"POST" (String
endpoint String -> String -> String
forall a. [a] -> [a] -> [a]
++ String
"lists/members/destroy.json") (ListParam -> APIQuery
mkListParam ListParam
list APIQuery -> APIQuery -> APIQuery
forall a. [a] -> [a] -> [a]
++ UserParam -> APIQuery
mkUserParam UserParam
user)
type ListsMembersDestroy = EmptyParams
listsMemberships :: Maybe UserParam -> APIRequest ListsMemberships (WithCursor Integer ListsCursorKey List)
listsMemberships :: Maybe UserParam
-> APIRequest FriendsIds (WithCursor StatusId ListsCursorKey List)
listsMemberships Maybe UserParam
q = Method
-> String
-> APIQuery
-> APIRequest FriendsIds (WithCursor StatusId ListsCursorKey List)
forall (supports :: [Param Symbol *]) responseType.
Method -> String -> APIQuery -> APIRequest supports responseType
APIRequest Method
"GET" (String
endpoint String -> String -> String
forall a. [a] -> [a] -> [a]
++ String
"lists/memberships.json") (APIQuery
-> APIRequest FriendsIds (WithCursor StatusId ListsCursorKey List))
-> APIQuery
-> APIRequest FriendsIds (WithCursor StatusId ListsCursorKey List)
forall a b. (a -> b) -> a -> b
$ APIQuery -> (UserParam -> APIQuery) -> Maybe UserParam -> APIQuery
forall b a. b -> (a -> b) -> Maybe a -> b
maybe [] UserParam -> APIQuery
mkUserParam Maybe UserParam
q
type ListsMemberships =
'[ "count" ':= Integer
, "cursor" ':= Integer
]
listsSubscribers :: ListParam -> APIRequest ListsSubscribers (WithCursor Integer UsersCursorKey User)
listsSubscribers :: ListParam
-> APIRequest
ListsSubscribers (WithCursor StatusId UsersCursorKey User)
listsSubscribers ListParam
q = Method
-> String
-> APIQuery
-> APIRequest
ListsSubscribers (WithCursor StatusId UsersCursorKey User)
forall (supports :: [Param Symbol *]) responseType.
Method -> String -> APIQuery -> APIRequest supports responseType
APIRequest Method
"GET" (String
endpoint String -> String -> String
forall a. [a] -> [a] -> [a]
++ String
"lists/subscribers.json") (ListParam -> APIQuery
mkListParam ListParam
q)
type ListsSubscribers =
'[ "count" ':= Integer
, "cursor" ':= Integer
, "skip_status" ':= Bool
]
listsSubscriptions :: Maybe UserParam -> APIRequest ListsSubscriptions (WithCursor Integer ListsCursorKey List)
listsSubscriptions :: Maybe UserParam
-> APIRequest FriendsIds (WithCursor StatusId ListsCursorKey List)
listsSubscriptions Maybe UserParam
q = Method
-> String
-> APIQuery
-> APIRequest FriendsIds (WithCursor StatusId ListsCursorKey List)
forall (supports :: [Param Symbol *]) responseType.
Method -> String -> APIQuery -> APIRequest supports responseType
APIRequest Method
"GET" (String
endpoint String -> String -> String
forall a. [a] -> [a] -> [a]
++ String
"lists/subscriptions.json") (APIQuery
-> APIRequest FriendsIds (WithCursor StatusId ListsCursorKey List))
-> APIQuery
-> APIRequest FriendsIds (WithCursor StatusId ListsCursorKey List)
forall a b. (a -> b) -> a -> b
$ APIQuery -> (UserParam -> APIQuery) -> Maybe UserParam -> APIQuery
forall b a. b -> (a -> b) -> Maybe a -> b
maybe [] UserParam -> APIQuery
mkUserParam Maybe UserParam
q
type ListsSubscriptions =
'[ "count" ':= Integer
, "cursor" ':= Integer
]
listsOwnerships :: Maybe UserParam -> APIRequest ListsOwnerships (WithCursor Integer ListsCursorKey List)
listsOwnerships :: Maybe UserParam
-> APIRequest FriendsIds (WithCursor StatusId ListsCursorKey List)
listsOwnerships Maybe UserParam
q = Method
-> String
-> APIQuery
-> APIRequest FriendsIds (WithCursor StatusId ListsCursorKey List)
forall (supports :: [Param Symbol *]) responseType.
Method -> String -> APIQuery -> APIRequest supports responseType
APIRequest Method
"GET" (String
endpoint String -> String -> String
forall a. [a] -> [a] -> [a]
++ String
"lists/ownerships.json") (APIQuery
-> APIRequest FriendsIds (WithCursor StatusId ListsCursorKey List))
-> APIQuery
-> APIRequest FriendsIds (WithCursor StatusId ListsCursorKey List)
forall a b. (a -> b) -> a -> b
$ APIQuery -> (UserParam -> APIQuery) -> Maybe UserParam -> APIQuery
forall b a. b -> (a -> b) -> Maybe a -> b
maybe [] UserParam -> APIQuery
mkUserParam Maybe UserParam
q
type ListsOwnerships =
'[ "count" ':= Integer
, "cursor" ':= Integer
]
listsMembersCreateAll :: ListParam -> UserListParam -> APIRequest ListsMembersCreateAll List
listsMembersCreateAll :: ListParam -> UserListParam -> APIRequest DirectMessagesDestroy List
listsMembersCreateAll ListParam
list UserListParam
users = Method
-> String -> APIQuery -> APIRequest DirectMessagesDestroy List
forall (supports :: [Param Symbol *]) responseType.
Method -> String -> APIQuery -> APIRequest supports responseType
APIRequest Method
"POST" (String
endpoint String -> String -> String
forall a. [a] -> [a] -> [a]
++ String
"lists/members/create_all.json") (ListParam -> APIQuery
mkListParam ListParam
list APIQuery -> APIQuery -> APIQuery
forall a. [a] -> [a] -> [a]
++ UserListParam -> APIQuery
mkUserListParam UserListParam
users)
type ListsMembersCreateAll = EmptyParams
listsMembersDestroyAll :: ListParam -> UserListParam -> APIRequest ListsMembersDestroyAll List
listsMembersDestroyAll :: ListParam -> UserListParam -> APIRequest DirectMessagesDestroy List
listsMembersDestroyAll ListParam
list UserListParam
users = Method
-> String -> APIQuery -> APIRequest DirectMessagesDestroy List
forall (supports :: [Param Symbol *]) responseType.
Method -> String -> APIQuery -> APIRequest supports responseType
APIRequest Method
"POST" (String
endpoint String -> String -> String
forall a. [a] -> [a] -> [a]
++ String
"lists/members/destroy_all.json") (ListParam -> APIQuery
mkListParam ListParam
list APIQuery -> APIQuery -> APIQuery
forall a. [a] -> [a] -> [a]
++ UserListParam -> APIQuery
mkUserListParam UserListParam
users)
type ListsMembersDestroyAll = EmptyParams
listsMembers :: ListParam -> APIRequest ListsMembers (WithCursor Integer UsersCursorKey User)
listsMembers :: ListParam
-> APIRequest
ListsSubscribers (WithCursor StatusId UsersCursorKey User)
listsMembers ListParam
q = Method
-> String
-> APIQuery
-> APIRequest
ListsSubscribers (WithCursor StatusId UsersCursorKey User)
forall (supports :: [Param Symbol *]) responseType.
Method -> String -> APIQuery -> APIRequest supports responseType
APIRequest Method
"GET" (String
endpoint String -> String -> String
forall a. [a] -> [a] -> [a]
++ String
"lists/members.json") (ListParam -> APIQuery
mkListParam ListParam
q)
type ListsMembers =
'[ "count" ':= Integer
, "cursor" ':= Integer
, "skip_status" ':= Bool
]
listsMembersCreate :: ListParam -> UserParam -> APIRequest ListsMembersCreate List
listsMembersCreate :: ListParam -> UserParam -> APIRequest DirectMessagesDestroy List
listsMembersCreate ListParam
list UserParam
user = Method
-> String -> APIQuery -> APIRequest DirectMessagesDestroy List
forall (supports :: [Param Symbol *]) responseType.
Method -> String -> APIQuery -> APIRequest supports responseType
APIRequest Method
"POST" (String
endpoint String -> String -> String
forall a. [a] -> [a] -> [a]
++ String
"lists/members/create.json") (ListParam -> APIQuery
mkListParam ListParam
list APIQuery -> APIQuery -> APIQuery
forall a. [a] -> [a] -> [a]
++ UserParam -> APIQuery
mkUserParam UserParam
user)
type ListsMembersCreate = EmptyParams
listsDestroy :: ListParam -> APIRequest ListsDestroy List
listsDestroy :: ListParam -> APIRequest DirectMessagesDestroy List
listsDestroy ListParam
list = Method
-> String -> APIQuery -> APIRequest DirectMessagesDestroy List
forall (supports :: [Param Symbol *]) responseType.
Method -> String -> APIQuery -> APIRequest supports responseType
APIRequest Method
"POST" (String
endpoint String -> String -> String
forall a. [a] -> [a] -> [a]
++ String
"lists/destroy.json") (ListParam -> APIQuery
mkListParam ListParam
list)
type ListsDestroy = EmptyParams
listsUpdate ::
ListParam ->
Bool ->
Maybe T.Text ->
APIRequest ListsUpdate List
listsUpdate :: ListParam
-> Bool -> Maybe Text -> APIRequest DirectMessagesDestroy List
listsUpdate ListParam
list Bool
isPublic Maybe Text
description = Method
-> String -> APIQuery -> APIRequest DirectMessagesDestroy List
forall (supports :: [Param Symbol *]) responseType.
Method -> String -> APIQuery -> APIRequest supports responseType
APIRequest Method
"POST" (String
endpoint String -> String -> String
forall a. [a] -> [a] -> [a]
++ String
"lists/update.json") (ListParam -> APIQuery
mkListParam ListParam
list APIQuery -> APIQuery -> APIQuery
forall a. [a] -> [a] -> [a]
++ APIQuery
p')
where
p :: APIQuery
p = [(Method
"mode", Text -> PV
PVString (Text -> PV) -> (Bool -> Text) -> Bool -> PV
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Bool -> Text
forall p. IsString p => Bool -> p
mode (Bool -> PV) -> Bool -> PV
forall a b. (a -> b) -> a -> b
$ Bool
isPublic)]
p' :: APIQuery
p' = (APIQuery -> APIQuery)
-> (Text -> APIQuery -> APIQuery)
-> Maybe Text
-> APIQuery
-> APIQuery
forall b a. b -> (a -> b) -> Maybe a -> b
maybe APIQuery -> APIQuery
forall a. a -> a
id (\Text
d -> ((Method
"description", Text -> PV
PVString Text
d) (Method, PV) -> APIQuery -> APIQuery
forall a. a -> [a] -> [a]
:)) Maybe Text
description APIQuery
p
mode :: Bool -> p
mode Bool
True = p
"public"
mode Bool
False = p
"private"
type ListsUpdate = EmptyParams
listsCreate ::
T.Text ->
Bool ->
Maybe T.Text ->
APIRequest ListsCreate List
listsCreate :: Text -> Bool -> Maybe Text -> APIRequest DirectMessagesDestroy List
listsCreate Text
name Bool
isPublic Maybe Text
description = Method
-> String -> APIQuery -> APIRequest DirectMessagesDestroy List
forall (supports :: [Param Symbol *]) responseType.
Method -> String -> APIQuery -> APIRequest supports responseType
APIRequest Method
"POST" (String
endpoint String -> String -> String
forall a. [a] -> [a] -> [a]
++ String
"lists/create.json") APIQuery
p'
where
p :: APIQuery
p = [(Method
"name", Text -> PV
PVString Text
name), (Method
"mode", Text -> PV
PVString (Text -> PV) -> (Bool -> Text) -> Bool -> PV
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Bool -> Text
forall p. IsString p => Bool -> p
mode (Bool -> PV) -> Bool -> PV
forall a b. (a -> b) -> a -> b
$ Bool
isPublic)]
p' :: APIQuery
p' = (APIQuery -> APIQuery)
-> (Text -> APIQuery -> APIQuery)
-> Maybe Text
-> APIQuery
-> APIQuery
forall b a. b -> (a -> b) -> Maybe a -> b
maybe APIQuery -> APIQuery
forall a. a -> a
id (\Text
d -> ((Method
"description", Text -> PV
PVString Text
d) (Method, PV) -> APIQuery -> APIQuery
forall a. a -> [a] -> [a]
:)) Maybe Text
description APIQuery
p
mode :: Bool -> p
mode Bool
True = p
"public"
mode Bool
False = p
"private"
type ListsCreate = EmptyParams
listsShow :: ListParam -> APIRequest ListsShow List
listsShow :: ListParam -> APIRequest DirectMessagesDestroy List
listsShow ListParam
q = Method
-> String -> APIQuery -> APIRequest DirectMessagesDestroy List
forall (supports :: [Param Symbol *]) responseType.
Method -> String -> APIQuery -> APIRequest supports responseType
APIRequest Method
"GET" (String
endpoint String -> String -> String
forall a. [a] -> [a] -> [a]
++ String
"lists/show.json") (ListParam -> APIQuery
mkListParam ListParam
q)
type ListsShow = EmptyParams
mediaUpload ::
MediaData ->
APIRequest MediaUpload UploadedMedia
mediaUpload :: MediaData -> APIRequest DirectMessagesDestroy UploadedMedia
mediaUpload MediaData
mediaData =
Method
-> String
-> APIQuery
-> [Part]
-> APIRequest DirectMessagesDestroy UploadedMedia
forall (supports :: [Param Symbol *]) responseType.
Method
-> String -> APIQuery -> [Part] -> APIRequest supports responseType
APIRequestMultipart Method
"POST" String
uri [] [MediaData -> Part
mediaBody MediaData
mediaData]
where
uri :: String
uri = String
"https://upload.twitter.com/1.1/media/upload.json"
mediaBody :: MediaData -> Part
mediaBody (MediaFromFile String
fp) = Text -> String -> Part
partFileSource Text
"media" String
fp
mediaBody (MediaRequestBody String
filename RequestBody
filebody) = Text -> String -> RequestBody -> Part
forall (m :: * -> *).
Applicative m =>
Text -> String -> RequestBody -> PartM m
partFileRequestBody Text
"media" String
filename RequestBody
filebody
type MediaUpload = EmptyParams