| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Network.API.TheMovieDB.Internal.TheMovieDB
- data TheMovieDB a
- type RequestFunction = Path -> QueryText -> IO (Either Error Body)
- getAndParse :: FromJSON a => Path -> QueryText -> TheMovieDB a
- tmdbError :: Error -> TheMovieDB a
- runTheMovieDB :: Key -> TheMovieDB a -> IO (Either Error a)
- runTheMovieDBWithManager :: Manager -> Key -> TheMovieDB a -> IO (Either Error a)
- runTheMovieDBWithRequestFunction :: RequestFunction -> TheMovieDB a -> IO (Either Error a)
Documentation
type RequestFunction = Path -> QueryText -> IO (Either Error Body) Source #
The type for functions that make requests to the API (or pretend to make a request for testing purposes).
getAndParse :: FromJSON a => Path -> QueryText -> TheMovieDB a Source #
Helper function to preform an HTTP GET and decode the JSON result.
tmdbError :: Error -> TheMovieDB a Source #
Create a TheMovieDB value representing an error.
Arguments
| :: Key | The API key to include in all requests. |
| -> TheMovieDB a | The API calls to make. |
| -> IO (Either Error a) | Response or error. |
Execute requests for TheMovieDB with the given API key and produce either an error or a result.
This version creates a temporary Manager using
tlsManagerSettings. If you want to use an existing Manager you
should use runTheMovieDBWithManager instead.
runTheMovieDBWithManager Source #
Arguments
| :: Manager | The |
| -> Key | The API key to include in all requests. |
| -> TheMovieDB a | The API calls to make. |
| -> IO (Either Error a) | Response or error. |
Execute requests for TheMovieDB with the given API key and produce either an error or a result.
This version allows you to provide a Manager value which should
have been created to allow TLS requests (e.g., with tlsManagerSettings).
runTheMovieDBWithRequestFunction Source #
Arguments
| :: RequestFunction | The request function to use. |
| -> TheMovieDB a | The API calls to make. |
| -> IO (Either Error a) | Response. |
Low-level interface for executing a TheMovieDB using the given
request function.