{-# 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.GetDevicePoolCompatibility
(
getDevicePoolCompatibility
, GetDevicePoolCompatibility
, gdpcAppARN
, gdpcTestType
, gdpcDevicePoolARN
, getDevicePoolCompatibilityResponse
, GetDevicePoolCompatibilityResponse
, gdpcrsIncompatibleDevices
, gdpcrsCompatibleDevices
, gdpcrsResponseStatus
) 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
data GetDevicePoolCompatibility = GetDevicePoolCompatibility'
{ _gdpcAppARN :: !(Maybe Text)
, _gdpcTestType :: !(Maybe TestType)
, _gdpcDevicePoolARN :: !Text
} deriving (Eq,Read,Show,Data,Typeable,Generic)
getDevicePoolCompatibility
:: Text
-> GetDevicePoolCompatibility
getDevicePoolCompatibility pDevicePoolARN_ =
GetDevicePoolCompatibility'
{ _gdpcAppARN = Nothing
, _gdpcTestType = Nothing
, _gdpcDevicePoolARN = pDevicePoolARN_
}
gdpcAppARN :: Lens' GetDevicePoolCompatibility (Maybe Text)
gdpcAppARN = lens _gdpcAppARN (\ s a -> s{_gdpcAppARN = a});
gdpcTestType :: Lens' GetDevicePoolCompatibility (Maybe TestType)
gdpcTestType = lens _gdpcTestType (\ s a -> s{_gdpcTestType = a});
gdpcDevicePoolARN :: Lens' GetDevicePoolCompatibility Text
gdpcDevicePoolARN = lens _gdpcDevicePoolARN (\ s a -> s{_gdpcDevicePoolARN = a});
instance AWSRequest GetDevicePoolCompatibility where
type Rs GetDevicePoolCompatibility =
GetDevicePoolCompatibilityResponse
request = postJSON deviceFarm
response
= receiveJSON
(\ s h x ->
GetDevicePoolCompatibilityResponse' <$>
(x .?> "incompatibleDevices" .!@ mempty) <*>
(x .?> "compatibleDevices" .!@ mempty)
<*> (pure (fromEnum s)))
instance Hashable GetDevicePoolCompatibility
instance NFData GetDevicePoolCompatibility
instance ToHeaders GetDevicePoolCompatibility where
toHeaders
= const
(mconcat
["X-Amz-Target" =#
("DeviceFarm_20150623.GetDevicePoolCompatibility" ::
ByteString),
"Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToJSON GetDevicePoolCompatibility where
toJSON GetDevicePoolCompatibility'{..}
= object
(catMaybes
[("appArn" .=) <$> _gdpcAppARN,
("testType" .=) <$> _gdpcTestType,
Just ("devicePoolArn" .= _gdpcDevicePoolARN)])
instance ToPath GetDevicePoolCompatibility where
toPath = const "/"
instance ToQuery GetDevicePoolCompatibility where
toQuery = const mempty
data GetDevicePoolCompatibilityResponse = GetDevicePoolCompatibilityResponse'
{ _gdpcrsIncompatibleDevices :: !(Maybe [DevicePoolCompatibilityResult])
, _gdpcrsCompatibleDevices :: !(Maybe [DevicePoolCompatibilityResult])
, _gdpcrsResponseStatus :: !Int
} deriving (Eq,Read,Show,Data,Typeable,Generic)
getDevicePoolCompatibilityResponse
:: Int
-> GetDevicePoolCompatibilityResponse
getDevicePoolCompatibilityResponse pResponseStatus_ =
GetDevicePoolCompatibilityResponse'
{ _gdpcrsIncompatibleDevices = Nothing
, _gdpcrsCompatibleDevices = Nothing
, _gdpcrsResponseStatus = pResponseStatus_
}
gdpcrsIncompatibleDevices :: Lens' GetDevicePoolCompatibilityResponse [DevicePoolCompatibilityResult]
gdpcrsIncompatibleDevices = lens _gdpcrsIncompatibleDevices (\ s a -> s{_gdpcrsIncompatibleDevices = a}) . _Default . _Coerce;
gdpcrsCompatibleDevices :: Lens' GetDevicePoolCompatibilityResponse [DevicePoolCompatibilityResult]
gdpcrsCompatibleDevices = lens _gdpcrsCompatibleDevices (\ s a -> s{_gdpcrsCompatibleDevices = a}) . _Default . _Coerce;
gdpcrsResponseStatus :: Lens' GetDevicePoolCompatibilityResponse Int
gdpcrsResponseStatus = lens _gdpcrsResponseStatus (\ s a -> s{_gdpcrsResponseStatus = a});
instance NFData GetDevicePoolCompatibilityResponse