Copyright | (c) 2013-2015 Brendan Hay |
---|---|
License | Mozilla Public License, v. 2.0. |
Maintainer | Brendan Hay <brendan.g.hay@gmail.com> |
Stability | provisional |
Portability | non-portable (GHC extensions) |
Safe Haskell | None |
Language | Haskell2010 |
- newtype AccessKey = AccessKey ByteString
- newtype SecretKey = SecretKey ByteString
- newtype SessionToken = SessionToken ByteString
- data AuthEnv = AuthEnv {}
- data Auth
- withAuth :: MonadIO m => Auth -> (AuthEnv -> m a) -> m a
- data LogLevel
- type Logger = LogLevel -> Builder -> IO ()
- data Abbrev
- class AWSSigner (Sg a) => AWSService a where
- data Service s = Service {
- _svcAbbrev :: !Abbrev
- _svcPrefix :: ByteString
- _svcVersion :: ByteString
- _svcEndpoint :: Region -> Endpoint
- _svcTimeout :: Maybe Seconds
- _svcStatus :: Status -> Bool
- _svcError :: Abbrev -> Status -> [Header] -> LazyByteString -> Error
- _svcRetry :: Retry
- serviceOf :: forall a. AWSService (Sv a) => a -> Service (Sv a)
- data Retry = Exponential {
- _retryBase :: !Double
- _retryGrowth :: !Int
- _retryAttempts :: !Int
- _retryCheck :: ServiceError -> Maybe Text
- class AWSSigner v where
- class AWSPresigner v where
- data family Meta v :: *
- data Signed v a where
- Signed :: ToLog (Meta v) => {
- _sgMeta :: Meta v
- _sgRequest :: ClientRequest
- Signed :: ToLog (Meta v) => {
- sgMeta :: ToLog (Meta v) => Lens' (Signed v a) (Meta v)
- sgRequest :: Lens' (Signed v a) ClientRequest
- class AWSService (Sv a) => AWSRequest a where
- data Request a = Request {
- _rqMethod :: !StdMethod
- _rqPath :: !RawPath
- _rqQuery :: !QueryString
- _rqHeaders :: ![Header]
- _rqBody :: !RqBody
- rqMethod :: Lens' (Request a) StdMethod
- rqHeaders :: Lens' (Request a) [Header]
- rqPath :: Lens' (Request a) RawPath
- rqQuery :: Lens' (Request a) QueryString
- rqBody :: Lens' (Request a) RqBody
- type Response a = (Status, Rs a)
- class AsError a where
- data Error
- data HttpException :: *
- data SerializeError = SerializeError' {}
- serializeAbbrev :: Lens' SerializeError Abbrev
- serializeStatus :: Lens' SerializeError Status
- serializeMessage :: Lens' SerializeError String
- data ServiceError = ServiceError' {}
- serviceAbbrev :: Lens' ServiceError Abbrev
- serviceStatus :: Lens' ServiceError Status
- serviceHeaders :: Lens' ServiceError [Header]
- serviceCode :: Lens' ServiceError ErrorCode
- serviceMessage :: Lens' ServiceError (Maybe ErrorMessage)
- serviceRequestId :: Lens' ServiceError (Maybe RequestId)
- newtype ErrorCode = ErrorCode Text
- newtype ErrorMessage = ErrorMessage Text
- newtype RequestId = RequestId Text
- data Endpoint = Endpoint {}
- data Region
- type ClientRequest = Request
- type ClientResponse = Response ResponseBody
- type ResponseBody = ResumableSource (ResourceT IO) ByteString
- clientRequest :: ClientRequest
- newtype Seconds = Seconds Int
- _Seconds :: Iso' Seconds Int
- seconds :: Seconds -> Int
- microseconds :: Seconds -> Int
- _Coerce :: (Coercible a b, Coercible b a) => Iso' a b
- _Default :: Monoid a => Iso' (Maybe a) a
Authentication
Credentials
Access key credential.
Secret key credential.
newtype SessionToken Source
A session token used by STS to temporarily authorise access to an AWS resource.
Environment
The authorisation environment.
An authorisation environment containing AWS credentials, and potentially a reference which can be refreshed out-of-band as temporary credentials expire.
Logging
type Logger = LogLevel -> Builder -> IO () Source
A function threaded through various request and serialisation routines to log informational and debug messages.
Services
Abbreviated service name.
class AWSSigner (Sg a) => AWSService a where Source
Attributes and functions specific to an AWS service.
Service | |
|
Retries
Constants and predicates used to create a RetryPolicy
.
Exponential | |
|
Signing
class AWSPresigner v where Source
data family Meta v :: * Source
Signing metadata data specific to a signing algorithm.
Note: this is used for logging purposes, and is otherwise ignored.
ToLog (Meta V2) | |
ToLog (Meta V4) | |
data Meta V2 = Meta {
| |
data Meta V4 = Meta {
|
A signed ClientRequest
and associated metadata specific to the signing
algorithm that was used.
Signed :: ToLog (Meta v) => Meta v -> ClientRequest -> Signed v a | |
|
sgRequest :: Lens' (Signed v a) ClientRequest Source
Requests
class AWSService (Sv a) => AWSRequest a where Source
Specify how a request can be de/serialised.
The successful, expected response associated with a request.
The default sevice configuration for the request.
An unsigned request.
rqQuery :: Lens' (Request a) QueryString Source
Responses
Errors
_Error :: Prism' a Error Source
A general Amazonka error.
_TransportError :: Prism' a HttpException Source
An error occured while communicating over HTTP with a remote service.
_SerializeError :: Prism' a SerializeError Source
A serialisation error occured when attempting to deserialise a response.
_ServiceError :: Prism' a ServiceError Source
A service specific error returned by the remote service.
An error type representing errors that can be attributed to this library.
HTTP Errors
data HttpException :: *
Serialize Errors
data SerializeError Source
Service Errors
Error Types
newtype ErrorMessage Source
Regions
The sum of available AWS regions.
Ireland | Europe / eu-west-1 |
Frankfurt | Europe / eu-central-1 |
Tokyo | Asia Pacific / ap-northeast-1 |
Singapore | Asia Pacific / ap-southeast-1 |
Sydney | Asia Pacific / ap-southeast-2 |
Beijing | China / cn-north-1 |
NorthVirginia | US / us-east-1 |
NorthCalifornia | US / us-west-1 |
Oregon | US / us-west-2 |
GovCloud | AWS GovCloud / us-gov-west-1 |
GovCloudFIPS | AWS GovCloud (FIPS 140-2) S3 Only / fips-us-gov-west-1 |
SaoPaulo | South America / sa-east-1 |
HTTP
type ClientRequest = Request Source
A convenience alias to avoid type ambiguity.
type ClientResponse = Response ResponseBody Source
A convenience alias encapsulating the common Response
.
type ResponseBody = ResumableSource (ResourceT IO) ByteString Source
A convenience alias encapsulating the common Response
body.
clientRequest :: ClientRequest Source
Construct a ClientRequest
using common parameters such as TLS and prevent
throwing errors when receiving erroneous status codes in respones.
Seconds
An integral value representing seconds.
microseconds :: Seconds -> Int Source