themoviedb-1.1.4.0: Haskell API bindings for http://themoviedb.org

Safe HaskellNone
LanguageHaskell2010

Network.API.TheMovieDB.Internal.TheMovieDB

Synopsis

Documentation

data TheMovieDB a Source #

Result type for operations involving TheMovieDB API.

Instances

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.

runTheMovieDB Source #

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 Manager to use.

-> 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.