-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | Haskell runtime for AWS Lambda -- -- Please see the README on GitHub at -- https://github.com/theam/aws-lambda-haskell-runtime#readme @package aws-lambda-haskell-runtime @version 4.1.0 module Aws.Lambda data Handler (handlerType :: HandlerType) m context request response error [StandaloneLambdaHandler] :: StandaloneCallback m context request response error -> Handler 'StandaloneHandlerType m context request response error [APIGatewayHandler] :: APIGatewayCallback m context request response error -> Handler 'APIGatewayHandlerType m context request response error [ALBHandler] :: ALBCallback m context request response error -> Handler 'ALBHandlerType m context request response error -- | A handler name used to configure the lambda in AWS newtype HandlerName HandlerName :: Text -> HandlerName [unHandlerName] :: HandlerName -> Text type Handlers handlerType m context request response error = HashMap HandlerName (Handler handlerType m context request response error) run :: RuntimeContext handlerType m context request response error => DispatcherOptions -> (forall a. m a -> IO a) -> Handlers handlerType m context request response error -> LambdaOptions context -> IO (Either (LambdaError handlerType) (LambdaResult handlerType)) addStandaloneLambdaHandler :: HandlerName -> StandaloneCallback m context request response error -> HandlersM 'StandaloneHandlerType m context request response error () addAPIGatewayHandler :: HandlerName -> APIGatewayCallback m context request response error -> HandlersM 'APIGatewayHandlerType m context request response error () addALBHandler :: HandlerName -> ALBCallback m context request response error -> HandlersM 'ALBHandlerType m context request response error () runLambdaHaskellRuntime :: RuntimeContext handlerType m context request response error => DispatcherOptions -> IO context -> (forall a. m a -> IO a) -> HandlersM handlerType m context request response error () -> IO () -- | Context that is passed to all the handlers data Context context Context :: !Int -> !Text -> !Text -> !Text -> !Text -> !Text -> !Text -> !Text -> !Int -> !IORef context -> Context context [memoryLimitInMb] :: Context context -> !Int [functionName] :: Context context -> !Text [functionVersion] :: Context context -> !Text [invokedFunctionArn] :: Context context -> !Text [awsRequestId] :: Context context -> !Text [xrayTraceId] :: Context context -> !Text [logStreamName] :: Context context -> !Text [logGroupName] :: Context context -> !Text [deadline] :: Context context -> !Int [customContext] :: Context context -> !IORef context -- | Initializes the context out of the environment initialize :: Throws Parsing => Throws EnvironmentVariableNotSet => IORef context -> IO (Context context) -- | Sets the context's event data setEventData :: Context context -> Event -> IO (Context context) -- | Options that the dispatcher generator expects newtype DispatcherOptions DispatcherOptions :: ApiGatewayDispatcherOptions -> DispatcherOptions [apiGatewayDispatcherOptions] :: DispatcherOptions -> ApiGatewayDispatcherOptions defaultDispatcherOptions :: DispatcherOptions -- | Callback that we pass to the dispatcher function type RunCallback (handlerType :: HandlerType) context = LambdaOptions context -> IO (Either (LambdaError handlerType) (LambdaResult handlerType)) -- | Wrapper type to handle the result of the user data LambdaResult (handlerType :: HandlerType) [StandaloneLambdaResult] :: StandaloneLambdaResponseBody -> LambdaResult 'StandaloneHandlerType [APIGatewayResult] :: ApiGatewayResponse ApiGatewayResponseBody -> LambdaResult 'APIGatewayHandlerType [ALBResult] :: ALBResponse ALBResponseBody -> LambdaResult 'ALBHandlerType -- | Wrapper type for lambda execution results data LambdaError (handlerType :: HandlerType) [StandaloneLambdaError] :: StandaloneLambdaResponseBody -> LambdaError 'StandaloneHandlerType [APIGatewayLambdaError] :: ApiGatewayResponse ApiGatewayResponseBody -> LambdaError 'APIGatewayHandlerType [ALBLambdaError] :: ALBResponse ALBResponseBody -> LambdaError 'ALBHandlerType -- | Options that the generated main expects data LambdaOptions context LambdaOptions :: !RawEventObject -> !HandlerName -> !Text -> !Context context -> LambdaOptions context [eventObject] :: LambdaOptions context -> !RawEventObject [functionHandler] :: LambdaOptions context -> !HandlerName [executionUuid] :: LambdaOptions context -> !Text [contextObject] :: LambdaOptions context -> !Context context -- | API Gateway specific dispatcher options newtype ApiGatewayDispatcherOptions ApiGatewayDispatcherOptions :: Bool -> ApiGatewayDispatcherOptions -- | Should impure exceptions be propagated through the API Gateway -- interface [$sel:propagateImpureExceptions:ApiGatewayDispatcherOptions] :: ApiGatewayDispatcherOptions -> Bool -- | The type of the handler depending on how you proxy the Lambda data HandlerType StandaloneHandlerType :: HandlerType APIGatewayHandlerType :: HandlerType ALBHandlerType :: HandlerType -- | A handler name used to configure the lambda in AWS newtype HandlerName HandlerName :: Text -> HandlerName [unHandlerName] :: HandlerName -> Text -- | The event received by the lambda before any processing type RawEventObject = ByteString data ApiGatewayRequest body ApiGatewayRequest :: !Text -> !Text -> !Text -> !Maybe (HashMap Text Text) -> !Maybe (HashMap Text Text) -> !Maybe (HashMap Text Text) -> !Maybe (HashMap Text Text) -> !Bool -> !ApiGatewayRequestContext -> !Maybe body -> ApiGatewayRequest body [$sel:apiGatewayRequestResource:ApiGatewayRequest] :: ApiGatewayRequest body -> !Text [$sel:apiGatewayRequestPath:ApiGatewayRequest] :: ApiGatewayRequest body -> !Text [$sel:apiGatewayRequestHttpMethod:ApiGatewayRequest] :: ApiGatewayRequest body -> !Text [$sel:apiGatewayRequestHeaders:ApiGatewayRequest] :: ApiGatewayRequest body -> !Maybe (HashMap Text Text) [$sel:apiGatewayRequestQueryStringParameters:ApiGatewayRequest] :: ApiGatewayRequest body -> !Maybe (HashMap Text Text) [$sel:apiGatewayRequestPathParameters:ApiGatewayRequest] :: ApiGatewayRequest body -> !Maybe (HashMap Text Text) [$sel:apiGatewayRequestStageVariables:ApiGatewayRequest] :: ApiGatewayRequest body -> !Maybe (HashMap Text Text) [$sel:apiGatewayRequestIsBase64Encoded:ApiGatewayRequest] :: ApiGatewayRequest body -> !Bool [$sel:apiGatewayRequestRequestContext:ApiGatewayRequest] :: ApiGatewayRequest body -> !ApiGatewayRequestContext [$sel:apiGatewayRequestBody:ApiGatewayRequest] :: ApiGatewayRequest body -> !Maybe body data ApiGatewayRequestContext ApiGatewayRequestContext :: !Text -> !Text -> !Text -> !Text -> !Text -> !Text -> !Text -> !Text -> !Text -> !Text -> !Text -> !Text -> !Text -> !ApiGatewayRequestContextIdentity -> !Maybe Value -> ApiGatewayRequestContext [$sel:apiGatewayRequestContextResourceId:ApiGatewayRequestContext] :: ApiGatewayRequestContext -> !Text [$sel:apiGatewayRequestContextResourcePath:ApiGatewayRequestContext] :: ApiGatewayRequestContext -> !Text [$sel:apiGatewayRequestContextHttpMethod:ApiGatewayRequestContext] :: ApiGatewayRequestContext -> !Text [$sel:apiGatewayRequestContextExtendedRequestId:ApiGatewayRequestContext] :: ApiGatewayRequestContext -> !Text [$sel:apiGatewayRequestContextRequestTime:ApiGatewayRequestContext] :: ApiGatewayRequestContext -> !Text [$sel:apiGatewayRequestContextPath:ApiGatewayRequestContext] :: ApiGatewayRequestContext -> !Text [$sel:apiGatewayRequestContextAccountId:ApiGatewayRequestContext] :: ApiGatewayRequestContext -> !Text [$sel:apiGatewayRequestContextProtocol:ApiGatewayRequestContext] :: ApiGatewayRequestContext -> !Text [$sel:apiGatewayRequestContextStage:ApiGatewayRequestContext] :: ApiGatewayRequestContext -> !Text [$sel:apiGatewayRequestContextDomainPrefix:ApiGatewayRequestContext] :: ApiGatewayRequestContext -> !Text [$sel:apiGatewayRequestContextRequestId:ApiGatewayRequestContext] :: ApiGatewayRequestContext -> !Text [$sel:apiGatewayRequestContextDomainName:ApiGatewayRequestContext] :: ApiGatewayRequestContext -> !Text [$sel:apiGatewayRequestContextApiId:ApiGatewayRequestContext] :: ApiGatewayRequestContext -> !Text [$sel:apiGatewayRequestContextIdentity:ApiGatewayRequestContext] :: ApiGatewayRequestContext -> !ApiGatewayRequestContextIdentity [$sel:apiGatewayRequestContextAuthorizer:ApiGatewayRequestContext] :: ApiGatewayRequestContext -> !Maybe Value data ApiGatewayRequestContextIdentity ApiGatewayRequestContextIdentity :: !Maybe Text -> !Maybe Text -> !Maybe Text -> !Maybe Text -> !Maybe Text -> !Maybe Text -> !Maybe Text -> !Maybe Text -> !Maybe Value -> !Maybe Text -> !Maybe Text -> !Maybe Text -> ApiGatewayRequestContextIdentity [$sel:apiGatewayRequestContextIdentityCognitoIdentityPoolId:ApiGatewayRequestContextIdentity] :: ApiGatewayRequestContextIdentity -> !Maybe Text [$sel:apiGatewayRequestContextIdentityAccountId:ApiGatewayRequestContextIdentity] :: ApiGatewayRequestContextIdentity -> !Maybe Text [$sel:apiGatewayRequestContextIdentityCognitoIdentityId:ApiGatewayRequestContextIdentity] :: ApiGatewayRequestContextIdentity -> !Maybe Text [$sel:apiGatewayRequestContextIdentityCaller:ApiGatewayRequestContextIdentity] :: ApiGatewayRequestContextIdentity -> !Maybe Text [$sel:apiGatewayRequestContextIdentitySourceIp:ApiGatewayRequestContextIdentity] :: ApiGatewayRequestContextIdentity -> !Maybe Text [$sel:apiGatewayRequestContextIdentityPrincipalOrgId:ApiGatewayRequestContextIdentity] :: ApiGatewayRequestContextIdentity -> !Maybe Text [$sel:apiGatewayRequestContextIdentityAccesskey:ApiGatewayRequestContextIdentity] :: ApiGatewayRequestContextIdentity -> !Maybe Text [$sel:apiGatewayRequestContextIdentityCognitoAuthenticationType:ApiGatewayRequestContextIdentity] :: ApiGatewayRequestContextIdentity -> !Maybe Text [$sel:apiGatewayRequestContextIdentityCognitoAuthenticationProvider:ApiGatewayRequestContextIdentity] :: ApiGatewayRequestContextIdentity -> !Maybe Value [$sel:apiGatewayRequestContextIdentityUserArn:ApiGatewayRequestContextIdentity] :: ApiGatewayRequestContextIdentity -> !Maybe Text [$sel:apiGatewayRequestContextIdentityUserAgent:ApiGatewayRequestContextIdentity] :: ApiGatewayRequestContextIdentity -> !Maybe Text [$sel:apiGatewayRequestContextIdentityUser:ApiGatewayRequestContextIdentity] :: ApiGatewayRequestContextIdentity -> !Maybe Text data ApiGatewayResponse body ApiGatewayResponse :: !Int -> !ResponseHeaders -> !body -> !Bool -> ApiGatewayResponse body [$sel:apiGatewayResponseStatusCode:ApiGatewayResponse] :: ApiGatewayResponse body -> !Int [$sel:apiGatewayResponseHeaders:ApiGatewayResponse] :: ApiGatewayResponse body -> !ResponseHeaders [$sel:apiGatewayResponseBody:ApiGatewayResponse] :: ApiGatewayResponse body -> !body [$sel:apiGatewayResponseIsBase64Encoded:ApiGatewayResponse] :: ApiGatewayResponse body -> !Bool newtype ApiGatewayResponseBody ApiGatewayResponseBody :: Text -> ApiGatewayResponseBody class ToApiGatewayResponseBody a toApiGatewayResponseBody :: ToApiGatewayResponseBody a => a -> ApiGatewayResponseBody -- | API Gateway specific dispatcher options newtype ApiGatewayDispatcherOptions ApiGatewayDispatcherOptions :: Bool -> ApiGatewayDispatcherOptions -- | Should impure exceptions be propagated through the API Gateway -- interface [$sel:propagateImpureExceptions:ApiGatewayDispatcherOptions] :: ApiGatewayDispatcherOptions -> Bool mkApiGatewayResponse :: Int -> ResponseHeaders -> payload -> ApiGatewayResponse payload data ALBRequest body ALBRequest :: !Text -> !Text -> !Maybe (HashMap Text Text) -> !Maybe (HashMap Text Text) -> !Bool -> !ALBRequestContext -> !Maybe body -> ALBRequest body [$sel:albRequestPath:ALBRequest] :: ALBRequest body -> !Text [$sel:albRequestHttpMethod:ALBRequest] :: ALBRequest body -> !Text [$sel:albRequestHeaders:ALBRequest] :: ALBRequest body -> !Maybe (HashMap Text Text) [$sel:albRequestQueryStringParameters:ALBRequest] :: ALBRequest body -> !Maybe (HashMap Text Text) [$sel:albRequestIsBase64Encoded:ALBRequest] :: ALBRequest body -> !Bool [$sel:albRequestRequestContext:ALBRequest] :: ALBRequest body -> !ALBRequestContext [$sel:albRequestBody:ALBRequest] :: ALBRequest body -> !Maybe body newtype ALBRequestContext ALBRequestContext :: ALBELB -> ALBRequestContext [$sel:albRequestContextElb:ALBRequestContext] :: ALBRequestContext -> ALBELB data ALBResponse body ALBResponse :: !Int -> !Text -> !ResponseHeaders -> !ResponseHeaders -> !body -> !Bool -> ALBResponse body [$sel:albResponseStatusCode:ALBResponse] :: ALBResponse body -> !Int [$sel:albResponseStatusDescription:ALBResponse] :: ALBResponse body -> !Text [$sel:albResponseHeaders:ALBResponse] :: ALBResponse body -> !ResponseHeaders [$sel:albResponseMultiValueHeaders:ALBResponse] :: ALBResponse body -> !ResponseHeaders [$sel:albResponseBody:ALBResponse] :: ALBResponse body -> !body [$sel:albResponseIsBase64Encoded:ALBResponse] :: ALBResponse body -> !Bool newtype ALBResponseBody ALBResponseBody :: Text -> ALBResponseBody class ToALBResponseBody a toALBResponseBody :: ToALBResponseBody a => a -> ALBResponseBody mkALBResponse :: Int -> ResponseHeaders -> payload -> ALBResponse payload -- | Runs the user haskell_lambda executable and posts back the -- results. This is called from the layer's main function. runLambda :: forall context handlerType. IO context -> RunCallback handlerType context -> IO () -- | Wrapper type to handle the result of the user data LambdaResult (handlerType :: HandlerType) [StandaloneLambdaResult] :: StandaloneLambdaResponseBody -> LambdaResult 'StandaloneHandlerType [APIGatewayResult] :: ApiGatewayResponse ApiGatewayResponseBody -> LambdaResult 'APIGatewayHandlerType [ALBResult] :: ALBResponse ALBResponseBody -> LambdaResult 'ALBHandlerType -- | API Gateway specific dispatcher options newtype ApiGatewayDispatcherOptions ApiGatewayDispatcherOptions :: Bool -> ApiGatewayDispatcherOptions -- | Should impure exceptions be propagated through the API Gateway -- interface [$sel:propagateImpureExceptions:ApiGatewayDispatcherOptions] :: ApiGatewayDispatcherOptions -> Bool data Parsing Parsing :: Text -> Text -> Text -> Parsing [errorMessage] :: Parsing -> Text [actualValue] :: Parsing -> Text [valueName] :: Parsing -> Text