Copyright | (c) 2013-2021 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 |
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 {}
- authAccessKeyId :: Lens' AuthEnv AccessKey
- authSecretAccessKey :: Lens' AuthEnv SecretKey
- authSessionToken :: Lens' AuthEnv (Maybe SessionToken)
- authExpiration :: Lens' AuthEnv (Maybe UTCTime)
- data LogLevel
- type Logger = LogLevel -> ByteStringBuilder -> IO ()
- type Algorithm a = Request a -> AuthEnv -> Region -> UTCTime -> Signed a
- data Meta where
- data Signer = Signer {
- signerSign :: forall a. Algorithm a
- signerPresign :: forall a. Seconds -> Algorithm a
- data Signed a = Signed {}
- data Abbrev
- data Service = Service {
- _serviceAbbrev :: Abbrev
- _serviceSigner :: Signer
- _serviceSigningName :: ByteString
- _serviceVersion :: ByteString
- _serviceEndpointPrefix :: ByteString
- _serviceEndpoint :: Region -> Endpoint
- _serviceTimeout :: Maybe Seconds
- _serviceCheck :: Status -> Bool
- _serviceError :: Status -> [Header] -> ByteStringLazy -> Error
- _serviceRetry :: 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 AWSResponse a :: *
- request :: a -> Request a
- response :: MonadResource m => Logger -> Service -> Proxy a -> ClientResponse ClientBody -> m (Either Error (ClientResponse (AWSResponse a)))
- data Request a = Request {}
- requestService :: Lens' (Request a) Service
- requestMethod :: Lens' (Request a) StdMethod
- requestHeaders :: Lens' (Request a) [Header]
- requestPath :: Lens' (Request a) RawPath
- requestQuery :: Lens' (Request a) QueryString
- requestBody :: Lens' (Request a) RequestBody
- requestSign :: Algorithm a
- requestPresign :: Seconds -> Algorithm a
- requestUnsigned :: Request a -> Region -> ClientRequest
- 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
- newErrorCode :: Text -> ErrorCode
- newtype ErrorMessage = ErrorMessage {}
- newtype RequestId = RequestId {}
- newtype Region where
- Region' {
- fromRegion :: Text
- pattern NorthVirginia :: Region
- pattern Ohio :: Region
- pattern NorthCalifornia :: Region
- pattern Oregon :: Region
- pattern GovCloudWest :: Region
- pattern GovCloudEast :: Region
- pattern Montreal :: Region
- pattern SaoPaulo :: Region
- pattern Frankfurt :: Region
- pattern Ireland :: Region
- pattern London :: Region
- pattern Milan :: Region
- pattern Paris :: Region
- pattern Stockholm :: Region
- pattern Bahrain :: Region
- pattern CapeTown :: Region
- pattern Beijing :: Region
- pattern Ningxia :: Region
- pattern HongKong :: Region
- pattern Tokyo :: Region
- pattern Seoul :: Region
- pattern Osaka :: Region
- pattern Singapore :: Region
- pattern Sydney :: Region
- pattern Mumbai :: Region
- 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
- type ClientBody = ConduitM () ByteString (ResourceT IO) ()
- newClientRequest :: Endpoint -> Maybe Seconds -> ClientRequest
- newtype Seconds = Seconds Int
- toSeconds :: Seconds -> Int
- toMicroseconds :: Seconds -> Int
Authentication
Credentials
An access key ID.
For example: AKIAIOSFODNN7EXAMPLE
Instances
Secret access key credential.
For example: wJalrXUtnFEMIK7MDENGbPxRfiCYEXAMPLEKE
Instances
Eq SecretKey Source # | |
IsString SecretKey Source # | |
Defined in Amazonka.Types fromString :: String -> SecretKey # | |
Generic SecretKey Source # | |
NFData SecretKey Source # | |
Defined in Amazonka.Types | |
Hashable SecretKey Source # | |
Defined in Amazonka.Types | |
ToJSON SecretKey Source # | |
Defined in Amazonka.Types | |
FromJSON SecretKey Source # | |
ToText SecretKey Source # | |
FromText SecretKey Source # | |
ToByteString SecretKey Source # | |
Defined in Amazonka.Types toBS :: SecretKey -> ByteString Source # | |
ToXML SecretKey Source # | |
FromXML SecretKey Source # | |
type Rep SecretKey Source # | |
Defined in Amazonka.Types type Rep SecretKey = D1 ('MetaData "SecretKey" "Amazonka.Types" "libZSamazonka-coreZSamazonka-core" 'True) (C1 ('MetaCons "SecretKey" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 ByteString))) |
newtype SessionToken Source #
A session token used by STS to temporarily authorise access to an AWS resource.
Instances
Environment
An authorisation environment containing AWS credentials, and potentially a reference which can be refreshed out-of-band as temporary credentials expire.
Instances
ToLog Auth Source # | |
Defined in Amazonka.Types build :: Auth -> ByteStringBuilder Source # |
The AuthN/AuthZ credential environment.
Instances
Eq AuthEnv Source # | |
Show AuthEnv Source # | |
Generic AuthEnv Source # | |
NFData AuthEnv Source # | |
Defined in Amazonka.Types | |
FromJSON AuthEnv Source # | |
FromXML AuthEnv Source # | |
ToLog AuthEnv Source # | |
Defined in Amazonka.Types build :: AuthEnv -> ByteStringBuilder Source # | |
type Rep AuthEnv Source # | |
Defined in Amazonka.Types type Rep AuthEnv = D1 ('MetaData "AuthEnv" "Amazonka.Types" "libZSamazonka-coreZSamazonka-core" 'False) (C1 ('MetaCons "AuthEnv" 'PrefixI 'True) ((S1 ('MetaSel ('Just "_authAccessKeyId") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 AccessKey) :*: S1 ('MetaSel ('Just "_authSecretAccessKey") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Sensitive SecretKey))) :*: (S1 ('MetaSel ('Just "_authSessionToken") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe (Sensitive SessionToken))) :*: S1 ('MetaSel ('Just "_authExpiration") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe ISO8601))))) |
authAccessKeyId :: Lens' AuthEnv AccessKey Source #
The access key ID that identifies the temporary security credentials.
authSecretAccessKey :: Lens' AuthEnv SecretKey Source #
The secret access key that can be used to sign requests.
authSessionToken :: Lens' AuthEnv (Maybe SessionToken) Source #
The token that users must pass to the service API to use the temporary credentials.
authExpiration :: Lens' AuthEnv (Maybe UTCTime) Source #
The date on which the current credentials expire.
Logging
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 # | |
Eq LogLevel Source # | |
Ord LogLevel Source # | |
Defined in Amazonka.Types | |
Show LogLevel Source # | |
Generic LogLevel Source # | |
ToText LogLevel Source # | |
FromText LogLevel Source # | |
ToByteString LogLevel Source # | |
Defined in Amazonka.Types toBS :: LogLevel -> ByteString Source # | |
type Rep LogLevel Source # | |
Defined in Amazonka.Types type Rep LogLevel = D1 ('MetaData "LogLevel" "Amazonka.Types" "libZSamazonka-coreZSamazonka-core" 'False) ((C1 ('MetaCons "Info" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "Error" 'PrefixI 'False) (U1 :: Type -> Type)) :+: (C1 ('MetaCons "Debug" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "Trace" 'PrefixI 'False) (U1 :: Type -> Type))) |
type Logger = LogLevel -> ByteStringBuilder -> IO () Source #
A function threaded through various request and serialisation routines to log informational and debug messages.
Signing
Signing algorithm specific metadata.
Instances
ToLog Meta Source # | |
Defined in Amazonka.Types build :: Meta -> ByteStringBuilder Source # |
Signer | |
|
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,
.AWSResponse
a
Service
Abbreviated service name.
Instances
Eq Abbrev Source # | |
Ord Abbrev Source # | |
Show Abbrev Source # | |
IsString Abbrev Source # | |
Defined in Amazonka.Types fromString :: String -> Abbrev # | |
Generic Abbrev Source # | |
FromJSON Abbrev Source # | |
ToText Abbrev Source # | |
FromText Abbrev Source # | |
FromXML Abbrev Source # | |
ToLog Abbrev Source # | |
Defined in Amazonka.Types build :: Abbrev -> ByteStringBuilder Source # | |
type Rep Abbrev Source # | |
Defined in Amazonka.Types |
Attributes and functions specific to an AWS service.
Service | |
|
Instances
Requests
class AWSRequest a where Source #
Specify how a request can be de/serialised.
type AWSResponse a :: * Source #
The successful, expected response associated with a request.
request :: a -> Request a Source #
response :: MonadResource m => Logger -> Service -> Proxy a -> ClientResponse ClientBody -> m (Either Error (ClientResponse (AWSResponse a))) Source #
An unsigned request.
Instances
Generic (Request a) Source # | |
type Rep (Request a) Source # | |
Defined in Amazonka.Types type Rep (Request a) = D1 ('MetaData "Request" "Amazonka.Types" "libZSamazonka-coreZSamazonka-core" 'False) (C1 ('MetaCons "Request" 'PrefixI 'True) ((S1 ('MetaSel ('Just "_requestService") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Service) :*: (S1 ('MetaSel ('Just "_requestMethod") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 StdMethod) :*: S1 ('MetaSel ('Just "_requestPath") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 RawPath))) :*: (S1 ('MetaSel ('Just "_requestQuery") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 QueryString) :*: (S1 ('MetaSel ('Just "_requestHeaders") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 [Header]) :*: S1 ('MetaSel ('Just "_requestBody") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 RequestBody))))) |
requestQuery :: Lens' (Request a) QueryString Source #
requestBody :: Lens' (Request a) RequestBody Source #
requestSign :: Algorithm a Source #
requestPresign :: Seconds -> Algorithm a Source #
requestUnsigned :: Request a -> Region -> ClientRequest Source #
Create an unsigned ClientRequest
. You will almost never need to do this.
Retries
Constants and predicates used to create a RetryPolicy
.
Exponential | |
|
Instances
Generic Retry Source # | |
type Rep Retry Source # | |
Defined in Amazonka.Types type Rep Retry = D1 ('MetaData "Retry" "Amazonka.Types" "libZSamazonka-coreZSamazonka-core" 'False) (C1 ('MetaCons "Exponential" 'PrefixI 'True) ((S1 ('MetaSel ('Just "_retryBase") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Double) :*: S1 ('MetaSel ('Just "_retryGrowth") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Int)) :*: (S1 ('MetaSel ('Just "_retryAttempts") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Int) :*: S1 ('MetaSel ('Just "_retryCheck") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (ServiceError -> Maybe Text))))) |
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.
Instances
Show Error Source # | |
Generic Error Source # | |
Exception Error Source # | |
Defined in Amazonka.Types toException :: Error -> SomeException # fromException :: SomeException -> Maybe Error # displayException :: Error -> String # | |
ToLog Error Source # | |
Defined in Amazonka.Types build :: Error -> ByteStringBuilder Source # | |
AsError Error Source # | |
type Rep Error Source # | |
Defined in Amazonka.Types type Rep Error = D1 ('MetaData "Error" "Amazonka.Types" "libZSamazonka-coreZSamazonka-core" 'False) (C1 ('MetaCons "TransportError" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 HttpException)) :+: (C1 ('MetaCons "SerializeError" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 SerializeError)) :+: C1 ('MetaCons "ServiceError" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 ServiceError)))) |
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 showsPrec :: Int -> HttpException -> ShowS # show :: HttpException -> String # showList :: [HttpException] -> ShowS # | |
Exception HttpException | |
Defined in Network.HTTP.Client.Types | |
ToLog HttpException Source # | |
Defined in Amazonka.Data.Log |
Serialize Errors
data SerializeError Source #
SerializeError' | |
|
Instances
Service Errors
data ServiceError Source #
Instances
Error Types
Instances
Eq ErrorCode Source # | |
Ord ErrorCode Source # | |
Defined in Amazonka.Types | |
Show ErrorCode Source # | |
IsString ErrorCode Source # | |
Defined in Amazonka.Types fromString :: String -> ErrorCode # | |
FromJSON ErrorCode Source # | |
ToText ErrorCode Source # | |
FromText ErrorCode Source # | |
FromXML ErrorCode Source # | |
ToLog ErrorCode Source # | |
Defined in Amazonka.Types build :: ErrorCode -> ByteStringBuilder Source # |
newtype ErrorMessage Source #
Instances
Instances
Eq RequestId Source # | |
Ord RequestId Source # | |
Defined in Amazonka.Types | |
Show RequestId Source # | |
IsString RequestId Source # | |
Defined in Amazonka.Types fromString :: String -> RequestId # | |
Generic RequestId Source # | |
FromJSON RequestId Source # | |
ToText RequestId Source # | |
FromText RequestId Source # | |
FromXML RequestId Source # | |
ToLog RequestId Source # | |
Defined in Amazonka.Types build :: RequestId -> ByteStringBuilder Source # | |
type Rep RequestId Source # | |
Defined in Amazonka.Types |
Regions
The available AWS regions.
pattern NorthVirginia :: Region | |
pattern Ohio :: Region | |
pattern NorthCalifornia :: Region | |
pattern Oregon :: Region | |
pattern GovCloudWest :: Region | |
pattern GovCloudEast :: Region | |
pattern Montreal :: Region | |
pattern SaoPaulo :: Region | |
pattern Frankfurt :: Region | |
pattern Ireland :: Region | |
pattern London :: Region | |
pattern Milan :: Region | |
pattern Paris :: Region | |
pattern Stockholm :: Region | |
pattern Bahrain :: Region | |
pattern CapeTown :: Region | |
pattern Beijing :: Region | |
pattern Ningxia :: Region | |
pattern HongKong :: Region | |
pattern Tokyo :: Region | |
pattern Seoul :: Region | |
pattern Osaka :: Region | |
pattern Singapore :: Region | |
pattern Sydney :: Region | |
pattern Mumbai :: Region |
Instances
Eq Region Source # | |
Ord Region Source # | |
Read Region Source # | |
Show Region Source # | |
IsString Region Source # | |
Defined in Amazonka.Types fromString :: String -> Region # | |
Generic Region Source # | |
NFData Region Source # | |
Defined in Amazonka.Types | |
Hashable Region Source # | |
Defined in Amazonka.Types | |
ToJSON Region Source # | |
Defined in Amazonka.Types | |
FromJSON Region Source # | |
ToText Region Source # | |
FromText Region Source # | |
ToByteString Region Source # | |
Defined in Amazonka.Types toBS :: Region -> ByteString Source # | |
ToXML Region Source # | |
FromXML Region Source # | |
ToQuery Region Source # | |
Defined in Amazonka.Types toQuery :: Region -> QueryString Source # | |
ToLog Region Source # | |
Defined in Amazonka.Types build :: Region -> ByteStringBuilder Source # | |
type Rep Region Source # | |
Defined in Amazonka.Types |
Endpoints
HTTP
type ClientRequest = Request Source #
A convenience alias to avoid type ambiguity.
type ClientResponse = Response Source #
A convenience alias encapsulating the common Response
.
type ClientBody = ConduitM () ByteString (ResourceT IO) () Source #
A convenience alias encapsulating the common Response
body.
newClientRequest :: 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
Bounded Seconds Source # | |
Enum Seconds Source # | |
Eq Seconds Source # | |
Integral Seconds Source # | |
Defined in Amazonka.Types | |
Num Seconds Source # | |
Ord Seconds Source # | |
Read Seconds Source # | |
Real Seconds Source # | |
Defined in Amazonka.Types toRational :: Seconds -> Rational # | |
Show Seconds Source # | |
Generic Seconds Source # | |
NFData Seconds Source # | |
Defined in Amazonka.Types | |
Hashable Seconds Source # | |
Defined in Amazonka.Types | |
ToText Seconds Source # | |
FromText Seconds Source # | |
ToByteString Seconds Source # | |
Defined in Amazonka.Types toBS :: Seconds -> ByteString Source # | |
ToQuery Seconds Source # | |
Defined in Amazonka.Types toQuery :: Seconds -> QueryString Source # | |
ToLog Seconds Source # | |
Defined in Amazonka.Types build :: Seconds -> ByteStringBuilder Source # | |
type Rep Seconds Source # | |
Defined in Amazonka.Types |
toMicroseconds :: Seconds -> Int Source #