| Copyright | (c) 2013-2018 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 |
Network.AWS.Types
Contents
Description
Synopsis
- 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
- type Rs a :: *
- request :: a -> Request a
- response :: (MonadResource m, MonadThrow m) => Logger -> Service -> Proxy a -> ClientResponse -> m (Response a)
- 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 = ConduitM () ByteString (ResourceT IO) ()
- 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
Constructors
| AccessKey ByteString |
Instances
Secret access key credential.
For example: wJalrXUtnFEMIK7MDENGbPxRfiCYEXAMPLEKE
Constructors
| SecretKey ByteString |
Instances
newtype SessionToken Source #
A session token used by STS to temporarily authorise access to an AWS resource.
Constructors
| SessionToken ByteString |
Instances
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.
Constructors
| AuthEnv | |
Fields
| |
Instances
| Eq AuthEnv Source # | |
| Data AuthEnv Source # | |
Defined in Network.AWS.Types Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> AuthEnv -> c AuthEnv # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c AuthEnv # toConstr :: AuthEnv -> Constr # dataTypeOf :: AuthEnv -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c AuthEnv) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c AuthEnv) # gmapT :: (forall b. Data b => b -> b) -> AuthEnv -> AuthEnv # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> AuthEnv -> r # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> AuthEnv -> r # gmapQ :: (forall d. Data d => d -> u) -> AuthEnv -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> AuthEnv -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> AuthEnv -> m AuthEnv # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> AuthEnv -> m AuthEnv # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> AuthEnv -> m AuthEnv # | |
| Show AuthEnv Source # | |
| Generic AuthEnv Source # | |
| FromJSON AuthEnv Source # | |
| NFData AuthEnv Source # | |
Defined in Network.AWS.Types | |
| ToLog AuthEnv Source # | |
| FromXML AuthEnv Source # | |
| type Rep AuthEnv Source # | |
Defined in Network.AWS.Types type Rep AuthEnv = D1 (MetaData "AuthEnv" "Network.AWS.Types" "amazonka-core-1.6.1-FZORvxk9gh76fGemhSgXQL" False) (C1 (MetaCons "AuthEnv" PrefixI True) ((S1 (MetaSel (Just "_authAccess") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 AccessKey) :*: S1 (MetaSel (Just "_authSecret") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 (Sensitive SecretKey))) :*: (S1 (MetaSel (Just "_authToken") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Maybe (Sensitive SessionToken))) :*: S1 (MetaSel (Just "_authExpiry") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Maybe ISO8601))))) | |
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
Constructors
| Info | Info messages supplied by the user - this level is not emitted by the library. |
| Error | Error messages only. |
| Debug | Useful debug information + info + error levels. |
| Trace | Includes potentially sensitive signing metadata, and non-streaming response bodies. |
Instances
| Enum LogLevel Source # | |
Defined in Network.AWS.Types | |
| Eq LogLevel Source # | |
| Data LogLevel Source # | |
Defined in Network.AWS.Types Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> LogLevel -> c LogLevel # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c LogLevel # toConstr :: LogLevel -> Constr # dataTypeOf :: LogLevel -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c LogLevel) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c LogLevel) # gmapT :: (forall b. Data b => b -> b) -> LogLevel -> LogLevel # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> LogLevel -> r # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> LogLevel -> r # gmapQ :: (forall d. Data d => d -> u) -> LogLevel -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> LogLevel -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> LogLevel -> m LogLevel # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> LogLevel -> m LogLevel # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> LogLevel -> m LogLevel # | |
| Ord LogLevel Source # | |
Defined in Network.AWS.Types | |
| Show LogLevel Source # | |
| ToText LogLevel Source # | |
| FromText LogLevel Source # | |
| ToByteString LogLevel Source # | |
Defined in Network.AWS.Types Methods toBS :: LogLevel -> ByteString Source # | |
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'.
Constructors
| Signed | |
Fields
| |
Service
Abbreviated service name.
Attributes and functions specific to an AWS service.
Constructors
| Service | |
Fields
| |
Requests
class AWSRequest a where Source #
Specify how a request can be de/serialised.
Methods
request :: a -> Request a Source #
response :: (MonadResource m, MonadThrow m) => Logger -> Service -> Proxy a -> ClientResponse -> m (Response a) Source #
An unsigned request.
Constructors
| Request | |
Fields
| |
Responses
Retries
Constants and predicates used to create a RetryPolicy.
Constructors
| Exponential | |
Fields
| |
retryCheck :: Lens' Retry (ServiceError -> Maybe Text) Source #
Errors
class AsError a where Source #
Minimal complete definition
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.
Instances
| AsError SomeException Source # | |
| AsError Error Source # | |
Defined in Network.AWS.Types | |
An error type representing errors that can be attributed to this library.
Instances
| Show Error Source # | |
| Exception Error Source # | |
Defined in Network.AWS.Types Methods toException :: Error -> SomeException # fromException :: SomeException -> Maybe Error # displayException :: Error -> String # | |
| ToLog Error Source # | |
| AsError Error Source # | |
Defined in Network.AWS.Types | |
HTTP Errors
data HttpException #
An exception which may be generated by this library
Since: http-client-0.5.0
Instances
| Show HttpException | |
Defined in Network.HTTP.Client.Types Methods showsPrec :: Int -> HttpException -> ShowS # show :: HttpException -> String # showList :: [HttpException] -> ShowS # | |
| Exception HttpException | |
Defined in Network.HTTP.Client.Types Methods toException :: HttpException -> SomeException # fromException :: SomeException -> Maybe HttpException # displayException :: HttpException -> String # | |
| ToLog HttpException Source # | |
Defined in Network.AWS.Data.Log Methods build :: HttpException -> Builder Source # | |
Serialize Errors
data SerializeError Source #
Constructors
| SerializeError' | |
Fields
| |
Instances
| Eq SerializeError Source # | |
Defined in Network.AWS.Types Methods (==) :: SerializeError -> SerializeError -> Bool # (/=) :: SerializeError -> SerializeError -> Bool # | |
| Show SerializeError Source # | |
Defined in Network.AWS.Types Methods showsPrec :: Int -> SerializeError -> ShowS # show :: SerializeError -> String # showList :: [SerializeError] -> ShowS # | |
| ToLog SerializeError Source # | |
Defined in Network.AWS.Types Methods build :: SerializeError -> Builder Source # | |
Service Errors
data ServiceError Source #
Constructors
| ServiceError' | |
Fields | |
Instances
| Eq ServiceError Source # | |
Defined in Network.AWS.Types | |
| Show ServiceError Source # | |
Defined in Network.AWS.Types Methods showsPrec :: Int -> ServiceError -> ShowS # show :: ServiceError -> String # showList :: [ServiceError] -> ShowS # | |
| ToLog ServiceError Source # | |
Defined in Network.AWS.Types Methods build :: ServiceError -> Builder Source # | |
Error Types
Instances
| Eq ErrorCode Source # | |
| Ord ErrorCode Source # | |
| Show ErrorCode Source # | |
| IsString ErrorCode Source # | |
Defined in Network.AWS.Types Methods fromString :: String -> ErrorCode # | |
| FromJSON ErrorCode Source # | |
| ToText ErrorCode Source # | |
| FromText ErrorCode Source # | |
| ToLog ErrorCode Source # | |
| FromXML ErrorCode Source # | |
newtype ErrorMessage Source #
Constructors
| ErrorMessage Text |
Instances
Instances
| Eq RequestId Source # | |
| Ord RequestId Source # | |
| Show RequestId Source # | |
| IsString RequestId Source # | |
Defined in Network.AWS.Types Methods fromString :: String -> RequestId # | |
| FromJSON RequestId Source # | |
| ToText RequestId Source # | |
| FromText RequestId Source # | |
| ToLog RequestId Source # | |
| FromXML RequestId Source # | |
Regions
The available AWS regions.
Constructors
| 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'). |
Instances
Endpoints
Constructors
| Endpoint | |
Fields
| |
Instances
| Eq Endpoint Source # | |
| Data Endpoint Source # | |
Defined in Network.AWS.Types Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Endpoint -> c Endpoint # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Endpoint # toConstr :: Endpoint -> Constr # dataTypeOf :: Endpoint -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Endpoint) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Endpoint) # gmapT :: (forall b. Data b => b -> b) -> Endpoint -> Endpoint # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Endpoint -> r # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Endpoint -> r # gmapQ :: (forall d. Data d => d -> u) -> Endpoint -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> Endpoint -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Endpoint -> m Endpoint # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Endpoint -> m Endpoint # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Endpoint -> m Endpoint # | |
| Show Endpoint Source # | |
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 = ConduitM () ByteString (ResourceT IO) () 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.
Instances
microseconds :: Seconds -> Int Source #