Safe Haskell | None |
---|---|
Language | Haskell2010 |
A dropbox client
Synopsis
- createClient :: IO (Dropbox (AsClientT IO))
- cliRoutes :: ClientEnv -> Dropbox (AsClientT IO)
- data Dropbox route = Dropbox {
- _dropbox_list_folder :: route :- ("2" :> ("files" :> ("list_folder" :> (Auth '[Bearer] Token :> (ReqBody '[JSON] ListFolderRequest :> Post '[JSON] ListFolderResponse)))))
- _dropbox_get_temporary_link :: route :- ("2" :> ("files" :> ("get_temporary_link" :> (Auth '[Bearer] Token :> (ReqBody '[JSON] LinkRequest :> Post '[JSON] LinkResponse)))))
- _dropbox_token :: route :- ("oauth2" :> ("token" :> (ReqBody '[FormUrlEncoded] TokenBody :> Post '[JSON] TokenRequest)))
- defListFolderRequest :: ListFolderRequest
- data FileTag
- data Entry = Entry {}
- newtype ListFolderResponse = ListFolderResponse {}
- data ListFolderRequest
- path :: ListFolderRequest -> String
- newtype LinkResponse = LinkResponse {}
- newtype LinkRequest = LinkRequest {}
- data TokenRequest = TokenRequest {
- trAccessToken :: Text
- trExpiresIn :: Maybe Int
- trTokenType :: Text
- trRefreshToken :: Maybe Text
- trScope :: Text
- trAccountId :: Text
- trUid :: Text
- data TokenBody = TokenBody {
- code :: Maybe Text
- refresh_token :: Maybe Text
- grant_type :: Text
- redirect_uri :: Text
- client_id :: Text
- client_secret :: Text
- dropboxProxy :: Proxy (ToServant Dropbox AsApi)
Documentation
cliRoutes :: ClientEnv -> Dropbox (AsClientT IO) Source #
gives an adhoc client. This throws exceptions
To use the various endpoints make sure you have the right
scope in your app
on dropbox: https://www.dropbox.com/developers/apps/info/t282kls5wbrtofs#permissions
then regenerate your token (because it's attached to that)
Dropbox | |
|
Instances
Generic (Dropbox route) Source # | |
type Rep (Dropbox route) Source # | |
Defined in Dropbox type Rep (Dropbox route) = D1 ('MetaData "Dropbox" "Dropbox" "dropbox-0.0.4-inplace" 'False) (C1 ('MetaCons "Dropbox" 'PrefixI 'True) (S1 ('MetaSel ('Just "_dropbox_list_folder") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (route :- ("2" :> ("files" :> ("list_folder" :> (Auth '[Bearer] Token :> (ReqBody '[JSON] ListFolderRequest :> Post '[JSON] ListFolderResponse))))))) :*: (S1 ('MetaSel ('Just "_dropbox_get_temporary_link") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (route :- ("2" :> ("files" :> ("get_temporary_link" :> (Auth '[Bearer] Token :> (ReqBody '[JSON] LinkRequest :> Post '[JSON] LinkResponse))))))) :*: S1 ('MetaSel ('Just "_dropbox_token") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (route :- ("oauth2" :> ("token" :> (ReqBody '[FormUrlEncoded] TokenBody :> Post '[JSON] TokenRequest)))))))) |
Instances
Eq Entry Source # | |
Show Entry Source # | |
Generic Entry Source # | |
FromJSON Entry Source # | |
type Rep Entry Source # | |
Defined in Dropbox type Rep Entry = D1 ('MetaData "Entry" "Dropbox" "dropbox-0.0.4-inplace" 'False) (C1 ('MetaCons "Entry" 'PrefixI 'True) ((S1 ('MetaSel ('Just "eTag") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 FileTag) :*: S1 ('MetaSel ('Just "eName") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text)) :*: (S1 ('MetaSel ('Just "ePathDisplay") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text) :*: S1 ('MetaSel ('Just "eId") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text)))) |
newtype ListFolderResponse Source #
Instances
data ListFolderRequest Source #
Instances
path :: ListFolderRequest -> String Source #
newtype LinkResponse Source #
Instances
Show LinkResponse Source # | |
Defined in Dropbox showsPrec :: Int -> LinkResponse -> ShowS # show :: LinkResponse -> String # showList :: [LinkResponse] -> ShowS # | |
Generic LinkResponse Source # | |
Defined in Dropbox type Rep LinkResponse :: Type -> Type # from :: LinkResponse -> Rep LinkResponse x # to :: Rep LinkResponse x -> LinkResponse # | |
FromJSON LinkResponse Source # | |
Defined in Dropbox parseJSON :: Value -> Parser LinkResponse # parseJSONList :: Value -> Parser [LinkResponse] # | |
type Rep LinkResponse Source # | |
Defined in Dropbox type Rep LinkResponse = D1 ('MetaData "LinkResponse" "Dropbox" "dropbox-0.0.4-inplace" 'True) (C1 ('MetaCons "LinkResponse" 'PrefixI 'True) (S1 ('MetaSel ('Just "link") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text))) |
newtype LinkRequest Source #
Instances
Generic LinkRequest Source # | |
Defined in Dropbox type Rep LinkRequest :: Type -> Type # from :: LinkRequest -> Rep LinkRequest x # to :: Rep LinkRequest x -> LinkRequest # | |
ToJSON LinkRequest Source # | |
Defined in Dropbox toJSON :: LinkRequest -> Value # toEncoding :: LinkRequest -> Encoding # toJSONList :: [LinkRequest] -> Value # toEncodingList :: [LinkRequest] -> Encoding # | |
type Rep LinkRequest Source # | |
Defined in Dropbox type Rep LinkRequest = D1 ('MetaData "LinkRequest" "Dropbox" "dropbox-0.0.4-inplace" 'True) (C1 ('MetaCons "LinkRequest" 'PrefixI 'True) (S1 ('MetaSel ('Just "linkPath") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 String))) |
data TokenRequest Source #
TokenRequest | |
|
Instances
TokenBody | |
|
Instances
Show TokenBody Source # | |
Generic TokenBody Source # | |
ToForm TokenBody Source # | |
type Rep TokenBody Source # | |
Defined in Dropbox type Rep TokenBody = D1 ('MetaData "TokenBody" "Dropbox" "dropbox-0.0.4-inplace" 'False) (C1 ('MetaCons "TokenBody" 'PrefixI 'True) ((S1 ('MetaSel ('Just "code") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Text)) :*: (S1 ('MetaSel ('Just "refresh_token") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Text)) :*: S1 ('MetaSel ('Just "grant_type") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text))) :*: (S1 ('MetaSel ('Just "redirect_uri") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text) :*: (S1 ('MetaSel ('Just "client_id") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text) :*: S1 ('MetaSel ('Just "client_secret") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text))))) |