Copyright | (c) 2013-2023 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 | Safe-Inferred |
Language | Haskell2010 |
Synopsis
- newtype AccessKey = AccessKey ByteString
- newtype SecretKey = SecretKey ByteString
- newtype SessionToken = SessionToken ByteString
- _AccessKey :: Iso' AccessKey ByteString
- _SecretKey :: Iso' SecretKey ByteString
- _SessionToken :: Iso' SessionToken ByteString
- data Auth
- withAuth :: MonadIO m => Auth -> (AuthEnv -> m a) -> m a
- data AuthEnv = AuthEnv {}
- authEnv_accessKeyId :: Lens' AuthEnv AccessKey
- authEnv_secretAccessKey :: Lens' AuthEnv (Sensitive SecretKey)
- authEnv_sessionToken :: Lens' AuthEnv (Maybe (Sensitive SessionToken))
- authEnv_expiration :: Lens' AuthEnv (Maybe ISO8601)
- type Algorithm a = Request a -> AuthEnv -> Region -> UTCTime -> Signed a
- data Meta where
- data Signer = Signer {}
- data Signed a = Signed {}
- signed_signedMeta :: Lens' (Signed a) Meta
- signed_signedRequest :: Lens' (Signed a) ClientRequest
- data Abbrev
- data Service = Service {
- abbrev :: Abbrev
- signer :: Signer
- signingName :: ByteString
- version :: ByteString
- s3AddressingStyle :: S3AddressingStyle
- endpointPrefix :: ByteString
- endpoint :: Region -> Endpoint
- timeout :: Maybe Seconds
- check :: Status -> Bool
- error :: Status -> [Header] -> ByteStringLazy -> Error
- retry :: Retry
- data S3AddressingStyle
- _Abbrev :: Iso' Abbrev Text
- service_abbrev :: Lens' Service Abbrev
- service_signer :: Lens' Service Signer
- service_signingName :: Lens' Service ByteString
- service_version :: Lens' Service ByteString
- service_s3AddressingStyle :: Lens' Service S3AddressingStyle
- service_endpointPrefix :: Lens' Service ByteString
- service_endpoint :: Lens' Service (Region -> Endpoint)
- service_timeout :: Lens' Service (Maybe Seconds)
- service_check :: Lens' Service (Status -> Bool)
- service_error :: Lens' Service (Status -> [Header] -> ByteStringLazy -> Error)
- service_retry :: Lens' Service Retry
- class AWSRequest a where
- type AWSResponse a :: Type
- request :: (Service -> Service) -> a -> Request a
- response :: MonadResource m => (ByteStringLazy -> IO ByteStringLazy) -> Service -> Proxy a -> ClientResponse ClientBody -> m (Either Error (ClientResponse (AWSResponse a)))
- data Request a = Request {}
- requestSign :: Algorithm a
- requestPresign :: Seconds -> Algorithm a
- requestUnsigned :: Request a -> Region -> ClientRequest
- request_service :: Lens' (Request a) Service
- request_method :: Lens' (Request a) StdMethod
- request_path :: Lens' (Request a) RawPath
- request_query :: Lens' (Request a) QueryString
- request_headers :: forall a. Lens' (Request a) [Header]
- request_body :: forall a. Lens' (Request a) RequestBody
- data Retry = Exponential {}
- retry_base :: Lens' Retry Double
- retry_growth :: Lens' Retry Int
- retry_attempts :: Lens' Retry Int
- retry_check :: Lens' Retry (ServiceError -> Maybe Text)
- class AsError a where
- data Error
- data HttpException
- data SerializeError = SerializeError' {}
- serializeError_abbrev :: Lens' SerializeError Abbrev
- serializeError_status :: Lens' SerializeError Status
- serializeError_body :: Lens' SerializeError (Maybe ByteStringLazy)
- serializeError_message :: Lens' SerializeError String
- data ServiceError = ServiceError' {}
- serviceError_abbrev :: Lens' ServiceError Abbrev
- serviceError_status :: Lens' ServiceError Status
- serviceError_headers :: Lens' ServiceError [Header]
- serviceError_code :: Lens' ServiceError ErrorCode
- serviceError_message :: Lens' ServiceError (Maybe ErrorMessage)
- serviceError_requestId :: Lens' ServiceError (Maybe RequestId)
- newtype ErrorCode = ErrorCode Text
- newErrorCode :: Text -> ErrorCode
- newtype ErrorMessage = ErrorMessage {}
- newtype RequestId = RequestId {}
- _ErrorCode :: Iso' ErrorCode Text
- _ErrorMessage :: Iso' ErrorMessage Text
- _RequestId :: Iso' RequestId Text
- newtype Region where
- Region' {
- fromRegion :: Text
- pattern Ohio :: Region
- pattern NorthVirginia :: Region
- pattern NorthCalifornia :: Region
- pattern Oregon :: Region
- pattern CapeTown :: Region
- pattern HongKong :: Region
- pattern Hyderabad :: Region
- pattern Jakarta :: Region
- pattern Melbourne :: Region
- pattern Mumbai :: Region
- pattern Osaka :: Region
- pattern Seoul :: Region
- pattern Singapore :: Region
- pattern Sydney :: Region
- pattern Tokyo :: Region
- pattern Montreal :: Region
- pattern Frankfurt :: Region
- pattern Ireland :: Region
- pattern London :: Region
- pattern Milan :: Region
- pattern Paris :: Region
- pattern Spain :: Region
- pattern Stockholm :: Region
- pattern Zurich :: Region
- pattern Bahrain :: Region
- pattern UAE :: Region
- pattern SaoPaulo :: Region
- pattern GovCloudEast :: Region
- pattern GovCloudWest :: Region
- pattern Beijing :: Region
- pattern Ningxia :: Region
- Region' {
- data Endpoint = Endpoint {
- host :: ByteString
- basePath :: RawPath
- secure :: Bool
- port :: Int
- scope :: ByteString
- endpoint_host :: Lens' Endpoint ByteString
- endpoint_basePath :: Lens' Endpoint RawPath
- endpoint_secure :: Lens' Endpoint Bool
- endpoint_port :: Lens' Endpoint Int
- endpoint_scope :: Lens' Endpoint ByteString
- type ClientRequest = Request
- type ClientResponse = Response
- type ClientBody = ConduitM () ByteString (ResourceT IO) ()
- newClientRequest :: Endpoint -> Maybe Seconds -> ClientRequest
- newtype Seconds = Seconds DiffTime
- toSeconds :: Seconds -> DiffTime
- toMicroseconds :: Seconds -> Int
Authentication
Credentials
An access key ID.
For example: AKIAIOSFODNN7EXAMPLE
Instances
Secret access key credential.
For example: wJalrXUtnFEMIK7MDENGbPxRfiCYEXAMPLEKE
Instances
FromJSON SecretKey Source # | |
ToJSON SecretKey Source # | |
Defined in Amazonka.Types | |
ToByteString SecretKey Source # | |
Defined in Amazonka.Types toBS :: SecretKey -> ByteString Source # | |
FromText SecretKey Source # | |
ToText SecretKey Source # | |
FromXML SecretKey Source # | |
ToXML SecretKey Source # | |
IsString SecretKey Source # | |
Defined in Amazonka.Types fromString :: String -> SecretKey # | |
Generic SecretKey Source # | |
NFData SecretKey Source # | |
Defined in Amazonka.Types | |
Eq SecretKey Source # | |
Hashable SecretKey Source # | |
Defined in Amazonka.Types | |
type Rep SecretKey Source # | |
Defined in Amazonka.Types type Rep SecretKey = D1 ('MetaData "SecretKey" "Amazonka.Types" "amazonka-core-2.0-BFuA7FRvuklLoYhn4b6A6p" '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
Optics
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
FromJSON AuthEnv Source # | |
ToLog AuthEnv Source # | |
Defined in Amazonka.Types build :: AuthEnv -> ByteStringBuilder Source # | |
FromXML AuthEnv Source # | |
Generic AuthEnv Source # | |
Show AuthEnv Source # | |
NFData AuthEnv Source # | |
Defined in Amazonka.Types | |
Eq AuthEnv Source # | |
type Rep AuthEnv Source # | |
Defined in Amazonka.Types type Rep AuthEnv = D1 ('MetaData "AuthEnv" "Amazonka.Types" "amazonka-core-2.0-BFuA7FRvuklLoYhn4b6A6p" 'False) (C1 ('MetaCons "AuthEnv" 'PrefixI 'True) ((S1 ('MetaSel ('Just "accessKeyId") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 AccessKey) :*: S1 ('MetaSel ('Just "secretAccessKey") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Sensitive SecretKey))) :*: (S1 ('MetaSel ('Just "sessionToken") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe (Sensitive SessionToken))) :*: S1 ('MetaSel ('Just "expiration") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe ISO8601))))) |
Lenses
Signing
Signing algorithm specific metadata.
Instances
ToLog Meta Source # | |
Defined in Amazonka.Types build :: Meta -> ByteStringBuilder Source # |
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
Lenses
Service
Abbreviated service name.
Instances
FromJSON Abbrev Source # | |
ToLog Abbrev Source # | |
Defined in Amazonka.Types build :: Abbrev -> ByteStringBuilder Source # | |
FromText Abbrev Source # | |
ToText Abbrev Source # | |
FromXML Abbrev Source # | |
IsString Abbrev Source # | |
Defined in Amazonka.Types fromString :: String -> Abbrev # | |
Generic Abbrev Source # | |
Show Abbrev Source # | |
Eq Abbrev Source # | |
Ord Abbrev Source # | |
type Rep Abbrev Source # | |
Defined in Amazonka.Types |
Attributes and functions specific to an AWS service.
Service | |
|
Instances
data S3AddressingStyle Source #
When to rewrite S3 requests into virtual-hosted style.
Requests to S3 can be rewritten to access buckets by setting the
Host:
header, which allows you to point a CNAME
record at an
Amazon S3 Bucket.
Non-S3 object stores usually do not support this, which is usually the only time you'll need to change this.
See: Virtual hosting of buckets in the Amazon S3 User Guide.
See: Changing the Addressing Style for the corresponding option in Boto 3.
S3AddressingStyleAuto | Rewrite S3 request paths only if they can be expressed as a DNS label. This is the default. |
S3AddressingStylePath | Do not ever rewrite S3 request paths. |
S3AddressingStyleVirtual | Force virtual hosted style rewrites without checking the bucket name. |
Instances
Optics
service_error :: Lens' Service (Status -> [Header] -> ByteStringLazy -> Error) Source #
Requests
class AWSRequest a where Source #
Specify how a request can be de/serialised.
type AWSResponse a :: Type Source #
The successful, expected response associated with a request.
:: MonadResource m | |
=> (ByteStringLazy -> IO ByteStringLazy) | Raw response body hook. |
-> Service | |
-> Proxy a | |
-> ClientResponse ClientBody | |
-> m (Either Error (ClientResponse (AWSResponse a))) |
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" "amazonka-core-2.0-BFuA7FRvuklLoYhn4b6A6p" 'False) (C1 ('MetaCons "Request" 'PrefixI 'True) ((S1 ('MetaSel ('Just "service") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Service) :*: (S1 ('MetaSel ('Just "method") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 StdMethod) :*: S1 ('MetaSel ('Just "path") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 RawPath))) :*: (S1 ('MetaSel ('Just "query") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 QueryString) :*: (S1 ('MetaSel ('Just "headers") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 [Header]) :*: S1 ('MetaSel ('Just "body") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 RequestBody))))) |
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.
Lenses
request_query :: Lens' (Request a) QueryString Source #
request_body :: forall a. Lens' (Request a) RequestBody Source #
Retries
Constants and predicates used to create a RetryPolicy
.
Instances
Generic Retry Source # | |
type Rep Retry Source # | |
Defined in Amazonka.Types type Rep Retry = D1 ('MetaData "Retry" "Amazonka.Types" "amazonka-core-2.0-BFuA7FRvuklLoYhn4b6A6p" 'False) (C1 ('MetaCons "Exponential" 'PrefixI 'True) ((S1 ('MetaSel ('Just "base") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Double) :*: S1 ('MetaSel ('Just "growth") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Int)) :*: (S1 ('MetaSel ('Just "attempts") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Int) :*: S1 ('MetaSel ('Just "check") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (ServiceError -> Maybe Text))))) |
Lenses
retry_check :: 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
HTTP Errors
data HttpException #
An exception which may be generated by this library
Since: http-client-0.5.0
Instances
ToLog HttpException Source # | |
Defined in Amazonka.Data.Log | |
Exception HttpException | |
Defined in Network.HTTP.Client.Types | |
Show HttpException | |
Defined in Network.HTTP.Client.Types showsPrec :: Int -> HttpException -> ShowS # show :: HttpException -> String # showList :: [HttpException] -> ShowS # |
Serialize Errors
data SerializeError Source #
Instances
Lenses
Service Errors
data ServiceError Source #
Instances
Lenses
Error Types
Instances
FromJSON ErrorCode Source # | |
ToLog ErrorCode Source # | |
Defined in Amazonka.Types build :: ErrorCode -> ByteStringBuilder Source # | |
FromText ErrorCode Source # | |
ToText ErrorCode Source # | |
FromXML ErrorCode Source # | |
IsString ErrorCode Source # | |
Defined in Amazonka.Types fromString :: String -> ErrorCode # | |
Show ErrorCode Source # | |
Eq ErrorCode Source # | |
Ord ErrorCode Source # | |
Defined in Amazonka.Types |
newtype ErrorMessage Source #
Instances
Instances
FromJSON RequestId Source # | |
ToLog RequestId Source # | |
Defined in Amazonka.Types build :: RequestId -> ByteStringBuilder Source # | |
FromText RequestId Source # | |
ToText RequestId Source # | |
FromXML RequestId Source # | |
IsString RequestId Source # | |
Defined in Amazonka.Types fromString :: String -> RequestId # | |
Generic RequestId Source # | |
Show RequestId Source # | |
Eq RequestId Source # | |
Ord RequestId Source # | |
Defined in Amazonka.Types | |
type Rep RequestId Source # | |
Defined in Amazonka.Types |
Optics
Regions
The available AWS regions.
pattern Ohio :: Region | |
pattern NorthVirginia :: Region | |
pattern NorthCalifornia :: Region | |
pattern Oregon :: Region | |
pattern CapeTown :: Region | |
pattern HongKong :: Region | |
pattern Hyderabad :: Region | |
pattern Jakarta :: Region | |
pattern Melbourne :: Region | |
pattern Mumbai :: Region | |
pattern Osaka :: Region | |
pattern Seoul :: Region | |
pattern Singapore :: Region | |
pattern Sydney :: Region | |
pattern Tokyo :: Region | |
pattern Montreal :: Region | |
pattern Frankfurt :: Region | |
pattern Ireland :: Region | |
pattern London :: Region | |
pattern Milan :: Region | |
pattern Paris :: Region | |
pattern Spain :: Region | |
pattern Stockholm :: Region | |
pattern Zurich :: Region | |
pattern Bahrain :: Region | |
pattern UAE :: Region | |
pattern SaoPaulo :: Region | |
pattern GovCloudEast :: Region | |
pattern GovCloudWest :: Region | |
pattern Beijing :: Region | |
pattern Ningxia :: Region |
Instances
FromJSON Region Source # | |
ToJSON Region Source # | |
Defined in Amazonka.Types | |
ToByteString Region Source # | |
Defined in Amazonka.Types toBS :: Region -> ByteString Source # | |
ToLog Region Source # | |
Defined in Amazonka.Types build :: Region -> ByteStringBuilder Source # | |
ToQuery Region Source # | |
Defined in Amazonka.Types toQuery :: Region -> QueryString Source # | |
FromText Region Source # | |
ToText Region Source # | |
FromXML Region Source # | |
ToXML Region Source # | |
IsString Region Source # | |
Defined in Amazonka.Types fromString :: String -> Region # | |
Generic Region Source # | |
Read Region Source # | |
Show Region Source # | |
NFData Region Source # | |
Defined in Amazonka.Types | |
Eq Region Source # | |
Ord Region Source # | |
Hashable Region Source # | |
Defined in Amazonka.Types | |
type Rep Region Source # | |
Defined in Amazonka.Types |
Endpoints
Endpoint | |
|
Instances
Generic Endpoint Source # | |
Show Endpoint Source # | |
Eq Endpoint Source # | |
type Rep Endpoint Source # | |
Defined in Amazonka.Types type Rep Endpoint = D1 ('MetaData "Endpoint" "Amazonka.Types" "amazonka-core-2.0-BFuA7FRvuklLoYhn4b6A6p" 'False) (C1 ('MetaCons "Endpoint" 'PrefixI 'True) ((S1 ('MetaSel ('Just "host") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 ByteString) :*: S1 ('MetaSel ('Just "basePath") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 RawPath)) :*: (S1 ('MetaSel ('Just "secure") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Bool) :*: (S1 ('MetaSel ('Just "port") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Int) :*: S1 ('MetaSel ('Just "scope") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 ByteString))))) |
Lenses
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
A numeric value representing seconds.
Instances
ToByteString Seconds Source # | |
Defined in Amazonka.Types toBS :: Seconds -> ByteString Source # | |
ToLog Seconds Source # | |
Defined in Amazonka.Types build :: Seconds -> ByteStringBuilder Source # | |
ToQuery Seconds Source # | |
Defined in Amazonka.Types toQuery :: Seconds -> QueryString Source # | |
FromText Seconds Source # | |
ToText Seconds Source # | |
Enum Seconds Source # | |
Generic Seconds Source # | |
Num Seconds Source # | |
Read Seconds Source # | |
Real Seconds Source # | |
Defined in Amazonka.Types toRational :: Seconds -> Rational # | |
Show Seconds Source # | |
NFData Seconds Source # | |
Defined in Amazonka.Types | |
Eq Seconds Source # | |
Ord Seconds Source # | |
Hashable Seconds Source # | |
Defined in Amazonka.Types | |
type Rep Seconds Source # | |
Defined in Amazonka.Types |
toMicroseconds :: Seconds -> Int Source #