Copyright | (c) 2013-2017 Brendan Hay |
---|---|
License | Mozilla Public License, v. 2.0. |
Maintainer | Brendan Hay <brendan.g.hay+amazonka@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 Auth
- withAuth :: MonadIO m => Auth -> (AuthEnv -> m a) -> m a
- data AuthEnv = AuthEnv {}
- accessKeyId :: Lens' AuthEnv AccessKey
- secretAccessKey :: Lens' AuthEnv SecretKey
- sessionToken :: Lens' AuthEnv (Maybe SessionToken)
- expiration :: Lens' AuthEnv (Maybe UTCTime)
- 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
An access key ID.
For example: AKIAIOSFODNN7EXAMPLE
Secret access key credential.
For example: wJalrXUtnFEMIK7MDENGbPxRfiCYEXAMPLEKE
newtype SessionToken Source #
A session token used by STS to temporarily authorise access to an AWS resource.
Environment
An authorisation environment containing AWS credentials, and potentially a reference which can be refreshed out-of-band as temporary credentials expire.
The AuthN/AuthZ credential environment.
AuthEnv | |
|
accessKeyId :: Lens' AuthEnv AccessKey Source #
The access key ID that identifies the temporary security credentials.
secretAccessKey :: Lens' AuthEnv SecretKey Source #
The secret access key that can be used to sign requests.
sessionToken :: Lens' AuthEnv (Maybe SessionToken) Source #
The token that users must pass to the service API to use the temporary credentials.
expiration :: Lens' AuthEnv (Maybe UTCTime) Source #
The date on which the current 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
data HttpException :: * #
An exception which may be generated by this library
Since: 0.5.0
Serialize Errors
data SerializeError Source #
SerializeError' | |
|
Service Errors
Error Types
newtype ErrorMessage Source #
Regions
The available AWS regions.
NorthVirginia | US East ('us-east-1'). |
Ohio | US East ('us-east-2'). |
NorthCalifornia | US West ('us-west-1'). |
Oregon | US West ('us-west-2'). |
Montreal | Canada ('ca-central-1'). |
Tokyo | Asia Pacific ('ap-northeast-1'). |
Seoul | Asia Pacific ('ap-northeast-2'). |
Mumbai | Asia Pacific ('ap-south-1'). |
Singapore | Asia Pacific ('ap-southeast-1'). |
Sydney | Asia Pacific ('ap-southeast-2'). |
SaoPaulo | South America ('sa-east-1'). |
Ireland | EU ('eu-west-1'). |
London | EU ('eu-west-2'). |
Frankfurt | EU ('eu-central-1'). |
GovCloud | US GovCloud ('us-gov-west-1'). |
GovCloudFIPS | US GovCloud FIPS (S3 Only, 'fips-us-gov-west-1'). |
Beijing | China ('cn-north-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 #