module Network.AWS.ImportExport.GetStatus
(
getStatus
, GetStatus
, gsAPIVersion
, gsJobId
, getStatusResponse
, GetStatusResponse
, gsrsCarrier
, gsrsTrackingNumber
, gsrsSignature
, gsrsJobType
, gsrsJobId
, gsrsSignatureFileContents
, gsrsErrorCount
, gsrsCurrentManifest
, gsrsArtifactList
, gsrsLogBucket
, gsrsCreationDate
, gsrsProgressCode
, gsrsLocationCode
, gsrsLogKey
, gsrsLocationMessage
, gsrsProgressMessage
, gsrsResponseStatus
) where
import Network.AWS.ImportExport.Types
import Network.AWS.ImportExport.Types.Product
import Network.AWS.Prelude
import Network.AWS.Request
import Network.AWS.Response
data GetStatus = GetStatus'
{ _gsAPIVersion :: !(Maybe Text)
, _gsJobId :: !Text
} deriving (Eq,Read,Show,Data,Typeable,Generic)
getStatus
:: Text
-> GetStatus
getStatus pJobId_ =
GetStatus'
{ _gsAPIVersion = Nothing
, _gsJobId = pJobId_
}
gsAPIVersion :: Lens' GetStatus (Maybe Text)
gsAPIVersion = lens _gsAPIVersion (\ s a -> s{_gsAPIVersion = a});
gsJobId :: Lens' GetStatus Text
gsJobId = lens _gsJobId (\ s a -> s{_gsJobId = a});
instance AWSRequest GetStatus where
type Rs GetStatus = GetStatusResponse
request = postQuery importExport
response
= receiveXMLWrapper "GetStatusResult"
(\ s h x ->
GetStatusResponse' <$>
(x .@? "Carrier") <*> (x .@? "TrackingNumber") <*>
(x .@? "Signature")
<*> (x .@? "JobType")
<*> (x .@? "JobId")
<*> (x .@? "SignatureFileContents")
<*> (x .@? "ErrorCount")
<*> (x .@? "CurrentManifest")
<*>
(x .@? "ArtifactList" .!@ mempty >>=
may (parseXMLList "member"))
<*> (x .@? "LogBucket")
<*> (x .@? "CreationDate")
<*> (x .@? "ProgressCode")
<*> (x .@? "LocationCode")
<*> (x .@? "LogKey")
<*> (x .@? "LocationMessage")
<*> (x .@? "ProgressMessage")
<*> (pure (fromEnum s)))
instance ToHeaders GetStatus where
toHeaders = const mempty
instance ToPath GetStatus where
toPath = const "/"
instance ToQuery GetStatus where
toQuery GetStatus'{..}
= mconcat
["Operation=GetStatus",
"Action" =: ("GetStatus" :: ByteString),
"Version" =: ("2010-06-01" :: ByteString),
"APIVersion" =: _gsAPIVersion, "JobId" =: _gsJobId]
data GetStatusResponse = GetStatusResponse'
{ _gsrsCarrier :: !(Maybe Text)
, _gsrsTrackingNumber :: !(Maybe Text)
, _gsrsSignature :: !(Maybe Text)
, _gsrsJobType :: !(Maybe JobType)
, _gsrsJobId :: !(Maybe Text)
, _gsrsSignatureFileContents :: !(Maybe Text)
, _gsrsErrorCount :: !(Maybe Int)
, _gsrsCurrentManifest :: !(Maybe Text)
, _gsrsArtifactList :: !(Maybe [Artifact])
, _gsrsLogBucket :: !(Maybe Text)
, _gsrsCreationDate :: !(Maybe ISO8601)
, _gsrsProgressCode :: !(Maybe Text)
, _gsrsLocationCode :: !(Maybe Text)
, _gsrsLogKey :: !(Maybe Text)
, _gsrsLocationMessage :: !(Maybe Text)
, _gsrsProgressMessage :: !(Maybe Text)
, _gsrsResponseStatus :: !Int
} deriving (Eq,Read,Show,Data,Typeable,Generic)
getStatusResponse
:: Int
-> GetStatusResponse
getStatusResponse pResponseStatus_ =
GetStatusResponse'
{ _gsrsCarrier = Nothing
, _gsrsTrackingNumber = Nothing
, _gsrsSignature = Nothing
, _gsrsJobType = Nothing
, _gsrsJobId = Nothing
, _gsrsSignatureFileContents = Nothing
, _gsrsErrorCount = Nothing
, _gsrsCurrentManifest = Nothing
, _gsrsArtifactList = Nothing
, _gsrsLogBucket = Nothing
, _gsrsCreationDate = Nothing
, _gsrsProgressCode = Nothing
, _gsrsLocationCode = Nothing
, _gsrsLogKey = Nothing
, _gsrsLocationMessage = Nothing
, _gsrsProgressMessage = Nothing
, _gsrsResponseStatus = pResponseStatus_
}
gsrsCarrier :: Lens' GetStatusResponse (Maybe Text)
gsrsCarrier = lens _gsrsCarrier (\ s a -> s{_gsrsCarrier = a});
gsrsTrackingNumber :: Lens' GetStatusResponse (Maybe Text)
gsrsTrackingNumber = lens _gsrsTrackingNumber (\ s a -> s{_gsrsTrackingNumber = a});
gsrsSignature :: Lens' GetStatusResponse (Maybe Text)
gsrsSignature = lens _gsrsSignature (\ s a -> s{_gsrsSignature = a});
gsrsJobType :: Lens' GetStatusResponse (Maybe JobType)
gsrsJobType = lens _gsrsJobType (\ s a -> s{_gsrsJobType = a});
gsrsJobId :: Lens' GetStatusResponse (Maybe Text)
gsrsJobId = lens _gsrsJobId (\ s a -> s{_gsrsJobId = a});
gsrsSignatureFileContents :: Lens' GetStatusResponse (Maybe Text)
gsrsSignatureFileContents = lens _gsrsSignatureFileContents (\ s a -> s{_gsrsSignatureFileContents = a});
gsrsErrorCount :: Lens' GetStatusResponse (Maybe Int)
gsrsErrorCount = lens _gsrsErrorCount (\ s a -> s{_gsrsErrorCount = a});
gsrsCurrentManifest :: Lens' GetStatusResponse (Maybe Text)
gsrsCurrentManifest = lens _gsrsCurrentManifest (\ s a -> s{_gsrsCurrentManifest = a});
gsrsArtifactList :: Lens' GetStatusResponse [Artifact]
gsrsArtifactList = lens _gsrsArtifactList (\ s a -> s{_gsrsArtifactList = a}) . _Default . _Coerce;
gsrsLogBucket :: Lens' GetStatusResponse (Maybe Text)
gsrsLogBucket = lens _gsrsLogBucket (\ s a -> s{_gsrsLogBucket = a});
gsrsCreationDate :: Lens' GetStatusResponse (Maybe UTCTime)
gsrsCreationDate = lens _gsrsCreationDate (\ s a -> s{_gsrsCreationDate = a}) . mapping _Time;
gsrsProgressCode :: Lens' GetStatusResponse (Maybe Text)
gsrsProgressCode = lens _gsrsProgressCode (\ s a -> s{_gsrsProgressCode = a});
gsrsLocationCode :: Lens' GetStatusResponse (Maybe Text)
gsrsLocationCode = lens _gsrsLocationCode (\ s a -> s{_gsrsLocationCode = a});
gsrsLogKey :: Lens' GetStatusResponse (Maybe Text)
gsrsLogKey = lens _gsrsLogKey (\ s a -> s{_gsrsLogKey = a});
gsrsLocationMessage :: Lens' GetStatusResponse (Maybe Text)
gsrsLocationMessage = lens _gsrsLocationMessage (\ s a -> s{_gsrsLocationMessage = a});
gsrsProgressMessage :: Lens' GetStatusResponse (Maybe Text)
gsrsProgressMessage = lens _gsrsProgressMessage (\ s a -> s{_gsrsProgressMessage = a});
gsrsResponseStatus :: Lens' GetStatusResponse Int
gsrsResponseStatus = lens _gsrsResponseStatus (\ s a -> s{_gsrsResponseStatus = a});