module Network.AWS.DeviceFarm.GetDevicePool
(
getDevicePool
, GetDevicePool
, gdpArn
, getDevicePoolResponse
, GetDevicePoolResponse
, gdprsDevicePool
, gdprsResponseStatus
) 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 GetDevicePool = GetDevicePool'
{ _gdpArn :: Text
} deriving (Eq,Read,Show,Data,Typeable,Generic)
getDevicePool
:: Text
-> GetDevicePool
getDevicePool pArn_ =
GetDevicePool'
{ _gdpArn = pArn_
}
gdpArn :: Lens' GetDevicePool Text
gdpArn = lens _gdpArn (\ s a -> s{_gdpArn = a});
instance AWSRequest GetDevicePool where
type Rs GetDevicePool = GetDevicePoolResponse
request = postJSON deviceFarm
response
= receiveJSON
(\ s h x ->
GetDevicePoolResponse' <$>
(x .?> "devicePool") <*> (pure (fromEnum s)))
instance ToHeaders GetDevicePool where
toHeaders
= const
(mconcat
["X-Amz-Target" =#
("DeviceFarm_20150623.GetDevicePool" :: ByteString),
"Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToJSON GetDevicePool where
toJSON GetDevicePool'{..}
= object (catMaybes [Just ("arn" .= _gdpArn)])
instance ToPath GetDevicePool where
toPath = const "/"
instance ToQuery GetDevicePool where
toQuery = const mempty
data GetDevicePoolResponse = GetDevicePoolResponse'
{ _gdprsDevicePool :: !(Maybe DevicePool)
, _gdprsResponseStatus :: !Int
} deriving (Eq,Read,Show,Data,Typeable,Generic)
getDevicePoolResponse
:: Int
-> GetDevicePoolResponse
getDevicePoolResponse pResponseStatus_ =
GetDevicePoolResponse'
{ _gdprsDevicePool = Nothing
, _gdprsResponseStatus = pResponseStatus_
}
gdprsDevicePool :: Lens' GetDevicePoolResponse (Maybe DevicePool)
gdprsDevicePool = lens _gdprsDevicePool (\ s a -> s{_gdprsDevicePool = a});
gdprsResponseStatus :: Lens' GetDevicePoolResponse Int
gdprsResponseStatus = lens _gdprsResponseStatus (\ s a -> s{_gdprsResponseStatus = a});