{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE TypeFamilies #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-binds #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}
module Network.AWS.ImportExport.UpdateJob
(
updateJob
, UpdateJob
, ujAPIVersion
, ujJobId
, ujManifest
, ujJobType
, ujValidateOnly
, updateJobResponse
, UpdateJobResponse
, ujrsSuccess
, ujrsWarningMessage
, ujrsArtifactList
, ujrsResponseStatus
) where
import Network.AWS.ImportExport.Types
import Network.AWS.ImportExport.Types.Product
import Network.AWS.Lens
import Network.AWS.Prelude
import Network.AWS.Request
import Network.AWS.Response
data UpdateJob = UpdateJob'
{ _ujAPIVersion :: !(Maybe Text)
, _ujJobId :: !Text
, _ujManifest :: !Text
, _ujJobType :: !JobType
, _ujValidateOnly :: !Bool
} deriving (Eq,Read,Show,Data,Typeable,Generic)
updateJob
:: Text
-> Text
-> JobType
-> Bool
-> UpdateJob
updateJob pJobId_ pManifest_ pJobType_ pValidateOnly_ =
UpdateJob'
{ _ujAPIVersion = Nothing
, _ujJobId = pJobId_
, _ujManifest = pManifest_
, _ujJobType = pJobType_
, _ujValidateOnly = pValidateOnly_
}
ujAPIVersion :: Lens' UpdateJob (Maybe Text)
ujAPIVersion = lens _ujAPIVersion (\ s a -> s{_ujAPIVersion = a});
ujJobId :: Lens' UpdateJob Text
ujJobId = lens _ujJobId (\ s a -> s{_ujJobId = a});
ujManifest :: Lens' UpdateJob Text
ujManifest = lens _ujManifest (\ s a -> s{_ujManifest = a});
ujJobType :: Lens' UpdateJob JobType
ujJobType = lens _ujJobType (\ s a -> s{_ujJobType = a});
ujValidateOnly :: Lens' UpdateJob Bool
ujValidateOnly = lens _ujValidateOnly (\ s a -> s{_ujValidateOnly = a});
instance AWSRequest UpdateJob where
type Rs UpdateJob = UpdateJobResponse
request = postQuery importExport
response
= receiveXMLWrapper "UpdateJobResult"
(\ s h x ->
UpdateJobResponse' <$>
(x .@? "Success") <*> (x .@? "WarningMessage") <*>
(x .@? "ArtifactList" .!@ mempty >>=
may (parseXMLList "member"))
<*> (pure (fromEnum s)))
instance Hashable UpdateJob
instance NFData UpdateJob
instance ToHeaders UpdateJob where
toHeaders = const mempty
instance ToPath UpdateJob where
toPath = const "/"
instance ToQuery UpdateJob where
toQuery UpdateJob'{..}
= mconcat
["Operation=UpdateJob",
"Action" =: ("UpdateJob" :: ByteString),
"Version" =: ("2010-06-01" :: ByteString),
"APIVersion" =: _ujAPIVersion, "JobId" =: _ujJobId,
"Manifest" =: _ujManifest, "JobType" =: _ujJobType,
"ValidateOnly" =: _ujValidateOnly]
data UpdateJobResponse = UpdateJobResponse'
{ _ujrsSuccess :: !(Maybe Bool)
, _ujrsWarningMessage :: !(Maybe Text)
, _ujrsArtifactList :: !(Maybe [Artifact])
, _ujrsResponseStatus :: !Int
} deriving (Eq,Read,Show,Data,Typeable,Generic)
updateJobResponse
:: Int
-> UpdateJobResponse
updateJobResponse pResponseStatus_ =
UpdateJobResponse'
{ _ujrsSuccess = Nothing
, _ujrsWarningMessage = Nothing
, _ujrsArtifactList = Nothing
, _ujrsResponseStatus = pResponseStatus_
}
ujrsSuccess :: Lens' UpdateJobResponse (Maybe Bool)
ujrsSuccess = lens _ujrsSuccess (\ s a -> s{_ujrsSuccess = a});
ujrsWarningMessage :: Lens' UpdateJobResponse (Maybe Text)
ujrsWarningMessage = lens _ujrsWarningMessage (\ s a -> s{_ujrsWarningMessage = a});
ujrsArtifactList :: Lens' UpdateJobResponse [Artifact]
ujrsArtifactList = lens _ujrsArtifactList (\ s a -> s{_ujrsArtifactList = a}) . _Default . _Coerce;
ujrsResponseStatus :: Lens' UpdateJobResponse Int
ujrsResponseStatus = lens _ujrsResponseStatus (\ s a -> s{_ujrsResponseStatus = a});
instance NFData UpdateJobResponse