amazonka-core-1.0.0: Core data types and functionality for Amazonka libraries.

Copyright(c) 2013-2015 Brendan Hay
LicenseMozilla Public License, v. 2.0.
MaintainerBrendan Hay <brendan.g.hay@gmail.com>
Stabilityprovisional
Portabilitynon-portable (GHC extensions)
Safe HaskellNone
LanguageHaskell2010

Network.AWS.Types

Contents

Description

 

Synopsis

Authentication

Credentials

newtype SecretKey Source

Secret key credential.

Constructors

SecretKey ByteString 

newtype SessionToken Source

A session token used by STS to temporarily authorise access to an AWS resource.

Constructors

SessionToken ByteString 

Environment

data AuthEnv Source

The authorisation environment.

data Auth Source

An authorisation environment containing AWS credentials, and potentially a reference which can be refreshed out-of-band as temporary credentials expire.

Instances

withAuth :: MonadIO m => Auth -> (AuthEnv -> m a) -> m a Source

Logging

data LogLevel Source

Constructors

Error

Error messages only.

Info

Info messages supplied by the user - this level is not emitted by the library.

Debug

Useful debug information + info + error levels.

Trace

Includes potentially sensitive signing metadata, and non-streaming response bodies.

type Logger = LogLevel -> Builder -> IO () Source

A function threaded through various request and serialisation routines to log informational and debug messages.

Services

class AWSSigner (Sg a) => AWSService a where Source

Associated Types

type Sg a :: * Source

The default signing algorithm for the service.

Methods

service :: (Sv p ~ a) => Proxy p -> Service a Source

data Service s Source

Attributes and functions specific to an AWS service.

serviceOf :: forall a. AWSService (Sv a) => a -> Service (Sv a) Source

Retries

data Retry Source

Constants and predicates used to create a RetryPolicy.

Constructors

Exponential 

Fields

_retryBase :: !Double
 
_retryGrowth :: !Int
 
_retryAttempts :: !Int
 
_retryCheck :: ServiceError -> Maybe Text

Returns a descriptive name for logging if the request should be retried.

Signing

class AWSSigner v where Source

Methods

signed :: (v ~ Sg s) => AuthEnv -> Region -> UTCTime -> Service s -> Request a -> Signed v a Source

Instances

class AWSPresigner v where Source

Methods

presigned :: (v ~ Sg s) => AuthEnv -> Region -> UTCTime -> Seconds -> Service s -> Request a -> Signed v a Source

Instances

data family Meta v :: * Source

Signing metadata data specific to a signing algorithm.

Note: this is used for logging purposes, and is otherwise ignored.

Instances

ToLog (Meta V2) 
ToLog (Meta V4) 
data Meta V2 = Meta {} 
data Meta V4 = Meta {} 

data Signed v a where Source

A signed ClientRequest and associated metadata specific to the signing algorithm that was used.

Constructors

Signed :: ToLog (Meta v) => Meta v -> ClientRequest -> Signed v a 

sgMeta :: ToLog (Meta v) => Lens' (Signed v a) (Meta v) Source

Requests

class AWSService (Sv a) => AWSRequest a where Source

Specify how a request can be de/serialised.

Associated Types

type Rs a :: * Source

The successful, expected response associated with a request.

type Sv a :: * Source

The default sevice configuration for the request.

data Request a Source

An unsigned request.

Instances

Responses

type Response a = (Status, Rs a) Source

Errors

class AsError a where Source

Minimal complete definition

_Error

Methods

_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.

data Error Source

An error type representing errors that can be attributed to this library.

HTTP Errors

Serialize Errors

Service Errors

Error Types

Regions

data Region Source

The sum of available AWS regions.

Constructors

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

Isomorphisms

_Coerce :: (Coercible a b, Coercible b a) => Iso' a b Source

_Default :: Monoid a => Iso' (Maybe a) a Source

Invalid Iso, should be a Prism but exists for ease of composition with the current 'Lens . Iso' chaining to hide internal types from the user.