aws-0.16: Amazon Web Services (AWS) for Haskell

Safe Haskell | None
Language | Haskell2010

Aws

Contents

- Logging
- Configuration
- Transaction runners
  - Safe runners
  - Unsafe runners
  - URI runners
  - Iterated runners
- Response
  - Full HTTP response
  - Metadata in responses
  - Memory responses
  - Exception types
- Query
  - Service configuration
  - Expiration
- Transactions
- Credentials

Synopsis

- data LogLevel
  - = Debug
  - | Info
  - | Warning
  - | Error
- type Logger = LogLevel -> Text -> IO ()
- defaultLog :: LogLevel -> Logger
- data Configuration = Configuration {
  - timeInfo :: TimeInfo
  - credentials :: Credentials
  - logger :: Logger
  }
- baseConfiguration :: MonadIO io => io Configuration
- dbgConfiguration :: MonadIO io => io Configuration
- aws :: Transaction r a => Configuration -> ServiceConfiguration r NormalQuery -> Manager -> r -> ResourceT IO (Response (ResponseMetadata a) a)
- awsRef :: Transaction r a => Configuration -> ServiceConfiguration r NormalQuery -> Manager -> IORef (ResponseMetadata a) -> r -> ResourceT IO a
- pureAws :: Transaction r a => Configuration -> ServiceConfiguration r NormalQuery -> Manager -> r -> ResourceT IO a
- simpleAws :: (Transaction r a, AsMemoryResponse a, MonadIO io) => Configuration -> ServiceConfiguration r NormalQuery -> r -> io (MemoryResponse a)
- unsafeAws :: (ResponseConsumer r a, Loggable (ResponseMetadata a), SignQuery r) => Configuration -> ServiceConfiguration r NormalQuery -> Manager -> r -> ResourceT IO (Response (ResponseMetadata a) a)
- unsafeAwsRef :: (ResponseConsumer r a, SignQuery r) => Configuration -> ServiceConfiguration r NormalQuery -> Manager -> IORef (ResponseMetadata a) -> r -> ResourceT IO a
- awsUri :: (SignQuery request, MonadIO io) => Configuration -> ServiceConfiguration request UriOnlyQuery -> request -> io ByteString
- awsIteratedSource :: IteratedTransaction r a => Configuration -> ServiceConfiguration r NormalQuery -> Manager -> r -> Producer (ResourceT IO) (Response (ResponseMetadata a) a)
- awsIteratedList :: (IteratedTransaction r a, ListResponse a i) => Configuration -> ServiceConfiguration r NormalQuery -> Manager -> r -> Producer (ResourceT IO) i
- type HTTPResponseConsumer a = Response (ResumableSource (ResourceT IO) ByteString) -> ResourceT IO a
- data Response m a = Response {
  - responseMetadata :: m
  - responseResult :: Either SomeException a
  }
- readResponse :: MonadThrow n => Response m a -> n a
- readResponseIO :: MonadIO io => Response m a -> io a
- class AsMemoryResponse resp where
  - type MemoryResponse resp :: *
- newtype XmlException = XmlException {
  - xmlErrorMessage :: String
  }
- newtype HeaderException = HeaderException {
  - headerErrorMessage :: String
  }
- newtype FormException = FormException {
  - formErrorMesage :: String
  }
- class DefaultServiceConfiguration config where
- data NormalQuery
- data UriOnlyQuery
- data TimeInfo
  - = Timestamp
  - | ExpiresAt {
    - fromExpiresAt :: UTCTime
    }
  - | ExpiresIn {
    - fromExpiresIn :: NominalDiffTime
    }
- class (SignQuery r, ResponseConsumer r a, Loggable (ResponseMetadata a)) => Transaction r a | r -> a
- class Transaction r a => IteratedTransaction r a | r -> a
- data Credentials = Credentials {
  - accessKeyID :: ByteString
  - secretAccessKey :: ByteString
  - v4SigningKeys :: IORef [V4Key]
  - iamToken :: Maybe ByteString
  }
- makeCredentials :: MonadIO io => ByteString -> ByteString -> io Credentials
- credentialsDefaultFile :: MonadIO io => io (Maybe FilePath)
- credentialsDefaultKey :: Text
- loadCredentialsFromFile :: MonadIO io => FilePath -> Text -> io (Maybe Credentials)
- loadCredentialsFromEnv :: MonadIO io => io (Maybe Credentials)
- loadCredentialsFromInstanceMetadata :: MonadIO io => io (Maybe Credentials)
- loadCredentialsFromEnvOrFile :: MonadIO io => FilePath -> Text -> io (Maybe Credentials)
- loadCredentialsFromEnvOrFileOrInstanceMetadata :: MonadIO io => FilePath -> Text -> io (Maybe Credentials)
- loadCredentialsDefault :: MonadIO io => io (Maybe Credentials)

# Logging

data LogLevel #

The severity of a log message, in rising order.

Constructors

Debug |
Info |
Warning |
Error |

Instances

Eq LogLevel # |
Methods (==) :: LogLevel -> LogLevel -> Bool # (/=) :: LogLevel -> LogLevel -> Bool #
Ord LogLevel # |
Methods compare :: LogLevel -> LogLevel -> Ordering # (<) :: LogLevel -> LogLevel -> Bool # (<=) :: LogLevel -> LogLevel -> Bool # (>) :: LogLevel -> LogLevel -> Bool # (>=) :: LogLevel -> LogLevel -> Bool # max :: LogLevel -> LogLevel -> LogLevel # min :: LogLevel -> LogLevel -> LogLevel #
Show LogLevel # |
Methods showsPrec :: Int -> LogLevel -> ShowS # show :: LogLevel -> String # showList :: [LogLevel] -> ShowS #

type Logger = LogLevel -> Text -> IO () #

The interface for any logging function. Takes log level and a log message, and can perform an arbitrary IO action.

defaultLog :: LogLevel -> Logger #

The default logger `defaultLog minLevel`, which prints log messages above level `minLevel` to `stderr`.

# Configuration

data Configuration #

The configuration for an AWS request. You can use multiple configurations in parallel, even over the same HTTP connection manager.

Constructors

Configuration |
Fields timeInfo :: TimeInfo Whether to restrict the signature validity with a plain timestamp, or with explicit expiration (absolute or relative). credentials :: Credentials AWS access credentials. logger :: Logger The error / message logger.

baseConfiguration :: MonadIO io => io Configuration #

The default configuration, with credentials loaded from environment variable or configuration file (see `loadCredentialsDefault`).

dbgConfiguration :: MonadIO io => io Configuration #

Debug configuration, which logs much more verbosely.

# Transaction runners

## Safe runners

aws :: Transaction r a => Configuration -> ServiceConfiguration r NormalQuery -> Manager -> r -> ResourceT IO (Response (ResponseMetadata a) a) #

Run an AWS transaction, with HTTP manager and metadata wrapped in a `Response`.

All errors are caught and wrapped in the `Response` value.

Metadata is logged at level `Info`.

Usage (with existing `Manager`): `resp <- aws cfg serviceCfg manager request`

awsRef :: Transaction r a => Configuration -> ServiceConfiguration r NormalQuery -> Manager -> IORef (ResponseMetadata a) -> r -> ResourceT IO a #

Run an AWS transaction, with HTTP manager and metadata returned in an `IORef`.

Errors are not caught, and need to be handled with exception handlers.

Metadata is not logged.

Usage (with existing `Manager`): `ref <- newIORef mempty; resp <- awsRef cfg serviceCfg manager request`

pureAws :: Transaction r a => Configuration -> ServiceConfiguration r NormalQuery -> Manager -> r -> ResourceT IO a #

Run an AWS transaction, with HTTP manager and without metadata.

Metadata is logged at level `Info`.

Usage (with existing `Manager`): `resp <- aws cfg serviceCfg manager request`

simpleAws :: (Transaction r a, AsMemoryResponse a, MonadIO io) => Configuration -> ServiceConfiguration r NormalQuery -> r -> io (MemoryResponse a) #

Run an AWS transaction, without HTTP manager and without metadata.

Metadata is logged at level `Info`.

Note that this is potentially less efficient than using `aws`, because HTTP connections cannot be re-used.

Usage: `resp <- simpleAws cfg serviceCfg request`

## Unsafe runners

unsafeAws :: (ResponseConsumer r a, Loggable (ResponseMetadata a), SignQuery r) => Configuration -> ServiceConfiguration r NormalQuery -> Manager -> r -> ResourceT IO (Response (ResponseMetadata a) a) #

Run an AWS transaction, without enforcing that response and request type form a valid transaction pair.

This is especially useful for debugging and development, you should not have to use it in production.

All errors are caught and wrapped in the `Response` value.

Metadata is wrapped in the Response, and also logged at level `Info`.

unsafeAwsRef :: (ResponseConsumer r a, SignQuery r) => Configuration -> ServiceConfiguration r NormalQuery -> Manager -> IORef (ResponseMetadata a) -> r -> ResourceT IO a #

Run an AWS transaction, without enforcing that response and request type form a valid transaction pair.

This is especially useful for debugging and development, you should not have to use it in production.

Errors are not caught, and need to be handled with exception handlers.

Metadata is put in the `IORef`, but not logged.

## URI runners

awsUri :: (SignQuery request, MonadIO io) => Configuration -> ServiceConfiguration request UriOnlyQuery -> request -> io ByteString #

Run a URI-only AWS transaction. Returns a URI that can be sent anywhere. Does not work with all requests.

Usage: `uri <- awsUri cfg request`

## Iterated runners

awsIteratedSource :: IteratedTransaction r a => Configuration -> ServiceConfiguration r NormalQuery -> Manager -> r -> Producer (ResourceT IO) (Response (ResponseMetadata a) a) #

awsIteratedList :: (IteratedTransaction r a, ListResponse a i) => Configuration -> ServiceConfiguration r NormalQuery -> Manager -> r -> Producer (ResourceT IO) i #

# Response

## Full HTTP response

type HTTPResponseConsumer a = Response (ResumableSource (ResourceT IO) ByteString) -> ResourceT IO a #

A full HTTP response parser. Takes HTTP status, response headers, and response body.

## Metadata in responses

data Response m a #

A response with metadata. Can also contain an error response, or an internal error, via `Attempt`.

Response forms a Writer-like monad.

Constructors

Response |
Fields responseMetadata :: m responseResult :: Either SomeException a

Instances

Monoid m => Monad (Response m) # |
Methods (>>=) :: Response m a -> (a -> Response m b) -> Response m b # (>>) :: Response m a -> Response m b -> Response m b # return :: a -> Response m a # fail :: String -> Response m a #
Functor (Response m) # |
Methods fmap :: (a -> b) -> Response m a -> Response m b # (<$) :: a -> Response m b -> Response m a #
Monoid m => Applicative (Response m) # |
Methods pure :: a -> Response m a # (<*>) :: Response m (a -> b) -> Response m a -> Response m b # (*>) :: Response m a -> Response m b -> Response m b # (<*) :: Response m a -> Response m b -> Response m a #
Monoid m => MonadThrow (Response m) # |
Methods throwM :: Exception e => e -> Response m a #
(Show a, Show m) => Show (Response m a) # |
Methods showsPrec :: Int -> Response m a -> ShowS # show :: Response m a -> String # showList :: [Response m a] -> ShowS #

readResponse :: MonadThrow n => Response m a -> n a #

Read a response result (if it's a success response, fail otherwise).

readResponseIO :: MonadIO io => Response m a -> io a #

Read a response result (if it's a success response, fail otherwise). In MonadIO.

## Memory responses

class AsMemoryResponse resp where #

Class for responses that are fully loaded into memory

Minimal complete definition

loadToMemory

Associated Types

type MemoryResponse resp :: * #

Methods

loadToMemory :: resp -> ResourceT IO (MemoryResponse resp) #

Instances

AsMemoryResponse DeleteItemResponse # |
Associated Types type MemoryResponse DeleteItemResponse :: * # Methods loadToMemory :: DeleteItemResponse -> ResourceT IO (MemoryResponse DeleteItemResponse) #
AsMemoryResponse GetItemResponse # |
Associated Types type MemoryResponse GetItemResponse :: * # Methods loadToMemory :: GetItemResponse -> ResourceT IO (MemoryResponse GetItemResponse) #
AsMemoryResponse PutItemResponse # |
Associated Types type MemoryResponse PutItemResponse :: * # Methods loadToMemory :: PutItemResponse -> ResourceT IO (MemoryResponse PutItemResponse) #
AsMemoryResponse QueryResponse # |
Associated Types type MemoryResponse QueryResponse :: * # Methods loadToMemory :: QueryResponse -> ResourceT IO (MemoryResponse QueryResponse) #
AsMemoryResponse ScanResponse # |
Associated Types type MemoryResponse ScanResponse :: * # Methods loadToMemory :: ScanResponse -> ResourceT IO (MemoryResponse ScanResponse) #
AsMemoryResponse ListTablesResult # |
Associated Types type MemoryResponse ListTablesResult :: * # Methods loadToMemory :: ListTablesResult -> ResourceT IO (MemoryResponse ListTablesResult) #
AsMemoryResponse DeleteTableResult # |
Associated Types type MemoryResponse DeleteTableResult :: * # Methods loadToMemory :: DeleteTableResult -> ResourceT IO (MemoryResponse DeleteTableResult) #
AsMemoryResponse UpdateTableResult # |
Associated Types type MemoryResponse UpdateTableResult :: * # Methods loadToMemory :: UpdateTableResult -> ResourceT IO (MemoryResponse UpdateTableResult) #
AsMemoryResponse DescribeTableResult # |
Associated Types type MemoryResponse DescribeTableResult :: * # Methods loadToMemory :: DescribeTableResult -> ResourceT IO (MemoryResponse DescribeTableResult) #
AsMemoryResponse CreateTableResult # |
Associated Types type MemoryResponse CreateTableResult :: * # Methods loadToMemory :: CreateTableResult -> ResourceT IO (MemoryResponse CreateTableResult) #
AsMemoryResponse UpdateItemResponse # |
Associated Types type MemoryResponse UpdateItemResponse :: * # Methods loadToMemory :: UpdateItemResponse -> ResourceT IO (MemoryResponse UpdateItemResponse) #
AsMemoryResponse CreateAccessKeyResponse # |
Associated Types type MemoryResponse CreateAccessKeyResponse :: * # Methods loadToMemory :: CreateAccessKeyResponse -> ResourceT IO (MemoryResponse CreateAccessKeyResponse) #
AsMemoryResponse CreateUserResponse # |
Associated Types type MemoryResponse CreateUserResponse :: * # Methods loadToMemory :: CreateUserResponse -> ResourceT IO (MemoryResponse CreateUserResponse) #
AsMemoryResponse DeleteAccessKeyResponse # |
Associated Types type MemoryResponse DeleteAccessKeyResponse :: * # Methods loadToMemory :: DeleteAccessKeyResponse -> ResourceT IO (MemoryResponse DeleteAccessKeyResponse) #
AsMemoryResponse DeleteUserResponse # |
Associated Types type MemoryResponse DeleteUserResponse :: * # Methods loadToMemory :: DeleteUserResponse -> ResourceT IO (MemoryResponse DeleteUserResponse) #
AsMemoryResponse DeleteUserPolicyResponse # |
Associated Types type MemoryResponse DeleteUserPolicyResponse :: * # Methods loadToMemory :: DeleteUserPolicyResponse -> ResourceT IO (MemoryResponse DeleteUserPolicyResponse) #
AsMemoryResponse GetUserResponse # |
Associated Types type MemoryResponse GetUserResponse :: * # Methods loadToMemory :: GetUserResponse -> ResourceT IO (MemoryResponse GetUserResponse) #
AsMemoryResponse GetUserPolicyResponse # |
Associated Types type MemoryResponse GetUserPolicyResponse :: * # Methods loadToMemory :: GetUserPolicyResponse -> ResourceT IO (MemoryResponse GetUserPolicyResponse) #
AsMemoryResponse ListAccessKeysResponse # |
Associated Types type MemoryResponse ListAccessKeysResponse :: * # Methods loadToMemory :: ListAccessKeysResponse -> ResourceT IO (MemoryResponse ListAccessKeysResponse) #
AsMemoryResponse ListMfaDevicesResponse # |
Associated Types type MemoryResponse ListMfaDevicesResponse :: * # Methods loadToMemory :: ListMfaDevicesResponse -> ResourceT IO (MemoryResponse ListMfaDevicesResponse) #
AsMemoryResponse ListUserPoliciesResponse # |
Associated Types type MemoryResponse ListUserPoliciesResponse :: * # Methods loadToMemory :: ListUserPoliciesResponse -> ResourceT IO (MemoryResponse ListUserPoliciesResponse) #
AsMemoryResponse ListUsersResponse # |
Associated Types type MemoryResponse ListUsersResponse :: * # Methods loadToMemory :: ListUsersResponse -> ResourceT IO (MemoryResponse ListUsersResponse) #
AsMemoryResponse PutUserPolicyResponse # |
Associated Types type MemoryResponse PutUserPolicyResponse :: * # Methods loadToMemory :: PutUserPolicyResponse -> ResourceT IO (MemoryResponse PutUserPolicyResponse) #
AsMemoryResponse UpdateAccessKeyResponse # |
Associated Types type MemoryResponse UpdateAccessKeyResponse :: * # Methods loadToMemory :: UpdateAccessKeyResponse -> ResourceT IO (MemoryResponse UpdateAccessKeyResponse) #
AsMemoryResponse UpdateUserResponse # |
Associated Types type MemoryResponse UpdateUserResponse :: * # Methods loadToMemory :: UpdateUserResponse -> ResourceT IO (MemoryResponse UpdateUserResponse) #
AsMemoryResponse CopyObjectResponse # |
Associated Types type MemoryResponse CopyObjectResponse :: * # Methods loadToMemory :: CopyObjectResponse -> ResourceT IO (MemoryResponse CopyObjectResponse) #
AsMemoryResponse DeleteBucketResponse # |
Associated Types type MemoryResponse DeleteBucketResponse :: * # Methods loadToMemory :: DeleteBucketResponse -> ResourceT IO (MemoryResponse DeleteBucketResponse) #
AsMemoryResponse DeleteObjectResponse # |
Associated Types type MemoryResponse DeleteObjectResponse :: * # Methods loadToMemory :: DeleteObjectResponse -> ResourceT IO (MemoryResponse DeleteObjectResponse) #
AsMemoryResponse DeleteObjectVersionResponse # |
Associated Types type MemoryResponse DeleteObjectVersionResponse :: * # Methods loadToMemory :: DeleteObjectVersionResponse -> ResourceT IO (MemoryResponse DeleteObjectVersionResponse) #
AsMemoryResponse DeleteObjectsResponse # |
Associated Types type MemoryResponse DeleteObjectsResponse :: * # Methods loadToMemory :: DeleteObjectsResponse -> ResourceT IO (MemoryResponse DeleteObjectsResponse) #
AsMemoryResponse GetBucketResponse # |
Associated Types type MemoryResponse GetBucketResponse :: * # Methods loadToMemory :: GetBucketResponse -> ResourceT IO (MemoryResponse GetBucketResponse) #
AsMemoryResponse GetBucketLocationResponse # |
Associated Types type MemoryResponse GetBucketLocationResponse :: * # Methods loadToMemory :: GetBucketLocationResponse -> ResourceT IO (MemoryResponse GetBucketLocationResponse) #
AsMemoryResponse GetBucketObjectVersionsResponse # |
Associated Types type MemoryResponse GetBucketObjectVersionsResponse :: * # Methods loadToMemory :: GetBucketObjectVersionsResponse -> ResourceT IO (MemoryResponse GetBucketObjectVersionsResponse) #
AsMemoryResponse GetObjectResponse # |
Associated Types type MemoryResponse GetObjectResponse :: * # Methods loadToMemory :: GetObjectResponse -> ResourceT IO (MemoryResponse GetObjectResponse) #
AsMemoryResponse GetServiceResponse # |
Associated Types type MemoryResponse GetServiceResponse :: * # Methods loadToMemory :: GetServiceResponse -> ResourceT IO (MemoryResponse GetServiceResponse) #
AsMemoryResponse HeadObjectResponse # |
Associated Types type MemoryResponse HeadObjectResponse :: * # Methods loadToMemory :: HeadObjectResponse -> ResourceT IO (MemoryResponse HeadObjectResponse) #
AsMemoryResponse PutBucketResponse # |
Associated Types type MemoryResponse PutBucketResponse :: * # Methods loadToMemory :: PutBucketResponse -> ResourceT IO (MemoryResponse PutBucketResponse) #
AsMemoryResponse PutObjectResponse # |
Associated Types type MemoryResponse PutObjectResponse :: * # Methods loadToMemory :: PutObjectResponse -> ResourceT IO (MemoryResponse PutObjectResponse) #
AsMemoryResponse DeleteIdentityResponse # |
Associated Types type MemoryResponse DeleteIdentityResponse :: * # Methods loadToMemory :: DeleteIdentityResponse -> ResourceT IO (MemoryResponse DeleteIdentityResponse) #
AsMemoryResponse GetIdentityDkimAttributesResponse # |
Associated Types type MemoryResponse GetIdentityDkimAttributesResponse :: * # Methods loadToMemory :: GetIdentityDkimAttributesResponse -> ResourceT IO (MemoryResponse GetIdentityDkimAttributesResponse) #
AsMemoryResponse GetIdentityNotificationAttributesResponse # |
Associated Types type MemoryResponse GetIdentityNotificationAttributesResponse :: * # Methods loadToMemory :: GetIdentityNotificationAttributesResponse -> ResourceT IO (MemoryResponse GetIdentityNotificationAttributesResponse) #
AsMemoryResponse GetIdentityVerificationAttributesResponse # |
Associated Types type MemoryResponse GetIdentityVerificationAttributesResponse :: * # Methods loadToMemory :: GetIdentityVerificationAttributesResponse -> ResourceT IO (MemoryResponse GetIdentityVerificationAttributesResponse) #
AsMemoryResponse ListIdentitiesResponse # |
Associated Types type MemoryResponse ListIdentitiesResponse :: * # Methods loadToMemory :: ListIdentitiesResponse -> ResourceT IO (MemoryResponse ListIdentitiesResponse) #
AsMemoryResponse SendRawEmailResponse # |
Associated Types type MemoryResponse SendRawEmailResponse :: * # Methods loadToMemory :: SendRawEmailResponse -> ResourceT IO (MemoryResponse SendRawEmailResponse) #
AsMemoryResponse SetIdentityDkimEnabledResponse # |
Associated Types type MemoryResponse SetIdentityDkimEnabledResponse :: * # Methods loadToMemory :: SetIdentityDkimEnabledResponse -> ResourceT IO (MemoryResponse SetIdentityDkimEnabledResponse) #
AsMemoryResponse SetIdentityFeedbackForwardingEnabledResponse # |
Associated Types type MemoryResponse SetIdentityFeedbackForwardingEnabledResponse :: * # Methods loadToMemory :: SetIdentityFeedbackForwardingEnabledResponse -> ResourceT IO (MemoryResponse SetIdentityFeedbackForwardingEnabledResponse) #
AsMemoryResponse SetIdentityNotificationTopicResponse # |
Associated Types type MemoryResponse SetIdentityNotificationTopicResponse :: * # Methods loadToMemory :: SetIdentityNotificationTopicResponse -> ResourceT IO (MemoryResponse SetIdentityNotificationTopicResponse) #
AsMemoryResponse VerifyDomainDkimResponse # |
Associated Types type MemoryResponse VerifyDomainDkimResponse :: * # Methods loadToMemory :: VerifyDomainDkimResponse -> ResourceT IO (MemoryResponse VerifyDomainDkimResponse) #
AsMemoryResponse VerifyDomainIdentityResponse # |
Associated Types type MemoryResponse VerifyDomainIdentityResponse :: * # Methods loadToMemory :: VerifyDomainIdentityResponse -> ResourceT IO (MemoryResponse VerifyDomainIdentityResponse) #
AsMemoryResponse VerifyEmailIdentityResponse # |
Associated Types type MemoryResponse VerifyEmailIdentityResponse :: * # Methods loadToMemory :: VerifyEmailIdentityResponse -> ResourceT IO (MemoryResponse VerifyEmailIdentityResponse) #
AsMemoryResponse BatchDeleteAttributesResponse # |
Associated Types type MemoryResponse BatchDeleteAttributesResponse :: * # Methods loadToMemory :: BatchDeleteAttributesResponse -> ResourceT IO (MemoryResponse BatchDeleteAttributesResponse) #
AsMemoryResponse BatchPutAttributesResponse # |
Associated Types type MemoryResponse BatchPutAttributesResponse :: * # Methods loadToMemory :: BatchPutAttributesResponse -> ResourceT IO (MemoryResponse BatchPutAttributesResponse) #
AsMemoryResponse DeleteAttributesResponse # |
Associated Types type MemoryResponse DeleteAttributesResponse :: * # Methods loadToMemory :: DeleteAttributesResponse -> ResourceT IO (MemoryResponse DeleteAttributesResponse) #
AsMemoryResponse PutAttributesResponse # |
Associated Types type MemoryResponse PutAttributesResponse :: * # Methods loadToMemory :: PutAttributesResponse -> ResourceT IO (MemoryResponse PutAttributesResponse) #
AsMemoryResponse GetAttributesResponse # |
Associated Types type MemoryResponse GetAttributesResponse :: * # Methods loadToMemory :: GetAttributesResponse -> ResourceT IO (MemoryResponse GetAttributesResponse) #
AsMemoryResponse ListDomainsResponse # |
Associated Types type MemoryResponse ListDomainsResponse :: * # Methods loadToMemory :: ListDomainsResponse -> ResourceT IO (MemoryResponse ListDomainsResponse) #
AsMemoryResponse DomainMetadataResponse # |
Associated Types type MemoryResponse DomainMetadataResponse :: * # Methods loadToMemory :: DomainMetadataResponse -> ResourceT IO (MemoryResponse DomainMetadataResponse) #
AsMemoryResponse DeleteDomainResponse # |
Associated Types type MemoryResponse DeleteDomainResponse :: * # Methods loadToMemory :: DeleteDomainResponse -> ResourceT IO (MemoryResponse DeleteDomainResponse) #
AsMemoryResponse CreateDomainResponse # |
Associated Types type MemoryResponse CreateDomainResponse :: * # Methods loadToMemory :: CreateDomainResponse -> ResourceT IO (MemoryResponse CreateDomainResponse) #
AsMemoryResponse SelectResponse # |
Associated Types type MemoryResponse SelectResponse :: * # Methods loadToMemory :: SelectResponse -> ResourceT IO (MemoryResponse SelectResponse) #
AsMemoryResponse ChangeMessageVisibilityResponse # |
Associated Types type MemoryResponse ChangeMessageVisibilityResponse :: * # Methods loadToMemory :: ChangeMessageVisibilityResponse -> ResourceT IO (MemoryResponse ChangeMessageVisibilityResponse) #
AsMemoryResponse ReceiveMessageResponse # |
Associated Types type MemoryResponse ReceiveMessageResponse :: * # Methods loadToMemory :: ReceiveMessageResponse -> ResourceT IO (MemoryResponse ReceiveMessageResponse) #
AsMemoryResponse DeleteMessageResponse # |
Associated Types type MemoryResponse DeleteMessageResponse :: * # Methods loadToMemory :: DeleteMessageResponse -> ResourceT IO (MemoryResponse DeleteMessageResponse) #
AsMemoryResponse SendMessageResponse # |
Associated Types type MemoryResponse SendMessageResponse :: * # Methods loadToMemory :: SendMessageResponse -> ResourceT IO (MemoryResponse SendMessageResponse) #
AsMemoryResponse RemovePermissionResponse # |
Associated Types type MemoryResponse RemovePermissionResponse :: * # Methods loadToMemory :: RemovePermissionResponse -> ResourceT IO (MemoryResponse RemovePermissionResponse) #
AsMemoryResponse AddPermissionResponse # |
Associated Types type MemoryResponse AddPermissionResponse :: * # Methods loadToMemory :: AddPermissionResponse -> ResourceT IO (MemoryResponse AddPermissionResponse) #
AsMemoryResponse ListQueuesResponse # |
Associated Types type MemoryResponse ListQueuesResponse :: * # Methods loadToMemory :: ListQueuesResponse -> ResourceT IO (MemoryResponse ListQueuesResponse) #
AsMemoryResponse DeleteQueueResponse # |
Associated Types type MemoryResponse DeleteQueueResponse :: * # Methods loadToMemory :: DeleteQueueResponse -> ResourceT IO (MemoryResponse DeleteQueueResponse) #
AsMemoryResponse CreateQueueResponse # |
Associated Types type MemoryResponse CreateQueueResponse :: * # Methods loadToMemory :: CreateQueueResponse -> ResourceT IO (MemoryResponse CreateQueueResponse) #
AsMemoryResponse SetQueueAttributesResponse # |
Associated Types type MemoryResponse SetQueueAttributesResponse :: * # Methods loadToMemory :: SetQueueAttributesResponse -> ResourceT IO (MemoryResponse SetQueueAttributesResponse) #
AsMemoryResponse GetQueueAttributesResponse # |
Associated Types type MemoryResponse GetQueueAttributesResponse :: * # Methods loadToMemory :: GetQueueAttributesResponse -> ResourceT IO (MemoryResponse GetQueueAttributesResponse) #
AsMemoryResponse AbortMultipartUploadResponse # |
Associated Types type MemoryResponse AbortMultipartUploadResponse :: * # Methods loadToMemory :: AbortMultipartUploadResponse -> ResourceT IO (MemoryResponse AbortMultipartUploadResponse) #
AsMemoryResponse CompleteMultipartUploadResponse # |
Associated Types type MemoryResponse CompleteMultipartUploadResponse :: * # Methods loadToMemory :: CompleteMultipartUploadResponse -> ResourceT IO (MemoryResponse CompleteMultipartUploadResponse) #
AsMemoryResponse UploadPartResponse # |
Associated Types type MemoryResponse UploadPartResponse :: * # Methods loadToMemory :: UploadPartResponse -> ResourceT IO (MemoryResponse UploadPartResponse) #
AsMemoryResponse InitiateMultipartUploadResponse # |
Associated Types type MemoryResponse InitiateMultipartUploadResponse :: * # Methods loadToMemory :: InitiateMultipartUploadResponse -> ResourceT IO (MemoryResponse InitiateMultipartUploadResponse) #

## Exception types

newtype XmlException #

An error that occurred during XML parsing / validation.

Constructors

XmlException |
Fields xmlErrorMessage :: String

Instances

Show XmlException # |
Methods showsPrec :: Int -> XmlException -> ShowS # show :: XmlException -> String # showList :: [XmlException] -> ShowS #
Exception XmlException # |
Methods toException :: XmlException -> SomeException # fromException :: SomeException -> Maybe XmlException # displayException :: XmlException -> String #

newtype HeaderException #

An error that occurred during header parsing / validation.

Constructors

HeaderException |
Fields headerErrorMessage :: String

Instances

Show HeaderException # |
Methods showsPrec :: Int -> HeaderException -> ShowS # show :: HeaderException -> String # showList :: [HeaderException] -> ShowS #
Exception HeaderException # |
Methods toException :: HeaderException -> SomeException # fromException :: SomeException -> Maybe HeaderException # displayException :: HeaderException -> String #

newtype FormException #

An error that occurred during form parsing / validation.

Constructors

FormException |
Fields formErrorMesage :: String

Instances

Show FormException # |
Methods showsPrec :: Int -> FormException -> ShowS # show :: FormException -> String # showList :: [FormException] -> ShowS #
Exception FormException # |
Methods toException :: FormException -> SomeException # fromException :: SomeException -> Maybe FormException # displayException :: FormException -> String #

# Query

## Service configuration

class DefaultServiceConfiguration config where #

Default configuration for a specific service.

Minimal complete definition

defServiceConfig

Methods

defServiceConfig :: config #

Default service configuration.

debugServiceConfig :: config #

Default debugging-only configuration. (Normally using HTTP instead of HTTPS for easier debugging.)

Instances

DefaultServiceConfiguration (DdbConfiguration NormalQuery) # |
Methods defServiceConfig :: DdbConfiguration NormalQuery # debugServiceConfig :: DdbConfiguration NormalQuery #
DefaultServiceConfiguration (IamConfiguration UriOnlyQuery) # |
Methods defServiceConfig :: IamConfiguration UriOnlyQuery # debugServiceConfig :: IamConfiguration UriOnlyQuery #
DefaultServiceConfiguration (IamConfiguration NormalQuery) # |
Methods defServiceConfig :: IamConfiguration NormalQuery # debugServiceConfig :: IamConfiguration NormalQuery #
DefaultServiceConfiguration (S3Configuration UriOnlyQuery) # |
Methods defServiceConfig :: S3Configuration UriOnlyQuery # debugServiceConfig :: S3Configuration UriOnlyQuery #
DefaultServiceConfiguration (S3Configuration NormalQuery) # |
Methods defServiceConfig :: S3Configuration NormalQuery # debugServiceConfig :: S3Configuration NormalQuery #
DefaultServiceConfiguration (SesConfiguration UriOnlyQuery) # |
Methods defServiceConfig :: SesConfiguration UriOnlyQuery # debugServiceConfig :: SesConfiguration UriOnlyQuery #
DefaultServiceConfiguration (SesConfiguration NormalQuery) # |
Methods defServiceConfig :: SesConfiguration NormalQuery # debugServiceConfig :: SesConfiguration NormalQuery #
DefaultServiceConfiguration (SdbConfiguration UriOnlyQuery) # |
Methods defServiceConfig :: SdbConfiguration UriOnlyQuery # debugServiceConfig :: SdbConfiguration UriOnlyQuery #
DefaultServiceConfiguration (SdbConfiguration NormalQuery) # |
Methods defServiceConfig :: SdbConfiguration NormalQuery # debugServiceConfig :: SdbConfiguration NormalQuery #
DefaultServiceConfiguration (SqsConfiguration UriOnlyQuery) # |
Methods defServiceConfig :: SqsConfiguration UriOnlyQuery # debugServiceConfig :: SqsConfiguration UriOnlyQuery #
DefaultServiceConfiguration (SqsConfiguration NormalQuery) # |
Methods defServiceConfig :: SqsConfiguration NormalQuery # debugServiceConfig :: SqsConfiguration NormalQuery #

data NormalQuery #

Tag type for normal queries.

Instances

Default (DdbConfiguration NormalQuery) # |
Methods def :: DdbConfiguration NormalQuery #
DefaultServiceConfiguration (DdbConfiguration NormalQuery) # |
Methods defServiceConfig :: DdbConfiguration NormalQuery # debugServiceConfig :: DdbConfiguration NormalQuery #
DefaultServiceConfiguration (IamConfiguration NormalQuery) # |
Methods defServiceConfig :: IamConfiguration NormalQuery # debugServiceConfig :: IamConfiguration NormalQuery #
DefaultServiceConfiguration (S3Configuration NormalQuery) # |
Methods defServiceConfig :: S3Configuration NormalQuery # debugServiceConfig :: S3Configuration NormalQuery #
DefaultServiceConfiguration (SesConfiguration NormalQuery) # |
Methods defServiceConfig :: SesConfiguration NormalQuery # debugServiceConfig :: SesConfiguration NormalQuery #
DefaultServiceConfiguration (SdbConfiguration NormalQuery) # |
Methods defServiceConfig :: SdbConfiguration NormalQuery # debugServiceConfig :: SdbConfiguration NormalQuery #
DefaultServiceConfiguration (SqsConfiguration NormalQuery) # |
Methods defServiceConfig :: SqsConfiguration NormalQuery # debugServiceConfig :: SqsConfiguration NormalQuery #

data UriOnlyQuery #

Tag type for URI-only queries.

Instances

DefaultServiceConfiguration (IamConfiguration UriOnlyQuery) # |
Methods defServiceConfig :: IamConfiguration UriOnlyQuery # debugServiceConfig :: IamConfiguration UriOnlyQuery #
DefaultServiceConfiguration (S3Configuration UriOnlyQuery) # |
Methods defServiceConfig :: S3Configuration UriOnlyQuery # debugServiceConfig :: S3Configuration UriOnlyQuery #
DefaultServiceConfiguration (SesConfiguration UriOnlyQuery) # |
Methods defServiceConfig :: SesConfiguration UriOnlyQuery # debugServiceConfig :: SesConfiguration UriOnlyQuery #
DefaultServiceConfiguration (SdbConfiguration UriOnlyQuery) # |
Methods defServiceConfig :: SdbConfiguration UriOnlyQuery # debugServiceConfig :: SdbConfiguration UriOnlyQuery #
DefaultServiceConfiguration (SqsConfiguration UriOnlyQuery) # |
Methods defServiceConfig :: SqsConfiguration UriOnlyQuery # debugServiceConfig :: SqsConfiguration UriOnlyQuery #

## Expiration

data TimeInfo #

Whether to restrict the signature validity with a plain timestamp, or with explicit expiration (absolute or relative).

Constructors

Timestamp | Use a simple timestamp to let AWS check the request validity.
ExpiresAt | Let requests expire at a specific fixed time.
Fields fromExpiresAt :: UTCTime
ExpiresIn | Let requests expire a specific number of seconds after they were generated.
Fields fromExpiresIn :: NominalDiffTime

Instances

Show TimeInfo # |
Methods showsPrec :: Int -> TimeInfo -> ShowS # show :: TimeInfo -> String # showList :: [TimeInfo] -> ShowS #

# Transactions

class (SignQuery r, ResponseConsumer r a, Loggable (ResponseMetadata a)) => Transaction r a | r -> a #

Associates a request type and a response type in a bi-directional way.

This allows the type-checker to infer the response type when given the request type and vice versa.

Note that the actual request generation and response parsing resides in `SignQuery` and `ResponseConsumer` respectively.

Instances

Transaction DeleteItem DeleteItemResponse # |
Transaction GetItem GetItemResponse # |
Transaction PutItem PutItemResponse # |
Transaction Query QueryResponse # |
Transaction Scan ScanResponse # |
Transaction ListTables ListTablesResult # |
Transaction DeleteTable DeleteTableResult # |
Transaction UpdateTable UpdateTableResult # |
Transaction DescribeTable DescribeTableResult # |
Transaction CreateTable CreateTableResult # |
Transaction UpdateItem UpdateItemResponse # |
Transaction CreateAccessKey CreateAccessKeyResponse # |
Transaction CreateUser CreateUserResponse # |
Transaction DeleteAccessKey DeleteAccessKeyResponse # |
Transaction DeleteUser DeleteUserResponse # |
Transaction DeleteUserPolicy DeleteUserPolicyResponse # |
Transaction GetUser GetUserResponse # |
Transaction GetUserPolicy GetUserPolicyResponse # |
Transaction ListAccessKeys ListAccessKeysResponse # |
Transaction ListMfaDevices ListMfaDevicesResponse # |
Transaction ListUserPolicies ListUserPoliciesResponse # |
Transaction ListUsers ListUsersResponse # |
Transaction PutUserPolicy PutUserPolicyResponse # |
Transaction UpdateAccessKey UpdateAccessKeyResponse # |
Transaction UpdateUser UpdateUserResponse # |
Transaction CopyObject CopyObjectResponse # |
Transaction DeleteBucket DeleteBucketResponse # |
Transaction DeleteObject DeleteObjectResponse # |
Transaction DeleteObjectVersion DeleteObjectVersionResponse # |
Transaction DeleteObjects DeleteObjectsResponse # |
Transaction GetBucket GetBucketResponse # |
Transaction GetBucketLocation GetBucketLocationResponse # |
Transaction GetBucketObjectVersions GetBucketObjectVersionsResponse # |
Transaction GetObject GetObjectResponse # |
Transaction GetService GetServiceResponse # |
Transaction HeadObject HeadObjectResponse # |
Transaction PutBucket PutBucketResponse # |
Transaction PutObject PutObjectResponse # |
Transaction DeleteIdentity DeleteIdentityResponse # |
Transaction GetIdentityDkimAttributes GetIdentityDkimAttributesResponse # |
Transaction GetIdentityNotificationAttributes GetIdentityNotificationAttributesResponse # |
Transaction GetIdentityVerificationAttributes GetIdentityVerificationAttributesResponse # |
Transaction ListIdentities ListIdentitiesResponse # |
Transaction SendRawEmail SendRawEmailResponse # |
Transaction SetIdentityDkimEnabled SetIdentityDkimEnabledResponse # |
Transaction SetIdentityFeedbackForwardingEnabled SetIdentityFeedbackForwardingEnabledResponse # |
Transaction SetIdentityNotificationTopic SetIdentityNotificationTopicResponse # |
Transaction VerifyDomainDkim VerifyDomainDkimResponse # |
Transaction VerifyDomainIdentity VerifyDomainIdentityResponse # |
Transaction VerifyEmailIdentity VerifyEmailIdentityResponse # |
Transaction BatchDeleteAttributes BatchDeleteAttributesResponse # |
Transaction BatchPutAttributes BatchPutAttributesResponse # |
Transaction DeleteAttributes DeleteAttributesResponse # |
Transaction PutAttributes PutAttributesResponse # |
Transaction GetAttributes GetAttributesResponse # |
Transaction ListDomains ListDomainsResponse # |
Transaction DomainMetadata DomainMetadataResponse # |
Transaction DeleteDomain DeleteDomainResponse # |
Transaction CreateDomain CreateDomainResponse # |
Transaction Select SelectResponse # |
Transaction ChangeMessageVisibility ChangeMessageVisibilityResponse # |
Transaction ReceiveMessage ReceiveMessageResponse # |
Transaction DeleteMessage DeleteMessageResponse # |
Transaction SendMessage SendMessageResponse # |
Transaction RemovePermission RemovePermissionResponse # |
Transaction AddPermission AddPermissionResponse # |
Transaction ListQueues ListQueuesResponse # |
Transaction DeleteQueue DeleteQueueResponse # |
Transaction CreateQueue CreateQueueResponse # |
Transaction SetQueueAttributes SetQueueAttributesResponse # |
Transaction GetQueueAttributes GetQueueAttributesResponse # |
Transaction AbortMultipartUpload AbortMultipartUploadResponse # |
Transaction CompleteMultipartUpload CompleteMultipartUploadResponse # |
Transaction UploadPart UploadPartResponse # |
Transaction InitiateMultipartUpload InitiateMultipartUploadResponse # |

class Transaction r a => IteratedTransaction r a | r -> a #

A transaction that may need to be split over multiple requests, for example because of upstream response size limits.

Minimal complete definition

nextIteratedRequest

Instances

IteratedTransaction Query QueryResponse # |
Methods nextIteratedRequest :: Query -> QueryResponse -> Maybe Query #
IteratedTransaction Scan ScanResponse # |
Methods nextIteratedRequest :: Scan -> ScanResponse -> Maybe Scan #
IteratedTransaction ListAccessKeys ListAccessKeysResponse # |
Methods nextIteratedRequest :: ListAccessKeys -> ListAccessKeysResponse -> Maybe ListAccessKeys #
IteratedTransaction ListMfaDevices ListMfaDevicesResponse # |
Methods nextIteratedRequest :: ListMfaDevices -> ListMfaDevicesResponse -> Maybe ListMfaDevices #
IteratedTransaction ListUserPolicies ListUserPoliciesResponse # |
Methods nextIteratedRequest :: ListUserPolicies -> ListUserPoliciesResponse -> Maybe ListUserPolicies #
IteratedTransaction ListUsers ListUsersResponse # |
Methods nextIteratedRequest :: ListUsers -> ListUsersResponse -> Maybe ListUsers #
IteratedTransaction GetBucket GetBucketResponse # |
Methods nextIteratedRequest :: GetBucket -> GetBucketResponse -> Maybe GetBucket #
IteratedTransaction GetBucketObjectVersions GetBucketObjectVersionsResponse # |
Methods nextIteratedRequest :: GetBucketObjectVersions -> GetBucketObjectVersionsResponse -> Maybe GetBucketObjectVersions #
IteratedTransaction ListDomains ListDomainsResponse # |
Methods nextIteratedRequest :: ListDomains -> ListDomainsResponse -> Maybe ListDomains #
IteratedTransaction Select SelectResponse # |
Methods nextIteratedRequest :: Select -> SelectResponse -> Maybe Select #

# Credentials

data Credentials #

AWS access credentials.

Constructors

Credentials |
Fields accessKeyID :: ByteString AWS Access Key ID. secretAccessKey :: ByteString AWS Secret Access Key. v4SigningKeys :: IORef [V4Key] Signing keys for signature version 4 iamToken :: Maybe ByteString Signed IAM token

Instances

Show Credentials # |
Methods showsPrec :: Int -> Credentials -> ShowS # show :: Credentials -> String # showList :: [Credentials] -> ShowS #

makeCredentials #

Arguments

:: MonadIO io |
=> ByteString | AWS Access Key ID
-> ByteString | AWS Secret Access Key
-> io Credentials |

credentialsDefaultFile :: MonadIO io => io (Maybe FilePath) #

The file where access credentials are loaded, when using `loadCredentialsDefault`. May return `Nothing` if `HOME` is unset.

Value: directory`/.aws-keys`

credentialsDefaultKey :: Text #

The key to be used in the access credential file that is loaded, when using `loadCredentialsDefault`.

Value: `default`

loadCredentialsFromFile :: MonadIO io => FilePath -> Text -> io (Maybe Credentials) #

Load credentials from a (text) file given a key name.

The file consists of a sequence of lines, each in the following format:

    keyName awsKeyID awsKeySecret

loadCredentialsFromEnv :: MonadIO io => io (Maybe Credentials) #

Load credentials from the environment variables `AWS_ACCESS_KEY_ID` and `AWS_ACCESS_KEY_SECRET` (or `AWS_SECRET_ACCESS_KEY`), if possible.

loadCredentialsFromInstanceMetadata :: MonadIO io => io (Maybe Credentials) #

loadCredentialsFromEnvOrFile :: MonadIO io => FilePath -> Text -> io (Maybe Credentials) #

Load credentials from environment variables if possible, or alternatively from a file with a given key name.

See `loadCredentialsFromEnv` and `loadCredentialsFromFile` for details.

loadCredentialsFromEnvOrFileOrInstanceMetadata :: MonadIO io => FilePath -> Text -> io (Maybe Credentials) #

Load credentials from environment variables if possible, or alternatively from the instance metadata store, or alternatively from a file with a given key name.

See `loadCredentialsFromEnv`, `loadCredentialsFromFile` and `loadCredentialsFromInstanceMetadata` for details.

loadCredentialsDefault :: MonadIO io => io (Maybe Credentials) #

Load credentials from environment variables if possible, or alternative from the default file with the default key name.

Default file: directory`/.aws-keys` Default key name: `default`

See `loadCredentialsFromEnv` and `loadCredentialsFromFile` for details.