Copyright | (c) 2013-2016 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 ()
- type Algorithm a = Request a -> AuthEnv -> Region -> UTCTime -> Signed a
- data Meta where
- data Signer = Signer {}
- data Signed a = Signed {
- sgMeta :: !Meta
- sgRequest :: !ClientRequest
- data Abbrev
- data Service = Service {
- _svcAbbrev :: !Abbrev
- _svcSigner :: !Signer
- _svcPrefix :: !ByteString
- _svcVersion :: !ByteString
- _svcEndpoint :: !(Region -> Endpoint)
- _svcTimeout :: !(Maybe Seconds)
- _svcCheck :: !(Status -> Bool)
- _svcError :: !(Status -> [Header] -> LazyByteString -> Error)
- _svcRetry :: !Retry
- serviceSigner :: Lens' Service Signer
- serviceEndpoint :: Setter' Service Endpoint
- serviceTimeout :: Lens' Service (Maybe Seconds)
- serviceCheck :: Lens' Service (Status -> Bool)
- serviceRetry :: Lens' Service Retry
- class AWSRequest a where
- data Request a = Request {
- _rqService :: !Service
- _rqMethod :: !StdMethod
- _rqPath :: !RawPath
- _rqQuery :: !QueryString
- _rqHeaders :: ![Header]
- _rqBody :: !RqBody
- rqService :: Lens' (Request a) Service
- 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
- rqSign :: Algorithm a
- rqPresign :: Seconds -> Algorithm a
- type Response a = (Status, Rs a)
- data Retry = Exponential {
- _retryBase :: !Double
- _retryGrowth :: !Int
- _retryAttempts :: !Int
- _retryCheck :: ServiceError -> Maybe Text
- exponentBase :: Lens' Retry Double
- exponentGrowth :: Lens' Retry Int
- retryAttempts :: Lens' Retry Int
- retryCheck :: Lens' Retry (ServiceError -> Maybe Text)
- 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
- errorCode :: Text -> ErrorCode
- newtype ErrorMessage = ErrorMessage Text
- newtype RequestId = RequestId Text
- data Region
- data Endpoint = Endpoint {}
- endpointHost :: Lens' Endpoint ByteString
- endpointPort :: Lens' Endpoint Int
- endpointSecure :: Lens' Endpoint Bool
- endpointScope :: Lens' Endpoint ByteString
- type ClientRequest = Request
- type ClientResponse = Response ResponseBody
- type ResponseBody = ResumableSource (ResourceT IO) ByteString
- clientRequest :: Endpoint -> Maybe Seconds -> ClientRequest
- newtype Seconds = 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.
Signing
Signing algorithm specific metadata.
A signed ClientRequest
and associated metadata specific
to the signing algorithm, tagged with the initial request type
to be able to obtain the associated response, 'Rs a'.
Signed | |
|
Service
Abbreviated service name.
Attributes and functions specific to an AWS service.
Service | |
|
Requests
class AWSRequest a where Source #
Specify how a request can be de/serialised.
An unsigned request.
Request | |
|
Responses
Retries
Constants and predicates used to create a RetryPolicy
.
Exponential | |
|
retryCheck :: Lens' Retry (ServiceError -> Maybe Text) Source #
Errors
class AsError a where Source #
_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
Serialize Errors
data SerializeError Source #
SerializeError' | |
|
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 |
Endpoints
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 :: Endpoint -> Maybe Seconds -> 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 #