amazonka-lambda 1.3.1 → 1.3.2
raw patch · 3 files changed
+27/−39 lines, 3 filesdep ~amazonka-coredep ~amazonka-lambdadep ~amazonka-testPVP: major bump suggested
API removals or changes: PVP suggests a major version bump
Dependency ranges changed: amazonka-core, amazonka-lambda, amazonka-test
API changes (from Hackage documentation)
- Network.AWS.Lambda.Invoke: instance Read Invoke
- Network.AWS.Lambda.Invoke: instance Read InvokeResponse
- Network.AWS.Lambda.Invoke: instance ToJSON Invoke
+ Network.AWS.Lambda.Invoke: instance ToBody Invoke
- Network.AWS.Lambda.Invoke: iPayload :: Lens' Invoke (Maybe ByteString)
+ Network.AWS.Lambda.Invoke: iPayload :: Lens' Invoke (HashMap Text Value)
- Network.AWS.Lambda.Invoke: invoke :: Text -> Invoke
+ Network.AWS.Lambda.Invoke: invoke :: Text -> HashMap Text Value -> Invoke
- Network.AWS.Lambda.Invoke: irsPayload :: Lens' InvokeResponse (Maybe ByteString)
+ Network.AWS.Lambda.Invoke: irsPayload :: Lens' InvokeResponse (Maybe (HashMap Text Value))
Files
- README.md +1/−1
- amazonka-lambda.cabal +5/−5
- gen/Network/AWS/Lambda/Invoke.hs +21/−33
README.md view
@@ -8,7 +8,7 @@ ## Version -`1.3.1`+`1.3.2` ## Description
amazonka-lambda.cabal view
@@ -1,5 +1,5 @@ name: amazonka-lambda-version: 1.3.1+version: 1.3.2 synopsis: Amazon Lambda SDK. homepage: https://github.com/brendanhay/amazonka bug-reports: https://github.com/brendanhay/amazonka/issues@@ -74,7 +74,7 @@ , Network.AWS.Lambda.Types.Sum build-depends:- amazonka-core == 1.3.1.*+ amazonka-core == 1.3.2.* , base >= 4.7 && < 5 test-suite amazonka-lambda-test@@ -94,9 +94,9 @@ , Test.AWS.Lambda.Internal build-depends:- amazonka-core == 1.3.1.*- , amazonka-test == 1.3.1.*- , amazonka-lambda == 1.3.1.*+ amazonka-core == 1.3.2.*+ , amazonka-test == 1.3.2.*+ , amazonka-lambda == 1.3.2.* , base , bytestring , lens
gen/Network/AWS/Lambda/Invoke.hs view
@@ -31,10 +31,10 @@ , Invoke -- * Request Lenses , iInvocationType- , iPayload , iLogType , iClientContext , iFunctionName+ , iPayload -- * Destructuring the Response , invokeResponse@@ -55,11 +55,11 @@ -- | /See:/ 'invoke' smart constructor. data Invoke = Invoke' { _iInvocationType :: !(Maybe InvocationType)- , _iPayload :: !(Maybe Base64) , _iLogType :: !(Maybe LogType) , _iClientContext :: !(Maybe Text) , _iFunctionName :: !Text- } deriving (Eq,Read,Show,Data,Typeable,Generic)+ , _iPayload :: !(HashMap Text Value)+ } deriving (Eq,Show,Data,Typeable,Generic) -- | Creates a value of 'Invoke' with the minimum fields required to make a request. --@@ -67,23 +67,24 @@ -- -- * 'iInvocationType' ----- * 'iPayload'--- -- * 'iLogType' -- -- * 'iClientContext' -- -- * 'iFunctionName'+--+-- * 'iPayload' invoke :: Text -- ^ 'iFunctionName'+ -> HashMap Text Value -- ^ 'iPayload' -> Invoke-invoke pFunctionName_ =+invoke pFunctionName_ pPayload_ = Invoke' { _iInvocationType = Nothing- , _iPayload = Nothing , _iLogType = Nothing , _iClientContext = Nothing , _iFunctionName = pFunctionName_+ , _iPayload = pPayload_ } -- | By default, the 'Invoke' API assumes \"RequestResponse\" invocation@@ -97,16 +98,6 @@ iInvocationType :: Lens' Invoke (Maybe InvocationType) iInvocationType = lens _iInvocationType (\ s a -> s{_iInvocationType = a}); --- | JSON that you want to provide to your Lambda function as input.------ /Note:/ This 'Lens' automatically encodes and decodes Base64 data,--- despite what the AWS documentation might say.--- The underlying isomorphism will encode to Base64 representation during--- serialisation, and decode from Base64 representation during deserialisation.--- This 'Lens' accepts and returns only raw unencoded data.-iPayload :: Lens' Invoke (Maybe ByteString)-iPayload = lens _iPayload (\ s a -> s{_iPayload = a}) . mapping _Base64;- -- | You can set this optional parameter to \"Tail\" in the request only if -- you specify the 'InvocationType' parameter with value -- \"RequestResponse\". In this case, AWS Lambda returns the base64-encoded@@ -139,18 +130,25 @@ iFunctionName :: Lens' Invoke Text iFunctionName = lens _iFunctionName (\ s a -> s{_iFunctionName = a}); +-- | JSON that you want to provide to your Lambda function as input.+iPayload :: Lens' Invoke (HashMap Text Value)+iPayload = lens _iPayload (\ s a -> s{_iPayload = a});+ instance AWSRequest Invoke where type Rs Invoke = InvokeResponse- request = postJSON lambda+ request = postBody lambda response = receiveJSON (\ s h x -> InvokeResponse' <$> (h .#? "X-Amz-Function-Error") <*> (h .#? "X-Amz-Log-Result")- <*> (x .?> "Payload")+ <*> (pure (Just x)) <*> (pure (fromEnum s))) +instance ToBody Invoke where+ toBody = toBody . _iPayload+ instance ToHeaders Invoke where toHeaders Invoke'{..} = mconcat@@ -158,10 +156,6 @@ "X-Amz-Log-Type" =# _iLogType, "X-Amz-Client-Context" =# _iClientContext] -instance ToJSON Invoke where- toJSON Invoke'{..}- = object (catMaybes [("Payload" .=) <$> _iPayload])- instance ToPath Invoke where toPath Invoke'{..} = mconcat@@ -177,9 +171,9 @@ data InvokeResponse = InvokeResponse' { _irsFunctionError :: !(Maybe Text) , _irsLogResult :: !(Maybe Text)- , _irsPayload :: !(Maybe Base64)+ , _irsPayload :: !(Maybe (HashMap Text Value)) , _irsStatusCode :: !Int- } deriving (Eq,Read,Show,Data,Typeable,Generic)+ } deriving (Eq,Show,Data,Typeable,Generic) -- | Creates a value of 'InvokeResponse' with the minimum fields required to make a request. --@@ -227,14 +221,8 @@ -- describing the error. For the 'Handled' errors the Lambda function will -- report this message. For 'Unhandled' errors AWS Lambda reports the -- message.------ /Note:/ This 'Lens' automatically encodes and decodes Base64 data,--- despite what the AWS documentation might say.--- The underlying isomorphism will encode to Base64 representation during--- serialisation, and decode from Base64 representation during deserialisation.--- This 'Lens' accepts and returns only raw unencoded data.-irsPayload :: Lens' InvokeResponse (Maybe ByteString)-irsPayload = lens _irsPayload (\ s a -> s{_irsPayload = a}) . mapping _Base64;+irsPayload :: Lens' InvokeResponse (Maybe (HashMap Text Value))+irsPayload = lens _irsPayload (\ s a -> s{_irsPayload = a}); -- | The HTTP status code will be in the 200 range for successful request. -- For the \"RequestResonse\" invocation type this status code will be 200.