module Network.AWS.DeviceFarm.GetDevicePoolCompatibility
(
getDevicePoolCompatibility
, GetDevicePoolCompatibility
, gdpcTestType
, gdpcDevicePoolARN
, gdpcAppARN
, getDevicePoolCompatibilityResponse
, GetDevicePoolCompatibilityResponse
, gdpcrsIncompatibleDevices
, gdpcrsCompatibleDevices
, gdpcrsStatus
) where
import Network.AWS.DeviceFarm.Types
import Network.AWS.DeviceFarm.Types.Product
import Network.AWS.Prelude
import Network.AWS.Request
import Network.AWS.Response
data GetDevicePoolCompatibility = GetDevicePoolCompatibility'
{ _gdpcTestType :: !(Maybe TestType)
, _gdpcDevicePoolARN :: !Text
, _gdpcAppARN :: !Text
} deriving (Eq,Read,Show,Data,Typeable,Generic)
getDevicePoolCompatibility
:: Text
-> Text
-> GetDevicePoolCompatibility
getDevicePoolCompatibility pDevicePoolARN_ pAppARN_ =
GetDevicePoolCompatibility'
{ _gdpcTestType = Nothing
, _gdpcDevicePoolARN = pDevicePoolARN_
, _gdpcAppARN = pAppARN_
}
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});
gdpcAppARN :: Lens' GetDevicePoolCompatibility Text
gdpcAppARN = lens _gdpcAppARN (\ s a -> s{_gdpcAppARN = a});
instance AWSRequest GetDevicePoolCompatibility where
type Sv GetDevicePoolCompatibility = DeviceFarm
type Rs GetDevicePoolCompatibility =
GetDevicePoolCompatibilityResponse
request = postJSON
response
= receiveJSON
(\ s h x ->
GetDevicePoolCompatibilityResponse' <$>
(x .?> "incompatibleDevices" .!@ mempty) <*>
(x .?> "compatibleDevices" .!@ mempty)
<*> (pure (fromEnum s)))
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
["testType" .= _gdpcTestType,
"devicePoolArn" .= _gdpcDevicePoolARN,
"appArn" .= _gdpcAppARN]
instance ToPath GetDevicePoolCompatibility where
toPath = const "/"
instance ToQuery GetDevicePoolCompatibility where
toQuery = const mempty
data GetDevicePoolCompatibilityResponse = GetDevicePoolCompatibilityResponse'
{ _gdpcrsIncompatibleDevices :: !(Maybe [DevicePoolCompatibilityResult])
, _gdpcrsCompatibleDevices :: !(Maybe [DevicePoolCompatibilityResult])
, _gdpcrsStatus :: !Int
} deriving (Eq,Read,Show,Data,Typeable,Generic)
getDevicePoolCompatibilityResponse
:: Int
-> GetDevicePoolCompatibilityResponse
getDevicePoolCompatibilityResponse pStatus_ =
GetDevicePoolCompatibilityResponse'
{ _gdpcrsIncompatibleDevices = Nothing
, _gdpcrsCompatibleDevices = Nothing
, _gdpcrsStatus = pStatus_
}
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;
gdpcrsStatus :: Lens' GetDevicePoolCompatibilityResponse Int
gdpcrsStatus = lens _gdpcrsStatus (\ s a -> s{_gdpcrsStatus = a});