{-# 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.DeviceFarm.GetUpload
(
getUpload
, GetUpload
, guArn
, getUploadResponse
, GetUploadResponse
, gursUpload
, gursResponseStatus
) where
import Network.AWS.DeviceFarm.Types
import Network.AWS.DeviceFarm.Types.Product
import Network.AWS.Lens
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 Rs GetUpload = GetUploadResponse
request = postJSON deviceFarm
response
= receiveJSON
(\ s h x ->
GetUploadResponse' <$>
(x .?> "upload") <*> (pure (fromEnum s)))
instance Hashable GetUpload where
instance NFData GetUpload where
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 (catMaybes [Just ("arn" .= _guArn)])
instance ToPath GetUpload where
toPath = const "/"
instance ToQuery GetUpload where
toQuery = const mempty
data GetUploadResponse = GetUploadResponse'
{ _gursUpload :: !(Maybe Upload)
, _gursResponseStatus :: !Int
} deriving (Eq, Read, Show, Data, Typeable, Generic)
getUploadResponse
:: Int
-> GetUploadResponse
getUploadResponse pResponseStatus_ =
GetUploadResponse'
{_gursUpload = Nothing, _gursResponseStatus = pResponseStatus_}
gursUpload :: Lens' GetUploadResponse (Maybe Upload)
gursUpload = lens _gursUpload (\ s a -> s{_gursUpload = a})
gursResponseStatus :: Lens' GetUploadResponse Int
gursResponseStatus = lens _gursResponseStatus (\ s a -> s{_gursResponseStatus = a})
instance NFData GetUploadResponse where