module Network.AWS.DeviceFarm.GetUpload
(
getUpload
, GetUpload
, guArn
, getUploadResponse
, GetUploadResponse
, gursUpload
, gursStatus
) where
import Network.AWS.DeviceFarm.Types
import Network.AWS.DeviceFarm.Types.Product
import Network.AWS.Prelude
import Network.AWS.Request
import Network.AWS.Response
newtype GetUpload = GetUpload'
{ _guArn :: Text
} deriving (Eq,Read,Show,Data,Typeable,Generic)
getUpload
:: Text
-> GetUpload
getUpload pArn_ =
GetUpload'
{ _guArn = pArn_
}
guArn :: Lens' GetUpload Text
guArn = lens _guArn (\ s a -> s{_guArn = a});
instance AWSRequest GetUpload where
type Sv GetUpload = DeviceFarm
type Rs GetUpload = GetUploadResponse
request = postJSON
response
= receiveJSON
(\ s h x ->
GetUploadResponse' <$>
(x .?> "upload") <*> (pure (fromEnum s)))
instance ToHeaders GetUpload where
toHeaders
= const
(mconcat
["X-Amz-Target" =#
("DeviceFarm_20150623.GetUpload" :: ByteString),
"Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToJSON GetUpload where
toJSON GetUpload'{..} = object ["arn" .= _guArn]
instance ToPath GetUpload where
toPath = const "/"
instance ToQuery GetUpload where
toQuery = const mempty
data GetUploadResponse = GetUploadResponse'
{ _gursUpload :: !(Maybe Upload)
, _gursStatus :: !Int
} deriving (Eq,Read,Show,Data,Typeable,Generic)
getUploadResponse
:: Int
-> GetUploadResponse
getUploadResponse pStatus_ =
GetUploadResponse'
{ _gursUpload = Nothing
, _gursStatus = pStatus_
}
gursUpload :: Lens' GetUploadResponse (Maybe Upload)
gursUpload = lens _gursUpload (\ s a -> s{_gursUpload = a});
gursStatus :: Lens' GetUploadResponse Int
gursStatus = lens _gursStatus (\ s a -> s{_gursStatus = a});