ms-graph-api-0.6.0.0: Microsoft Graph API
Safe HaskellSafe-Inferred
LanguageHaskell2010

MSGraphAPI.Internal.Common

Description

Synopsis

GET

get Source #

Arguments

:: FromJSON a 
=> [Text]

URI path segments

-> Option 'Https 
-> AccessToken 
-> Req a 
GET https://graph.microsoft.com/v1.0/...

getLbs Source #

Arguments

:: [Text]

URI path segments

-> Option 'Https 
-> AccessToken 
-> Req ByteString 
GET https://graph.microsoft.com/v1.0/...

Returns the response body as a bytestring, e.g. for endpoints that download files or general bytestring payloads

catch HTTP exceptions

getE Source #

Arguments

:: FromJSON a 
=> [Text]

URI path segments

-> Option 'Https 
-> AccessToken 
-> Req (Either HttpException a) 

Like get but catches HttpExceptions to allow pattern matching

POST

post Source #

Arguments

:: (ToJSON a, FromJSON b) 
=> [Text]

URI path segments

-> Option 'Https 
-> a

request body

-> AccessToken 
-> Req b 
POST https://graph.microsoft.com/v1.0/...

catch HTTP exceptions

postE Source #

Arguments

:: (ToJSON a, FromJSON b) 
=> [Text]

URI path segments

-> Option 'Https 
-> a 
-> AccessToken 
-> Req (Either HttpException b) 

Like post but catches HttpExceptions to allow pattern matching

running requests

runReq #

Arguments

:: MonadIO m 
=> HttpConfig

HttpConfig to use

-> Req a

Computation to run

-> m a 

Run a computation in the Req monad with the given HttpConfig. In the case of an exceptional situation an HttpException will be thrown.

Since: req-0.4.0

tryReq :: Req a -> Req (Either HttpException a) Source #

Specialized version of try to HttpExceptions

This can be used to catch exceptions of composite Req statements, e.g. around a do block

JSON : aeson helpers

data Collection a Source #

a collection of items with key value

Constructors

Collection 

Fields

Instances

Instances details
FromJSON a => FromJSON (Collection a) Source # 
Instance details

Defined in MSGraphAPI.Internal.Common

Generic (Collection a) Source # 
Instance details

Defined in MSGraphAPI.Internal.Common

Associated Types

type Rep (Collection a) :: Type -> Type #

Methods

from :: Collection a -> Rep (Collection a) x #

to :: Rep (Collection a) x -> Collection a #

Show a => Show (Collection a) Source # 
Instance details

Defined in MSGraphAPI.Internal.Common

Eq a => Eq (Collection a) Source # 
Instance details

Defined in MSGraphAPI.Internal.Common

Methods

(==) :: Collection a -> Collection a -> Bool #

(/=) :: Collection a -> Collection a -> Bool #

type Rep (Collection a) Source # 
Instance details

Defined in MSGraphAPI.Internal.Common

type Rep (Collection a) = D1 ('MetaData "Collection" "MSGraphAPI.Internal.Common" "ms-graph-api-0.6.0.0-6WfOhvX5Fo5Ch00DaiDjHP" 'False) (C1 ('MetaCons "Collection" 'PrefixI 'True) (S1 ('MetaSel ('Just "cValue") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [a])))

aesonOptions Source #

Arguments

:: String

record prefix

-> Options 

drop the prefix and lowercase first character

e.g. userDisplayName -> displayName