| Safe Haskell | None |
|---|---|
| Language | Haskell98 |
Network.Google
Description
Helper functions for accessing Google APIs.
- type AccessToken = ByteString
- toAccessToken :: String -> AccessToken
- type ProjectId = String
- appendBody :: ByteString -> Request -> Request
- appendHeaders :: [(String, String)] -> Request -> Request
- appendQuery :: [(String, String)] -> Request -> Request
- doManagedRequest :: DoRequest a => Manager -> Request -> IO a
- doRequest :: DoRequest a => Request -> IO a
- makeHeaderName :: String -> CI ByteString
- makeProjectRequest :: ProjectId -> AccessToken -> (String, String) -> String -> (String, String) -> Request
- makeRequest :: AccessToken -> (String, String) -> String -> (String, String) -> Request
- makeRequestValue :: String -> ByteString
Types
type AccessToken = ByteString Source
OAuth 2.0 access token.
Arguments
| :: String | The string. |
| -> AccessToken | The OAuth 2.0 access token. |
Convert a string to an access token.
type ProjectId = String Source
Google API project ID, see https://code.google.com/apis/console.
Functions
Arguments
| :: ByteString | The data for the body. |
| -> Request | The request. |
| -> Request | The request with the body appended. |
Append a body to a request.
Arguments
| :: [(String, String)] | The (name/key, value) pairs for the headers. |
| -> Request | The request. |
| -> Request | The request with the additional headers. |
Append headers to a request.
Arguments
| :: [(String, String)] | The query keys and values. |
| -> Request | The request. |
| -> Request | The request with the query appended. |
Append a query to a request.
Arguments
| :: DoRequest a | |
| => Request | The request. |
| -> IO a | The action returning the result of performing the request. |
Perform a request.
Arguments
| :: String | The name. |
| -> CI ByteString | The prepared name. TODO: In principle, we should UTF-8 encode the bytestrings packed below. |
Prepare a name/key for a header.
Arguments
| :: ProjectId | The project ID. |
| -> AccessToken | The OAuth 2.0 access token. |
| -> (String, String) | The Google API name and version. |
| -> String | The HTTP method. |
| -> (String, String) | The host and path for the request. |
| -> Request | The HTTP request. |
Construct a project-related Google API request.
Arguments
| :: AccessToken | The OAuth 2.0 access token. |
| -> (String, String) | The Google API name and version. |
| -> String | The HTTP method. |
| -> (String, String) | The host and path for the request. |
| -> Request | The HTTP request. |
Construct a Google API request.
Arguments
| :: String | The string. |
| -> ByteString | The prepared string. TODO: In principle, we should UTF-8 encode the bytestrings packed below. |
Prepare a string for inclusion in a request.