module Network.AWS.ImportExport.UpdateJob
(
UpdateJob
, updateJob
, ujJobId
, ujJobType
, ujManifest
, ujValidateOnly
, UpdateJobResponse
, updateJobResponse
, ujrSuccess
, ujrWarningMessage
) where
import Network.AWS.Prelude
import Network.AWS.Request.Query
import Network.AWS.ImportExport.Types
import qualified GHC.Exts
data UpdateJob = UpdateJob
{ _ujJobId :: Text
, _ujJobType :: JobType
, _ujManifest :: Text
, _ujValidateOnly :: Bool
} deriving (Eq, Show)
updateJob :: Text
-> Text
-> JobType
-> Bool
-> UpdateJob
updateJob p1 p2 p3 p4 = UpdateJob
{ _ujJobId = p1
, _ujManifest = p2
, _ujJobType = p3
, _ujValidateOnly = p4
}
ujJobId :: Lens' UpdateJob Text
ujJobId = lens _ujJobId (\s a -> s { _ujJobId = a })
ujJobType :: Lens' UpdateJob JobType
ujJobType = lens _ujJobType (\s a -> s { _ujJobType = a })
ujManifest :: Lens' UpdateJob Text
ujManifest = lens _ujManifest (\s a -> s { _ujManifest = a })
ujValidateOnly :: Lens' UpdateJob Bool
ujValidateOnly = lens _ujValidateOnly (\s a -> s { _ujValidateOnly = a })
data UpdateJobResponse = UpdateJobResponse
{ _ujrSuccess :: Maybe Bool
, _ujrWarningMessage :: Maybe Text
} deriving (Eq, Ord, Show)
updateJobResponse :: UpdateJobResponse
updateJobResponse = UpdateJobResponse
{ _ujrSuccess = Nothing
, _ujrWarningMessage = Nothing
}
ujrSuccess :: Lens' UpdateJobResponse (Maybe Bool)
ujrSuccess = lens _ujrSuccess (\s a -> s { _ujrSuccess = a })
ujrWarningMessage :: Lens' UpdateJobResponse (Maybe Text)
ujrWarningMessage =
lens _ujrWarningMessage (\s a -> s { _ujrWarningMessage = a })
instance ToPath UpdateJob where
toPath = const "/"
instance ToQuery UpdateJob where
toQuery UpdateJob{..} = mconcat
[ "JobId" =? _ujJobId
, "JobType" =? _ujJobType
, "Manifest" =? _ujManifest
, "ValidateOnly" =? _ujValidateOnly
]
instance ToHeaders UpdateJob
instance AWSRequest UpdateJob where
type Sv UpdateJob = ImportExport
type Rs UpdateJob = UpdateJobResponse
request = post "UpdateJob"
response = xmlResponse
instance FromXML UpdateJobResponse where
parseXML = withElement "UpdateJobResult" $ \x -> UpdateJobResponse
<$> x .@? "Success"
<*> x .@? "WarningMessage"