{-# 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
, gdpcTest
, gdpcAppARN
, gdpcConfiguration
, 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'
{ _gdpcTest :: !(Maybe ScheduleRunTest)
, _gdpcAppARN :: !(Maybe Text)
, _gdpcConfiguration :: !(Maybe ScheduleRunConfiguration)
, _gdpcTestType :: !(Maybe TestType)
, _gdpcDevicePoolARN :: !Text
} deriving (Eq, Read, Show, Data, Typeable, Generic)
getDevicePoolCompatibility
:: Text
-> GetDevicePoolCompatibility
getDevicePoolCompatibility pDevicePoolARN_ =
GetDevicePoolCompatibility'
{ _gdpcTest = Nothing
, _gdpcAppARN = Nothing
, _gdpcConfiguration = Nothing
, _gdpcTestType = Nothing
, _gdpcDevicePoolARN = pDevicePoolARN_
}
gdpcTest :: Lens' GetDevicePoolCompatibility (Maybe ScheduleRunTest)
gdpcTest = lens _gdpcTest (\ s a -> s{_gdpcTest = a})
gdpcAppARN :: Lens' GetDevicePoolCompatibility (Maybe Text)
gdpcAppARN = lens _gdpcAppARN (\ s a -> s{_gdpcAppARN = a})
gdpcConfiguration :: Lens' GetDevicePoolCompatibility (Maybe ScheduleRunConfiguration)
gdpcConfiguration = lens _gdpcConfiguration (\ s a -> s{_gdpcConfiguration = 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 where
instance NFData GetDevicePoolCompatibility where
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
[("test" .=) <$> _gdpcTest,
("appArn" .=) <$> _gdpcAppARN,
("configuration" .=) <$> _gdpcConfiguration,
("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
where