-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | Comprehensive Amazon Web Services SDK -- @package amazonka @version 0.0.0 -- | The core module for making requests to the various AWS services. module Network.AWS -- | The environment containing the parameters required to make AWS -- requests. data Env envAuth :: Lens' Env Auth envRegion :: Lens' Env Region envManager :: Lens' Env Manager envLogger :: Lens' Env Logger -- | Determines how authentication information is retrieved. data Credentials :: * -- | Explicit access and secret keys. Note: you can achieve the same result -- purely by using fromKeys. FromKeys :: AccessKey -> SecretKey -> Credentials -- | A session containing the access key, secret key, and a security token. -- Note: you can achieve the same result purely by using -- fromSession. FromSession :: AccessKey -> SecretKey -> SecurityToken -> Credentials -- | An IAM Profile name to lookup from the local EC2 instance-data. FromProfile :: Text -> Credentials -- | Environment variables to lookup for the access and secret keys. FromEnv :: Text -> Text -> Credentials -- | Attempt to read the default access and secret keys from the -- environment, falling back to the first available IAM profile if they -- are not set. -- -- Note: This attempts to resolve http://instance-data rather than -- directly retrieving http://169.254.169.254 for IAM profile -- information to ensure the dns lookup terminates promptly if not -- running on EC2. Discover :: Credentials -- | This creates a new environment without debug logging and uses -- getAuth to expand/discover the supplied Credentials. -- -- Lenses such as envLogger can be used to modify the Env -- with a debug logger. newEnv :: (Functor m, MonadIO m) => Region -> Credentials -> Manager -> ExceptT String m Env -- | Create a new environment without debug logging, creating a new -- Manager. -- -- Any errors are thrown using error. -- -- See: newEnv getEnv :: Region -> Credentials -> IO Env -- | Send a data type which is an instance of AWSRequest, returning -- either the associated Rs response type in the success case, or -- the related service's Er type in the error case. -- -- This includes HTTPExceptions, serialisation errors, and any -- service errors returned as part of the Response. send :: (MonadCatch m, MonadResource m, AWSRequest a) => Env -> a -> m (Response a) -- | Send a data type which is an instance of AWSPager and paginate -- over the associated Rs response type in the success case, or -- the related service's Er type in the error case. -- -- Note: The ResumableSource will close when there are no -- more results or the ResourceT computation is unwrapped. See: -- runResourceT for more information. paginate :: (MonadCatch m, MonadResource m, AWSPager a) => Env -> a -> Source m (Response a) -- | Presign a URL with expiry to be used at a later time. -- -- Note: Requires the service's signer to be an instance of -- AWSPresigner. Not all signing process support this. presign :: (MonadIO m, AWSRequest a, AWSPresigner (Sg (Sv a))) => Env -> a -> UTCTime -> Int -> m (Signed a (Sg (Sv a))) -- | A monad transformer built on top of functions from Network.AWS -- which encapsulates various common parameters, errors, and usage -- patterns. module Control.Monad.Trans.AWS -- | A convenient alias for AWST IO. type AWS = AWST IO -- | The transformer. This satisfies all of the constraints that the -- functions in this module require, such as providing -- MonadResource instances, as well as keeping track of the -- internal Env environment. -- -- The MonadError instance for this transformer internally uses -- ExceptT to handle actions that result in an Error. For -- more information see sendCatch and paginateCatch. data AWST m a -- | Provides an alias for shortening type signatures if preferred. -- -- Note: requires the ConstraintKinds extension. type MonadAWS m = (MonadBaseControl IO m, MonadCatch m, MonadResource m, MonadError Error m, MonadReader Env m) -- | Unwrap an AWST transformer, calling all of the registered -- ResourceT release actions. runAWST :: MonadBaseControl IO m => Env -> AWST m a -> m (Either Error a) -- | The environment containing the parameters required to make AWS -- requests. data Env envAuth :: Lens' Env Auth envRegion :: Lens' Env Region envManager :: Lens' Env Manager envLogger :: Lens' Env Logger -- | Pass the current environment to a function. scoped :: MonadReader Env m => (Env -> m a) -> m a -- | Determines how authentication information is retrieved. data Credentials :: * -- | Explicit access and secret keys. Note: you can achieve the same result -- purely by using fromKeys. FromKeys :: AccessKey -> SecretKey -> Credentials -- | A session containing the access key, secret key, and a security token. -- Note: you can achieve the same result purely by using -- fromSession. FromSession :: AccessKey -> SecretKey -> SecurityToken -> Credentials -- | An IAM Profile name to lookup from the local EC2 instance-data. FromProfile :: Text -> Credentials -- | Environment variables to lookup for the access and secret keys. FromEnv :: Text -> Text -> Credentials -- | Attempt to read the default access and secret keys from the -- environment, falling back to the first available IAM profile if they -- are not set. -- -- Note: This attempts to resolve http://instance-data rather than -- directly retrieving http://169.254.169.254 for IAM profile -- information to ensure the dns lookup terminates promptly if not -- running on EC2. Discover :: Credentials -- | This creates a new environment without debug logging and uses -- getAuth to expand/discover the supplied Credentials. -- -- Lenses such as envLogger can be used to modify the Env -- with a debug logger. newEnv :: (Functor m, MonadIO m) => Region -> Credentials -> Manager -> ExceptT String m Env -- | Create a new environment without debug logging, creating a new -- Manager. -- -- Any errors are thrown using error. -- -- See: newEnv getEnv :: Region -> Credentials -> IO Env -- | Use the logger from envLogger to log a debug message. debug :: (MonadIO m, MonadReader Env m) => Text -> m () -- | Perform a monadic action if envLogger is set to Debug. -- -- Analogous to when. whenDebug :: MonadReader Env m => m () -> m () -- | The sum of available AWS regions. data Region :: * -- | Europe / eu-west-1 Ireland :: 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 -- | Scope a monadic action within the specific Region. within :: MonadReader Env m => Region -> m a -> m a -- | The top-level error type. type Error = ServiceError String -- | Hoist an Either throwing the Left case, and returning -- the Right. hoistEither :: (MonadError Error m, AWSError e) => Either e a -> m a throwAWSError :: (MonadError Error m, AWSError e) => e -> m a verify :: (AWSError e, MonadError Error m) => Prism' e a -> e -> m () verifyWith :: (AWSError e, MonadError Error m) => Prism' e a -> (a -> Bool) -> e -> m () -- | Send a data type which is an instance of AWSRequest, returning -- it's associated Rs response type. -- -- This will throw any HTTPException or AWSServiceError -- returned by the service using the MonadError instance. In the -- case of AWST this will cause the internal ExceptT to -- short-circuit and return an Error in the Left case as -- the result of the computation. send :: (MonadCatch m, MonadResource m, MonadReader Env m, MonadError Error m, AWSRequest a) => a -> m (Rs a) -- | A variant of send which discards any successful response. send_ :: (MonadCatch m, MonadResource m, MonadReader Env m, MonadError Error m, AWSRequest a) => a -> m () -- | Send a data type which is an instance of AWSRequest, returning -- either the associated Rs response type in the success case, or -- the related service's Er type in the error case. -- -- This includes HTTPExceptions, serialisation errors, and any -- service errors returned as part of the Response. sendCatch :: (MonadCatch m, MonadResource m, MonadReader Env m, AWSRequest a) => a -> m (Response a) -- | Send a data type which is an instance of AWSPager and paginate -- while there are more results as defined by the related service -- operation. -- -- Errors will be handle identically to send. -- -- Note: The ResumableSource will close when there are no -- more results or the ResourceT computation is unwrapped. See: -- runResourceT for more information. paginate :: (MonadCatch m, MonadResource m, MonadReader Env m, MonadError Error m, AWSPager a) => a -> Source m (Rs a) -- | Send a data type which is an instance of AWSPager and paginate -- over the associated Rs response type in the success case, or -- the related service's Er type in the error case. -- -- Note: The ResumableSource will close when there are no -- more results or the ResourceT computation is unwrapped. See: -- runResourceT for more information. paginateCatch :: (MonadCatch m, MonadResource m, MonadReader Env m, AWSPager a) => a -> Source m (Response a) -- | Presign a URL with expiry to be used at a later time. -- -- Note: Requires the service's signer to be an instance of -- AWSPresigner. Not all signing process support this. presign :: (MonadIO m, MonadReader Env m, AWSRequest a, AWSPresigner (Sg (Sv a))) => a -> UTCTime -> Int -> m (Signed a (Sg (Sv a))) instance Functor m => Functor (AWST m) instance (Monad m, Functor m) => Applicative (AWST m) instance (Monad m, Functor m) => Alternative (AWST m) instance Monad m => Monad (AWST m) instance MonadIO m => MonadIO (AWST m) instance Monad m => MonadPlus (AWST m) instance MonadThrow m => MonadThrow (AWST m) instance MonadCatch m => MonadCatch (AWST m) instance Monad m => MonadError Error (AWST m) instance (Applicative m, MonadIO m, MonadBase IO m, MonadThrow m) => MonadResource (AWST m) instance MMonad AWST instance MFunctor AWST instance MonadBaseControl b m => MonadBaseControl b (AWST m) instance MonadTransControl AWST instance MonadBase b m => MonadBase b (AWST m) instance MonadTrans AWST instance Monad m => MonadReader Env (AWST m)