-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | Core functionality and data types for Amazonka libraries. -- -- Core functionality, serialisation primitives, and data types for -- Amazonka related Amazon Web Services SDKs. -- -- The external interface of this library is stable with respect to the -- downstream Amazonka libraries, only, and as such is probably not -- suitable for use in non-Amazonka projects. -- -- Warning: This is an experimental preview release which is still -- under heavy development and not intended for public consumption, -- caveat emptor! @package amazonka-core @version 0.2.2 -- | Serialisation classes and primitives for the various formats used to -- communicate with AWS. module Network.AWS.Data type LazyByteString = ByteString class ToByteString a where toBS = encodeUtf8 . toText toBS :: ToByteString a => a -> ByteString class ToBuilder a where build = build . toBS build :: ToBuilder a => a -> Builder showBS :: ToByteString a => a -> String buildBS :: ToBuilder a => a -> LazyByteString stripBS :: ByteString -> ByteString -- | Base64 encoded binary data. data Base64 class FromText a parser :: FromText a => Parser a fromText :: FromText a => Text -> Either String a takeLowerText :: Parser Text matchCI :: Text -> a -> Parser a class ToText a toText :: ToText a => a -> Text showText :: ToText a => a -> String newtype Nat Nat :: Natural -> Nat unNat :: Nat -> Natural _Nat :: Iso' Nat Natural data Format RFC822Format :: Format ISO8601Format :: Format BasicFormat :: Format AWSFormat :: Format POSIXFormat :: Format data Time :: Format -> * Time :: UTCTime -> Time a _Time :: Iso' (Time a) UTCTime -- | This is the simplest representation of UTC. It consists of the day -- number, and a time offset from midnight. Note that if a day has a leap -- second added to it, it will have 86401 seconds. data UTCTime :: * type RFC822 = Time RFC822Format type ISO8601 = Time ISO8601Format type BasicTime = Time BasicFormat type AWSTime = Time AWSFormat type POSIX = Time POSIXFormat -- | read . show /= isomorphic newtype Sensitive a Sensitive :: a -> Sensitive a desensitise :: Sensitive a -> a _Sensitive :: Iso' (Sensitive a) a data RsBody RsBody :: (ResumableSource (ResourceT IO) ByteString) -> RsBody _RsBody :: Iso' RsBody (ResumableSource (ResourceT IO) ByteString) connectBody :: MonadResource m => RsBody -> Sink ByteString m a -> m a data RqBody RqBody :: Digest SHA256 -> RequestBody -> RqBody _bdyHash :: RqBody -> Digest SHA256 _bdyBody :: RqBody -> RequestBody bdyHash :: Lens' RqBody (Digest SHA256) bdyBody :: Lens' RqBody RequestBody bodyHash :: RqBody -> ByteString isStreaming :: RqBody -> Bool class ToBody a where toBody = const (RqBody (hash "") (RequestBodyLBS mempty)) toBody :: ToBody a => a -> RqBody sourceBody :: Digest SHA256 -> Int64 -> Source IO ByteString -> RqBody sourceHandle :: Digest SHA256 -> Int64 -> Handle -> RqBody sourceFile :: Digest SHA256 -> Int64 -> FilePath -> RqBody sourceFileIO :: MonadIO m => FilePath -> m RqBody sourcePopper :: Source IO ByteString -> GivesPopper () (~:) :: FromText a => ResponseHeaders -> HeaderName -> Either String a (~:?) :: FromText a => ResponseHeaders -> HeaderName -> Either String (Maybe a) class ToHeaders a where toHeaders = const mempty toHeaders :: ToHeaders a => a -> [Header] (=:) :: ToHeader a => HeaderName -> a -> [Header] hdr :: HeaderName -> ByteString -> [Header] -> [Header] hdrs :: [Header] -> [Header] -> [Header] toHeaderText :: ToText a => HeaderName -> a -> [Header] class ToHeader a where toHeader k = toHeader k . toText toHeader :: ToHeader a => HeaderName -> a -> [Header] hHost :: HeaderName hAMZToken :: HeaderName hAMZTarget :: HeaderName hAMZAlgorithm :: HeaderName hAMZCredential :: HeaderName hAMZExpires :: HeaderName hAMZSignedHeaders :: HeaderName hAMZContentSHA256 :: HeaderName hAMZAuth :: HeaderName hAMZDate :: HeaderName hMetaPrefix :: HeaderName class ToPath a where toPath = const mempty toPath :: ToPath a => a -> Text class ToQuery a where toQuery = toQuery . toText toQuery :: ToQuery a => a -> Query renderQuery :: Query -> ByteString data Query valuesOf :: Traversal' Query (Maybe ByteString) (=?) :: ToQuery a => ByteString -> a -> Query pair :: ToQuery a => ByteString -> a -> Query -> Query toQueryList :: (IsList a, ToQuery (Item a)) => ByteString -> a -> Query collapsePath :: ByteString -> ByteString class FromXML a parseXML :: FromXML a => [Node] -> Either String a decodeXML :: LazyByteString -> Either String [Node] parseXMLText :: FromText a => String -> [Node] -> Either String a childNodes :: Text -> Node -> Maybe [Node] findElement :: Text -> [Node] -> Either String [Node] withContent :: String -> [Node] -> Either String (Maybe Text) withElement :: Text -> ([Node] -> Either String a) -> [Node] -> Either String a localName :: Node -> Maybe Text (.@) :: FromXML a => [Node] -> Text -> Either String a (.@?) :: FromXML a => [Node] -> Text -> Either String (Maybe a) (.!@) :: Either String (Maybe a) -> a -> Either String a class ToXML a where toXML = (: []) . NodeElement . toXMLRoot toXML :: ToXML a => a -> [Node] class ToXMLRoot a toXMLRoot :: ToXMLRoot a => a -> Element encodeXML :: ToXMLRoot a => a -> LazyByteString toXMLText :: ToText a => a -> [Node] namespaced :: Text -> Text -> [Node] -> Element element :: Name -> [Node] -> Element nodes :: Name -> [Node] -> [Node] (=@) :: ToXML a => Name -> a -> Node -- | Caution: This is for use with types which are -- flattened in AWS service model terminology. It is applied by -- the generator/templating in safe contexts only. unsafeToXML :: (Show a, ToXML a) => a -> Node -- | A type that can be converted from JSON, with the possibility of -- failure. -- -- When writing an instance, use empty, mzero, or -- fail to make a conversion fail, e.g. if an Object is -- missing a required key, or the value is of the wrong type. -- -- An example type and instance: -- -- @{-# LANGUAGE OverloadedStrings #-} -- -- data Coord = Coord { x :: Double, y :: Double } -- -- instance FromJSON Coord where parseJSON (Object v) = Coord -- <$> v .: "x" <*> v .: -- "y" -- -- -- A non-Object value is of the wrong type, so use -- mzero to fail. parseJSON _ = mzero @ -- -- Note the use of the OverloadedStrings language extension -- which enables Text values to be written as string literals. -- -- Instead of manually writing your FromJSON instance, there are -- three options to do it automatically: -- -- -- -- To use this, simply add a deriving Generic clause to -- your datatype and declare a FromJSON instance for your -- datatype without giving a definition for parseJSON. -- -- For example the previous example can be simplified to just: -- -- @{-# LANGUAGE DeriveGeneric #-} -- -- import GHC.Generics -- -- data Coord = Coord { x :: Double, y :: Double } deriving Generic -- -- instance FromJSON Coord @ -- -- Note that, instead of using DefaultSignatures, it's also -- possible to parameterize the generic decoding using -- genericParseJSON applied to your encoding/decoding -- Options: -- --
--   instance FromJSON Coord where
--       parseJSON = genericParseJSON defaultOptions
--   
class FromJSON a parseJSON :: FromJSON a => Value -> Parser a parseJSONText :: FromText a => String -> Value -> Parser a -- | Like decode' but returns an error message when decoding fails. eitherDecode' :: FromJSON a => ByteString -> Either String a -- | withObject expected f value applies f to the -- Object when value is an Object and fails -- using typeMismatch expected otherwise. withObject :: String -> (Object -> Parser a) -> Value -> Parser a -- | Retrieve the value associated with the given key of an Object. -- The result is empty if the key is not present or the value -- cannot be converted to the desired type. -- -- This accessor is appropriate if the key and value must be -- present in an object for it to be valid. If the key and value are -- optional, use '(.:?)' instead. (.:) :: FromJSON a => Object -> Text -> Parser a -- | Retrieve the value associated with the given key of an Object. -- The result is Nothing if the key is not present, or -- empty if the value cannot be converted to the desired type. -- -- This accessor is most useful if the key and value can be absent from -- an object without affecting its validity. If the key and value are -- mandatory, use '(.:)' instead. (.:?) :: FromJSON a => Object -> Text -> Parser (Maybe a) -- | Helper for use in combination with .:? to provide default -- values for optional JSON object fields. -- -- This combinator is most useful if the key and value can be absent from -- an object without affecting its validity and we know a default value -- to assign in that case. If the key and value are mandatory, use '(.:)' -- instead. -- -- Example usage: -- --
--   v1 <- o .:? "opt_field_with_dfl" .!= "default_val"
--   v2 <- o .:  "mandatory_field"
--   v3 <- o .:? "opt_field2"
--   
(.!=) :: Parser (Maybe a) -> a -> Parser a (.:>) :: FromJSON a => Object -> Text -> Either String a (.:?>) :: FromJSON a => Object -> Text -> Either String (Maybe a) -- | A type that can be converted to JSON. -- -- An example type and instance: -- -- @{-# LANGUAGE OverloadedStrings #-} -- -- data Coord = Coord { x :: Double, y :: Double } -- -- instance ToJSON Coord where toJSON (Coord x y) = object ["x" -- .= x, "y" .= y] @ -- -- Note the use of the OverloadedStrings language extension -- which enables Text values to be written as string literals. -- -- Instead of manually writing your ToJSON instance, there are -- three options to do it automatically: -- -- -- -- To use the latter option, simply add a deriving -- Generic clause to your datatype and declare a -- ToJSON instance for your datatype without giving a definition -- for toJSON. -- -- For example the previous example can be simplified to just: -- -- @{-# LANGUAGE DeriveGeneric #-} -- -- import GHC.Generics -- -- data Coord = Coord { x :: Double, y :: Double } deriving Generic -- -- instance ToJSON Coord @ -- -- Note that, instead of using DefaultSignatures, it's also -- possible to parameterize the generic encoding using -- genericToJSON applied to your encoding/decoding Options: -- --
--   instance ToJSON Coord where
--       toJSON = genericToJSON defaultOptions
--   
class ToJSON a toJSON :: ToJSON a => a -> Value toJSONText :: ToText a => a -> Value -- | Create a Value from a list of name/value Pairs. If -- duplicate keys arise, earlier keys and their associated values win. object :: [Pair] -> Value -- | Construct a Pair from a key and a value. (.=) :: ToJSON a => Text -> a -> Pair newtype List (e :: Symbol) a List :: [a] -> List a list :: List a -> [a] newtype List1 (e :: Symbol) a List1 :: NonEmpty a -> List1 a list1 :: List1 a -> NonEmpty a _List :: (Coercible a b, Coercible b a) => Iso' (List e a) [b] _List1 :: (Coercible a b, Coercible b a) => Iso' (List1 e a) (NonEmpty b) fromList1 :: List1 e a -> List e a toList1 :: List e a -> Either String (List1 e a) newtype Map k v Map :: HashMap k v -> Map k v fromMap :: Map k v -> HashMap k v _Map :: (Coercible a b, Coercible b a) => Iso' (Map k a) (HashMap k b) (~::) :: ResponseHeaders -> CI Text -> Either String (Map (CI Text) Text) newtype EMap (e :: Symbol) (i :: Symbol) (j :: Symbol) k v EMap :: HashMap k v -> EMap k v fromEMap :: EMap k v -> HashMap k v _EMap :: (Coercible a b, Coercible b a) => Iso' (EMap e i j k a) (HashMap k b) module Network.AWS.Types -- | Access key credential. newtype AccessKey AccessKey :: ByteString -> AccessKey -- | Secret key credential. newtype SecretKey SecretKey :: ByteString -> SecretKey -- | A security token used by STS to temporarily authorise access to an AWS -- resource. newtype SecurityToken SecurityToken :: ByteString -> SecurityToken -- | The authorisation environment. data AuthEnv AuthEnv :: !AccessKey -> !SecretKey -> Maybe SecurityToken -> Maybe UTCTime -> AuthEnv _authAccess :: AuthEnv -> !AccessKey _authSecret :: AuthEnv -> !SecretKey _authToken :: AuthEnv -> Maybe SecurityToken _authExpiry :: AuthEnv -> Maybe UTCTime -- | An authorisation environment containing AWS credentials, and -- potentially a reference which can be refreshed out-of-band as -- temporary credentials expire. data Auth Ref :: ThreadId -> (IORef AuthEnv) -> Auth Auth :: AuthEnv -> Auth withAuth :: MonadIO m => Auth -> (AuthEnv -> m a) -> m a -- | The properties (such as endpoint) for a service, as well as it's -- associated signing algorithm and error types. class (AWSSigner (Sg a), Show (Er a)) => AWSService a where type family Sg a :: * type family Er a :: * service :: AWSService a => Service a -- | Abbreviated service name. type Abbrev = Text -- | Attributes specific to an AWS service. data Service a Service :: !Text -> !ByteString -> !ByteString -> Maybe ByteString -> Maybe ByteString -> (Status -> Maybe (LazyByteString -> ServiceError (Er a))) -> Retry a -> Service a _svcAbbrev :: Service a -> !Text _svcPrefix :: Service a -> !ByteString _svcVersion :: Service a -> !ByteString _svcTargetPrefix :: Service a -> Maybe ByteString _svcJSONVersion :: Service a -> Maybe ByteString _svcHandle :: Service a -> Status -> Maybe (LazyByteString -> ServiceError (Er a)) _svcRetry :: Service a -> Retry a serviceOf :: AWSService (Sv a) => Request a -> Service (Sv a) -- | Constants and predicates used to create a RetryPolicy. data Retry a Exponential :: !Double -> !Int -> !Int -> (Status -> Er a -> Bool) -> Retry a _retryBase :: Retry a -> !Double _retryGrowth :: Retry a -> !Int _retryAttempts :: Retry a -> !Int _retryCheck :: Retry a -> Status -> Er a -> Bool data Endpoint Endpoint :: ByteString -> ByteString -> Endpoint _endpointHost :: Endpoint -> ByteString _endpointScope :: Endpoint -> ByteString -- | Determine the full host address and credential scope for a -- Service within the specified Region. endpoint :: Service a -> Region -> Endpoint -- | An error type representing the subset of errors that can be directly -- attributed to this library. data ServiceError a HttpError :: HttpException -> ServiceError a SerializerError :: Abbrev -> String -> ServiceError a ServiceError :: Abbrev -> Status -> a -> ServiceError a Errors :: [ServiceError a] -> ServiceError a _HttpError :: Prism' (ServiceError a_aDnt) HttpException _SerializerError :: Prism' (ServiceError a_aDnt) (Abbrev, String) _ServiceError :: Prism' (ServiceError a_aDnt) (Abbrev, Status, a_aDnt) _Errors :: Prism' (ServiceError a_aDnt) [ServiceError a_aDnt] class AWSSigner v signed :: (AWSSigner v, AWSService (Sv a), v ~ Sg (Sv a)) => AuthEnv -> Region -> Request a -> UTCTime -> Signed a v class AWSPresigner v presigned :: (AWSPresigner v, AWSService (Sv a), v ~ Sg (Sv a)) => AuthEnv -> Region -> Request a -> UTCTime -> Integer -> Signed a v -- | A signed ClientRequest and associated metadata specific to the -- signing algorithm that was used. data Signed a v Signed :: Meta v -> ClientRequest -> Signed a v _sgMeta :: Signed a v -> Meta v _sgRequest :: Signed a v -> ClientRequest -- | Signing metadata data specific to a signing algorithm. -- -- Note: this is used for test and debug purposes, or is otherwise -- ignored. sgMeta :: Lens' (Signed a v) (Meta v) sgRequest :: Lens' (Signed a v) ClientRequest -- | Specify how a request can be de/serialised. class (AWSService (Sv a), AWSSigner (Sg (Sv a))) => AWSRequest a where type family Sv a :: * type family Rs a :: * request :: AWSRequest a => a -> Request a response :: (AWSRequest a, MonadResource m) => Logger -> Request a -> Either HttpException ClientResponse -> m (Response' a) -- | Specify how an AWSRequest and it's associated Rs -- response can generate a subsequent request, if available. class AWSRequest a => AWSPager a page :: AWSPager a => a -> Rs a -> Maybe a -- | An unsigned request. data Request a Request :: !StdMethod -> !ByteString -> Query -> [Header] -> RqBody -> Request a _rqMethod :: Request a -> !StdMethod _rqPath :: Request a -> !ByteString _rqQuery :: Request a -> Query _rqHeaders :: Request a -> [Header] _rqBody :: Request a -> RqBody rqMethod :: Lens (Request a_aDnb) (Request a_aEt1) StdMethod StdMethod rqHeaders :: Lens (Request a_aDnb) (Request a_aEt0) [Header] [Header] rqPath :: Lens (Request a_aDnb) (Request a_aEt2) ByteString ByteString rqQuery :: Lens (Request a_aDnb) (Request a_aEt3) Query Query rqBody :: Lens (Request a_aDnb) (Request a_aEsZ) RqBody RqBody -- | An alias for the common response Either containing a service -- error in the Left case, or the expected response in the -- Right. type Response a = Either (ServiceError (Er (Sv a))) (Rs a) type Response' a = Either (ServiceError (Er (Sv a))) (Status, Rs a) data Empty Empty :: Empty data LogLevel -- | Informational messages supplied by the user, not used by the library. Info :: LogLevel -- | Info level + debug messages + non-streaming response bodies. Debug :: LogLevel -- | Debug level + potentially sensitive signing metadata. Trace :: LogLevel type Logger = LogLevel -> Builder -> IO () -- | The sum of available AWS regions. data Region -- | Europe / eu-west-1 Ireland :: Region -- | Europe / eu-central-1 Frankfurt :: Region -- | Asia Pacific / ap-northeast-1 Tokyo :: Region -- | Asia Pacific / ap-southeast-1 Singapore :: Region -- | Asia Pacific / ap-southeast-2 Sydney :: Region -- | China / cn-north-1 Beijing :: Region -- | US / us-east-1 NorthVirginia :: Region -- | US / us-west-1 NorthCalifornia :: Region -- | US / us-west-2 Oregon :: Region -- | AWS GovCloud / us-gov-west-1 GovCloud :: Region -- | AWS GovCloud (FIPS 140-2) S3 Only / fips-us-gov-west-1 GovCloudFIPS :: Region -- | South America / sa-east-1 SaoPaulo :: Region -- | A service's query action. newtype Action Action :: Text -> Action -- | A convenience alias to avoid type ambiguity. type ClientRequest = Request -- | A convenience alias encapsulating the common Response. type ClientResponse = Response ResponseBody -- | A convenience alias encapsulating the common Response body. type ResponseBody = ResumableSource (ResourceT IO) ByteString -- | Construct a ClientRequest using common parameters such as TLS -- and prevent throwing errors when receiving erroneous status codes in -- respones. clientRequest :: ClientRequest instance Typeable ServiceError instance Show a => Show (ServiceError a) instance Eq LogLevel instance Ord LogLevel instance Enum LogLevel instance Show LogLevel instance Eq AccessKey instance Show AccessKey instance IsString AccessKey instance ToText AccessKey instance ToByteString AccessKey instance ToBuilder AccessKey instance Eq SecretKey instance IsString SecretKey instance ToText SecretKey instance ToByteString SecretKey instance Eq SecurityToken instance IsString SecurityToken instance ToText SecurityToken instance ToByteString SecurityToken instance Eq Endpoint instance Show Endpoint instance Eq Region instance Ord Region instance Read Region instance Show Region instance Generic Region instance Eq Action instance Ord Action instance Show Action instance IsString Action instance ToText Action instance ToByteString Action instance Eq Empty instance Show Empty instance Datatype D1Region instance Constructor C1_0Region instance Constructor C1_1Region instance Constructor C1_2Region instance Constructor C1_3Region instance Constructor C1_4Region instance Constructor C1_5Region instance Constructor C1_6Region instance Constructor C1_7Region instance Constructor C1_8Region instance Constructor C1_9Region instance Constructor C1_10Region instance Constructor C1_11Region instance ToJSON Empty instance ToXML Region instance FromXML Region instance ToBuilder Region instance ToByteString Region instance ToText Region instance FromText Region instance Default Region instance Hashable Region instance ToBuilder (Request a) instance Default (Request a) instance ToBuilder Auth instance ToBuilder AuthEnv instance FromJSON AuthEnv instance Monoid (ServiceError a) instance (Show a, Typeable a) => Exception (ServiceError a) module Network.AWS.Error statusSuccess :: Status -> Bool class AWSError a awsError :: AWSError a => a -> ServiceError String class AWSErrorCode a awsErrorCode :: AWSErrorCode a => a -> ErrorCode newtype ErrorCode ErrorCode :: Text -> ErrorCode data ErrorType Receiver :: ErrorType Sender :: ErrorType -- | An error type representing the subset of errors that can be directly -- attributed to this library. data ServiceError a HttpError :: HttpException -> ServiceError a SerializerError :: Abbrev -> String -> ServiceError a ServiceError :: Abbrev -> Status -> a -> ServiceError a Errors :: [ServiceError a] -> ServiceError a data RESTError restRequestId :: Lens' RESTError Text restType :: Lens' RESTError (Maybe ErrorType) restCode :: Lens' RESTError ErrorCode restMessage :: Lens' RESTError Text restError :: FromXML (Er a) => (Status -> Bool) -> Service a -> Status -> Maybe (ByteString -> ServiceError (Er a)) data JSONError jsonType :: Lens' JSONError (Maybe Text) jsonCode :: Lens' JSONError ErrorCode jsonMessage :: Lens' JSONError Text jsonError :: FromJSON (Er a) => (Status -> Bool) -> Service a -> Status -> Maybe (ByteString -> ServiceError (Er a)) instance FromJSON JSONError instance AWSErrorCode JSONError instance Eq JSONError instance Show JSONError instance Generic JSONError instance Datatype D1JSONError instance Constructor C1_0JSONError instance Selector S1_0_0JSONError instance Selector S1_0_1JSONError instance Selector S1_0_2JSONError instance FromXML RESTError instance AWSErrorCode RESTError instance Eq ErrorCode instance Ord ErrorCode instance Show ErrorCode instance FromXML ErrorCode instance FromJSON ErrorCode instance IsString ErrorCode instance Generic ErrorCode instance Eq ErrorType instance Ord ErrorType instance Enum ErrorType instance Show ErrorType instance Generic ErrorType instance Eq RESTError instance Show RESTError instance Generic RESTError instance Datatype D1ErrorCode instance Constructor C1_0ErrorCode instance Datatype D1ErrorType instance Constructor C1_0ErrorType instance Constructor C1_1ErrorType instance Datatype D1RESTError instance Constructor C1_0RESTError instance Selector S1_0_0RESTError instance Selector S1_0_1RESTError instance Selector S1_0_2RESTError instance Selector S1_0_3RESTError instance FromXML ErrorType instance FromText ErrorType instance Show a => AWSError (ServiceError a) module Network.AWS.Pagination more :: AWSMore a => a -> Bool stop :: AWSMore a => a -> Bool index :: ToText c => Getter a [b] -> Getter b c -> Getter a (Maybe Text) choice :: Alternative f => (a -> f b) -> (a -> f b) -> a -> f b instance AWSMore (HashMap k v) instance AWSMore [a] instance AWSMore (Maybe Text) instance AWSMore (Maybe Bool) instance AWSMore Bool module Network.AWS.Response nullResponse :: (MonadResource m, AWSService (Sv a)) => Rs a -> Logger -> Request a -> Either HttpException ClientResponse -> m (Response' a) headerResponse :: (MonadResource m, AWSService (Sv a)) => (ResponseHeaders -> Either String (Rs a)) -> Logger -> Request a -> Either HttpException ClientResponse -> m (Response' a) xmlResponse :: (MonadResource m, AWSService (Sv a), FromXML (Rs a)) => Logger -> Request a -> Either HttpException ClientResponse -> m (Response' a) xmlHeaderResponse :: (MonadResource m, AWSService (Sv a)) => (ResponseHeaders -> [Node] -> Either String (Rs a)) -> Logger -> Request a -> Either HttpException ClientResponse -> m (Response' a) jsonResponse :: (MonadResource m, AWSService (Sv a), FromJSON (Rs a)) => Logger -> Request a -> Either HttpException ClientResponse -> m (Response' a) jsonHeaderResponse :: (MonadResource m, AWSService (Sv a)) => (ResponseHeaders -> Object -> Either String (Rs a)) -> Logger -> Request a -> Either HttpException ClientResponse -> m (Response' a) bodyResponse :: (MonadResource m, AWSService (Sv a)) => (ResponseHeaders -> ResponseBody -> Either String (Rs a)) -> Logger -> Request a -> Either HttpException ClientResponse -> m (Response' a) module Network.AWS.Prelude -- | A space-efficient representation of a Word8 vector, supporting -- many efficient operations. -- -- A ByteString contains 8-bit bytes, or by using the operations -- from Data.ByteString.Char8 it can be interpreted as containing -- 8-bit characters. data ByteString :: * -- | A CI s provides Case Insensitive comparison for -- the string-like type s (for example: String, -- Text, ByteString, etc.). -- -- Note that CI s has an instance for IsString which -- together with the OverloadedStrings language extension allows -- you to write case insensitive string literals as in: -- --
--   > ("Content-Type" :: CI Text) == ("CONTENT-TYPE" :: CI Text)
--   True
--   
data CI s :: * -> * -- | A convenience alias to avoid type ambiguity. type ClientRequest = Request -- | A convenience alias encapsulating the common Response. type ClientResponse = Response ResponseBody -- | Any type that you wish to throw or catch as an exception must be an -- instance of the Exception class. The simplest case is a new -- exception type directly below the root: -- --
--   data MyException = ThisException | ThatException
--       deriving (Show, Typeable)
--   
--   instance Exception MyException
--   
-- -- The default method definitions in the Exception class do what -- we need in this case. You can now throw and catch -- ThisException and ThatException as exceptions: -- --
--   *Main> throw ThisException `catch` \e -> putStrLn ("Caught " ++ show (e :: MyException))
--   Caught ThisException
--   
-- -- In more complicated examples, you may wish to define a whole hierarchy -- of exceptions: -- --
--   ---------------------------------------------------------------------
--   -- Make the root exception type for all the exceptions in a compiler
--   
--   data SomeCompilerException = forall e . Exception e => SomeCompilerException e
--       deriving Typeable
--   
--   instance Show SomeCompilerException where
--       show (SomeCompilerException e) = show e
--   
--   instance Exception SomeCompilerException
--   
--   compilerExceptionToException :: Exception e => e -> SomeException
--   compilerExceptionToException = toException . SomeCompilerException
--   
--   compilerExceptionFromException :: Exception e => SomeException -> Maybe e
--   compilerExceptionFromException x = do
--       SomeCompilerException a <- fromException x
--       cast a
--   
--   ---------------------------------------------------------------------
--   -- Make a subhierarchy for exceptions in the frontend of the compiler
--   
--   data SomeFrontendException = forall e . Exception e => SomeFrontendException e
--       deriving Typeable
--   
--   instance Show SomeFrontendException where
--       show (SomeFrontendException e) = show e
--   
--   instance Exception SomeFrontendException where
--       toException = compilerExceptionToException
--       fromException = compilerExceptionFromException
--   
--   frontendExceptionToException :: Exception e => e -> SomeException
--   frontendExceptionToException = toException . SomeFrontendException
--   
--   frontendExceptionFromException :: Exception e => SomeException -> Maybe e
--   frontendExceptionFromException x = do
--       SomeFrontendException a <- fromException x
--       cast a
--   
--   ---------------------------------------------------------------------
--   -- Make an exception type for a particular frontend compiler exception
--   
--   data MismatchedParentheses = MismatchedParentheses
--       deriving (Typeable, Show)
--   
--   instance Exception MismatchedParentheses where
--       toException   = frontendExceptionToException
--       fromException = frontendExceptionFromException
--   
-- -- We can now catch a MismatchedParentheses exception as -- MismatchedParentheses, SomeFrontendException or -- SomeCompilerException, but not other types, e.g. -- IOException: -- --
--   *Main> throw MismatchedParentheses catch e -> putStrLn ("Caught " ++ show (e :: MismatchedParentheses))
--   Caught MismatchedParentheses
--   *Main> throw MismatchedParentheses catch e -> putStrLn ("Caught " ++ show (e :: SomeFrontendException))
--   Caught MismatchedParentheses
--   *Main> throw MismatchedParentheses catch e -> putStrLn ("Caught " ++ show (e :: SomeCompilerException))
--   Caught MismatchedParentheses
--   *Main> throw MismatchedParentheses catch e -> putStrLn ("Caught " ++ show (e :: IOException))
--   *** Exception: MismatchedParentheses
--   
class (Typeable * e, Show e) => Exception e -- | A map from keys to values. A map cannot contain duplicate keys; each -- key can map to at most one value. data HashMap k v :: * -> * -> * data HttpException :: * -- | Type representing arbitrary-precision non-negative integers. -- -- Operations whose result would be negative throw -- (Underflow :: ArithException). -- -- The Natural type has become part of base starting with -- `base-4.8.0.0`. data Natural :: * data NonEmpty a :: * -> * (:|) :: a -> [a] -> NonEmpty a -- | When using one of the RequestBodyStream / -- RequestBodyStreamChunked constructors, you must ensure that the -- GivesPopper can be called multiple times. Usually this is not a -- problem. -- -- The RequestBodyStreamChunked will send a chunked request body. -- Note that not all servers support this. Only use -- RequestBodyStreamChunked if you know the server you're sending -- to supports chunked request bodies. -- -- Since 0.1.0 data RequestBody :: * -- | An alias for the common response Either containing a service -- error in the Left case, or the expected response in the -- Right. type Response a = Either (ServiceError (Er (Sv a))) (Rs a) -- | A space efficient, packed, unboxed Unicode text type. data Text :: * -- | Specify how an AWSRequest and it's associated Rs -- response can generate a subsequent request, if available. class AWSRequest a => AWSPager a page :: AWSPager a => a -> Rs a -> Maybe a -- | Specify how a request can be de/serialised. class (AWSService (Sv a), AWSSigner (Sg (Sv a))) => AWSRequest a where type family Sv a :: * type family Rs a :: * request :: AWSRequest a => a -> Request a response :: (AWSRequest a, MonadResource m) => Logger -> Request a -> Either HttpException ClientResponse -> m (Response' a) -- | The properties (such as endpoint) for a service, as well as it's -- associated signing algorithm and error types. class (AWSSigner (Sg a), Show (Er a)) => AWSService a where type family Sg a :: * type family Er a :: * service :: AWSService a => Service a -- | Representable types of kind *. This class is derivable in GHC with the -- DeriveGeneric flag on. class Generic a -- | Class for string-like datastructures; used by the overloaded string -- extension (-XOverloadedStrings in GHC). class IsString a fromString :: IsString a => String -> a class Semigroup a -- | Constants and predicates used to create a RetryPolicy. data Retry a Exponential :: !Double -> !Int -> !Int -> (Status -> Er a -> Bool) -> Retry a _retryBase :: Retry a -> !Double _retryGrowth :: Retry a -> !Int _retryAttempts :: Retry a -> !Int _retryCheck :: Retry a -> Status -> Er a -> Bool class AWSError a awsError :: AWSError a => a -> ServiceError String class AWSErrorCode a awsErrorCode :: AWSErrorCode a => a -> ErrorCode -- | An error type representing the subset of errors that can be directly -- attributed to this library. data ServiceError a HttpError :: HttpException -> ServiceError a SerializerError :: Abbrev -> String -> ServiceError a ServiceError :: Abbrev -> Status -> a -> ServiceError a Errors :: [ServiceError a] -> ServiceError a data RESTError restError :: FromXML (Er a) => (Status -> Bool) -> Service a -> Status -> Maybe (ByteString -> ServiceError (Er a)) data JSONError jsonError :: FromJSON (Er a) => (Status -> Bool) -> Service a -> Status -> Maybe (ByteString -> ServiceError (Er a)) statusSuccess :: Status -> Bool data Empty Empty :: Empty -- | Attributes specific to an AWS service. data Service a Service :: !Text -> !ByteString -> !ByteString -> Maybe ByteString -> Maybe ByteString -> (Status -> Maybe (LazyByteString -> ServiceError (Er a))) -> Retry a -> Service a _svcAbbrev :: Service a -> !Text _svcPrefix :: Service a -> !ByteString _svcVersion :: Service a -> !ByteString _svcTargetPrefix :: Service a -> Maybe ByteString _svcJSONVersion :: Service a -> Maybe ByteString _svcHandle :: Service a -> Status -> Maybe (LazyByteString -> ServiceError (Er a)) _svcRetry :: Service a -> Retry a -- | HTTP standard method (as defined by RFC 2616, and PATCH which is -- defined by RFC 5789). data StdMethod :: * GET :: StdMethod POST :: StdMethod HEAD :: StdMethod PUT :: StdMethod DELETE :: StdMethod TRACE :: StdMethod CONNECT :: StdMethod OPTIONS :: StdMethod PATCH :: StdMethod -- | HTTP Status. -- -- Only the statusCode is used for comparisons. -- -- Please use mkStatus to create status codes from code and -- message, or the Enum instance or the status code constants -- (like ok200). There might be additional record members in the -- future. -- -- Note that the Show instance is only for debugging. data Status :: * Status :: Int -> ByteString -> Status statusCode :: Status -> Int statusMessage :: Status -> ByteString module Network.AWS.Request.JSON post :: (AWSService (Sv a), ToQuery a, ToPath a, ToHeaders a, ToJSON a) => Action -> a -> Request a module Network.AWS.Request.Query post :: (AWSService (Sv a), ToQuery a, ToPath a, ToHeaders a) => Action -> a -> Request a module Network.AWS.Request.RestJSON get :: (ToPath a, ToQuery a, ToHeaders a) => a -> Request a delete :: (ToPath a, ToQuery a, ToHeaders a) => a -> Request a post :: (AWSService (Sv a), ToQuery a, ToPath a, ToHeaders a, ToJSON a) => a -> Request a put :: (AWSService (Sv a), ToQuery a, ToPath a, ToHeaders a, ToJSON a) => a -> Request a module Network.AWS.Request.RestXML get :: (ToPath a, ToQuery a, ToHeaders a) => a -> Request a head :: (ToPath a, ToQuery a, ToHeaders a) => a -> Request a delete :: (ToPath a, ToQuery a, ToHeaders a) => a -> Request a post :: (ToPath a, ToQuery a, ToHeaders a, ToXMLRoot a) => a -> Request a put :: (ToPath a, ToQuery a, ToHeaders a, ToXMLRoot a) => a -> Request a module Network.AWS.Request.S3 get :: (ToPath a, ToQuery a, ToHeaders a) => a -> Request a head :: (ToPath a, ToQuery a, ToHeaders a) => a -> Request a delete :: (ToPath a, ToQuery a, ToHeaders a) => a -> Request a post :: (ToPath a, ToQuery a, ToHeaders a, ToXMLRoot a) => a -> Request a put :: (ToPath a, ToQuery a, ToHeaders a, ToXMLRoot a) => a -> Request a stream :: (ToPath a, ToQuery a, ToHeaders a, ToBody a) => StdMethod -> a -> Request a module Network.AWS.Signing data V2 data V4 sign :: (MonadIO m, AWSRequest a, AWSSigner (Sg (Sv a))) => Auth -> Region -> Request a -> UTCTime -> m (Signed a (Sg (Sv a))) presign :: (MonadIO m, AWSRequest a, AWSPresigner (Sg (Sv a))) => Auth -> Region -> Request a -> UTCTime -> Integer -> m (Signed a (Sg (Sv a))) module Network.AWS.Waiters type Acceptor a = Request a -> Response' a -> Maybe Accept data Accept AcceptSuccess :: Accept AcceptFailure :: Accept AcceptRetry :: Accept -- | Timing and acceptance criteria to check fulfillment of a remote -- operation. data Wait a Wait :: !ByteString -> !Int -> !Int -> [Acceptor a] -> Wait a _waitName :: Wait a -> !ByteString _waitAttempts :: Wait a -> !Int _waitDelay :: Wait a -> !Int _waitAcceptors :: Wait a -> [Acceptor a] accept :: Wait a -> Acceptor a matchAll :: Eq b => b -> Accept -> Fold (Rs a) b -> Acceptor a matchAny :: Eq b => b -> Accept -> Fold (Rs a) b -> Acceptor a matchError :: AWSErrorCode (Er (Sv a)) => ErrorCode -> Accept -> Acceptor a matchStatus :: Int -> Accept -> Acceptor a instance Eq Accept instance Show Accept instance ToBuilder Accept