Safe Haskell | None |
---|---|
Language | Haskell2010 |
- newtype AccessKey = AccessKey ByteString
- newtype SecretKey = SecretKey ByteString
- newtype SecurityToken = SecurityToken ByteString
- data AuthEnv = AuthEnv {}
- data Auth
- withAuth :: MonadIO m => Auth -> (AuthEnv -> m a) -> m a
- class (AWSSigner (Sg a), Show (Er a)) => AWSService a where
- type Abbrev = Text
- data Service a = Service {
- _svcAbbrev :: !Text
- _svcPrefix :: !ByteString
- _svcVersion :: !ByteString
- _svcTargetPrefix :: Maybe ByteString
- _svcJSONVersion :: Maybe ByteString
- _svcHandle :: Status -> Maybe (LazyByteString -> ServiceError (Er a))
- _svcRetry :: Retry a
- serviceOf :: AWSService (Sv a) => Request a -> Service (Sv a)
- data Retry a = Exponential {
- _retryBase :: !Double
- _retryGrowth :: !Int
- _retryAttempts :: !Int
- _retryCheck :: Status -> Er a -> Bool
- data Endpoint = Endpoint {}
- endpoint :: Service a -> Region -> Endpoint
- data ServiceError a
- _HttpError :: forall a. Prism' (ServiceError a) HttpException
- _SerializerError :: forall a. Prism' (ServiceError a) (Abbrev, String)
- _ServiceError :: forall a. Prism' (ServiceError a) (Abbrev, Status, a)
- _Errors :: forall a. Prism' (ServiceError a) [ServiceError a]
- class AWSSigner v where
- class AWSPresigner v where
- data Signed a v where
- Signed :: ToBuilder (Meta v) => {
- _sgMeta :: Meta v
- _sgRequest :: ClientRequest
- Signed :: ToBuilder (Meta v) => {
- data family Meta v :: *
- sgMeta :: Lens' (Signed a v) (Meta v)
- sgRequest :: Lens' (Signed a v) ClientRequest
- class (AWSService (Sv a), AWSSigner (Sg (Sv a))) => AWSRequest a where
- type Sv a :: *
- type Rs a :: *
- request :: a -> Request a
- response :: MonadResource m => Logger -> Request a -> Either HttpException ClientResponse -> m (Response' a)
- class AWSRequest a => AWSPager a where
- data Request a = Request {
- _rqMethod :: !StdMethod
- _rqPath :: !ByteString
- _rqQuery :: Query
- _rqHeaders :: [Header]
- _rqBody :: RqBody
- rqMethod :: forall a a. Lens (Request a) (Request a) StdMethod StdMethod
- rqHeaders :: forall a a. Lens (Request a) (Request a) [Header] [Header]
- rqPath :: forall a a. Lens (Request a) (Request a) ByteString ByteString
- rqQuery :: forall a a. Lens (Request a) (Request a) Query Query
- rqBody :: forall a a. Lens (Request a) (Request a) RqBody RqBody
- type Response a = Either (ServiceError (Er (Sv a))) (Rs a)
- type Response' a = Either (ServiceError (Er (Sv a))) (Status, Rs a)
- data Empty = Empty
- data LogLevel
- type Logger = LogLevel -> Builder -> IO ()
- data Region
- newtype Action = Action Text
- type ClientRequest = Request
- type ClientResponse = Response ResponseBody
- type ResponseBody = ResumableSource (ResourceT IO) ByteString
- clientRequest :: ClientRequest
Authentication
Credentials
Access key credential.
Secret key credential.
newtype SecurityToken Source
A security 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.
Services
class (AWSSigner (Sg a), Show (Er a)) => AWSService a where Source
The properties (such as endpoint) for a service, as well as it's associated signing algorithm and error types.
Signing algorithm supported by the service.
The general service error.
Attributes specific to an AWS service.
Service | |
|
Retries
Constants and predicates used to create a RetryPolicy
.
Exponential | |
|
Endpoints
Errors
data ServiceError a Source
An error type representing the subset of errors that can be directly attributed to this library.
HttpError HttpException | |
SerializerError Abbrev String | |
ServiceError Abbrev Status a | |
Errors [ServiceError a] |
Show a => Show (ServiceError a) | |
(Show a, Typeable * a) => Exception (ServiceError a) | |
Monoid (ServiceError a) | |
Show a => AWSError (ServiceError a) | |
Typeable (* -> *) ServiceError |
_HttpError :: forall a. Prism' (ServiceError a) HttpException Source
_SerializerError :: forall a. Prism' (ServiceError a) (Abbrev, String) Source
_ServiceError :: forall a. Prism' (ServiceError a) (Abbrev, Status, a) Source
_Errors :: forall a. Prism' (ServiceError a) [ServiceError a] Source
Signing
class AWSPresigner v where Source
A signed ClientRequest
and associated metadata specific to the signing
algorithm that was used.
Signed :: ToBuilder (Meta v) => Meta v -> ClientRequest -> Signed a v | |
|
data family Meta v :: * Source
Signing metadata data specific to a signing algorithm.
Note: this is used for test and debug purposes, or is otherwise ignored.
sgRequest :: Lens' (Signed a v) ClientRequest Source
Requests
class (AWSService (Sv a), AWSSigner (Sg (Sv a))) => AWSRequest a where Source
Specify how a request can be de/serialised.
The service definition for a request.
The successful, expected response associated with a request.
request :: a -> Request a Source
response :: MonadResource m => Logger -> Request a -> Either HttpException ClientResponse -> m (Response' a) Source
class AWSRequest a => AWSPager a where Source
Specify how an AWSRequest
and it's associated Rs
response can generate
a subsequent request, if available.
An unsigned request.
rqPath :: forall a a. Lens (Request a) (Request a) ByteString ByteString Source
Responses
Logging
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 |
Query Actions
A service's query action.
Convenience
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.