1
0
Fork 0
tooty/src/Mastodon/ApiUrl.elm

152 lines
2.3 KiB
Elm
Raw Normal View History

2017-04-26 15:07:43 +00:00
module Mastodon.ApiUrl
exposing
( apps
, oauthAuthorize
, oauthToken
, userAccount
2017-04-26 15:07:43 +00:00
, account
2017-04-27 20:01:51 +00:00
, accountTimeline
, followers
, following
2017-04-29 07:20:26 +00:00
, status
2017-04-26 15:07:43 +00:00
, homeTimeline
, publicTimeline
, notifications
, relationships
2017-04-26 15:07:43 +00:00
, statuses
, context
2017-04-26 15:07:43 +00:00
, reblog
, unreblog
, favourite
, unfavourite
, follow
, unfollow
2017-04-26 15:07:43 +00:00
, streaming
, searchAccount
2017-04-26 15:07:43 +00:00
)
apiPrefix : String
apiPrefix =
"/api/v1"
2017-04-26 15:07:43 +00:00
2017-05-02 20:05:46 +00:00
apps : String
apps =
apiPrefix ++ "/apps"
2017-04-26 15:07:43 +00:00
2017-05-02 20:05:46 +00:00
oauthAuthorize : String
oauthAuthorize =
"/oauth/authorize"
2017-04-26 15:07:43 +00:00
2017-05-02 20:05:46 +00:00
oauthToken : String
oauthToken =
"/oauth/token"
2017-04-26 15:07:43 +00:00
accounts : String
accounts =
apiPrefix ++ "/accounts/"
2017-04-26 15:07:43 +00:00
account : Int -> String
account id =
accounts ++ (toString id)
2017-05-02 20:05:46 +00:00
follow : Int -> String
follow id =
accounts ++ (toString id) ++ "/follow"
2017-05-02 20:05:46 +00:00
unfollow : Int -> String
unfollow id =
accounts ++ (toString id) ++ "/unfollow"
2017-05-02 20:05:46 +00:00
userAccount : String
userAccount =
accounts ++ "verify_credentials"
2017-05-02 20:05:46 +00:00
searchAccount : String
searchAccount =
accounts ++ "search"
relationships : String
relationships =
accounts ++ "relationships"
followers : Int -> String
followers id =
(account id) ++ "/followers"
following : Int -> String
following id =
(account id) ++ "/following"
2017-04-26 15:07:43 +00:00
homeTimeline : String
homeTimeline =
apiPrefix ++ "/timelines/home"
2017-04-26 15:07:43 +00:00
publicTimeline : String
publicTimeline =
apiPrefix ++ "/timelines/public"
2017-04-26 15:07:43 +00:00
2017-04-27 20:01:51 +00:00
accountTimeline : Int -> String
accountTimeline id =
(account id) ++ "/statuses"
2017-04-26 15:07:43 +00:00
notifications : String
notifications =
apiPrefix ++ "/notifications"
2017-04-26 15:07:43 +00:00
2017-05-02 20:05:46 +00:00
statuses : String
statuses =
apiPrefix ++ "/statuses"
2017-04-26 15:07:43 +00:00
2017-05-02 20:05:46 +00:00
context : Int -> String
context id =
statuses ++ "/" ++ (toString id) ++ "/context"
2017-05-02 20:05:46 +00:00
reblog : Int -> String
reblog id =
statuses ++ "/" ++ (toString id) ++ "/reblog"
2017-04-26 15:07:43 +00:00
2017-05-02 20:05:46 +00:00
status : Int -> String
status id =
statuses ++ "/" ++ (toString id)
2017-04-29 07:20:26 +00:00
2017-05-02 20:05:46 +00:00
unreblog : Int -> String
unreblog id =
statuses ++ "/" ++ (toString id) ++ "/unreblog"
2017-04-26 15:07:43 +00:00
2017-05-02 20:05:46 +00:00
favourite : Int -> String
favourite id =
statuses ++ "/" ++ (toString id) ++ "/favourite"
2017-04-26 15:07:43 +00:00
2017-05-02 20:05:46 +00:00
unfavourite : Int -> String
unfavourite id =
statuses ++ "/" ++ (toString id) ++ "/unfavourite"
2017-04-26 15:07:43 +00:00
2017-05-02 20:05:46 +00:00
streaming : String
streaming =
apiPrefix ++ "/streaming/"